common.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. /*
  8. * Basic Orion init functions used early by machine-setup.
  9. */
  10. void orion5x_map_io(void);
  11. void orion5x_init_early(void);
  12. void orion5x_init_irq(void);
  13. void orion5x_init(void);
  14. void orion5x_id(u32 *dev, u32 *rev, char **dev_name);
  15. void clk_init(void);
  16. extern int orion5x_tclk;
  17. extern void orion5x_timer_init(void);
  18. void orion5x_setup_wins(void);
  19. void orion5x_ehci0_init(void);
  20. void orion5x_ehci1_init(void);
  21. void orion5x_eth_init(struct mv643xx_eth_platform_data *eth_data);
  22. void orion5x_eth_switch_init(struct dsa_platform_data *d, int irq);
  23. void orion5x_i2c_init(void);
  24. void orion5x_sata_init(struct mv_sata_platform_data *sata_data);
  25. void orion5x_spi_init(void);
  26. void orion5x_uart0_init(void);
  27. void orion5x_uart1_init(void);
  28. void orion5x_xor_init(void);
  29. void orion5x_restart(enum reboot_mode, const char *);
  30. /*
  31. * PCIe/PCI functions.
  32. */
  33. struct pci_bus;
  34. struct pci_sys_data;
  35. struct pci_dev;
  36. void orion5x_pcie_id(u32 *dev, u32 *rev);
  37. void orion5x_pci_disable(void);
  38. void orion5x_pci_set_cardbus_mode(void);
  39. int orion5x_pci_sys_setup(int nr, struct pci_sys_data *sys);
  40. struct pci_bus *orion5x_pci_sys_scan_bus(int nr, struct pci_sys_data *sys);
  41. int orion5x_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin);
  42. /* board init functions for boards not fully converted to fdt */
  43. #ifdef CONFIG_MACH_EDMINI_V2_DT
  44. void edmini_v2_init(void);
  45. #else
  46. static inline void edmini_v2_init(void) {};
  47. #endif
  48. struct meminfo;
  49. struct tag;
  50. extern void __init tag_fixup_mem32(struct tag *, char **, struct meminfo *);
  51. /*****************************************************************************
  52. * Helpers to access Orion registers
  53. ****************************************************************************/
  54. /*
  55. * These are not preempt-safe. Locks, if needed, must be taken
  56. * care of by the caller.
  57. */
  58. #define orion5x_setbits(r, mask) writel(readl(r) | (mask), (r))
  59. #define orion5x_clrbits(r, mask) writel(readl(r) & ~(mask), (r))
  60. #endif