arch/mips/alchemy/devboards/db1300.c
Source file repositories/reference/linux-study-clean/arch/mips/alchemy/devboards/db1300.c
File Facts
- System
- Linux kernel
- Corpus path
arch/mips/alchemy/devboards/db1300.c- Extension
.c- Size
- 25308 bytes
- Lines
- 957
- 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/machine.hlinux/gpio/property.hlinux/init.hlinux/input-event-codes.hlinux/i2c.hlinux/io.hlinux/leds.hlinux/interrupt.hlinux/ata_platform.hlinux/mmc/host.hlinux/mtd/mtd.hlinux/mtd/platnand.hlinux/platform_device.hlinux/property.hlinux/smsc911x.hlinux/wm97xx.hasm/mach-au1x00/au1000.hasm/mach-au1x00/gpio-au1300.hasm/mach-au1x00/au1100_mmc.hasm/mach-au1x00/au1200fb.hasm/mach-au1x00/au1xxx_dbdma.hasm/mach-au1x00/au1xxx_psc.hasm/mach-db1x00/bcsr.hasm/mach-au1x00/prom.hdb1xxx.hplatform.h
Detected Declarations
function db1300_gpio_configfunction au1300_nand_cmd_ctrlfunction au1300_nand_device_readyfunction db1300_eth_initfunction db1300_5waysw_initfunction db1300_mmc_cdfunction db1300_mmc_cdfnfunction db1300_mmc_card_readonlyfunction db1300_mmc_card_insertedfunction db1300_mmc_cd_setupfunction db1300_mmcled_setfunction db1300_movinand_insertedfunction db1300_movinand_readonlyfunction db1300_movinand_led_setfunction db1300fb_panel_indexfunction db1300fb_panel_initfunction db1300fb_panel_shutdownfunction db1300_wm97xx_probefunction db1300_wm97xx_probefunction db1300_dev_setupfunction db1300_board_setup
Annotated Snippet
if (ret) {
free_irq(DB1300_SD1_INSERT_INT, mmc_host);
goto out;
}
if (db1300_mmc_card_inserted(mmc_host))
enable_irq(DB1300_SD1_EJECT_INT);
else
enable_irq(DB1300_SD1_INSERT_INT);
} else {
free_irq(DB1300_SD1_INSERT_INT, mmc_host);
free_irq(DB1300_SD1_EJECT_INT, mmc_host);
}
ret = 0;
out:
return ret;
}
static void db1300_mmcled_set(struct led_classdev *led,
enum led_brightness brightness)
{
if (brightness != LED_OFF)
bcsr_mod(BCSR_LEDS, BCSR_LEDS_LED0, 0);
else
bcsr_mod(BCSR_LEDS, 0, BCSR_LEDS_LED0);
}
static struct led_classdev db1300_mmc_led = {
.brightness_set = db1300_mmcled_set,
};
struct au1xmmc_platform_data db1300_sd1_platdata = {
.cd_setup = db1300_mmc_cd_setup,
.card_inserted = db1300_mmc_card_inserted,
.card_readonly = db1300_mmc_card_readonly,
.led = &db1300_mmc_led,
};
static struct resource au1300_sd1_res[] = {
[0] = {
.start = AU1300_SD1_PHYS_ADDR,
.end = AU1300_SD1_PHYS_ADDR,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = AU1300_SD1_INT,
.end = AU1300_SD1_INT,
.flags = IORESOURCE_IRQ,
},
[2] = {
.start = AU1300_DSCR_CMD0_SDMS_TX1,
.end = AU1300_DSCR_CMD0_SDMS_TX1,
.flags = IORESOURCE_DMA,
},
[3] = {
.start = AU1300_DSCR_CMD0_SDMS_RX1,
.end = AU1300_DSCR_CMD0_SDMS_RX1,
.flags = IORESOURCE_DMA,
},
};
static struct platform_device db1300_sd1_dev = {
.dev = {
.dma_mask = &au1300_all_dmamask,
.coherent_dma_mask = DMA_BIT_MASK(32),
.platform_data = &db1300_sd1_platdata,
},
.name = "au1xxx-mmc",
.id = 1,
.resource = au1300_sd1_res,
.num_resources = ARRAY_SIZE(au1300_sd1_res),
};
/**********************************************************************/
static int db1300_movinand_inserted(void *mmc_host)
{
return 0; /* disable for now, it doesn't work yet */
}
static int db1300_movinand_readonly(void *mmc_host)
{
return 0;
}
static void db1300_movinand_led_set(struct led_classdev *led,
enum led_brightness brightness)
{
if (brightness != LED_OFF)
Annotation
- Immediate include surface: `linux/clk.h`, `linux/dma-mapping.h`, `linux/gpio/machine.h`, `linux/gpio/property.h`, `linux/init.h`, `linux/input-event-codes.h`, `linux/i2c.h`, `linux/io.h`.
- Detected declarations: `function db1300_gpio_config`, `function au1300_nand_cmd_ctrl`, `function au1300_nand_device_ready`, `function db1300_eth_init`, `function db1300_5waysw_init`, `function db1300_mmc_cd`, `function db1300_mmc_cdfn`, `function db1300_mmc_card_readonly`, `function db1300_mmc_card_inserted`, `function db1300_mmc_cd_setup`.
- 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.