board-mss2.c 2.1 KB

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