arch/mips/sgi-ip22/ip22-platform.c
Source file repositories/reference/linux-study-clean/arch/mips/sgi-ip22/ip22-platform.c
File Facts
- System
- Linux kernel
- Corpus path
arch/mips/sgi-ip22/ip22-platform.c- Extension
.c- Size
- 5725 bytes
- Lines
- 256
- 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/if_ether.hlinux/kernel.hlinux/platform_device.hlinux/dma-mapping.hasm/paccess.hasm/sgi/ip22.hasm/sgi/hpc3.hasm/sgi/mc.hasm/sgi/seeq.hasm/sgi/wd.h
Detected Declarations
function sgiwd93_devinitfunction sgiseeq_devinitfunction sgi_hal2_devinitfunction sgi_button_devinitfunction sgi_ds1286_devinitfunction sgi_zilog_devinitmodule init sgiwd93_devinitmodule init sgiseeq_devinitmodule init sgi_hal2_devinitmodule init sgi_button_devinitmodule init sgi_ds1286_devinitmodule init sgi_zilog_devinit
Annotated Snippet
device_initcall(sgiwd93_devinit);
static struct resource sgiseeq_0_resources[] = {
{
.name = "eth0 irq",
.start = SGI_ENET_IRQ,
.end = SGI_ENET_IRQ,
.flags = IORESOURCE_IRQ
}
};
static struct sgiseeq_platform_data eth0_pd;
static u64 sgiseeq_dma_mask = DMA_BIT_MASK(32);
static struct platform_device eth0_device = {
.name = "sgiseeq",
.id = 0,
.num_resources = ARRAY_SIZE(sgiseeq_0_resources),
.resource = sgiseeq_0_resources,
.dev = {
.platform_data = ð0_pd,
.dma_mask = &sgiseeq_dma_mask,
.coherent_dma_mask = DMA_BIT_MASK(32),
},
};
static struct resource sgiseeq_1_resources[] = {
{
.name = "eth1 irq",
.start = SGI_GIO_0_IRQ,
.end = SGI_GIO_0_IRQ,
.flags = IORESOURCE_IRQ
}
};
static struct sgiseeq_platform_data eth1_pd;
static struct platform_device eth1_device = {
.name = "sgiseeq",
.id = 1,
.num_resources = ARRAY_SIZE(sgiseeq_1_resources),
.resource = sgiseeq_1_resources,
.dev = {
.platform_data = ð1_pd,
},
};
/*
* Create a platform device for the GPI port that receives the
* image data from the embedded camera.
*/
static int __init sgiseeq_devinit(void)
{
unsigned int pbdma __maybe_unused;
int res, i;
eth0_pd.hpc = hpc3c0;
eth0_pd.irq = SGI_ENET_IRQ;
#define EADDR_NVOFS 250
for (i = 0; i < 3; i++) {
unsigned short tmp = ip22_nvram_read(EADDR_NVOFS / 2 + i);
eth0_pd.mac[2 * i] = tmp >> 8;
eth0_pd.mac[2 * i + 1] = tmp & 0xff;
}
res = platform_device_register(ð0_device);
if (res)
return res;
/* Second HPC is missing? */
if (ip22_is_fullhouse() ||
get_dbe(pbdma, (unsigned int *)&hpc3c1->pbdma[1]))
return 0;
sgimc->giopar |= SGIMC_GIOPAR_MASTEREXP1 | SGIMC_GIOPAR_EXP164 |
SGIMC_GIOPAR_HPC264;
hpc3c1->pbus_piocfg[0][0] = 0x3ffff;
/* interrupt/config register on Challenge S Mezz board */
hpc3c1->pbus_extregs[0][0] = 0x30;
eth1_pd.hpc = hpc3c1;
eth1_pd.irq = SGI_GIO_0_IRQ;
#define EADDR_NVOFS 250
for (i = 0; i < 3; i++) {
unsigned short tmp = ip22_eeprom_read(&hpc3c1->eeprom,
EADDR_NVOFS / 2 + i);
eth1_pd.mac[2 * i] = tmp >> 8;
Annotation
- Immediate include surface: `linux/init.h`, `linux/if_ether.h`, `linux/kernel.h`, `linux/platform_device.h`, `linux/dma-mapping.h`, `asm/paccess.h`, `asm/sgi/ip22.h`, `asm/sgi/hpc3.h`.
- Detected declarations: `function sgiwd93_devinit`, `function sgiseeq_devinit`, `function sgi_hal2_devinit`, `function sgi_button_devinit`, `function sgi_ds1286_devinit`, `function sgi_zilog_devinit`, `module init sgiwd93_devinit`, `module init sgiseeq_devinit`, `module init sgi_hal2_devinit`, `module init sgi_button_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.