board-mss2.c 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. * Maxtor Shared Storage II Board Setup
  3. *
  4. * Maintainer: Sylver Bruneau <sylver.bruneau@googlemail.com>
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License
  8. * as published by the Free Software Foundation; either version
  9. * 2 of the License, or (at your option) any later version.
  10. */
  11. #include <linux/kernel.h>
  12. #include <linux/init.h>
  13. #include <linux/platform_device.h>
  14. #include <linux/pci.h>
  15. #include <linux/irq.h>
  16. #include <asm/mach-types.h>
  17. #include <asm/mach/arch.h>
  18. #include <asm/mach/pci.h>
  19. #include "orion5x.h"
  20. #include "bridge-regs.h"
  21. #include "common.h"
  22. /*****************************************************************************
  23. * Maxtor Shared Storage II Info
  24. ****************************************************************************/
  25. /****************************************************************************
  26. * PCI setup
  27. ****************************************************************************/
  28. static int __init mss2_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
  29. {
  30. int irq;
  31. /*
  32. * Check for devices with hard-wired IRQs.
  33. */
  34. irq = orion5x_pci_map_irq(dev, slot, pin);
  35. if (irq != -1)
  36. return irq;
  37. return -1;
  38. }
  39. static struct hw_pci mss2_pci __initdata = {
  40. .nr_controllers = 2,
  41. .setup = orion5x_pci_sys_setup,
  42. .scan = orion5x_pci_sys_scan_bus,
  43. .map_irq = mss2_pci_map_irq,
  44. };
  45. static int __init mss2_pci_init(void)
  46. {
  47. if (machine_is_mss2())
  48. pci_common_init(&mss2_pci);
  49. return 0;
  50. }
  51. subsys_initcall(mss2_pci_init);
  52. /*****************************************************************************
  53. * MSS2 power off method
  54. ****************************************************************************/
  55. /*
  56. * On the Maxtor Shared Storage II, the shutdown process is the following :
  57. * - Userland modifies U-boot env to tell U-boot to go idle at next boot
  58. * - The board reboots
  59. * - U-boot starts and go into an idle mode until the user press "power"
  60. */
  61. static void mss2_power_off(void)
  62. {
  63. u32 reg;
  64. /*
  65. * Enable and issue soft reset
  66. */
  67. reg = readl(RSTOUTn_MASK);
  68. reg |= 1 << 2;
  69. writel(reg, RSTOUTn_MASK);
  70. reg = readl(CPU_SOFT_RESET);
  71. reg |= 1;
  72. writel(reg, CPU_SOFT_RESET);
  73. }
  74. void __init mss2_init(void)
  75. {
  76. /* register mss2 specific power-off method */
  77. pm_power_off = mss2_power_off;
  78. }