arch/mips/sibyte/swarm/setup.c
Source file repositories/reference/linux-study-clean/arch/mips/sibyte/swarm/setup.c
File Facts
- System
- Linux kernel
- Corpus path
arch/mips/sibyte/swarm/setup.c- Extension
.c- Size
- 3416 bytes
- Lines
- 170
- Domain
- Architecture Layer
- Bucket
- arch/mips
- 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/spinlock.hlinux/mm.hlinux/memblock.hlinux/init.hlinux/kernel.hlinux/console.hlinux/screen_info.hlinux/initrd.hasm/irq.hasm/io.hasm/bootinfo.hasm/mipsregs.hasm/reboot.hasm/time.hasm/traps.hasm/sibyte/sb1250.hasm/sibyte/bcm1480_regs.hasm/sibyte/sb1250_regs.hasm/sibyte/sb1250_genbus.hasm/sibyte/board.h
Detected Declarations
enum swarm_rtc_typefunction swarm_be_handlerfunction read_persistent_clock64function update_persistent_clock64function plat_mem_setupfunction setleds
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Copyright (C) 2000, 2001, 2002, 2003, 2004 Broadcom Corporation
* Copyright (C) 2004 by Ralf Baechle (ralf@linux-mips.org)
*/
/*
* Setup code for the SWARM board
*/
#include <linux/spinlock.h>
#include <linux/mm.h>
#include <linux/memblock.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/console.h>
#include <linux/screen_info.h>
#include <linux/initrd.h>
#include <asm/irq.h>
#include <asm/io.h>
#include <asm/bootinfo.h>
#include <asm/mipsregs.h>
#include <asm/reboot.h>
#include <asm/time.h>
#include <asm/traps.h>
#include <asm/sibyte/sb1250.h>
#ifdef CONFIG_SIBYTE_BCM1x80
#include <asm/sibyte/bcm1480_regs.h>
#elif defined(CONFIG_SIBYTE_SB1250) || defined(CONFIG_SIBYTE_BCM112X)
#include <asm/sibyte/sb1250_regs.h>
#else
#error invalid SiByte board configuration
#endif
#include <asm/sibyte/sb1250_genbus.h>
#include <asm/sibyte/board.h>
#ifdef CONFIG_SIBYTE_BCM1x80
extern void bcm1480_setup(void);
#elif defined(CONFIG_SIBYTE_SB1250) || defined(CONFIG_SIBYTE_BCM112X)
extern void sb1250_setup(void);
#else
#error invalid SiByte board configuration
#endif
extern int xicor_probe(void);
extern int xicor_set_time(time64_t);
extern time64_t xicor_get_time(void);
extern int m41t81_probe(void);
extern int m41t81_set_time(time64_t);
extern time64_t m41t81_get_time(void);
const char *get_system_type(void)
{
return "SiByte " SIBYTE_BOARD_NAME;
}
int swarm_be_handler(struct pt_regs *regs, int is_fixup)
{
if (!is_fixup && (regs->cp0_cause & 4)) {
/* Data bus error - print PA */
printk("DBE physical address: %010Lx\n",
__read_64bit_c0_register($26, 1));
}
return is_fixup ? MIPS_BE_FIXUP : MIPS_BE_FATAL;
}
enum swarm_rtc_type {
RTC_NONE,
RTC_XICOR,
RTC_M41T81,
};
enum swarm_rtc_type swarm_rtc_type;
void read_persistent_clock64(struct timespec64 *ts)
{
time64_t sec;
switch (swarm_rtc_type) {
case RTC_XICOR:
sec = xicor_get_time();
break;
case RTC_M41T81:
sec = m41t81_get_time();
break;
case RTC_NONE:
Annotation
- Immediate include surface: `linux/spinlock.h`, `linux/mm.h`, `linux/memblock.h`, `linux/init.h`, `linux/kernel.h`, `linux/console.h`, `linux/screen_info.h`, `linux/initrd.h`.
- Detected declarations: `enum swarm_rtc_type`, `function swarm_be_handler`, `function read_persistent_clock64`, `function update_persistent_clock64`, `function plat_mem_setup`, `function setleds`.
- Atlas domain: Architecture Layer / arch/mips.
- 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.