system.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * linux/include/asm-arm/arch-ixp2000/system.h
  3. *
  4. * Copyright (C) 2002 Intel Corp.
  5. * Copyricht (C) 2003-2005 MontaVista Software, Inc.
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License version 2 as
  9. * published by the Free Software Foundation.
  10. */
  11. #include <asm/hardware.h>
  12. #include <asm/mach-types.h>
  13. static inline void arch_idle(void)
  14. {
  15. cpu_do_idle();
  16. }
  17. static inline void arch_reset(char mode)
  18. {
  19. local_irq_disable();
  20. /*
  21. * Reset flash banking register so that we are pointing at
  22. * RedBoot bank.
  23. */
  24. if (machine_is_ixdp2401()) {
  25. ixp2000_reg_write(IXDP2X01_CPLD_FLASH_REG,
  26. ((0 >> IXDP2X01_FLASH_WINDOW_BITS)
  27. | IXDP2X01_CPLD_FLASH_INTERN));
  28. ixp2000_reg_wrb(IXDP2X01_CPLD_RESET_REG, 0xffffffff);
  29. }
  30. /*
  31. * On IXDP2801 we need to write this magic sequence to the CPLD
  32. * to cause a complete reset of the CPU and all external devices
  33. * and move the flash bank register back to 0.
  34. */
  35. if (machine_is_ixdp2801() || machine_is_ixdp28x5()) {
  36. unsigned long reset_reg = *IXDP2X01_CPLD_RESET_REG;
  37. reset_reg = 0x55AA0000 | (reset_reg & 0x0000FFFF);
  38. ixp2000_reg_write(IXDP2X01_CPLD_RESET_REG, reset_reg);
  39. ixp2000_reg_wrb(IXDP2X01_CPLD_RESET_REG, 0x80000000);
  40. }
  41. ixp2000_reg_wrb(IXP2000_RESET0, RSTALL);
  42. }