arch/arm/mach-mxs/mach-mxs.c
Source file repositories/reference/linux-study-clean/arch/arm/mach-mxs/mach-mxs.c
File Facts
- System
- Linux kernel
- Corpus path
arch/arm/mach-mxs/mach-mxs.c- Extension
.c- Size
- 10610 bytes
- Lines
- 481
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/clk/mxs.hlinux/clkdev.hlinux/delay.hlinux/err.hlinux/gpio.hlinux/init.hlinux/reboot.hlinux/micrel_phy.hlinux/of_address.hlinux/of_platform.hlinux/phy.hlinux/sys_soc.hasm/mach/arch.hasm/mach/map.hasm/mach/time.hasm/system_info.hasm/system_misc.hpm.h
Detected Declarations
enum mac_ouifunction __mxs_setlfunction __mxs_clrlfunction __mxs_toglfunction update_fec_mac_propfunction enable_clk_enet_outfunction imx28_evk_initfunction imx28_apf28_initfunction apx4devkit_phy_fixupfunction apx4devkit_initfunction crystalfontz_initfunction duckbill_initfunction m28cu3_initfunction mxs_get_cpu_revfunction mxs_restart_initfunction eukrea_mbmx283lc_initfunction mxs_machine_initfunction mxs_restart
Annotated Snippet
if (!newmac->name) {
kfree(newmac);
return;
}
/*
* OCOTP only stores the last 4 octets for each mac address,
* so hard-code OUI here.
*/
macaddr = newmac->value;
switch (oui) {
case OUI_FSL:
macaddr[0] = 0x00;
macaddr[1] = 0x04;
macaddr[2] = 0x9f;
break;
case OUI_DENX:
macaddr[0] = 0xc0;
macaddr[1] = 0xe5;
macaddr[2] = 0x4e;
break;
case OUI_CRYSTALFONTZ:
macaddr[0] = 0x58;
macaddr[1] = 0xb9;
macaddr[2] = 0xe1;
break;
case OUI_I2SE:
macaddr[0] = 0x00;
macaddr[1] = 0x01;
macaddr[2] = 0x87;
break;
case OUI_ARMADEUS:
macaddr[0] = 0x00;
macaddr[1] = 0x1e;
macaddr[2] = 0xac;
break;
}
val = ocotp[i];
macaddr[3] = (val >> 16) & 0xff;
macaddr[4] = (val >> 8) & 0xff;
macaddr[5] = (val >> 0) & 0xff;
of_update_property(np, newmac);
}
}
static inline void enable_clk_enet_out(void)
{
struct clk *clk = clk_get_sys("enet_out", NULL);
if (!IS_ERR(clk))
clk_prepare_enable(clk);
}
static void __init imx28_evk_init(void)
{
update_fec_mac_prop(OUI_FSL);
mxs_saif_clkmux_select(MXS_DIGCTL_SAIF_CLKMUX_EXTMSTR0);
}
static void __init imx28_apf28_init(void)
{
update_fec_mac_prop(OUI_ARMADEUS);
}
static int apx4devkit_phy_fixup(struct phy_device *phy)
{
phy->dev_flags |= MICREL_PHY_50MHZ_CLK;
return 0;
}
static void __init apx4devkit_init(void)
{
enable_clk_enet_out();
if (IS_BUILTIN(CONFIG_PHYLIB))
phy_register_fixup_for_uid(PHY_ID_KSZ8051, MICREL_PHY_ID_MASK,
apx4devkit_phy_fixup);
}
static void __init crystalfontz_init(void)
{
update_fec_mac_prop(OUI_CRYSTALFONTZ);
}
static void __init duckbill_init(void)
{
update_fec_mac_prop(OUI_I2SE);
}
Annotation
- Immediate include surface: `linux/clk.h`, `linux/clk/mxs.h`, `linux/clkdev.h`, `linux/delay.h`, `linux/err.h`, `linux/gpio.h`, `linux/init.h`, `linux/reboot.h`.
- Detected declarations: `enum mac_oui`, `function __mxs_setl`, `function __mxs_clrl`, `function __mxs_togl`, `function update_fec_mac_prop`, `function enable_clk_enet_out`, `function imx28_evk_init`, `function imx28_apf28_init`, `function apx4devkit_phy_fixup`, `function apx4devkit_init`.
- Atlas domain: Architecture Layer / arch/arm.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.