arch/m68k/bvme6000/config.c
Source file repositories/reference/linux-study-clean/arch/m68k/bvme6000/config.c
File Facts
- System
- Linux kernel
- Corpus path
arch/m68k/bvme6000/config.c- Extension
.c- Size
- 9108 bytes
- Lines
- 323
- 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/types.hlinux/kernel.hlinux/mm.hlinux/tty.hlinux/clocksource.hlinux/console.hlinux/linkage.hlinux/init.hlinux/major.hlinux/rtc.hlinux/interrupt.hlinux/bcd.hasm/bootinfo.hasm/bootinfo-vme.hasm/byteorder.hasm/setup.hasm/irq.hasm/traps.hasm/machdep.hasm/bvme6000hw.hasm/config.h
Detected Declarations
function bvme6000_parse_bootinfofunction bvme6000_resetfunction bvme6000_get_modelfunction bvme6000_init_IRQfunction config_bvme6000function bvme6000_abort_intfunction bvme6000_timer_intfunction bvme6000_sched_initfunction bvme6000_read_clkfunction bvme6000_hwclk
Annotated Snippet
if (!vme_brdtype) {
if (m68k_cputype == CPU_68060)
vme_brdtype = VME_TYPE_BVME6000;
else
vme_brdtype = VME_TYPE_BVME4000;
}
#if 0
/* Call bvme6000_set_vectors() so ABORT will work, along with BVMBug
* debugger. Note trap_init() will splat the abort vector, but
* bvme6000_init_IRQ() will put it back again. Hopefully. */
bvme6000_set_vectors();
#endif
mach_sched_init = bvme6000_sched_init;
mach_init_IRQ = bvme6000_init_IRQ;
mach_hwclk = bvme6000_hwclk;
mach_reset = bvme6000_reset;
mach_get_model = bvme6000_get_model;
pr_info("Board is %sconfigured as a System Controller\n",
*config_reg_ptr & BVME_CONFIG_SW1 ? "" : "not ");
/* Now do the PIT configuration */
pit->pgcr = 0x00; /* Unidirectional 8 bit, no handshake for now */
pit->psrr = 0x18; /* PIACK and PIRQ functions enabled */
pit->pacr = 0x00; /* Sub Mode 00, H2 i/p, no DMA */
pit->padr = 0x00; /* Just to be tidy! */
pit->paddr = 0x00; /* All inputs for now (safest) */
pit->pbcr = 0x80; /* Sub Mode 1x, H4 i/p, no DMA */
pit->pbdr = 0xbc | (*config_reg_ptr & BVME_CONFIG_SW1 ? 0 : 0x40);
/* PRI, SYSCON?, Level3, SCC clks from xtal */
pit->pbddr = 0xf3; /* Mostly outputs */
pit->pcdr = 0x01; /* PA transceiver disabled */
pit->pcddr = 0x03; /* WDOG disable */
/* Disable snooping for Ethernet and VME accesses */
bvme_acr_addrctl = 0;
}
static irqreturn_t bvme6000_abort_int(int irq, void *dev_id)
{
unsigned long *new = (unsigned long *)vectors;
unsigned long *old = (unsigned long *)0xf8000000;
/* Wait for button release */
while (*(volatile unsigned char *)BVME_LOCAL_IRQ_STAT & BVME_ABORT_STATUS)
;
*(new+4) = *(old+4); /* Illegal instruction */
*(new+9) = *(old+9); /* Trace */
*(new+47) = *(old+47); /* Trap #15 */
*(new+0x1f) = *(old+0x1f); /* ABORT switch */
return IRQ_HANDLED;
}
static u64 bvme6000_read_clk(struct clocksource *cs);
static struct clocksource bvme6000_clk = {
.name = "rtc",
.rating = 250,
.read = bvme6000_read_clk,
.mask = CLOCKSOURCE_MASK(32),
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
};
static u32 clk_total, clk_offset;
#define RTC_TIMER_CLOCK_FREQ 8000000
#define RTC_TIMER_CYCLES (RTC_TIMER_CLOCK_FREQ / HZ)
#define RTC_TIMER_COUNT ((RTC_TIMER_CYCLES / 2) - 1)
static irqreturn_t bvme6000_timer_int (int irq, void *dev_id)
{
unsigned long flags;
volatile RtcPtr_t rtc = (RtcPtr_t)BVME_RTC_BASE;
unsigned char msr;
local_irq_save(flags);
msr = rtc->msr & 0xc0;
rtc->msr = msr | 0x20; /* Ack the interrupt */
clk_total += RTC_TIMER_CYCLES;
clk_offset = 0;
legacy_timer_tick(1);
local_irq_restore(flags);
return IRQ_HANDLED;
Annotation
- Immediate include surface: `linux/types.h`, `linux/kernel.h`, `linux/mm.h`, `linux/tty.h`, `linux/clocksource.h`, `linux/console.h`, `linux/linkage.h`, `linux/init.h`.
- Detected declarations: `function bvme6000_parse_bootinfo`, `function bvme6000_reset`, `function bvme6000_get_model`, `function bvme6000_init_IRQ`, `function config_bvme6000`, `function bvme6000_abort_int`, `function bvme6000_timer_int`, `function bvme6000_sched_init`, `function bvme6000_read_clk`, `function bvme6000_hwclk`.
- 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.