arch/mips/bcm63xx/dev-flash.c
Source file repositories/reference/linux-study-clean/arch/mips/bcm63xx/dev-flash.c
File Facts
- System
- Linux kernel
- Corpus path
arch/mips/bcm63xx/dev-flash.c- Extension
.c- Size
- 3335 bytes
- Lines
- 132
- 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/init.hlinux/kernel.hlinux/platform_device.hlinux/mtd/mtd.hlinux/mtd/partitions.hlinux/mtd/physmap.hbcm63xx_cpu.hbcm63xx_dev_flash.hbcm63xx_regs.hbcm63xx_io.h
Detected Declarations
function bcm63xx_detect_flash_typefunction bcm63xx_flash_register
Annotated Snippet
switch (val & STRAPBUS_6368_BOOT_SEL_MASK) {
case STRAPBUS_6368_BOOT_SEL_NAND:
return BCM63XX_FLASH_TYPE_NAND;
case STRAPBUS_6368_BOOT_SEL_SERIAL:
return BCM63XX_FLASH_TYPE_SERIAL;
case STRAPBUS_6368_BOOT_SEL_PARALLEL:
return BCM63XX_FLASH_TYPE_PARALLEL;
}
fallthrough;
default:
return -EINVAL;
}
}
int __init bcm63xx_flash_register(void)
{
int flash_type;
u32 val;
flash_type = bcm63xx_detect_flash_type();
switch (flash_type) {
case BCM63XX_FLASH_TYPE_PARALLEL:
/* read base address of boot chip select (0) */
val = bcm_mpi_readl(MPI_CSBASE_REG(0));
val &= MPI_CSBASE_BASE_MASK;
mtd_resources[0].start = val;
mtd_resources[0].end = 0x1FFFFFFF;
return platform_device_register(&mtd_dev);
case BCM63XX_FLASH_TYPE_SERIAL:
pr_warn("unsupported serial flash detected\n");
return -ENODEV;
case BCM63XX_FLASH_TYPE_NAND:
pr_warn("unsupported NAND flash detected\n");
return -ENODEV;
default:
pr_err("flash detection failed for BCM%x: %d\n",
bcm63xx_get_cpu_id(), flash_type);
return -ENODEV;
}
}
Annotation
- Immediate include surface: `linux/init.h`, `linux/kernel.h`, `linux/platform_device.h`, `linux/mtd/mtd.h`, `linux/mtd/partitions.h`, `linux/mtd/physmap.h`, `bcm63xx_cpu.h`, `bcm63xx_dev_flash.h`.
- Detected declarations: `function bcm63xx_detect_flash_type`, `function bcm63xx_flash_register`.
- 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.