arch/m68k/apollo/config.c
Source file repositories/reference/linux-study-clean/arch/m68k/apollo/config.c
File Facts
- System
- Linux kernel
- Corpus path
arch/m68k/apollo/config.c- Extension
.c- Size
- 5317 bytes
- Lines
- 241
- Domain
- Architecture Layer
- Bucket
- arch/m68k
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/init.hlinux/types.hlinux/kernel.hlinux/mm.hlinux/rtc.hlinux/interrupt.hasm/setup.hasm/bootinfo.hasm/bootinfo-apollo.hasm/byteorder.hasm/apollohw.hasm/irq.hasm/machdep.hasm/config.hapollo.h
Detected Declarations
function apollo_parse_bootinfofunction dn_setup_modelfunction dn_serial_printfunction config_apollofunction dn_timer_intfunction dn_sched_initfunction dn_dummy_hwclkfunction dn_dummy_resetfunction dn_get_modelfunction dn_heartbeat
Annotated Snippet
while (*str) {
if (*str == '\n') {
sio01.rhrb_thrb = (unsigned char)'\r';
while (!(sio01.srb_csrb & 0x4))
;
}
sio01.rhrb_thrb = (unsigned char)*str++;
while (!(sio01.srb_csrb & 0x4))
;
}
}
void __init config_apollo(void)
{
int i;
dn_setup_model();
mach_sched_init=dn_sched_init; /* */
mach_init_IRQ=dn_init_IRQ;
mach_hwclk = dn_dummy_hwclk; /* */
mach_reset = dn_dummy_reset; /* */
#ifdef CONFIG_HEARTBEAT
mach_heartbeat = dn_heartbeat;
#endif
mach_get_model = dn_get_model;
cpuctrl=0xaa00;
/* clear DMA translation table */
for(i=0;i<0x400;i++)
addr_xlat_map[i]=0;
}
irqreturn_t dn_timer_int(int irq, void *dev_id)
{
unsigned char *at = (unsigned char *)apollo_timer;
legacy_timer_tick(1);
timer_heartbeat();
READ_ONCE(*(at + 3));
READ_ONCE(*(at + 5));
return IRQ_HANDLED;
}
void dn_sched_init(void)
{
/* program timer 1 */
*(volatile unsigned char *)(apollo_timer + 3) = 0x01;
*(volatile unsigned char *)(apollo_timer + 1) = 0x40;
*(volatile unsigned char *)(apollo_timer + 5) = 0x09;
*(volatile unsigned char *)(apollo_timer + 7) = 0xc4;
/* enable IRQ of PIC B */
*(volatile unsigned char *)(pica+1)&=(~8);
#if 0
pr_info("*(0x10803) %02x\n",
*(volatile unsigned char *)(apollo_timer + 0x3));
pr_info("*(0x10803) %02x\n",
*(volatile unsigned char *)(apollo_timer + 0x3));
#endif
if (request_irq(IRQ_APOLLO, dn_timer_int, 0, "time", NULL))
pr_err("Couldn't register timer interrupt\n");
}
int dn_dummy_hwclk(int op, struct rtc_time *t) {
if(!op) { /* read */
t->tm_sec=rtc->second;
t->tm_min=rtc->minute;
t->tm_hour=rtc->hours;
t->tm_mday=rtc->day_of_month;
t->tm_wday=rtc->day_of_week;
t->tm_mon = rtc->month - 1;
t->tm_year=rtc->year;
if (t->tm_year < 70)
t->tm_year += 100;
} else {
rtc->second=t->tm_sec;
rtc->minute=t->tm_min;
rtc->hours=t->tm_hour;
rtc->day_of_month=t->tm_mday;
if(t->tm_wday!=-1)
rtc->day_of_week=t->tm_wday;
Annotation
- Immediate include surface: `linux/init.h`, `linux/types.h`, `linux/kernel.h`, `linux/mm.h`, `linux/rtc.h`, `linux/interrupt.h`, `asm/setup.h`, `asm/bootinfo.h`.
- Detected declarations: `function apollo_parse_bootinfo`, `function dn_setup_model`, `function dn_serial_print`, `function config_apollo`, `function dn_timer_int`, `function dn_sched_init`, `function dn_dummy_hwclk`, `function dn_dummy_reset`, `function dn_get_model`, `function dn_heartbeat`.
- Atlas domain: Architecture Layer / arch/m68k.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.