2011-05-09 16:56:46 +00:00
|
|
|
#ifndef LINUX_BCMA_PRIVATE_H_
|
|
|
|
#define LINUX_BCMA_PRIVATE_H_
|
|
|
|
|
|
|
|
#ifndef pr_fmt
|
|
|
|
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <linux/bcma/bcma.h>
|
|
|
|
#include <linux/delay.h>
|
|
|
|
|
|
|
|
#define BCMA_CORE_SIZE 0x1000
|
|
|
|
|
2012-07-05 20:07:32 +00:00
|
|
|
#define bcma_err(bus, fmt, ...) \
|
|
|
|
pr_err("bus%d: " fmt, (bus)->num, ##__VA_ARGS__)
|
|
|
|
#define bcma_warn(bus, fmt, ...) \
|
|
|
|
pr_warn("bus%d: " fmt, (bus)->num, ##__VA_ARGS__)
|
|
|
|
#define bcma_info(bus, fmt, ...) \
|
|
|
|
pr_info("bus%d: " fmt, (bus)->num, ##__VA_ARGS__)
|
|
|
|
#define bcma_debug(bus, fmt, ...) \
|
|
|
|
pr_debug("bus%d: " fmt, (bus)->num, ##__VA_ARGS__)
|
|
|
|
|
2011-05-09 16:56:46 +00:00
|
|
|
struct bcma_bus;
|
|
|
|
|
|
|
|
/* main.c */
|
2013-06-26 08:02:11 +00:00
|
|
|
bool bcma_wait_value(struct bcma_device *core, u16 reg, u32 mask, u32 value,
|
|
|
|
int timeout);
|
2014-10-03 15:00:24 +00:00
|
|
|
void bcma_prepare_core(struct bcma_bus *bus, struct bcma_device *core);
|
2012-12-21 23:12:59 +00:00
|
|
|
int bcma_bus_register(struct bcma_bus *bus);
|
2011-06-17 23:01:59 +00:00
|
|
|
void bcma_bus_unregister(struct bcma_bus *bus);
|
2011-07-22 23:20:07 +00:00
|
|
|
int __init bcma_bus_early_register(struct bcma_bus *bus,
|
|
|
|
struct bcma_device *core_cc,
|
|
|
|
struct bcma_device *core_mips);
|
2011-12-09 21:16:07 +00:00
|
|
|
#ifdef CONFIG_PM
|
2012-01-13 22:58:40 +00:00
|
|
|
int bcma_bus_suspend(struct bcma_bus *bus);
|
2011-12-09 21:16:07 +00:00
|
|
|
int bcma_bus_resume(struct bcma_bus *bus);
|
|
|
|
#endif
|
2011-05-09 16:56:46 +00:00
|
|
|
|
|
|
|
/* scan.c */
|
|
|
|
int bcma_bus_scan(struct bcma_bus *bus);
|
2011-07-22 23:20:07 +00:00
|
|
|
int __init bcma_bus_scan_early(struct bcma_bus *bus,
|
|
|
|
struct bcma_device_id *match,
|
|
|
|
struct bcma_device *core);
|
|
|
|
void bcma_init_bus(struct bcma_bus *bus);
|
2011-05-09 16:56:46 +00:00
|
|
|
|
2011-06-02 00:08:51 +00:00
|
|
|
/* sprom.c */
|
|
|
|
int bcma_sprom_get(struct bcma_bus *bus);
|
|
|
|
|
2011-07-22 23:20:10 +00:00
|
|
|
/* driver_chipcommon.c */
|
|
|
|
#ifdef CONFIG_BCMA_DRIVER_MIPS
|
|
|
|
void bcma_chipco_serial_init(struct bcma_drv_cc *cc);
|
2013-01-25 10:37:26 +00:00
|
|
|
extern struct platform_device bcma_pflash_dev;
|
2011-07-22 23:20:10 +00:00
|
|
|
#endif /* CONFIG_BCMA_DRIVER_MIPS */
|
|
|
|
|
2014-09-08 20:53:36 +00:00
|
|
|
/* driver_chipcommon_b.c */
|
|
|
|
int bcma_core_chipcommon_b_init(struct bcma_drv_cc_b *ccb);
|
|
|
|
void bcma_core_chipcommon_b_free(struct bcma_drv_cc_b *ccb);
|
|
|
|
|
2011-07-22 23:20:10 +00:00
|
|
|
/* driver_chipcommon_pmu.c */
|
2012-12-07 11:56:56 +00:00
|
|
|
u32 bcma_pmu_get_alp_clock(struct bcma_drv_cc *cc);
|
|
|
|
u32 bcma_pmu_get_cpu_clock(struct bcma_drv_cc *cc);
|
2011-07-22 23:20:10 +00:00
|
|
|
|
2012-07-17 14:26:41 +00:00
|
|
|
#ifdef CONFIG_BCMA_SFLASH
|
|
|
|
/* driver_chipcommon_sflash.c */
|
|
|
|
int bcma_sflash_init(struct bcma_drv_cc *cc);
|
2012-08-10 19:23:53 +00:00
|
|
|
extern struct platform_device bcma_sflash_dev;
|
2012-07-17 14:26:41 +00:00
|
|
|
#else
|
|
|
|
static inline int bcma_sflash_init(struct bcma_drv_cc *cc)
|
|
|
|
{
|
|
|
|
bcma_err(cc->core->bus, "Serial flash not supported\n");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
#endif /* CONFIG_BCMA_SFLASH */
|
|
|
|
|
|
|
|
#ifdef CONFIG_BCMA_NFLASH
|
|
|
|
/* driver_chipcommon_nflash.c */
|
|
|
|
int bcma_nflash_init(struct bcma_drv_cc *cc);
|
2012-08-12 11:08:05 +00:00
|
|
|
extern struct platform_device bcma_nflash_dev;
|
2012-07-17 14:26:41 +00:00
|
|
|
#else
|
|
|
|
static inline int bcma_nflash_init(struct bcma_drv_cc *cc)
|
|
|
|
{
|
|
|
|
bcma_err(cc->core->bus, "NAND flash not supported\n");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
#endif /* CONFIG_BCMA_NFLASH */
|
|
|
|
|
2011-05-09 16:56:46 +00:00
|
|
|
#ifdef CONFIG_BCMA_HOST_PCI
|
|
|
|
/* host_pci.c */
|
|
|
|
extern int __init bcma_host_pci_init(void);
|
|
|
|
extern void __exit bcma_host_pci_exit(void);
|
|
|
|
#endif /* CONFIG_BCMA_HOST_PCI */
|
|
|
|
|
2014-09-25 22:09:19 +00:00
|
|
|
/* host_soc.c */
|
|
|
|
#if defined(CONFIG_BCMA_HOST_SOC) && defined(CONFIG_OF)
|
|
|
|
extern int __init bcma_host_soc_register_driver(void);
|
|
|
|
extern void __exit bcma_host_soc_unregister_driver(void);
|
|
|
|
#else
|
|
|
|
static inline int __init bcma_host_soc_register_driver(void)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
static inline void __exit bcma_host_soc_unregister_driver(void)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
#endif /* CONFIG_BCMA_HOST_SOC && CONFIG_OF */
|
|
|
|
|
2012-01-30 23:03:33 +00:00
|
|
|
/* driver_pci.c */
|
|
|
|
u32 bcma_pcie_read(struct bcma_drv_pci *pc, u32 address);
|
|
|
|
|
2012-12-05 17:46:02 +00:00
|
|
|
extern int bcma_chipco_watchdog_register(struct bcma_drv_cc *cc);
|
|
|
|
|
2011-07-05 17:48:26 +00:00
|
|
|
#ifdef CONFIG_BCMA_DRIVER_PCI_HOSTMODE
|
2012-12-21 23:12:59 +00:00
|
|
|
bool bcma_core_pci_is_in_hostmode(struct bcma_drv_pci *pc);
|
|
|
|
void bcma_core_pci_hostmode_init(struct bcma_drv_pci *pc);
|
2011-07-05 17:48:26 +00:00
|
|
|
#endif /* CONFIG_BCMA_DRIVER_PCI_HOSTMODE */
|
|
|
|
|
2012-11-20 22:24:30 +00:00
|
|
|
#ifdef CONFIG_BCMA_DRIVER_GPIO
|
|
|
|
/* driver_gpio.c */
|
|
|
|
int bcma_gpio_init(struct bcma_drv_cc *cc);
|
2013-02-03 22:25:33 +00:00
|
|
|
int bcma_gpio_unregister(struct bcma_drv_cc *cc);
|
2012-11-20 22:24:30 +00:00
|
|
|
#else
|
|
|
|
static inline int bcma_gpio_init(struct bcma_drv_cc *cc)
|
|
|
|
{
|
|
|
|
return -ENOTSUPP;
|
|
|
|
}
|
2013-02-03 22:25:33 +00:00
|
|
|
static inline int bcma_gpio_unregister(struct bcma_drv_cc *cc)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
2012-11-20 22:24:30 +00:00
|
|
|
#endif /* CONFIG_BCMA_DRIVER_GPIO */
|
|
|
|
|
2011-05-09 16:56:46 +00:00
|
|
|
#endif
|