bcma_private.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. #ifndef LINUX_BCMA_PRIVATE_H_
  2. #define LINUX_BCMA_PRIVATE_H_
  3. #ifndef pr_fmt
  4. #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
  5. #endif
  6. #include <linux/bcma/bcma.h>
  7. #include <linux/delay.h>
  8. #define BCMA_CORE_SIZE 0x1000
  9. #define bcma_err(bus, fmt, ...) \
  10. pr_err("bus%d: " fmt, (bus)->num, ##__VA_ARGS__)
  11. #define bcma_warn(bus, fmt, ...) \
  12. pr_warn("bus%d: " fmt, (bus)->num, ##__VA_ARGS__)
  13. #define bcma_info(bus, fmt, ...) \
  14. pr_info("bus%d: " fmt, (bus)->num, ##__VA_ARGS__)
  15. #define bcma_debug(bus, fmt, ...) \
  16. pr_debug("bus%d: " fmt, (bus)->num, ##__VA_ARGS__)
  17. struct bcma_bus;
  18. /* main.c */
  19. bool bcma_wait_value(struct bcma_device *core, u16 reg, u32 mask, u32 value,
  20. int timeout);
  21. int bcma_bus_register(struct bcma_bus *bus);
  22. void bcma_bus_unregister(struct bcma_bus *bus);
  23. int __init bcma_bus_early_register(struct bcma_bus *bus,
  24. struct bcma_device *core_cc,
  25. struct bcma_device *core_mips);
  26. #ifdef CONFIG_PM
  27. int bcma_bus_suspend(struct bcma_bus *bus);
  28. int bcma_bus_resume(struct bcma_bus *bus);
  29. #endif
  30. struct bcma_device *bcma_find_core_unit(struct bcma_bus *bus, u16 coreid,
  31. u8 unit);
  32. /* scan.c */
  33. int bcma_bus_scan(struct bcma_bus *bus);
  34. int __init bcma_bus_scan_early(struct bcma_bus *bus,
  35. struct bcma_device_id *match,
  36. struct bcma_device *core);
  37. void bcma_init_bus(struct bcma_bus *bus);
  38. /* sprom.c */
  39. int bcma_sprom_get(struct bcma_bus *bus);
  40. /* driver_chipcommon.c */
  41. #ifdef CONFIG_BCMA_DRIVER_MIPS
  42. void bcma_chipco_serial_init(struct bcma_drv_cc *cc);
  43. extern struct platform_device bcma_pflash_dev;
  44. #endif /* CONFIG_BCMA_DRIVER_MIPS */
  45. /* driver_chipcommon_pmu.c */
  46. u32 bcma_pmu_get_alp_clock(struct bcma_drv_cc *cc);
  47. u32 bcma_pmu_get_cpu_clock(struct bcma_drv_cc *cc);
  48. #ifdef CONFIG_BCMA_SFLASH
  49. /* driver_chipcommon_sflash.c */
  50. int bcma_sflash_init(struct bcma_drv_cc *cc);
  51. extern struct platform_device bcma_sflash_dev;
  52. #else
  53. static inline int bcma_sflash_init(struct bcma_drv_cc *cc)
  54. {
  55. bcma_err(cc->core->bus, "Serial flash not supported\n");
  56. return 0;
  57. }
  58. #endif /* CONFIG_BCMA_SFLASH */
  59. #ifdef CONFIG_BCMA_NFLASH
  60. /* driver_chipcommon_nflash.c */
  61. int bcma_nflash_init(struct bcma_drv_cc *cc);
  62. extern struct platform_device bcma_nflash_dev;
  63. #else
  64. static inline int bcma_nflash_init(struct bcma_drv_cc *cc)
  65. {
  66. bcma_err(cc->core->bus, "NAND flash not supported\n");
  67. return 0;
  68. }
  69. #endif /* CONFIG_BCMA_NFLASH */
  70. #ifdef CONFIG_BCMA_HOST_PCI
  71. /* host_pci.c */
  72. extern int __init bcma_host_pci_init(void);
  73. extern void __exit bcma_host_pci_exit(void);
  74. #endif /* CONFIG_BCMA_HOST_PCI */
  75. /* driver_pci.c */
  76. u32 bcma_pcie_read(struct bcma_drv_pci *pc, u32 address);
  77. extern int bcma_chipco_watchdog_register(struct bcma_drv_cc *cc);
  78. #ifdef CONFIG_BCMA_DRIVER_PCI_HOSTMODE
  79. bool bcma_core_pci_is_in_hostmode(struct bcma_drv_pci *pc);
  80. void bcma_core_pci_hostmode_init(struct bcma_drv_pci *pc);
  81. #endif /* CONFIG_BCMA_DRIVER_PCI_HOSTMODE */
  82. #ifdef CONFIG_BCMA_DRIVER_GPIO
  83. /* driver_gpio.c */
  84. int bcma_gpio_init(struct bcma_drv_cc *cc);
  85. int bcma_gpio_unregister(struct bcma_drv_cc *cc);
  86. #else
  87. static inline int bcma_gpio_init(struct bcma_drv_cc *cc)
  88. {
  89. return -ENOTSUPP;
  90. }
  91. static inline int bcma_gpio_unregister(struct bcma_drv_cc *cc)
  92. {
  93. return 0;
  94. }
  95. #endif /* CONFIG_BCMA_DRIVER_GPIO */
  96. #endif