arch/arm/mach-mvebu/kirkwood.c
Source file repositories/reference/linux-study-clean/arch/arm/mach-mvebu/kirkwood.c
File Facts
- System
- Linux kernel
- Corpus path
arch/arm/mach-mvebu/kirkwood.c- Extension
.c- Size
- 4712 bytes
- Lines
- 193
- Domain
- Architecture Layer
- Bucket
- arch/arm
- Inferred role
- Architecture Layer: implementation source
- Status
- source implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/clk.hlinux/kernel.hlinux/init.hlinux/mbus.hlinux/of.hlinux/of_address.hlinux/of_net.hlinux/of_platform.hlinux/platform_device.hlinux/slab.hasm/hardware/cache-feroceon-l2.hasm/mach/arch.hasm/mach/map.hkirkwood.hkirkwood-pm.hcommon.h
Detected Declarations
function kirkwood_cpufreq_initfunction kirkwood_cpuidle_initfunction kirkwood_dt_eth_fixupfunction errorsfunction kirkwood_dt_init
Annotated Snippet
if (!pmac->name) {
kfree(pmac);
goto eth_fixup_no_mem;
}
macaddr = pmac->value;
reg = readl(io + MV643XX_ETH_MAC_ADDR_HIGH);
macaddr[0] = (reg >> 24) & 0xff;
macaddr[1] = (reg >> 16) & 0xff;
macaddr[2] = (reg >> 8) & 0xff;
macaddr[3] = reg & 0xff;
reg = readl(io + MV643XX_ETH_MAC_ADDR_LOW);
macaddr[4] = (reg >> 8) & 0xff;
macaddr[5] = reg & 0xff;
of_update_property(np, pmac);
eth_fixup_no_mem:
iounmap(io);
clk_disable_unprepare(clk);
eth_fixup_no_map:
clk_put(clk);
eth_fixup_skip:
of_node_put(pnp);
}
}
/*
* Disable propagation of mbus errors to the CPU local bus, as this
* causes mbus errors (which can occur for example for PCI aborts) to
* throw CPU aborts, which we're not set up to deal with.
*/
static void kirkwood_disable_mbus_error_propagation(void)
{
void __iomem *cpu_config;
cpu_config = ioremap(CPU_CONFIG_PHYS, 4);
writel(readl(cpu_config) & ~CPU_CONFIG_ERROR_PROP, cpu_config);
}
static struct of_dev_auxdata auxdata[] __initdata = {
OF_DEV_AUXDATA("marvell,kirkwood-audio", 0xf10a0000,
"mvebu-audio", NULL),
{ /* sentinel */ }
};
static void __init kirkwood_dt_init(void)
{
kirkwood_disable_mbus_error_propagation();
BUG_ON(mvebu_mbus_dt_init(false));
#ifdef CONFIG_CACHE_FEROCEON_L2
feroceon_of_init();
#endif
kirkwood_cpufreq_init();
kirkwood_cpuidle_init();
kirkwood_pm_init();
kirkwood_dt_eth_fixup();
of_platform_default_populate(NULL, auxdata, NULL);
}
static const char * const kirkwood_dt_board_compat[] __initconst = {
"marvell,kirkwood",
NULL
};
DT_MACHINE_START(KIRKWOOD_DT, "Marvell Kirkwood (Flattened Device Tree)")
/* Maintainer: Jason Cooper <jason@lakedaemon.net> */
.init_machine = kirkwood_dt_init,
.restart = mvebu_restart,
.dt_compat = kirkwood_dt_board_compat,
MACHINE_END
Annotation
- Immediate include surface: `linux/clk.h`, `linux/kernel.h`, `linux/init.h`, `linux/mbus.h`, `linux/of.h`, `linux/of_address.h`, `linux/of_net.h`, `linux/of_platform.h`.
- Detected declarations: `function kirkwood_cpufreq_init`, `function kirkwood_cpuidle_init`, `function kirkwood_dt_eth_fixup`, `function errors`, `function kirkwood_dt_init`.
- Atlas domain: Architecture Layer / arch/arm.
- Implementation status: source 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.