arch/arm/mach-omap2/board-n8x0.c
Source file repositories/reference/linux-study-clean/arch/arm/mach-omap2/board-n8x0.c
File Facts
- System
- Linux kernel
- Corpus path
arch/arm/mach-omap2/board-n8x0.c- Extension
.c- Size
- 11114 bytes
- Lines
- 513
- Domain
- Architecture Layer
- Bucket
- arch/arm
- 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/clk.hlinux/delay.hlinux/gpio/machine.hlinux/gpio/consumer.hlinux/init.hlinux/io.hlinux/irq.hlinux/stddef.hlinux/i2c.hlinux/spi/spi.hlinux/usb/musb.hlinux/mmc/host.hlinux/platform_data/mmc-omap.hlinux/mfd/menelaus.hasm/mach/arch.hasm/mach-types.hcommon.hmmc.husb-tusb6010.hsoc.hcommon-board-devices.h
Detected Declarations
function board_check_revisionfunction n8x0_usb_initfunction n8x0_usb_initfunction n8x0_mmc_set_power_menelausfunction n8x0_mmc_set_powerfunction n8x0_mmc_set_bus_modefunction n8x0_mmc_get_cover_statefunction n8x0_mmc_callbackfunction n8x0_mmc_late_initfunction n8x0_mmc_shutdownfunction n8x0_mmc_cleanupfunction n8x0_mmc_initfunction n8x0_mmc_initfunction n8x0_auto_voltage_scalefunction n8x0_menelaus_late_initfunction n8x0_menelaus_late_initfunction n8x0_late_initcallfunction n8x0_legacy_init
Annotated Snippet
static void __init n8x0_usb_init(void) {}
#endif /*CONFIG_USB_MUSB_TUSB6010 */
#if defined(CONFIG_MENELAUS) && IS_ENABLED(CONFIG_MMC_OMAP)
/*
* On both N800 and N810, only the first of the two MMC controllers is in use.
* The two MMC slots are multiplexed via Menelaus companion chip over I2C.
* On N800, both slots are powered via Menelaus. On N810, only one of the
* slots is powered via Menelaus. The N810 EMMC is powered via GPIO.
*
* VMMC slot 1 on both N800 and N810
* VDCDC3_APE and VMCS2_APE slot 2 on N800
* GPIO23 and GPIO9 slot 2 EMMC on N810
*
*/
static int slot1_cover_open;
static int slot2_cover_open;
static struct device *mmc_device;
static struct gpiod_lookup_table nokia800_mmc_gpio_table = {
.dev_id = "mmci-omap.0",
.table = {
/* Slot switch, GPIO 96 */
GPIO_LOOKUP("gpio-96-127", 0, "switch", GPIO_ACTIVE_HIGH),
{ }
},
};
static struct gpiod_lookup_table nokia810_mmc_gpio_table = {
.dev_id = "mmci-omap.0",
.table = {
/* Slot switch, GPIO 96 */
GPIO_LOOKUP("gpio-96-127", 0, "switch", GPIO_ACTIVE_HIGH),
/* Slot index 1, VSD power, GPIO 23 */
GPIO_LOOKUP_IDX("gpio-0-31", 23, "vsd", 1, GPIO_ACTIVE_HIGH),
/* Slot index 1, VIO power, GPIO 9 */
GPIO_LOOKUP_IDX("gpio-0-31", 9, "vio", 1, GPIO_ACTIVE_HIGH),
{ }
},
};
static int n8x0_mmc_set_power_menelaus(struct device *dev, int slot,
int power_on, int vdd)
{
int mV;
#ifdef CONFIG_MMC_DEBUG
dev_dbg(dev, "Set slot %d power: %s (vdd %d)\n", slot + 1,
str_on_off(power_on), vdd);
#endif
if (slot == 0) {
if (!power_on)
return menelaus_set_vmmc(0);
switch (1 << vdd) {
case MMC_VDD_33_34:
case MMC_VDD_32_33:
case MMC_VDD_31_32:
mV = 3100;
break;
case MMC_VDD_30_31:
mV = 3000;
break;
case MMC_VDD_28_29:
mV = 2800;
break;
case MMC_VDD_165_195:
mV = 1850;
break;
default:
BUG();
}
return menelaus_set_vmmc(mV);
} else {
if (!power_on)
return menelaus_set_vdcdc(3, 0);
switch (1 << vdd) {
case MMC_VDD_33_34:
case MMC_VDD_32_33:
mV = 3300;
break;
case MMC_VDD_30_31:
case MMC_VDD_29_30:
mV = 3000;
break;
case MMC_VDD_28_29:
case MMC_VDD_27_28:
mV = 2800;
break;
Annotation
- Immediate include surface: `linux/clk.h`, `linux/delay.h`, `linux/gpio/machine.h`, `linux/gpio/consumer.h`, `linux/init.h`, `linux/io.h`, `linux/irq.h`, `linux/stddef.h`.
- Detected declarations: `function board_check_revision`, `function n8x0_usb_init`, `function n8x0_usb_init`, `function n8x0_mmc_set_power_menelaus`, `function n8x0_mmc_set_power`, `function n8x0_mmc_set_bus_mode`, `function n8x0_mmc_get_cover_state`, `function n8x0_mmc_callback`, `function n8x0_mmc_late_init`, `function n8x0_mmc_shutdown`.
- Atlas domain: Architecture Layer / arch/arm.
- 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.