drivers/bus/mvebu-mbus.c
Source file repositories/reference/linux-study-clean/drivers/bus/mvebu-mbus.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/bus/mvebu-mbus.c- Extension
.c- Size
- 35573 bytes
- Lines
- 1321
- Domain
- Driver Families
- Bucket
- drivers/bus
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/module.hlinux/init.hlinux/mbus.hlinux/io.hlinux/ioport.hlinux/of.hlinux/of_address.hlinux/debugfs.hlinux/log2.hlinux/memblock.hlinux/syscore_ops.h
Detected Declarations
struct mvebu_mbus_statestruct mvebu_mbus_soc_datastruct mvebu_mbus_win_datastruct mvebu_mbus_statefunction mvebu_mbus_window_is_remappablefunction mvebu_mbus_read_windowfunction mvebu_mbus_disable_windowfunction mvebu_mbus_window_is_freefunction givenfunction mvebu_mbus_find_windowfunction mvebu_mbus_setup_windowfunction mvebu_mbus_alloc_windowfunction mvebu_sdram_debug_show_orionfunction mvebu_sdram_debug_show_dovefunction mvebu_sdram_debug_showfunction mvebu_devs_debug_showfunction generic_mbus_win_cfg_offsetfunction armada_370_xp_mbus_win_cfg_offsetfunction mv78xx0_mbus_win_cfg_offsetfunction generic_mbus_win_remap_2_offsetfunction generic_mbus_win_remap_4_offsetfunction generic_mbus_win_remap_8_offsetfunction armada_xp_mbus_win_remap_offsetfunction mvebu_mbus_find_bridge_holefunction for_each_mem_rangefunction mvebu_mbus_setup_cpu_target_nooverlapfunction mvebu_mbus_default_setup_cpu_targetfunction setfunction mvebu_mbus_default_save_cpu_targetfunction mvebu_mbus_dove_setup_cpu_targetfunction mvebu_mbus_dove_save_cpu_targetfunction mvebu_mbus_save_cpu_targetfunction mvebu_mbus_add_window_remap_by_idfunction mvebu_mbus_add_window_by_idfunction mvebu_mbus_del_windowfunction mvebu_mbus_get_pcie_mem_aperturefunction mvebu_mbus_get_pcie_io_aperturefunction mvebu_mbus_get_dram_win_infofunction mvebu_mbus_get_io_win_infofunction mvebu_mbus_debugfs_initfunction mvebu_mbus_suspendfunction mvebu_mbus_resumefunction mvebu_mbus_common_initfunction mvebu_mbus_initfunction mbus_dt_setup_winfunction mbus_dt_setupfunction for_each_of_rangefunction mvebu_mbus_get_pcie_resources
Annotated Snippet
struct mvebu_mbus_soc_data {
unsigned int num_wins;
bool has_mbus_bridge;
unsigned int (*win_cfg_offset)(const int win);
unsigned int (*win_remap_offset)(const int win);
void (*setup_cpu_target)(struct mvebu_mbus_state *s);
int (*save_cpu_target)(struct mvebu_mbus_state *s,
u32 __iomem *store_addr);
int (*show_cpu_target)(struct mvebu_mbus_state *s,
struct seq_file *seq, void *v);
};
/*
* Used to store the state of one MBus window across suspend/resume.
*/
struct mvebu_mbus_win_data {
u32 ctrl;
u32 base;
u32 remap_lo;
u32 remap_hi;
};
struct mvebu_mbus_state {
void __iomem *mbuswins_base;
void __iomem *sdramwins_base;
void __iomem *mbusbridge_base;
phys_addr_t sdramwins_phys_base;
struct dentry *debugfs_root;
struct dentry *debugfs_sdram;
struct dentry *debugfs_devs;
struct resource pcie_mem_aperture;
struct resource pcie_io_aperture;
const struct mvebu_mbus_soc_data *soc;
int hw_io_coherency;
/* Used during suspend/resume */
u32 mbus_bridge_ctrl;
u32 mbus_bridge_base;
struct mvebu_mbus_win_data wins[MBUS_WINS_MAX];
};
static struct mvebu_mbus_state mbus_state;
/*
* We provide two variants of the mv_mbus_dram_info() function:
*
* - The normal one, where the described DRAM ranges may overlap with
* the I/O windows, but for which the DRAM ranges are guaranteed to
* have a power of two size. Such ranges are suitable for the DMA
* masters that only DMA between the RAM and the device, which is
* actually all devices except the crypto engines.
*
* - The 'nooverlap' one, where the described DRAM ranges are
* guaranteed to not overlap with the I/O windows, but for which the
* DRAM ranges will not have power of two sizes. They will only be
* aligned on a 64 KB boundary, and have a size multiple of 64
* KB. Such ranges are suitable for the DMA masters that DMA between
* the crypto SRAM (which is mapped through an I/O window) and a
* device. This is the case for the crypto engines.
*/
static struct mbus_dram_target_info mvebu_mbus_dram_info;
static struct mbus_dram_target_info mvebu_mbus_dram_info_nooverlap;
const struct mbus_dram_target_info *mv_mbus_dram_info(void)
{
return &mvebu_mbus_dram_info;
}
EXPORT_SYMBOL_GPL(mv_mbus_dram_info);
const struct mbus_dram_target_info *mv_mbus_dram_info_nooverlap(void)
{
return &mvebu_mbus_dram_info_nooverlap;
}
EXPORT_SYMBOL_GPL(mv_mbus_dram_info_nooverlap);
/* Checks whether the given window has remap capability */
static bool mvebu_mbus_window_is_remappable(struct mvebu_mbus_state *mbus,
const int win)
{
return mbus->soc->win_remap_offset(win) != MVEBU_MBUS_NO_REMAP;
}
/*
* Functions to manipulate the address decoding windows
*/
static void mvebu_mbus_read_window(struct mvebu_mbus_state *mbus,
int win, int *enabled, u64 *base,
u32 *size, u8 *target, u8 *attr,
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/module.h`, `linux/init.h`, `linux/mbus.h`, `linux/io.h`, `linux/ioport.h`, `linux/of.h`, `linux/of_address.h`.
- Detected declarations: `struct mvebu_mbus_state`, `struct mvebu_mbus_soc_data`, `struct mvebu_mbus_win_data`, `struct mvebu_mbus_state`, `function mvebu_mbus_window_is_remappable`, `function mvebu_mbus_read_window`, `function mvebu_mbus_disable_window`, `function mvebu_mbus_window_is_free`, `function given`, `function mvebu_mbus_find_window`.
- Atlas domain: Driver Families / drivers/bus.
- Implementation status: integration implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.