arch/arm/mach-orion5x/dns323-setup.c
Source file repositories/reference/linux-study-clean/arch/arm/mach-orion5x/dns323-setup.c
File Facts
- System
- Linux kernel
- Corpus path
arch/arm/mach-orion5x/dns323-setup.c- Extension
.c- Size
- 19630 bytes
- Lines
- 758
- Domain
- Architecture Layer
- Bucket
- arch/arm
- 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/gpio.hlinux/gpio/machine.hlinux/kernel.hlinux/init.hlinux/delay.hlinux/platform_device.hlinux/pci.hlinux/irq.hlinux/mtd/physmap.hlinux/mv643xx_eth.hlinux/leds.hlinux/gpio_keys.hlinux/input.hlinux/i2c.hlinux/ata_platform.hlinux/phy.hlinux/marvell_phy.hasm/mach-types.hasm/mach/arch.hasm/mach/pci.hasm/system_info.hplat/orion-gpio.horion5x.hcommon.hmpp.h
Detected Declarations
function dns323_pci_map_irqfunction dns323_pci_initfunction dns323_parse_hex_nibblefunction dns323_parse_hex_bytefunction dns323_read_mac_addrfunction dns323a_power_offfunction dns323b_power_offfunction dns323c_power_offfunction dns323c_phy_fixupfunction dns323_identify_revfunction dns323_initmodule init dns323_pci_init
Annotated Snippet
subsys_initcall(dns323_pci_init);
/****************************************************************************
* 8MiB NOR flash (Spansion S29GL064M90TFIR4)
*
* Layout as used by D-Link:
* 0x00000000-0x00010000 : "MTD1"
* 0x00010000-0x00020000 : "MTD2"
* 0x00020000-0x001a0000 : "Linux Kernel"
* 0x001a0000-0x007d0000 : "File System"
* 0x007d0000-0x00800000 : "u-boot"
*/
#define DNS323_NOR_BOOT_BASE 0xf4000000
#define DNS323_NOR_BOOT_SIZE SZ_8M
static struct mtd_partition dns323_partitions[] = {
{
.name = "MTD1",
.size = 0x00010000,
.offset = 0,
}, {
.name = "MTD2",
.size = 0x00010000,
.offset = 0x00010000,
}, {
.name = "Linux Kernel",
.size = 0x00180000,
.offset = 0x00020000,
}, {
.name = "File System",
.size = 0x00630000,
.offset = 0x001A0000,
}, {
.name = "u-boot",
.size = 0x00030000,
.offset = 0x007d0000,
},
};
static struct physmap_flash_data dns323_nor_flash_data = {
.width = 1,
.parts = dns323_partitions,
.nr_parts = ARRAY_SIZE(dns323_partitions)
};
static struct resource dns323_nor_flash_resource = {
.flags = IORESOURCE_MEM,
.start = DNS323_NOR_BOOT_BASE,
.end = DNS323_NOR_BOOT_BASE + DNS323_NOR_BOOT_SIZE - 1,
};
static struct platform_device dns323_nor_flash = {
.name = "physmap-flash",
.id = 0,
.dev = {
.platform_data = &dns323_nor_flash_data,
},
.resource = &dns323_nor_flash_resource,
.num_resources = 1,
};
/****************************************************************************
* Ethernet
*/
static struct mv643xx_eth_platform_data dns323_eth_data = {
.phy_addr = MV643XX_ETH_PHY_ADDR(8),
};
/* dns323_parse_hex_*() taken from tsx09-common.c; should a common copy of these
* functions be kept somewhere?
*/
static int __init dns323_parse_hex_nibble(char n)
{
if (n >= '0' && n <= '9')
return n - '0';
if (n >= 'A' && n <= 'F')
return n - 'A' + 10;
if (n >= 'a' && n <= 'f')
return n - 'a' + 10;
return -1;
}
static int __init dns323_parse_hex_byte(const char *b)
{
int hi;
Annotation
- Immediate include surface: `linux/gpio.h`, `linux/gpio/machine.h`, `linux/kernel.h`, `linux/init.h`, `linux/delay.h`, `linux/platform_device.h`, `linux/pci.h`, `linux/irq.h`.
- Detected declarations: `function dns323_pci_map_irq`, `function dns323_pci_init`, `function dns323_parse_hex_nibble`, `function dns323_parse_hex_byte`, `function dns323_read_mac_addr`, `function dns323a_power_off`, `function dns323b_power_off`, `function dns323c_power_off`, `function dns323c_phy_fixup`, `function dns323_identify_rev`.
- Atlas domain: Architecture Layer / arch/arm.
- 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.