arch/mips/rb532/prom.c
Source file repositories/reference/linux-study-clean/arch/mips/rb532/prom.c
File Facts
- System
- Linux kernel
- Corpus path
arch/mips/rb532/prom.c- Extension
.c- Size
- 2838 bytes
- Lines
- 126
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/init.hlinux/mm.hlinux/export.hlinux/string.hlinux/console.hlinux/memblock.hlinux/ioport.hasm/bootinfo.hasm/mach-rc32434/ddr.hasm/mach-rc32434/prom.h
Detected Declarations
function match_tagfunction tag2ulfunction prom_setup_cmdlinefunction prom_initexport idt_cpu_freq
Annotated Snippet
if (match_tag(prom_argv[i], FREQ_TAG)) {
idt_cpu_freq = tag2ul(prom_argv[i], FREQ_TAG);
continue;
}
#ifdef IGNORE_CMDLINE_MEM
/* parses out the "mem=xx" arg */
if (match_tag(prom_argv[i], MEM_TAG))
continue;
#endif
if (i > 0)
*(cp++) = ' ';
if (match_tag(prom_argv[i], BOARD_TAG)) {
board = prom_argv[i] + strlen(BOARD_TAG);
if (match_tag(board, BOARD_RB532A))
mips_machtype = MACH_MIKROTIK_RB532A;
else
mips_machtype = MACH_MIKROTIK_RB532;
}
len = strlen(prom_argv[i]);
memcpy(cp, prom_argv[i], len + 1);
cp += len;
}
*(cp++) = ' ';
len = strlen(arcs_cmdline);
if (len > 0) {
*(cp++) = ' ';
memcpy(cp, arcs_cmdline, len + 1);
cp += len;
}
cmd_line[COMMAND_LINE_SIZE - 1] = '\0';
strscpy(arcs_cmdline, cmd_line);
}
void __init prom_init(void)
{
struct ddr_ram __iomem *ddr;
phys_addr_t memsize;
phys_addr_t ddrbase;
ddr = ioremap(ddr_reg[0].start,
ddr_reg[0].end - ddr_reg[0].start);
if (!ddr) {
printk(KERN_ERR "Unable to remap DDR register\n");
return;
}
ddrbase = (phys_addr_t)&ddr->ddrbase;
memsize = (phys_addr_t)&ddr->ddrmask;
memsize = 0 - memsize;
prom_setup_cmdline();
/* give all RAM to boot allocator,
* except for the first 0x400 and the last 0x200 bytes */
memblock_add(ddrbase + 0x400, memsize - 0x600);
}
Annotation
- Immediate include surface: `linux/init.h`, `linux/mm.h`, `linux/export.h`, `linux/string.h`, `linux/console.h`, `linux/memblock.h`, `linux/ioport.h`, `asm/bootinfo.h`.
- Detected declarations: `function match_tag`, `function tag2ul`, `function prom_setup_cmdline`, `function prom_init`, `export idt_cpu_freq`.
- 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.