PageRenderTime 426ms CodeModel.GetById 255ms RepoModel.GetById 1ms app.codeStats 0ms

/arch/arm/mach-footbridge/include/mach/system.h

https://bitbucket.org/sammyz/iscream_thunderc-2.6.35-rebase
C++ Header | 69 lines | 33 code | 5 blank | 31 comment | 5 complexity | 83da8a57d0d0e576906dfbf219c55961 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.0, AGPL-1.0
  1. /*
  2. * arch/arm/mach-footbridge/include/mach/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 <linux/io.h>
  11. #include <asm/hardware/dec21285.h>
  12. #include <mach/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, const char *cmd)
  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. }