arch/powerpc/platforms/pasemi/setup.c
Source file repositories/reference/linux-study-clean/arch/powerpc/platforms/pasemi/setup.c
File Facts
- System
- Linux kernel
- Corpus path
arch/powerpc/platforms/pasemi/setup.c- Extension
.c- Size
- 10748 bytes
- Lines
- 457
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/errno.hlinux/kernel.hlinux/delay.hlinux/console.hlinux/export.hlinux/pci.hlinux/of.hlinux/of_platform.hlinux/platform_device.hlinux/gfp.hlinux/irqdomain.hasm/iommu.hasm/machdep.hasm/i8259.hasm/mpic.hasm/smp.hasm/time.hasm/mmu.hasm/debug.hpcmcia/ss.hpcmcia/cistpl.hpcmcia/ds.hpasemi.h
Detected Declarations
struct mce_regsfunction pas_restartfunction pas_shutdownfunction nemo_init_rtcfunction nemo_init_rtcfunction pas_give_timebasefunction pas_take_timebasefunction pas_setup_archfunction pas_setup_mce_regsfunction sb600_8259_cascadefunction nemo_init_IRQfunction nemo_init_IRQfunction for_each_node_by_typefunction for_each_node_by_typefunction pas_progressfunction pas_machine_check_handlerfunction pasemi_publish_devicesfunction pas_probe
Annotated Snippet
struct mce_regs {
char *name;
void __iomem *addr;
};
static struct mce_regs mce_regs[MAX_MCE_REGS];
static int num_mce_regs;
static int nmi_virq = 0;
static void __noreturn pas_restart(char *cmd)
{
/* Need to put others cpu in hold loop so they're not sleeping */
smp_send_stop();
udelay(10000);
printk("Restarting...\n");
while (1)
out_le32(reset_reg, 0x6000000);
}
#ifdef CONFIG_PPC_PASEMI_NEMO
static void pas_shutdown(void)
{
/* Set the PLD bit that makes the SB600 think the power button is being pressed */
void __iomem *pld_map = ioremap(0xf5000000,4096);
while (1)
out_8(pld_map+7,0x01);
}
/* RTC platform device structure as is not in device tree */
static struct resource rtc_resource[] = {{
.name = "rtc",
.start = 0x70,
.end = 0x71,
.flags = IORESOURCE_IO,
}, {
.name = "rtc",
.start = 8,
.end = 8,
.flags = IORESOURCE_IRQ,
}};
static inline void nemo_init_rtc(void)
{
platform_device_register_simple("rtc_cmos", -1, rtc_resource, 2);
}
#else
static inline void nemo_init_rtc(void)
{
}
#endif
#ifdef CONFIG_SMP
static arch_spinlock_t timebase_lock;
static unsigned long timebase;
static void pas_give_timebase(void)
{
unsigned long flags;
local_irq_save(flags);
hard_irq_disable();
arch_spin_lock(&timebase_lock);
mtspr(SPRN_TBCTL, TBCTL_FREEZE);
isync();
timebase = get_tb();
arch_spin_unlock(&timebase_lock);
while (timebase)
barrier();
mtspr(SPRN_TBCTL, TBCTL_RESTART);
local_irq_restore(flags);
}
static void pas_take_timebase(void)
{
while (!timebase)
smp_rmb();
arch_spin_lock(&timebase_lock);
set_tb(timebase >> 32, timebase & 0xffffffff);
timebase = 0;
arch_spin_unlock(&timebase_lock);
}
static struct smp_ops_t pas_smp_ops = {
.probe = smp_mpic_probe,
.message_pass = smp_mpic_message_pass,
Annotation
- Immediate include surface: `linux/errno.h`, `linux/kernel.h`, `linux/delay.h`, `linux/console.h`, `linux/export.h`, `linux/pci.h`, `linux/of.h`, `linux/of_platform.h`.
- Detected declarations: `struct mce_regs`, `function pas_restart`, `function pas_shutdown`, `function nemo_init_rtc`, `function nemo_init_rtc`, `function pas_give_timebase`, `function pas_take_timebase`, `function pas_setup_arch`, `function pas_setup_mce_regs`, `function sb600_8259_cascade`.
- Atlas domain: Architecture Layer / arch/powerpc.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.