arch/sh/boards/of-generic.c
Source file repositories/reference/linux-study-clean/arch/sh/boards/of-generic.c
File Facts
- System
- Linux kernel
- Corpus path
arch/sh/boards/of-generic.c- Extension
.c- Size
- 3562 bytes
- Lines
- 175
- Domain
- Architecture Layer
- Bucket
- arch/sh
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/of.hlinux/of_clk.hlinux/of_fdt.hlinux/clocksource.hlinux/irqchip.hasm/clock.hasm/machvec.hasm/rtc.h
Detected Declarations
struct sh_clk_opsfunction Copyrightfunction dummy_send_ipifunction sh_of_smp_probefunction for_each_of_cpu_nodefunction sh_of_smp_probefunction sh_of_mem_reservefunction sh_of_setupfunction sh_of_irq_demuxfunction sh_of_init_irqfunction sh_of_clk_initfunction arch_init_clk_ops
Annotated Snippet
if (id < NR_CPUS) {
if (!method)
of_property_read_string(np, "enable-method", &method);
set_cpu_possible(id, true);
set_cpu_present(id, true);
__cpu_number_map[id] = id;
__cpu_logical_map[id] = id;
}
}
if (!method) {
np = of_find_node_by_name(NULL, "cpus");
of_property_read_string(np, "enable-method", &method);
of_node_put(np);
}
pr_info("CPU enable method: %s\n", method);
if (method)
for (; m->method; m++)
if (!strcmp(m->method, method)) {
register_smp_ops(m->ops);
return;
}
register_smp_ops(&dummy_smp_ops);
}
#else
static void sh_of_smp_probe(void)
{
}
#endif
static void noop(void)
{
}
static int noopi(void)
{
return 0;
}
static void __init sh_of_mem_reserve(void)
{
early_init_fdt_reserve_self();
early_init_fdt_scan_reserved_mem();
}
static void __init sh_of_setup(char **cmdline_p)
{
struct device_node *root;
sh_mv.mv_name = "Unknown SH model";
root = of_find_node_by_path("/");
if (root) {
of_property_read_string(root, "model", &sh_mv.mv_name);
of_node_put(root);
}
sh_of_smp_probe();
}
static int sh_of_irq_demux(int irq)
{
/* FIXME: eventually this should not be used at all;
* the interrupt controller should set_handle_irq(). */
return irq;
}
static void __init sh_of_init_irq(void)
{
pr_info("SH generic board support: scanning for interrupt controllers\n");
irqchip_init();
}
static int __init sh_of_clk_init(void)
{
#ifdef CONFIG_COMMON_CLK
/* Disabled pending move to COMMON_CLK framework. */
pr_info("SH generic board support: scanning for clk providers\n");
of_clk_init(NULL);
#endif
return 0;
}
static struct sh_machine_vector __initmv sh_of_generic_mv = {
.mv_setup = sh_of_setup,
.mv_name = "devicetree", /* replaced by DT root's model */
.mv_irq_demux = sh_of_irq_demux,
Annotation
- Immediate include surface: `linux/of.h`, `linux/of_clk.h`, `linux/of_fdt.h`, `linux/clocksource.h`, `linux/irqchip.h`, `asm/clock.h`, `asm/machvec.h`, `asm/rtc.h`.
- Detected declarations: `struct sh_clk_ops`, `function Copyright`, `function dummy_send_ipi`, `function sh_of_smp_probe`, `function for_each_of_cpu_node`, `function sh_of_smp_probe`, `function sh_of_mem_reserve`, `function sh_of_setup`, `function sh_of_irq_demux`, `function sh_of_init_irq`.
- Atlas domain: Architecture Layer / arch/sh.
- 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.