system.h
上传用户:szlgq88
上传日期:2009-04-28
资源大小:48287k
文件大小:2k
源码类别:

嵌入式Linux

开发平台:

Unix_Linux

  1. /*
  2.  *  linux/include/asm-arm/arch-ebsa285/system.h
  3.  *
  4.  *  Copyright (C) 1996-1999 Russell King.
  5.  *
  6.  * This program is free software; you can redistribute it and/or modify
  7.  * it under the terms of the GNU General Public License version 2 as
  8.  * published by the Free Software Foundation.
  9.  */
  10. #include <asm/hardware/dec21285.h>
  11. #include <asm/io.h>
  12. #include <asm/hardware.h>
  13. #include <asm/leds.h>
  14. #include <asm/mach-types.h>
  15. static inline void arch_idle(void)
  16. {
  17. cpu_do_idle();
  18. }
  19. static inline void arch_reset(char mode)
  20. {
  21. if (mode == 's') {
  22. /*
  23.  * Jump into the ROM
  24.  */
  25. cpu_reset(0x41000000);
  26. } else {
  27. if (machine_is_netwinder()) {
  28. /* open up the SuperIO chip
  29.  */
  30. outb(0x87, 0x370);
  31. outb(0x87, 0x370);
  32. /* aux function group 1 (logical device 7)
  33.  */
  34. outb(0x07, 0x370);
  35. outb(0x07, 0x371);
  36. /* set GP16 for WD-TIMER output
  37.  */
  38. outb(0xe6, 0x370);
  39. outb(0x00, 0x371);
  40. /* set a RED LED and toggle WD_TIMER for rebooting
  41.  */
  42. outb(0xc4, 0x338);
  43. } else {
  44. /* 
  45.  * Force the watchdog to do a CPU reset.
  46.  *
  47.  * After making sure that the watchdog is disabled
  48.  * (so we can change the timer registers) we first
  49.  * enable the timer to autoreload itself.  Next, the
  50.  * timer interval is set really short and any
  51.  * current interrupt request is cleared (so we can
  52.  * see an edge transition).  Finally, TIMER4 is
  53.  * enabled as the watchdog.
  54.  */
  55. *CSR_SA110_CNTL &= ~(1 << 13);
  56. *CSR_TIMER4_CNTL = TIMER_CNTL_ENABLE |
  57.    TIMER_CNTL_AUTORELOAD |
  58.    TIMER_CNTL_DIV16;
  59. *CSR_TIMER4_LOAD = 0x2;
  60. *CSR_TIMER4_CLR  = 0;
  61. *CSR_SA110_CNTL |= (1 << 13);
  62. }
  63. }
  64. }