arch/powerpc/platforms/44x/ppc476.c
Source file repositories/reference/linux-study-clean/arch/powerpc/platforms/44x/ppc476.c
File Facts
- System
- Linux kernel
- Corpus path
arch/powerpc/platforms/44x/ppc476.c- Extension
.c- Size
- 7359 bytes
- Lines
- 291
- Domain
- Architecture Layer
- Bucket
- arch/powerpc
- 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/of.hlinux/of_address.hlinux/of_platform.hlinux/rtc.hasm/machdep.hasm/udbg.hasm/time.hasm/uic.hasm/ppc4xx.hasm/mpic.hasm/mmu.hasm/swiotlb.hlinux/pci.hlinux/i2c.h
Detected Declarations
function quirk_ppc_currituck_usb_fixupfunction avr_halt_systemfunction avr_power_off_systemfunction avr_reset_systemfunction avr_probefunction ppc47x_device_probefunction ppc47x_init_irqfunction smp_ppc47x_setup_cpufunction smp_ppc47x_kick_cpufunction ppc47x_smp_initfunction ppc47x_smp_initfunction ppc47x_get_board_revfunction ppc47x_pci_irq_fixup
Annotated Snippet
static void __init ppc47x_smp_init(void) { }
#endif /* CONFIG_SMP */
static void __init ppc47x_setup_arch(void)
{
/* No need to check the DMA config as we /know/ our windows are all of
* RAM. Lets hope that doesn't change */
swiotlb_detect_4g();
ppc47x_smp_init();
}
static int board_rev = -1;
static int __init ppc47x_get_board_rev(void)
{
int reg;
u8 __iomem *fpga;
struct device_node *np = NULL;
if (of_machine_is_compatible("ibm,currituck")) {
np = of_find_compatible_node(NULL, NULL, "ibm,currituck-fpga");
reg = 0;
} else if (of_machine_is_compatible("ibm,akebono")) {
np = of_find_compatible_node(NULL, NULL, "ibm,akebono-fpga");
reg = 2;
}
if (!np)
goto fail;
fpga = of_iomap(np, 0);
of_node_put(np);
if (!fpga)
goto fail;
board_rev = ioread8(fpga + reg) & 0x03;
pr_info("%s: Found board revision %d\n", __func__, board_rev);
iounmap(fpga);
return 0;
fail:
pr_info("%s: Unable to find board revision\n", __func__);
return 0;
}
machine_arch_initcall(ppc47x_akebono, ppc47x_get_board_rev);
machine_arch_initcall(ppc47x_currituck, ppc47x_get_board_rev);
/* Use USB controller should have been hardware swizzled but it wasn't :( */
static void ppc47x_pci_irq_fixup(struct pci_dev *dev)
{
if (dev->vendor == 0x1033 && (dev->device == 0x0035 ||
dev->device == 0x00e0)) {
if (board_rev == 0) {
dev->irq = irq_create_mapping(NULL, 47);
pr_info("%s: Mapping irq %d\n", __func__, dev->irq);
} else if (board_rev == 2) {
dev->irq = irq_create_mapping(NULL, 49);
pr_info("%s: Mapping irq %d\n", __func__, dev->irq);
} else {
pr_alert("%s: Unknown board revision\n", __func__);
}
}
}
define_machine(ppc47x_akebono) {
.name = "PowerPC 47x (akebono)",
.compatible = "ibm,akebono",
.progress = udbg_progress,
.init_IRQ = ppc47x_init_irq,
.setup_arch = ppc47x_setup_arch,
.restart = ppc4xx_reset_system,
};
define_machine(ppc47x_currituck) {
.name = "PowerPC 47x (currituck)",
.compatible = "ibm,currituck",
.progress = udbg_progress,
.init_IRQ = ppc47x_init_irq,
.pci_irq_fixup = ppc47x_pci_irq_fixup,
.setup_arch = ppc47x_setup_arch,
.restart = ppc4xx_reset_system,
};
Annotation
- Immediate include surface: `linux/init.h`, `linux/of.h`, `linux/of_address.h`, `linux/of_platform.h`, `linux/rtc.h`, `asm/machdep.h`, `asm/udbg.h`, `asm/time.h`.
- Detected declarations: `function quirk_ppc_currituck_usb_fixup`, `function avr_halt_system`, `function avr_power_off_system`, `function avr_reset_system`, `function avr_probe`, `function ppc47x_device_probe`, `function ppc47x_init_irq`, `function smp_ppc47x_setup_cpu`, `function smp_ppc47x_kick_cpu`, `function ppc47x_smp_init`.
- Atlas domain: Architecture Layer / arch/powerpc.
- 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.