#ifndef LINUX_SSB_H_
#define LINUX_SSB_H_
#include <linux/device.h>
#include <linux/list.h>
#include <linux/types.h>
#include <linux/spinlock.h>
#include <linux/pci.h>
#include <linux/gpio/driver.h>
#include <linux/mod_devicetable.h>
#include <linux/dma-mapping.h>
#include <linux/platform_device.h>
#include <linux/ssb/ssb_regs.h>
struct pcmcia_device;
struct ssb_bus;
struct ssb_driver;
struct ssb_sprom_core_pwr_info { … };
struct ssb_sprom { … };
struct ssb_boardinfo { … };
struct ssb_device;
struct ssb_bus_ops { … };
#define SSB_DEV_CHIPCOMMON …
#define SSB_DEV_ILINE20 …
#define SSB_DEV_SDRAM …
#define SSB_DEV_PCI …
#define SSB_DEV_MIPS …
#define SSB_DEV_ETHERNET …
#define SSB_DEV_V90 …
#define SSB_DEV_USB11_HOSTDEV …
#define SSB_DEV_ADSL …
#define SSB_DEV_ILINE100 …
#define SSB_DEV_IPSEC …
#define SSB_DEV_PCMCIA …
#define SSB_DEV_INTERNAL_MEM …
#define SSB_DEV_MEMC_SDRAM …
#define SSB_DEV_EXTIF …
#define SSB_DEV_80211 …
#define SSB_DEV_MIPS_3302 …
#define SSB_DEV_USB11_HOST …
#define SSB_DEV_USB11_DEV …
#define SSB_DEV_USB20_HOST …
#define SSB_DEV_USB20_DEV …
#define SSB_DEV_SDIO_HOST …
#define SSB_DEV_ROBOSWITCH …
#define SSB_DEV_PARA_ATA …
#define SSB_DEV_SATA_XORDMA …
#define SSB_DEV_ETHERNET_GBIT …
#define SSB_DEV_PCIE …
#define SSB_DEV_MIMO_PHY …
#define SSB_DEV_SRAM_CTRLR …
#define SSB_DEV_MINI_MACPHY …
#define SSB_DEV_ARM_1176 …
#define SSB_DEV_ARM_7TDMI …
#define SSB_DEV_ARM_CM3 …
#define SSB_VENDOR_BROADCOM …
struct __ssb_dev_wrapper { … };
struct ssb_device { … };
static inline
struct ssb_device * dev_to_ssb_dev(const struct device *dev)
{ … }
static inline
void ssb_set_drvdata(struct ssb_device *dev, void *data)
{ … }
static inline
void * ssb_get_drvdata(struct ssb_device *dev)
{ … }
void ssb_set_devtypedata(struct ssb_device *dev, void *data);
static inline
void * ssb_get_devtypedata(struct ssb_device *dev)
{ … }
struct ssb_driver { … };
#define drv_to_ssb_drv(_drv) …
extern int __ssb_driver_register(struct ssb_driver *drv, struct module *owner);
#define ssb_driver_register(drv) …
extern void ssb_driver_unregister(struct ssb_driver *drv);
enum ssb_bustype { … };
#define SSB_BOARDVENDOR_BCM …
#define SSB_BOARDVENDOR_DELL …
#define SSB_BOARDVENDOR_HP …
#define SSB_BOARD_BCM94301CB …
#define SSB_BOARD_BCM94301MP …
#define SSB_BOARD_BU4309 …
#define SSB_BOARD_BCM94309CB …
#define SSB_BOARD_BCM4309MP …
#define SSB_BOARD_BU4306 …
#define SSB_BOARD_BCM94306MP …
#define SSB_BOARD_BCM4309G …
#define SSB_BOARD_BCM4306CB …
#define SSB_BOARD_BCM94306PC …
#define SSB_BOARD_BCM94306CBSG …
#define SSB_BOARD_PCSG94306 …
#define SSB_BOARD_BU4704SD …
#define SSB_BOARD_BCM94704AGR …
#define SSB_BOARD_BCM94308MP …
#define SSB_BOARD_BU4318 …
#define SSB_BOARD_CB4318 …
#define SSB_BOARD_MPG4318 …
#define SSB_BOARD_MP4318 …
#define SSB_BOARD_SD4318 …
#define SSB_BOARD_BCM94306P …
#define SSB_BOARD_BCM94303MP …
#define SSB_BOARD_BCM94306MPM …
#define SSB_BOARD_BCM94306MPL …
#define SSB_BOARD_PC4303 …
#define SSB_BOARD_BCM94306MPLNA …
#define SSB_BOARD_BCM94306MPH …
#define SSB_BOARD_BCM94306PCIV …
#define SSB_BOARD_BCM94318MPGH …
#define SSB_BOARD_BU4311 …
#define SSB_BOARD_BCM94311MC …
#define SSB_BOARD_BCM94311MCAG …
#define SSB_BOARD_BU4321 …
#define SSB_BOARD_BU4321E …
#define SSB_BOARD_MP4321 …
#define SSB_BOARD_CB2_4321 …
#define SSB_BOARD_CB2_4321_AG …
#define SSB_BOARD_MC4321 …
#define SSB_BOARD_BCM94325DEVBU …
#define SSB_BOARD_BCM94325BGABU …
#define SSB_BOARD_BCM94325SDGWB …
#define SSB_BOARD_BCM94325SDGMDL …
#define SSB_BOARD_BCM94325SDGMDL2 …
#define SSB_BOARD_BCM94325SDGMDL3 …
#define SSB_BOARD_BCM94325SDABGWBA …
#define SSB_BOARD_BCM94322MC …
#define SSB_BOARD_BCM94322USB …
#define SSB_BOARD_BCM94322HM …
#define SSB_BOARD_BCM94322USB2D …
#define SSB_BOARD_BU4312 …
#define SSB_BOARD_BCM4312MCGSG …
#define SSB_CHIPPACK_BCM4712S …
#define SSB_CHIPPACK_BCM4712M …
#define SSB_CHIPPACK_BCM4712L …
#include <linux/ssb/ssb_driver_chipcommon.h>
#include <linux/ssb/ssb_driver_mips.h>
#include <linux/ssb/ssb_driver_extif.h>
#include <linux/ssb/ssb_driver_pci.h>
struct ssb_bus { … };
enum ssb_quirks { … };
struct ssb_init_invariants { … };
ssb_invariants_func_t;
extern int ssb_bus_host_soc_register(struct ssb_bus *bus,
unsigned long baseaddr);
#ifdef CONFIG_SSB_PCIHOST
extern int ssb_bus_pcibus_register(struct ssb_bus *bus,
struct pci_dev *host_pci);
#endif
#ifdef CONFIG_SSB_PCMCIAHOST
extern int ssb_bus_pcmciabus_register(struct ssb_bus *bus,
struct pcmcia_device *pcmcia_dev,
unsigned long baseaddr);
#endif
#ifdef CONFIG_SSB_SDIOHOST
extern int ssb_bus_sdiobus_register(struct ssb_bus *bus,
struct sdio_func *sdio_func,
unsigned int quirks);
#endif
extern void ssb_bus_unregister(struct ssb_bus *bus);
extern bool ssb_is_sprom_available(struct ssb_bus *bus);
extern int ssb_arch_register_fallback_sprom(
int (*sprom_callback)(struct ssb_bus *bus,
struct ssb_sprom *out));
extern int ssb_bus_suspend(struct ssb_bus *bus);
extern int ssb_bus_resume(struct ssb_bus *bus);
extern u32 ssb_clockspeed(struct ssb_bus *bus);
int ssb_device_is_enabled(struct ssb_device *dev);
void ssb_device_enable(struct ssb_device *dev, u32 core_specific_flags);
void ssb_device_disable(struct ssb_device *dev, u32 core_specific_flags);
static inline u8 ssb_read8(struct ssb_device *dev, u16 offset)
{ … }
static inline u16 ssb_read16(struct ssb_device *dev, u16 offset)
{ … }
static inline u32 ssb_read32(struct ssb_device *dev, u16 offset)
{ … }
static inline void ssb_write8(struct ssb_device *dev, u16 offset, u8 value)
{ … }
static inline void ssb_write16(struct ssb_device *dev, u16 offset, u16 value)
{ … }
static inline void ssb_write32(struct ssb_device *dev, u16 offset, u32 value)
{ … }
#ifdef CONFIG_SSB_BLOCKIO
static inline void ssb_block_read(struct ssb_device *dev, void *buffer,
size_t count, u16 offset, u8 reg_width)
{ … }
static inline void ssb_block_write(struct ssb_device *dev, const void *buffer,
size_t count, u16 offset, u8 reg_width)
{ … }
#endif
extern u32 ssb_dma_translation(struct ssb_device *dev);
#define SSB_DMA_TRANSLATION_MASK …
#define SSB_DMA_TRANSLATION_SHIFT …
#ifdef CONFIG_SSB_PCIHOST
extern int ssb_pcihost_register(struct pci_driver *driver);
static inline void ssb_pcihost_unregister(struct pci_driver *driver)
{ … }
static inline
void ssb_pcihost_set_power_state(struct ssb_device *sdev, pci_power_t state)
{ … }
#else
static inline void ssb_pcihost_unregister(struct pci_driver *driver)
{
}
static inline
void ssb_pcihost_set_power_state(struct ssb_device *sdev, pci_power_t state)
{
}
#endif
extern int ssb_bus_may_powerdown(struct ssb_bus *bus);
extern int ssb_bus_powerup(struct ssb_bus *bus, bool dynamic_pctl);
extern void ssb_commit_settings(struct ssb_bus *bus);
extern u32 ssb_admatch_base(u32 adm);
extern u32 ssb_admatch_size(u32 adm);
#ifdef CONFIG_SSB_EMBEDDED
int ssb_pcibios_plat_dev_init(struct pci_dev *dev);
int ssb_pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin);
#endif
#endif