common.c 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*
  2. * arch/arm/mach-iop3xx/common.c
  3. *
  4. * Common routines shared across all IOP3xx implementations
  5. *
  6. * Author: Deepak Saxena <dsaxena@mvista.com>
  7. *
  8. * Copyright 2003 (c) MontaVista, Software, Inc.
  9. *
  10. * This file is licensed under the terms of the GNU General Public
  11. * License version 2. This program is licensed "as is" without any
  12. * warranty of any kind, whether express or implied.
  13. */
  14. #include <linux/config.h>
  15. #include <linux/delay.h>
  16. #include <asm/hardware.h>
  17. /*
  18. * Shared variables
  19. */
  20. unsigned long iop3xx_pcibios_min_io = 0;
  21. unsigned long iop3xx_pcibios_min_mem = 0;
  22. #ifdef CONFIG_ARCH_EP80219
  23. #include <linux/kernel.h>
  24. /*
  25. * Default power-off for EP80219
  26. */
  27. #include <asm/mach-types.h>
  28. static inline void ep80219_send_to_pic(__u8 c) {
  29. }
  30. void ep80219_power_off(void)
  31. {
  32. /*
  33. * This function will send a SHUTDOWN_COMPLETE message to the PIC controller
  34. * over I2C. We are not using the i2c subsystem since we are going to power
  35. * off and it may be removed
  36. */
  37. /* Send the Address byte w/ the start condition */
  38. *IOP321_IDBR1 = 0x60;
  39. *IOP321_ICR1 = 0xE9;
  40. mdelay(1);
  41. /* Send the START_MSG byte w/ no start or stop condition */
  42. *IOP321_IDBR1 = 0x0F;
  43. *IOP321_ICR1 = 0xE8;
  44. mdelay(1);
  45. /* Send the SHUTDOWN_COMPLETE Message ID byte w/ no start or stop condition */
  46. *IOP321_IDBR1 = 0x03;
  47. *IOP321_ICR1 = 0xE8;
  48. mdelay(1);
  49. /* Send an ignored byte w/ stop condition */
  50. *IOP321_IDBR1 = 0x00;
  51. *IOP321_ICR1 = 0xEA;
  52. while (1) ;
  53. }
  54. #include <linux/init.h>
  55. #include <linux/pm.h>
  56. static int __init ep80219_init(void)
  57. {
  58. pm_power_off = ep80219_power_off;
  59. return 0;
  60. }
  61. arch_initcall(ep80219_init);
  62. #endif