arch/mips/ralink/mt7620.c
Source file repositories/reference/linux-study-clean/arch/mips/ralink/mt7620.c
File Facts
- System
- Linux kernel
- Corpus path
arch/mips/ralink/mt7620.c- Extension
.c- Size
- 6034 bytes
- Lines
- 257
- Domain
- Architecture Layer
- Bucket
- arch/mips
- Inferred role
- Architecture Layer: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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/kernel.hlinux/init.hlinux/bug.hlinux/slab.hlinux/sys_soc.hasm/mipsregs.hasm/mach-ralink/ralink_regs.hasm/mach-ralink/mt7620.hcommon.h
Detected Declarations
function mt7620_dram_initfunction mt7628_dram_initfunction mt7620_get_soc_name0function mt7620_get_soc_name1function mt7620_soc_validfunction mt7628_soc_validfunction mt7620_get_revfunction mt7620_get_bgafunction mt7620_get_efusefunction mt7620_get_soc_verfunction mt7620_get_soc_ecofunction mt7620_soc_dev_initfunction prom_soc_initmodule init mt7620_soc_dev_init
Annotated Snippet
device_initcall(mt7620_soc_dev_init);
void __init prom_soc_init(struct ralink_soc_info *soc_info)
{
const char *name = mt7620_get_soc_name(soc_info);
u32 cfg0;
u32 pmu0;
u32 pmu1;
snprintf(soc_info->sys_type, RAMIPS_SYS_TYPE_LEN,
"MediaTek %s ver:%u eco:%u",
name, mt7620_get_soc_ver(), mt7620_get_soc_eco());
cfg0 = __raw_readl(MT7620_SYSC_BASE + SYSC_REG_SYSTEM_CONFIG0);
if (is_mt76x8()) {
dram_type = cfg0 & DRAM_TYPE_MT7628_MASK;
} else {
dram_type = (cfg0 >> SYSCFG0_DRAM_TYPE_SHIFT) &
SYSCFG0_DRAM_TYPE_MASK;
if (dram_type == SYSCFG0_DRAM_TYPE_UNKNOWN)
dram_type = SYSCFG0_DRAM_TYPE_SDRAM;
}
soc_info->mem_base = MT7620_DRAM_BASE;
if (is_mt76x8())
mt7628_dram_init(soc_info);
else
mt7620_dram_init(soc_info);
pmu0 = __raw_readl(MT7620_SYSC_BASE + PMU0_CFG);
pmu1 = __raw_readl(MT7620_SYSC_BASE + PMU1_CFG);
pr_info("Analog PMU set to %s control\n",
(pmu0 & PMU_SW_SET) ? ("sw") : ("hw"));
pr_info("Digital PMU set to %s control\n",
(pmu1 & DIG_SW_SEL) ? ("sw") : ("hw"));
soc_info_ptr = soc_info;
}
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/init.h`, `linux/bug.h`, `linux/slab.h`, `linux/sys_soc.h`, `asm/mipsregs.h`, `asm/mach-ralink/ralink_regs.h`, `asm/mach-ralink/mt7620.h`.
- Detected declarations: `function mt7620_dram_init`, `function mt7628_dram_init`, `function mt7620_get_soc_name0`, `function mt7620_get_soc_name1`, `function mt7620_soc_valid`, `function mt7628_soc_valid`, `function mt7620_get_rev`, `function mt7620_get_bga`, `function mt7620_get_efuse`, `function mt7620_get_soc_ver`.
- Atlas domain: Architecture Layer / arch/mips.
- 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.