arch/mips/econet/init.c
Source file repositories/reference/linux-study-clean/arch/mips/econet/init.c
File Facts
- System
- Linux kernel
- Corpus path
arch/mips/econet/init.c- Extension
.c- Size
- 1392 bytes
- Lines
- 79
- Domain
- Architecture Layer
- Bucket
- arch/mips
- 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.
Dependency Surface
linux/init.hlinux/of_clk.hlinux/irqchip.hasm/addrspace.hasm/io.hasm/bootinfo.hasm/time.hasm/prom.hasm/smp-ops.hasm/reboot.h
Detected Declarations
function Copyrightfunction prom_initfunction plat_mem_setupfunction device_tree_initfunction arch_init_irqfunction plat_time_init
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* EcoNet setup code
*
* Copyright (C) 2025 Caleb James DeLisle <cjd@cjdns.fr>
*/
#include <linux/init.h>
#include <linux/of_clk.h>
#include <linux/irqchip.h>
#include <asm/addrspace.h>
#include <asm/io.h>
#include <asm/bootinfo.h>
#include <asm/time.h>
#include <asm/prom.h>
#include <asm/smp-ops.h>
#include <asm/reboot.h>
#define CR_AHB_RSTCR ((void __iomem *)CKSEG1ADDR(0x1fb00040))
#define RESET BIT(31)
#define UART_BASE CKSEG1ADDR(0x1fbf0003)
#define UART_REG_SHIFT 2
static void hw_reset(char *command)
{
iowrite32(RESET, CR_AHB_RSTCR);
}
/* 1. Bring up early printk. */
void __init prom_init(void)
{
setup_8250_early_printk_port(UART_BASE, UART_REG_SHIFT, 0);
_machine_restart = hw_reset;
}
/* 2. Parse the DT and find memory */
void __init plat_mem_setup(void)
{
void *dtb;
set_io_port_base(KSEG1);
dtb = get_fdt();
if (!dtb)
panic("no dtb found");
__dt_setup_arch(dtb);
early_init_dt_scan_memory();
}
/* 3. Overload __weak device_tree_init(), add SMP_UP ops */
void __init device_tree_init(void)
{
unflatten_and_copy_device_tree();
register_up_smp_ops();
}
const char *get_system_type(void)
{
return "EcoNet-EN75xx";
}
/* 4. Initialize the IRQ subsystem */
void __init arch_init_irq(void)
{
irqchip_init();
}
/* 5. Timers */
void __init plat_time_init(void)
{
of_clk_init(NULL);
timer_probe();
}
Annotation
- Immediate include surface: `linux/init.h`, `linux/of_clk.h`, `linux/irqchip.h`, `asm/addrspace.h`, `asm/io.h`, `asm/bootinfo.h`, `asm/time.h`, `asm/prom.h`.
- Detected declarations: `function Copyright`, `function prom_init`, `function plat_mem_setup`, `function device_tree_init`, `function arch_init_irq`, `function plat_time_init`.
- Atlas domain: Architecture Layer / arch/mips.
- 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.