common.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. #ifndef __ARCH_ORION5X_COMMON_H
  2. #define __ARCH_ORION5X_COMMON_H
  3. #include <linux/reboot.h>
  4. struct dsa_platform_data;
  5. struct mv643xx_eth_platform_data;
  6. struct mv_sata_platform_data;
  7. #define ORION_MBUS_PCIE_MEM_TARGET 0x04
  8. #define ORION_MBUS_PCIE_MEM_ATTR 0x59
  9. #define ORION_MBUS_PCIE_IO_TARGET 0x04
  10. #define ORION_MBUS_PCIE_IO_ATTR 0x51
  11. #define ORION_MBUS_PCIE_WA_TARGET 0x04
  12. #define ORION_MBUS_PCIE_WA_ATTR 0x79
  13. #define ORION_MBUS_PCI_MEM_TARGET 0x03
  14. #define ORION_MBUS_PCI_MEM_ATTR 0x59
  15. #define ORION_MBUS_PCI_IO_TARGET 0x03
  16. #define ORION_MBUS_PCI_IO_ATTR 0x51
  17. #define ORION_MBUS_DEVBUS_BOOT_TARGET 0x01
  18. #define ORION_MBUS_DEVBUS_BOOT_ATTR 0x0f
  19. #define ORION_MBUS_DEVBUS_TARGET(cs) 0x01
  20. #define ORION_MBUS_DEVBUS_ATTR(cs) (~(1 << cs))
  21. #define ORION_MBUS_SRAM_TARGET 0x09
  22. #define ORION_MBUS_SRAM_ATTR 0x00
  23. /*
  24. * Basic Orion init functions used early by machine-setup.
  25. */
  26. void orion5x_map_io(void);
  27. void orion5x_init_early(void);
  28. void orion5x_init_irq(void);
  29. void orion5x_init(void);
  30. void orion5x_id(u32 *dev, u32 *rev, char **dev_name);
  31. void clk_init(void);
  32. extern int orion5x_tclk;
  33. extern void orion5x_timer_init(void);
  34. void orion5x_setup_wins(void);
  35. void orion5x_ehci0_init(void);
  36. void orion5x_ehci1_init(void);
  37. void orion5x_eth_init(struct mv643xx_eth_platform_data *eth_data);
  38. void orion5x_eth_switch_init(struct dsa_platform_data *d);
  39. void orion5x_i2c_init(void);
  40. void orion5x_sata_init(struct mv_sata_platform_data *sata_data);
  41. void orion5x_spi_init(void);
  42. void orion5x_uart0_init(void);
  43. void orion5x_uart1_init(void);
  44. void orion5x_xor_init(void);
  45. void orion5x_restart(enum reboot_mode, const char *);
  46. /*
  47. * PCIe/PCI functions.
  48. */
  49. struct pci_bus;
  50. struct pci_sys_data;
  51. struct pci_dev;
  52. void orion5x_pcie_id(u32 *dev, u32 *rev);
  53. void orion5x_pci_disable(void);
  54. void orion5x_pci_set_cardbus_mode(void);
  55. int orion5x_pci_sys_setup(int nr, struct pci_sys_data *sys);
  56. struct pci_bus *orion5x_pci_sys_scan_bus(int nr, struct pci_sys_data *sys);
  57. int orion5x_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin);
  58. struct tag;
  59. extern void __init tag_fixup_mem32(struct tag *, char **);
  60. #ifdef CONFIG_MACH_MSS2_DT
  61. extern void mss2_init(void);
  62. #else
  63. static inline void mss2_init(void) {}
  64. #endif
  65. /*****************************************************************************
  66. * Helpers to access Orion registers
  67. ****************************************************************************/
  68. /*
  69. * These are not preempt-safe. Locks, if needed, must be taken
  70. * care of by the caller.
  71. */
  72. #define orion5x_setbits(r, mask) writel(readl(r) | (mask), (r))
  73. #define orion5x_clrbits(r, mask) writel(readl(r) & ~(mask), (r))
  74. #endif