arch/arm/mach-keystone/keystone.c
Source file repositories/reference/linux-study-clean/arch/arm/mach-keystone/keystone.c
File Facts
- System
- Linux kernel
- Corpus path
arch/arm/mach-keystone/keystone.c- Extension
.c- Size
- 3567 bytes
- Lines
- 149
- 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/io.hlinux/dma-map-ops.hlinux/init.hlinux/pm_runtime.hlinux/pm_clock.hlinux/memblock.hlinux/of.hlinux/platform_device.hasm/setup.hasm/mach/map.hasm/mach/arch.hasm/mach/time.hasm/page.h
Detected Declarations
function keystone_pm_runtime_initfunction keystone_platform_notifierfunction keystone_initfunction keystone_pv_fixup
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* Keystone2 based boards and SOC related code.
*
* Copyright 2013 Texas Instruments, Inc.
* Cyril Chemparathy <cyril@ti.com>
* Santosh Shilimkar <santosh.shillimkar@ti.com>
*/
#include <linux/io.h>
#include <linux/dma-map-ops.h>
#include <linux/init.h>
#include <linux/pm_runtime.h>
#include <linux/pm_clock.h>
#include <linux/memblock.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <asm/setup.h>
#include <asm/mach/map.h>
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
#include <asm/page.h>
#define KEYSTONE_LOW_PHYS_START 0x80000000ULL
#define KEYSTONE_LOW_PHYS_SIZE 0x80000000ULL /* 2G */
#define KEYSTONE_LOW_PHYS_END (KEYSTONE_LOW_PHYS_START + \
KEYSTONE_LOW_PHYS_SIZE - 1)
#define KEYSTONE_HIGH_PHYS_START 0x800000000ULL
#define KEYSTONE_HIGH_PHYS_SIZE 0x400000000ULL /* 16G */
#define KEYSTONE_HIGH_PHYS_END (KEYSTONE_HIGH_PHYS_START + \
KEYSTONE_HIGH_PHYS_SIZE - 1)
static struct dev_pm_domain keystone_pm_domain = {
.ops = {
USE_PM_CLK_RUNTIME_OPS
USE_PLATFORM_PM_SLEEP_OPS
},
};
static struct pm_clk_notifier_block platform_domain_notifier = {
.pm_domain = &keystone_pm_domain,
.con_ids = { NULL },
};
static const struct of_device_id of_keystone_table[] = {
{.compatible = "ti,k2hk"},
{.compatible = "ti,k2e"},
{.compatible = "ti,k2l"},
{ /* end of list */ },
};
static int __init keystone_pm_runtime_init(void)
{
struct device_node *np;
np = of_find_matching_node(NULL, of_keystone_table);
if (!np)
return 0;
pm_clk_add_notifier(&platform_bus_type, &platform_domain_notifier);
return 0;
}
#ifdef CONFIG_ARM_LPAE
static int keystone_platform_notifier(struct notifier_block *nb,
unsigned long event, void *data)
{
struct device *dev = data;
if (event != BUS_NOTIFY_ADD_DEVICE)
return NOTIFY_DONE;
if (!dev)
return NOTIFY_BAD;
if (!dev->of_node) {
int ret = dma_direct_set_offset(dev, KEYSTONE_HIGH_PHYS_START,
KEYSTONE_LOW_PHYS_START,
KEYSTONE_HIGH_PHYS_SIZE);
dev_err(dev, "set dma_offset%08llx%s\n",
KEYSTONE_HIGH_PHYS_START - KEYSTONE_LOW_PHYS_START,
ret ? " failed" : "");
}
return NOTIFY_OK;
}
static struct notifier_block platform_nb = {
Annotation
- Immediate include surface: `linux/io.h`, `linux/dma-map-ops.h`, `linux/init.h`, `linux/pm_runtime.h`, `linux/pm_clock.h`, `linux/memblock.h`, `linux/of.h`, `linux/platform_device.h`.
- Detected declarations: `function keystone_pm_runtime_init`, `function keystone_platform_notifier`, `function keystone_init`, `function keystone_pv_fixup`.
- 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.