common.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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 0x00
  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, int irq);
  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. /* board init functions for boards not fully converted to fdt */
  59. #ifdef CONFIG_MACH_EDMINI_V2_DT
  60. void edmini_v2_init(void);
  61. #else
  62. static inline void edmini_v2_init(void) {};
  63. #endif
  64. struct meminfo;
  65. struct tag;
  66. extern void __init tag_fixup_mem32(struct tag *, char **, struct meminfo *);
  67. /*****************************************************************************
  68. * Helpers to access Orion registers
  69. ****************************************************************************/
  70. /*
  71. * These are not preempt-safe. Locks, if needed, must be taken
  72. * care of by the caller.
  73. */
  74. #define orion5x_setbits(r, mask) writel(readl(r) | (mask), (r))
  75. #define orion5x_clrbits(r, mask) writel(readl(r) & ~(mask), (r))
  76. #endif