linux/drivers/ssb/main.c

/*
 * Sonics Silicon Backplane
 * Subsystem core
 *
 * Copyright 2005, Broadcom Corporation
 * Copyright 2006, 2007, Michael Buesch <[email protected]>
 *
 * Licensed under the GNU/GPL. See COPYING for details.
 */

#include "ssb_private.h"

#include <linux/delay.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/ssb/ssb.h>
#include <linux/ssb/ssb_regs.h>
#include <linux/ssb/ssb_driver_gige.h>
#include <linux/dma-mapping.h>
#include <linux/pci.h>
#include <linux/mmc/sdio_func.h>
#include <linux/slab.h>

#include <pcmcia/cistpl.h>
#include <pcmcia/ds.h>


MODULE_DESCRIPTION();
MODULE_LICENSE();


/* Temporary list of yet-to-be-attached buses */
static LIST_HEAD(attach_queue);
/* List if running buses */
static LIST_HEAD(buses);
/* Software ID counter */
static unsigned int next_busnumber;
/* buses_mutes locks the two buslists and the next_busnumber.
 * Don't lock this directly, but use ssb_buses_[un]lock() below.
 */
static DEFINE_MUTEX(buses_mutex);

/* There are differences in the codeflow, if the bus is
 * initialized from early boot, as various needed services
 * are not available early. This is a mechanism to delay
 * these initializations to after early boot has finished.
 * It's also used to avoid mutex locking, as that's not
 * available and needed early.
 */
static bool ssb_is_early_boot =;

static void ssb_buses_lock(void);
static void ssb_buses_unlock(void);


#ifdef CONFIG_SSB_PCIHOST
struct ssb_bus *ssb_pci_dev_to_bus(struct pci_dev *pdev)
{}
#endif /* CONFIG_SSB_PCIHOST */

#ifdef CONFIG_SSB_PCMCIAHOST
struct ssb_bus *ssb_pcmcia_dev_to_bus(struct pcmcia_device *pdev)
{}
#endif /* CONFIG_SSB_PCMCIAHOST */

int ssb_for_each_bus_call(unsigned long data,
			  int (*func)(struct ssb_bus *bus, unsigned long data))
{}

static struct ssb_device *ssb_device_get(struct ssb_device *dev)
{}

static void ssb_device_put(struct ssb_device *dev)
{}

static int ssb_device_resume(struct device *dev)
{}

static int ssb_device_suspend(struct device *dev, pm_message_t state)
{}

int ssb_bus_resume(struct ssb_bus *bus)
{}
EXPORT_SYMBOL();

int ssb_bus_suspend(struct ssb_bus *bus)
{}
EXPORT_SYMBOL();

#ifdef CONFIG_SSB_SPROM
/** ssb_devices_freeze - Freeze all devices on the bus.
 *
 * After freezing no device driver will be handling a device
 * on this bus anymore. ssb_devices_thaw() must be called after
 * a successful freeze to reactivate the devices.
 *
 * @bus: The bus.
 * @ctx: Context structure. Pass this to ssb_devices_thaw().
 */
int ssb_devices_freeze(struct ssb_bus *bus, struct ssb_freeze_context *ctx)
{}

/** ssb_devices_thaw - Unfreeze all devices on the bus.
 *
 * This will re-attach the device drivers and re-init the devices.
 *
 * @ctx: The context structure from ssb_devices_freeze()
 */
int ssb_devices_thaw(struct ssb_freeze_context *ctx)
{}
#endif /* CONFIG_SSB_SPROM */

static void ssb_device_shutdown(struct device *dev)
{}

static void ssb_device_remove(struct device *dev)
{}

static int ssb_device_probe(struct device *dev)
{}

static int ssb_match_devid(const struct ssb_device_id *tabid,
			   const struct ssb_device_id *devid)
{}

static int ssb_bus_match(struct device *dev, const struct device_driver *drv)
{}

static int ssb_device_uevent(const struct device *dev, struct kobj_uevent_env *env)
{}

#define ssb_config_attr(attrib, field, format_string)

ssb_config_attr()
ssb_config_attr()
ssb_config_attr()
ssb_config_attr()
ssb_config_attr()
static ssize_t
name_show(struct device *dev, struct device_attribute *attr, char *buf)
{}
static DEVICE_ATTR_RO(name);

static struct attribute *ssb_device_attrs[] =;
ATTRIBUTE_GROUPS();

static const struct bus_type ssb_bustype =;

