arch/arm/kernel/bios32.c
Source file repositories/reference/linux-study-clean/arch/arm/kernel/bios32.c
File Facts
- System
- Linux kernel
- Corpus path
arch/arm/kernel/bios32.c- Extension
.c- Size
- 15643 bytes
- Lines
- 597
- 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/export.hlinux/kernel.hlinux/pci.hlinux/slab.hlinux/string_choices.hlinux/init.hlinux/io.hasm/mach-types.hasm/mach/map.hasm/mach/pci.h
Detected Declarations
function pcibios_bus_report_statusfunction list_for_each_entryfunction pcibios_report_statusfunction pci_fixup_83c553function pci_fixup_unassignfunction layerfunction pci_dev_for_each_resourcefunction pci_fixup_ide_basesfunction pci_dev_for_each_resourcefunction pci_fixup_dec21142function pci_fixup_cy82c693function pdev_bad_for_parityfunction pcibios_fixup_busfunction pcibios_swizzlefunction pcibios_map_irqfunction pcibios_init_resourcefunction pcibios_init_hwfunction pci_common_init_devfunction list_for_each_entryfunction pci_bus_claim_resourcesfunction pcibios_set_masterfunction pcibios_align_resourcefunction pci_map_io_earlyexport pcibios_fixup_bus
Annotated Snippet
pci_dev_for_each_resource(dev, r) {
r->start = 0;
r->end = 0;
r->flags = 0;
}
}
}
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_21285, pci_fixup_dec21285);
/*
* PCI IDE controllers use non-standard I/O port decoding, respect it.
*/
static void pci_fixup_ide_bases(struct pci_dev *dev)
{
struct resource *r;
if ((dev->class >> 8) != PCI_CLASS_STORAGE_IDE)
return;
pci_dev_for_each_resource(dev, r) {
if ((r->start & ~0x80) == 0x374) {
r->start |= 2;
r->end = r->start;
}
}
}
DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, pci_fixup_ide_bases);
/*
* Put the DEC21142 to sleep
*/
static void pci_fixup_dec21142(struct pci_dev *dev)
{
pci_write_config_dword(dev, 0x40, 0x80000000);
}
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_21142, pci_fixup_dec21142);
/*
* The CY82C693 needs some rather major fixups to ensure that it does
* the right thing. Idea from the Alpha people, with a few additions.
*
* We ensure that the IDE base registers are set to 1f0/3f4 for the
* primary bus, and 170/374 for the secondary bus. Also, hide them
* from the PCI subsystem view as well so we won't try to perform
* our own auto-configuration on them.
*
* In addition, we ensure that the PCI IDE interrupts are routed to
* IRQ 14 and IRQ 15 respectively.
*
* The above gets us to a point where the IDE on this device is
* functional. However, The CY82C693U _does not work_ in bus
* master mode without locking the PCI bus solid.
*/
static void pci_fixup_cy82c693(struct pci_dev *dev)
{
if ((dev->class >> 8) == PCI_CLASS_STORAGE_IDE) {
u32 base0, base1;
if (dev->class & 0x80) { /* primary */
base0 = 0x1f0;
base1 = 0x3f4;
} else { /* secondary */
base0 = 0x170;
base1 = 0x374;
}
pci_write_config_dword(dev, PCI_BASE_ADDRESS_0,
base0 | PCI_BASE_ADDRESS_SPACE_IO);
pci_write_config_dword(dev, PCI_BASE_ADDRESS_1,
base1 | PCI_BASE_ADDRESS_SPACE_IO);
dev->resource[0].start = 0;
dev->resource[0].end = 0;
dev->resource[0].flags = 0;
dev->resource[1].start = 0;
dev->resource[1].end = 0;
dev->resource[1].flags = 0;
} else if (PCI_FUNC(dev->devfn) == 0) {
/*
* Setup IDE IRQ routing.
*/
pci_write_config_byte(dev, 0x4b, 14);
pci_write_config_byte(dev, 0x4c, 15);
/*
* Disable FREQACK handshake, enable USB.
*/
pci_write_config_byte(dev, 0x4d, 0x41);
Annotation
- Immediate include surface: `linux/export.h`, `linux/kernel.h`, `linux/pci.h`, `linux/slab.h`, `linux/string_choices.h`, `linux/init.h`, `linux/io.h`, `asm/mach-types.h`.
- Detected declarations: `function pcibios_bus_report_status`, `function list_for_each_entry`, `function pcibios_report_status`, `function pci_fixup_83c553`, `function pci_fixup_unassign`, `function layer`, `function pci_dev_for_each_resource`, `function pci_fixup_ide_bases`, `function pci_dev_for_each_resource`, `function pci_fixup_dec21142`.
- 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.