system.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * arch/arm/mach-ixp2000/include/mach/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 <mach/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, const char *cmd)
  18. {
  19. /*
  20. * Reset flash banking register so that we are pointing at
  21. * RedBoot bank.
  22. */
  23. if (machine_is_ixdp2401()) {
  24. ixp2000_reg_write(IXDP2X01_CPLD_FLASH_REG,
  25. ((0 >> IXDP2X01_FLASH_WINDOW_BITS)
  26. | IXDP2X01_CPLD_FLASH_INTERN));
  27. ixp2000_reg_wrb(IXDP2X01_CPLD_RESET_REG, 0xffffffff);
  28. }
  29. /*
  30. * On IXDP2801 we need to write this magic sequence to the CPLD
  31. * to cause a complete reset of the CPU and all external devices
  32. * and move the flash bank register back to 0.
  33. */
  34. if (machine_is_ixdp2801() || machine_is_ixdp28x5()) {
  35. unsigned long reset_reg = *IXDP2X01_CPLD_RESET_REG;
  36. reset_reg = 0x55AA0000 | (reset_reg & 0x0000FFFF);
  37. ixp2000_reg_write(IXDP2X01_CPLD_RESET_REG, reset_reg);
  38. ixp2000_reg_wrb(IXDP2X01_CPLD_RESET_REG, 0x80000000);
  39. }
  40. ixp2000_reg_wrb(IXP2000_RESET0, RSTALL);
  41. }