static void ssb_buses_lock(void)
{}

static void ssb_buses_unlock(void)
{}

static void ssb_devices_unregister(struct ssb_bus *bus)
{}

void ssb_bus_unregister(struct ssb_bus *bus)
{}
EXPORT_SYMBOL();

static void ssb_release_dev(struct device *dev)
{}

static int ssb_devices_register(struct ssb_bus *bus)
{}

/* Needs ssb_buses_lock() */
static int ssb_attach_queued_buses(void)
{}

static int ssb_fetch_invariants(struct ssb_bus *bus,
				ssb_invariants_func_t get_invariants)
{}

static int __maybe_unused
ssb_bus_register(struct ssb_bus *bus,
		 ssb_invariants_func_t get_invariants,
		 unsigned long baseaddr)
{}

#ifdef CONFIG_SSB_PCIHOST
int ssb_bus_pcibus_register(struct ssb_bus *bus, struct pci_dev *host_pci)
{}
#endif /* CONFIG_SSB_PCIHOST */

#ifdef CONFIG_SSB_PCMCIAHOST
int ssb_bus_pcmciabus_register(struct ssb_bus *bus,
			       struct pcmcia_device *pcmcia_dev,
			       unsigned long baseaddr)
{}
#endif /* CONFIG_SSB_PCMCIAHOST */

#ifdef CONFIG_SSB_SDIOHOST
int ssb_bus_sdiobus_register(struct ssb_bus *bus, struct sdio_func *func,
			     unsigned int quirks)
{}
EXPORT_SYMBOL();
#endif /* CONFIG_SSB_PCMCIAHOST */

#ifdef CONFIG_SSB_HOST_SOC
int ssb_bus_host_soc_register(struct ssb_bus *bus, unsigned long baseaddr)
{}
#endif

int __ssb_driver_register(struct ssb_driver *drv, struct module *owner)
{}
EXPORT_SYMBOL();

void ssb_driver_unregister(struct ssb_driver *drv)
{}
EXPORT_SYMBOL();

void ssb_set_devtypedata(struct ssb_device *dev, void *data)
{}
EXPORT_SYMBOL();

static u32 clkfactor_f6_resolve(u32 v)
{}

/* Calculate the speed the backplane would run at a given set of clockcontrol values */
u32 ssb_calc_clock_rate(u32 plltype, u32 n, u32 m)
{}

/* Get the current speed the backplane is running at */
u32 ssb_clockspeed(struct ssb_bus *bus)
{}
EXPORT_SYMBOL();

static u32 ssb_tmslow_reject_bitmask(struct ssb_device *dev)
{}

int ssb_device_is_enabled(struct ssb_device *dev)
{}
EXPORT_SYMBOL();

static void ssb_flush_tmslow(struct ssb_device *dev)
{}

void ssb_device_enable(struct ssb_device *dev, u32 core_specific_flags)
{}
EXPORT_SYMBOL();

/* Wait for bitmask in a register to get set or cleared.
 * timeout is in units of ten-microseconds
 */
static int ssb_wait_bits(struct ssb_device *dev, u16 reg, u32 bitmask,
			 int timeout, int set)
{}

void ssb_device_disable(struct ssb_device *dev, u32 core_specific_flags)
{}
EXPORT_SYMBOL();

/* Some chipsets need routing known for PCIe and 64-bit DMA */
static bool ssb_dma_translation_special_bit(struct ssb_device *dev)
{}

u32 ssb_dma_translation(struct ssb_device *dev)
{}
EXPORT_SYMBOL();

int ssb_bus_may_powerdown(struct ssb_bus *bus)
{}
EXPORT_SYMBOL();

int ssb_bus_powerup(struct ssb_bus *bus, bool dynamic_pctl)
{}
EXPORT_SYMBOL();

static void ssb_broadcast_value(struct ssb_device *dev,
				u32 address, u32 data)
{}

void ssb_commit_settings(struct ssb_bus *bus)
{}
EXPORT_SYMBOL();

u32 ssb_admatch_base(u32 adm)
{}
EXPORT_SYMBOL();

u32 ssb_admatch_size(u32 adm)
{}
EXPORT_SYMBOL();

static int __init ssb_modinit(void)
{}
/* ssb must be initialized after PCI but before the ssb drivers.
 * That means we must use some initcall between subsys_initcall
 * and device_initcall.
 */
fs_initcall(ssb_modinit);

static void __exit ssb_modexit(void)
{}
module_exit()