arch/mips/alchemy/devboards/db1200.c
Source file repositories/reference/linux-study-clean/arch/mips/alchemy/devboards/db1200.c
File Facts
- System
- Linux kernel
- Corpus path
arch/mips/alchemy/devboards/db1200.c- Extension
.c- Size
- 24721 bytes
- Lines
- 945
- 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.
- 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/clk.hlinux/dma-mapping.hlinux/gpio.hlinux/i2c.hlinux/init.hlinux/interrupt.hlinux/io.hlinux/leds.hlinux/mmc/host.hlinux/mtd/mtd.hlinux/mtd/platnand.hlinux/platform_device.hlinux/serial_8250.hlinux/spi/spi.hlinux/spi/flash.hlinux/smc91x.hlinux/ata_platform.hasm/mach-au1x00/au1000.hasm/mach-au1x00/au1100_mmc.hasm/mach-au1x00/au1xxx_dbdma.hasm/mach-au1x00/au1xxx_psc.hasm/mach-au1x00/au1200fb.hasm/mach-au1x00/au1550_spi.hasm/mach-db1x00/bcsr.hdb1xxx.hplatform.h
Detected Declarations
function db1200_detect_boardfunction db1200_board_setupfunction au1200_nand_cmd_ctrlfunction au1200_nand_device_readyfunction db1200_mmc_cdfunction db1200_mmc_cdfnfunction db1200_mmc_cd_setupfunction db1200_mmc_set_powerfunction db1200_mmc_card_readonlyfunction db1200_mmc_card_insertedfunction db1200_mmcled_setfunction pb1200_mmc1_cdfunction pb1200_mmc1_cdfnfunction pb1200_mmc1_cd_setupfunction pb1200_mmc1led_setfunction pb1200_mmc1_set_powerfunction pb1200_mmc1_card_readonlyfunction pb1200_mmc1_card_insertedfunction db1200fb_panel_indexfunction db1200fb_panel_initfunction db1200fb_panel_shutdownfunction db1200_spi_cs_enfunction pb1200_res_fixupfunction db1200_dev_setup
Annotated Snippet
if (bcsr_read(BCSR_HEXLEDS) != t) {
bcsr_write(BCSR_HEXLEDS, t);
return 0;
}
}
/* okay, try the PB1200 then */
bcsr_init(PB1200_BCSR_PHYS_ADDR,
PB1200_BCSR_PHYS_ADDR + PB1200_BCSR_HEXLED_OFS);
bid = BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI));
if ((bid == BCSR_WHOAMI_PB1200_DDR1) ||
(bid == BCSR_WHOAMI_PB1200_DDR2)) {
unsigned short t = bcsr_read(BCSR_HEXLEDS);
bcsr_write(BCSR_HEXLEDS, ~t);
if (bcsr_read(BCSR_HEXLEDS) != t) {
bcsr_write(BCSR_HEXLEDS, t);
return 0;
}
}
return 1; /* it's neither */
}
int __init db1200_board_setup(void)
{
unsigned short whoami;
if (db1200_detect_board())
return -ENODEV;
whoami = bcsr_read(BCSR_WHOAMI);
switch (BCSR_WHOAMI_BOARD(whoami)) {
case BCSR_WHOAMI_PB1200_DDR1:
case BCSR_WHOAMI_PB1200_DDR2:
case BCSR_WHOAMI_DB1200:
break;
default:
return -ENODEV;
}
printk(KERN_INFO "Alchemy/AMD/RMI %s Board, CPLD Rev %d"
" Board-ID %d Daughtercard ID %d\n", get_system_type(),
(whoami >> 4) & 0xf, (whoami >> 8) & 0xf, whoami & 0xf);
return 0;
}
/******************************************************************************/
static u64 au1200_all_dmamask = DMA_BIT_MASK(32);
static struct mtd_partition db1200_spiflash_parts[] = {
{
.name = "spi_flash",
.offset = 0,
.size = MTDPART_SIZ_FULL,
},
};
static struct flash_platform_data db1200_spiflash_data = {
.name = "s25fl001",
.parts = db1200_spiflash_parts,
.nr_parts = ARRAY_SIZE(db1200_spiflash_parts),
.type = "m25p10",
};
static struct spi_board_info db1200_spi_devs[] __initdata = {
{
/* TI TMP121AIDBVR temp sensor */
.modalias = "tmp121",
.max_speed_hz = 2000000,
.bus_num = 0,
.chip_select = 0,
.mode = 0,
},
{
/* Spansion S25FL001D0FMA SPI flash */
.modalias = "m25p80",
.max_speed_hz = 50000000,
.bus_num = 0,
.chip_select = 1,
.mode = 0,
.platform_data = &db1200_spiflash_data,
},
};
static struct i2c_board_info db1200_i2c_devs[] __initdata = {
{ I2C_BOARD_INFO("24c04", 0x52), }, /* AT24C04-10 I2C eeprom */
{ I2C_BOARD_INFO("ne1619", 0x2d), }, /* adm1025-compat hwmon */
{ I2C_BOARD_INFO("wm8731", 0x1b), }, /* I2S audio codec WM8731 */
Annotation
- Immediate include surface: `linux/clk.h`, `linux/dma-mapping.h`, `linux/gpio.h`, `linux/i2c.h`, `linux/init.h`, `linux/interrupt.h`, `linux/io.h`, `linux/leds.h`.
- Detected declarations: `function db1200_detect_board`, `function db1200_board_setup`, `function au1200_nand_cmd_ctrl`, `function au1200_nand_device_ready`, `function db1200_mmc_cd`, `function db1200_mmc_cdfn`, `function db1200_mmc_cd_setup`, `function db1200_mmc_set_power`, `function db1200_mmc_card_readonly`, `function db1200_mmc_card_inserted`.
- Atlas domain: Architecture Layer / arch/mips.
- 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.