common.h 2.0 KB

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