system.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. *IXDP2X01_CPLD_FLASH_REG = ((0 >> IXDP2X01_FLASH_WINDOW_BITS)
  26. | IXDP2X01_CPLD_FLASH_INTERN);
  27. *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 moves the flash bank register back to 0.
  33. */
  34. if (machine_is_ixdp2801()) {
  35. unsigned long reset_reg = *IXDP2X01_CPLD_RESET_REG;
  36. reset_reg = 0x55AA0000 | (reset_reg & 0x0000FFFF);
  37. *IXDP2X01_CPLD_RESET_REG = reset_reg;
  38. mb();
  39. *IXDP2X01_CPLD_RESET_REG = 0x80000000;
  40. }
  41. /*
  42. * We do a reset all if we are PCI master. We could be a slave and we
  43. * don't want to do anything funky on the PCI bus.
  44. */
  45. if (*IXP2000_STRAP_OPTIONS & CFG_PCI_BOOT_HOST) {
  46. *(IXP2000_RESET0) |= (RSTALL);
  47. }
  48. }