drivers/soc/tegra/fuse/tegra-apbmisc.c
Source file repositories/reference/linux-study-clean/drivers/soc/tegra/fuse/tegra-apbmisc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/soc/tegra/fuse/tegra-apbmisc.c- Extension
.c- Size
- 8297 bytes
- Lines
- 353
- Domain
- Driver Families
- Bucket
- drivers/soc
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- 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/acpi.hlinux/arm-smccc.hlinux/export.hlinux/io.hlinux/kernel.hlinux/mod_devicetable.hlinux/of.hlinux/of_address.hsoc/tegra/common.hsoc/tegra/fuse.hfuse.h
Detected Declarations
function tegra_read_chipidfunction tegra_get_chip_idfunction tegra_get_major_revfunction tegra_get_minor_revfunction tegra_get_platformfunction tegra_is_siliconfunction tegra_read_strapsfunction tegra_read_ram_codefunction ERDfunction tegra_init_revisionfunction tegra_init_apbmisc_resourcesfunction tegra_init_apbmiscfunction tegra_acpi_init_apbmiscfunction tegra_acpi_init_apbmiscexport tegra_read_ram_codeexport tegra194_miscreg_mask_serror
Annotated Snippet
if (IS_ENABLED(CONFIG_ARM) && soc_is_tegra()) {
/* APBMISC registers (chip revision, ...) */
apbmisc.start = 0x70000800;
apbmisc.end = 0x70000863;
apbmisc.flags = IORESOURCE_MEM;
/* strapping options */
if (of_machine_is_compatible("nvidia,tegra124")) {
straps.start = 0x7000e864;
straps.end = 0x7000e867;
} else {
straps.start = 0x70000008;
straps.end = 0x7000000b;
}
straps.flags = IORESOURCE_MEM;
pr_warn("Using APBMISC region %pR\n", &apbmisc);
pr_warn("Using strapping options registers %pR\n",
&straps);
} else {
/*
* At this point we're not running on Tegra, so play
* nice with multi-platform kernels.
*/
return;
}
} else {
/*
* Extract information from the device tree if we've found a
* matching node.
*/
if (of_address_to_resource(np, 0, &apbmisc) < 0) {
pr_err("failed to get APBMISC registers\n");
goto put;
}
if (of_address_to_resource(np, 1, &straps) < 0) {
pr_err("failed to get strapping options registers\n");
goto put;
}
}
tegra_init_apbmisc_resources(&apbmisc, &straps);
long_ram_code = of_property_read_bool(np, "nvidia,long-ram-code");
put:
of_node_put(np);
}
#ifdef CONFIG_ACPI
static const struct acpi_device_id apbmisc_acpi_match[] = {
{ "NVDA2010" },
{ /* sentinel */ }
};
void tegra_acpi_init_apbmisc(void)
{
struct resource *resources[2] = { NULL };
struct resource_entry *rentry;
struct acpi_device *adev = NULL;
struct list_head resource_list;
int rcount = 0;
int ret;
adev = acpi_dev_get_first_match_dev(apbmisc_acpi_match[0].id, NULL, -1);
if (!adev)
return;
INIT_LIST_HEAD(&resource_list);
ret = acpi_dev_get_memory_resources(adev, &resource_list);
if (ret < 0) {
pr_err("failed to get APBMISC memory resources");
goto out_put_acpi_dev;
}
/*
* Get required memory resources.
*
* resources[0]: apbmisc.
* resources[1]: straps.
*/
resource_list_for_each_entry(rentry, &resource_list) {
if (rcount >= ARRAY_SIZE(resources))
break;
resources[rcount++] = rentry->res;
}
Annotation
- Immediate include surface: `linux/acpi.h`, `linux/arm-smccc.h`, `linux/export.h`, `linux/io.h`, `linux/kernel.h`, `linux/mod_devicetable.h`, `linux/of.h`, `linux/of_address.h`.
- Detected declarations: `function tegra_read_chipid`, `function tegra_get_chip_id`, `function tegra_get_major_rev`, `function tegra_get_minor_rev`, `function tegra_get_platform`, `function tegra_is_silicon`, `function tegra_read_straps`, `function tegra_read_ram_code`, `function ERD`, `function tegra_init_revision`.
- Atlas domain: Driver Families / drivers/soc.
- 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.