arch/mips/sgi-ip32/ip32-platform.c
Source file repositories/reference/linux-study-clean/arch/mips/sgi-ip32/ip32-platform.c
File Facts
- System
- Linux kernel
- Corpus path
arch/mips/sgi-ip32/ip32-platform.c- Extension
.c- Size
- 3051 bytes
- Lines
- 139
- Domain
- Architecture Layer
- Bucket
- arch/mips
- 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/platform_device.hlinux/serial_8250.hlinux/rtc/ds1685.hasm/ip32/mace.hasm/ip32/ip32_ints.h
Detected Declarations
function uart8250_initfunction meth_devinitfunction sgio2audio_devinitfunction sgio2btns_devinitfunction sgio2_rtc_devinitmodule init uart8250_initmodule init meth_devinitmodule init sgio2audio_devinitmodule init sgio2btns_devinitmodule init sgio2_rtc_devinit
Annotated Snippet
device_initcall(uart8250_init);
static __init int meth_devinit(void)
{
struct platform_device *pd;
int ret;
pd = platform_device_alloc("meth", -1);
if (!pd)
return -ENOMEM;
ret = platform_device_add(pd);
if (ret)
platform_device_put(pd);
return ret;
}
device_initcall(meth_devinit);
static __init int sgio2audio_devinit(void)
{
struct platform_device *pd;
int ret;
pd = platform_device_alloc("sgio2audio", -1);
if (!pd)
return -ENOMEM;
ret = platform_device_add(pd);
if (ret)
platform_device_put(pd);
return ret;
}
device_initcall(sgio2audio_devinit);
static __init int sgio2btns_devinit(void)
{
return IS_ERR(platform_device_register_simple("sgibtns", -1, NULL, 0));
}
device_initcall(sgio2btns_devinit);
#define MACE_RTC_RES_START (MACE_BASE + offsetof(struct sgi_mace, isa.rtc))
#define MACE_RTC_RES_END (MACE_RTC_RES_START + 32767)
static struct resource ip32_rtc_resources[] = {
{
.start = MACEISA_RTC_IRQ,
.end = MACEISA_RTC_IRQ,
.flags = IORESOURCE_IRQ
}, {
.start = MACE_RTC_RES_START,
.end = MACE_RTC_RES_END,
.flags = IORESOURCE_MEM,
}
};
/* RTC registers on IP32 are each padded by 256 bytes (0x100). */
static struct ds1685_rtc_platform_data
ip32_rtc_platform_data[] = {
{
.regstep = 0x100,
.bcd_mode = true,
.no_irq = false,
.uie_unsupported = false,
.access_type = ds1685_reg_direct,
.plat_prepare_poweroff = ip32_prepare_poweroff,
},
};
struct platform_device ip32_rtc_device = {
.name = "rtc-ds1685",
.id = -1,
.dev = {
.platform_data = ip32_rtc_platform_data,
},
.num_resources = ARRAY_SIZE(ip32_rtc_resources),
.resource = ip32_rtc_resources,
};
static __init int sgio2_rtc_devinit(void)
{
return platform_device_register(&ip32_rtc_device);
}
device_initcall(sgio2_rtc_devinit);
Annotation
- Immediate include surface: `linux/init.h`, `linux/platform_device.h`, `linux/serial_8250.h`, `linux/rtc/ds1685.h`, `asm/ip32/mace.h`, `asm/ip32/ip32_ints.h`.
- Detected declarations: `function uart8250_init`, `function meth_devinit`, `function sgio2audio_devinit`, `function sgio2btns_devinit`, `function sgio2_rtc_devinit`, `module init uart8250_init`, `module init meth_devinit`, `module init sgio2audio_devinit`, `module init sgio2btns_devinit`, `module init sgio2_rtc_devinit`.
- Atlas domain: Architecture Layer / arch/mips.
- 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.