common.c 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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/delay.h>
  15. #include <asm/hardware.h>
  16. /*
  17. * Shared variables
  18. */
  19. unsigned long iop3xx_pcibios_min_io = 0;
  20. unsigned long iop3xx_pcibios_min_mem = 0;
  21. #ifdef CONFIG_ARCH_EP80219
  22. #include <linux/kernel.h>
  23. /*
  24. * Default power-off for EP80219
  25. */
  26. static inline void ep80219_send_to_pic(__u8 c) {
  27. }
  28. void ep80219_power_off(void)
  29. {
  30. /*
  31. * This function will send a SHUTDOWN_COMPLETE message to the PIC controller
  32. * over I2C. We are not using the i2c subsystem since we are going to power
  33. * off and it may be removed
  34. */
  35. /* Send the Address byte w/ the start condition */
  36. *IOP321_IDBR1 = 0x60;
  37. *IOP321_ICR1 = 0xE9;
  38. mdelay(1);
  39. /* Send the START_MSG byte w/ no start or stop condition */
  40. *IOP321_IDBR1 = 0x0F;
  41. *IOP321_ICR1 = 0xE8;
  42. mdelay(1);
  43. /* Send the SHUTDOWN_COMPLETE Message ID byte w/ no start or stop condition */
  44. *IOP321_IDBR1 = 0x03;
  45. *IOP321_ICR1 = 0xE8;
  46. mdelay(1);
  47. /* Send an ignored byte w/ stop condition */
  48. *IOP321_IDBR1 = 0x00;
  49. *IOP321_ICR1 = 0xEA;
  50. while (1) ;
  51. }
  52. #include <linux/init.h>
  53. #include <linux/pm.h>
  54. static int __init ep80219_init(void)
  55. {
  56. pm_power_off = ep80219_power_off;
  57. return 0;
  58. }
  59. arch_initcall(ep80219_init);
  60. #endif