#define pr_fmt(fmt) …
#include <linux/module.h>
#include <linux/of_device.h>
#include <linux/of_address.h>
#include <linux/ioport.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/limits.h>
#include <linux/bitops.h>
#include <linux/dma-mapping.h>
#include <linux/acpi.h>
#include <linux/iommu.h>
#include <linux/dma-map-ops.h>
#include "fsl-mc-private.h"
#define FSL_MC_DEFAULT_DMA_MASK …
static struct fsl_mc_version mc_version;
struct fsl_mc { … };
struct fsl_mc_addr_translation_range { … };
#define FSL_MC_GCR1 …
#define GCR1_P1_STOP …
#define GCR1_P2_STOP …
#define FSL_MC_FAPR …
#define MC_FAPR_PL …
#define MC_FAPR_BMT …
static phys_addr_t mc_portal_base_phys_addr;
static int fsl_mc_bus_match(struct device *dev, const struct device_driver *drv)
{ … }
static int fsl_mc_bus_uevent(const struct device *dev, struct kobj_uevent_env *env)
{ … }
static int fsl_mc_dma_configure(struct device *dev)
{ … }
static void fsl_mc_dma_cleanup(struct device *dev)
{ … }
static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR_RO(modalias);
static ssize_t driver_override_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static ssize_t driver_override_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RW(driver_override);
static struct attribute *fsl_mc_dev_attrs[] = …;
ATTRIBUTE_GROUPS(…);
static int scan_fsl_mc_bus(struct device *dev, void *data)
{ … }
static ssize_t rescan_store(const struct bus_type *bus,
const char *buf, size_t count)
{ … }
static BUS_ATTR_WO(rescan);
static int fsl_mc_bus_set_autorescan(struct device *dev, void *data)
{ … }
static int fsl_mc_bus_get_autorescan(struct device *dev, void *data)
{ … }
static ssize_t autorescan_store(const struct bus_type *bus,
const char *buf, size_t count)
{ … }
static ssize_t autorescan_show(const struct bus_type *bus, char *buf)
{ … }
static BUS_ATTR_RW(autorescan);
static struct attribute *fsl_mc_bus_attrs[] = …;
ATTRIBUTE_GROUPS(…);
struct bus_type fsl_mc_bus_type = …;
EXPORT_SYMBOL_GPL(…);
struct device_type fsl_mc_bus_dprc_type = …;
EXPORT_SYMBOL_GPL(…);
struct device_type fsl_mc_bus_dpni_type = …;
EXPORT_SYMBOL_GPL(…);
struct device_type fsl_mc_bus_dpio_type = …;
EXPORT_SYMBOL_GPL(…);
struct device_type fsl_mc_bus_dpsw_type = …;
EXPORT_SYMBOL_GPL(…);
struct device_type fsl_mc_bus_dpbp_type = …;
EXPORT_SYMBOL_GPL(…);
struct device_type fsl_mc_bus_dpcon_type = …;
EXPORT_SYMBOL_GPL(…);
struct device_type fsl_mc_bus_dpmcp_type = …;
EXPORT_SYMBOL_GPL(…);
struct device_type fsl_mc_bus_dpmac_type = …;
EXPORT_SYMBOL_GPL(…);
struct device_type fsl_mc_bus_dprtc_type = …;
EXPORT_SYMBOL_GPL(…);
struct device_type fsl_mc_bus_dpseci_type = …;
EXPORT_SYMBOL_GPL(…);
struct device_type fsl_mc_bus_dpdmux_type = …;
EXPORT_SYMBOL_GPL(…);
struct device_type fsl_mc_bus_dpdcei_type = …;
EXPORT_SYMBOL_GPL(…);
struct device_type fsl_mc_bus_dpaiop_type = …;
EXPORT_SYMBOL_GPL(…);
struct device_type fsl_mc_bus_dpci_type = …;
EXPORT_SYMBOL_GPL(…);
struct device_type fsl_mc_bus_dpdmai_type = …;
EXPORT_SYMBOL_GPL(…);
struct device_type fsl_mc_bus_dpdbg_type = …;
EXPORT_SYMBOL_GPL(…);
static struct device_type *fsl_mc_get_device_type(const char *type)
{ … }
static int fsl_mc_driver_probe(struct device *dev)
{ … }
static int fsl_mc_driver_remove(struct device *dev)
{ … }
static void fsl_mc_driver_shutdown(struct device *dev)
{ … }
int __fsl_mc_driver_register(struct fsl_mc_driver *mc_driver,
struct module *owner)
{ … }
EXPORT_SYMBOL_GPL(…);
void fsl_mc_driver_unregister(struct fsl_mc_driver *mc_driver)
{ … }
EXPORT_SYMBOL_GPL(…);
static int mc_get_version(struct fsl_mc_io *mc_io,
u32 cmd_flags,
struct fsl_mc_version *mc_ver_info)
{ … }
struct fsl_mc_version *fsl_mc_get_version(void)
{ … }
EXPORT_SYMBOL_GPL(…);
void fsl_mc_get_root_dprc(struct device *dev,
struct device **root_dprc_dev)
{ … }
static int get_dprc_attr(struct fsl_mc_io *mc_io,
int container_id, struct dprc_attributes *attr)
{ … }
static int get_dprc_icid(struct fsl_mc_io *mc_io,
int container_id, u32 *icid)
{ … }
static int translate_mc_addr(struct fsl_mc_device *mc_dev,
enum dprc_region_type mc_region_type,
u64 mc_offset, phys_addr_t *phys_addr)
{ … }
static int fsl_mc_device_get_mmio_regions(struct fsl_mc_device *mc_dev,
struct fsl_mc_device *mc_bus_dev)
{ … }
bool fsl_mc_is_root_dprc(struct device *dev)
{ … }
static void fsl_mc_device_release(struct device *dev)
{ … }
int fsl_mc_device_add(struct fsl_mc_obj_desc *obj_desc,
struct fsl_mc_io *mc_io,
struct device *parent_dev,
struct fsl_mc_device **new_mc_dev)
{ … }
EXPORT_SYMBOL_GPL(…);
static struct notifier_block fsl_mc_nb;
void fsl_mc_device_remove(struct fsl_mc_device *mc_dev)
{ … }
EXPORT_SYMBOL_GPL(…);
struct fsl_mc_device *fsl_mc_get_endpoint(struct fsl_mc_device *mc_dev,
u16 if_id)
{ … }
EXPORT_SYMBOL_GPL(…);
static int get_mc_addr_translation_ranges(struct device *dev,
struct fsl_mc_addr_translation_range
**ranges,
u8 *num_ranges)
{ … }
static int fsl_mc_bus_probe(struct platform_device *pdev)
{ … }
static void fsl_mc_bus_remove(struct platform_device *pdev)
{ … }
static const struct of_device_id fsl_mc_bus_match_table[] = …;
MODULE_DEVICE_TABLE(of, fsl_mc_bus_match_table);
static const struct acpi_device_id fsl_mc_bus_acpi_match_table[] = …;
MODULE_DEVICE_TABLE(acpi, fsl_mc_bus_acpi_match_table);
static struct platform_driver fsl_mc_bus_driver = …;
static int fsl_mc_bus_notifier(struct notifier_block *nb,
unsigned long action, void *data)
{ … }
static struct notifier_block fsl_mc_nb = …;
static int __init fsl_mc_bus_driver_init(void)
{ … }
postcore_initcall(fsl_mc_bus_driver_init);