arch/mips/ralink/mt7621.c
Source file repositories/reference/linux-study-clean/arch/mips/ralink/mt7621.c
File Facts
- System
- Linux kernel
- Corpus path
arch/mips/ralink/mt7621.c- Extension
.c- Size
- 5184 bytes
- Lines
- 214
- 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/slab.hlinux/sys_soc.hlinux/memblock.hlinux/pci.hlinux/bug.hasm/bootinfo.hasm/mipsregs.hasm/smp-ops.hasm/mips-cps.hasm/mach-ralink/ralink_regs.hasm/mach-ralink/mt7621.hcommon.h
Detected Declarations
function pcibios_root_bridge_preparefunction mips_cpc_default_phys_basefunction mt7621_addr_wraparound_testfunction mt7621_memory_detectfunction mt7621_get_soc_name0function mt7621_get_soc_name1function mt7621_soc_validfunction mt7621_get_soc_revfunction mt7621_get_soc_verfunction mt7621_get_soc_ecofunction mt7621_soc_dev_initfunction prom_soc_initmodule init mt7621_soc_dev_init
Annotated Snippet
device_initcall(mt7621_soc_dev_init);
void __init prom_soc_init(struct ralink_soc_info *soc_info)
{
/* Early detection of CMP support */
mips_cm_probe();
mips_cpc_probe();
if (mips_cps_numiocu(0)) {
/*
* mips_cm_probe() wipes out bootloader
* config for CM regions and we have to configure them
* again. This SoC cannot talk to pamlbus devices
* without proper iocu region set up.
*
* FIXME: it would be better to do this with values
* from DT, but we need this very early because
* without this we cannot talk to pretty much anything
* including serial.
*/
write_gcr_reg0_base(MT7621_PALMBUS_BASE);
write_gcr_reg0_mask(~MT7621_PALMBUS_SIZE |
CM_GCR_REGn_MASK_CMTGT_IOCU0);
__sync();
}
if (mt7621_soc_valid())
soc_info->compatible = "mediatek,mt7621-soc";
else
panic("mt7621: unknown SoC, n0:%08x n1:%08x\n",
mt7621_get_soc_name0(),
mt7621_get_soc_name1());
ralink_soc = MT762X_SOC_MT7621AT;
snprintf(soc_info->sys_type, RAMIPS_SYS_TYPE_LEN,
"MediaTek %s ver:%u eco:%u",
mt7621_get_soc_id(),
mt7621_get_soc_ver(),
mt7621_get_soc_eco());
soc_info->mem_detect = mt7621_memory_detect;
soc_info_ptr = soc_info;
if (!register_cps_smp_ops())
return;
if (!register_vsmp_smp_ops())
return;
}
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/init.h`, `linux/slab.h`, `linux/sys_soc.h`, `linux/memblock.h`, `linux/pci.h`, `linux/bug.h`, `asm/bootinfo.h`.
- Detected declarations: `function pcibios_root_bridge_prepare`, `function mips_cpc_default_phys_base`, `function mt7621_addr_wraparound_test`, `function mt7621_memory_detect`, `function mt7621_get_soc_name0`, `function mt7621_get_soc_name1`, `function mt7621_soc_valid`, `function mt7621_get_soc_rev`, `function mt7621_get_soc_ver`, `function mt7621_get_soc_eco`.
- 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.