arch/arm/mach-dove/common.c
Source file repositories/reference/linux-study-clean/arch/arm/mach-dove/common.c
File Facts
- System
- Linux kernel
- Corpus path
arch/arm/mach-dove/common.c- Extension
.c- Size
- 13762 bytes
- Lines
- 450
- 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-provider.hlinux/dma-mapping.hlinux/init.hlinux/io.hlinux/platform_data/dma-mv_xor.hlinux/platform_data/usb-ehci-orion.hlinux/platform_device.hlinux/soc/dove/pmu.hasm/hardware/cache-tauros2.hasm/mach/arch.hasm/mach/map.hasm/mach/time.hplat/common.hplat/irq.hplat/time.hbridge-regs.hpm.hcommon.h
Detected Declarations
function dove_map_iofunction dove_clk_initfunction dove_ehci0_initfunction dove_ehci1_initfunction dove_ge00_initfunction dove_rtc_initfunction dove_sata_initfunction dove_uart0_initfunction dove_uart1_initfunction dove_uart2_initfunction dove_uart3_initfunction dove_spi0_initfunction dove_spi1_initfunction dove_i2c_initfunction dove_init_earlyfunction dove_find_tclkfunction dove_timer_initfunction dove_xor0_initfunction dove_xor1_initfunction dove_sdio0_initfunction dove_sdio1_initfunction dove_setup_cpu_winsfunction orion_wdt_initfunction dove_initfunction dove_restart
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* arch/arm/mach-dove/common.c
*
* Core functions for Marvell Dove 88AP510 System On Chip
*/
#include <linux/clk-provider.h>
#include <linux/dma-mapping.h>
#include <linux/init.h>
#include <linux/io.h>
#include <linux/platform_data/dma-mv_xor.h>
#include <linux/platform_data/usb-ehci-orion.h>
#include <linux/platform_device.h>
#include <linux/soc/dove/pmu.h>
#include <asm/hardware/cache-tauros2.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
#include <asm/mach/time.h>
#include <plat/common.h>
#include <plat/irq.h>
#include <plat/time.h>
#include "bridge-regs.h"
#include "pm.h"
#include "common.h"
/* These can go away once Dove uses the mvebu-mbus DT binding */
#define DOVE_MBUS_PCIE0_MEM_TARGET 0x4
#define DOVE_MBUS_PCIE0_MEM_ATTR 0xe8
#define DOVE_MBUS_PCIE0_IO_TARGET 0x4
#define DOVE_MBUS_PCIE0_IO_ATTR 0xe0
#define DOVE_MBUS_PCIE1_MEM_TARGET 0x8
#define DOVE_MBUS_PCIE1_MEM_ATTR 0xe8
#define DOVE_MBUS_PCIE1_IO_TARGET 0x8
#define DOVE_MBUS_PCIE1_IO_ATTR 0xe0
#define DOVE_MBUS_CESA_TARGET 0x3
#define DOVE_MBUS_CESA_ATTR 0x1
#define DOVE_MBUS_BOOTROM_TARGET 0x1
#define DOVE_MBUS_BOOTROM_ATTR 0xfd
#define DOVE_MBUS_SCRATCHPAD_TARGET 0xd
#define DOVE_MBUS_SCRATCHPAD_ATTR 0x0
/*****************************************************************************
* I/O Address Mapping
****************************************************************************/
static struct map_desc __maybe_unused dove_io_desc[] __initdata = {
{
.virtual = (unsigned long) DOVE_SB_REGS_VIRT_BASE,
.pfn = __phys_to_pfn(DOVE_SB_REGS_PHYS_BASE),
.length = DOVE_SB_REGS_SIZE,
.type = MT_DEVICE,
}, {
.virtual = (unsigned long) DOVE_NB_REGS_VIRT_BASE,
.pfn = __phys_to_pfn(DOVE_NB_REGS_PHYS_BASE),
.length = DOVE_NB_REGS_SIZE,
.type = MT_DEVICE,
},
};
void __init dove_map_io(void)
{
iotable_init(dove_io_desc, ARRAY_SIZE(dove_io_desc));
}
/*****************************************************************************
* CLK tree
****************************************************************************/
static int dove_tclk;
static DEFINE_SPINLOCK(gating_lock);
static struct clk *tclk;
static struct clk __init *dove_register_gate(const char *name,
const char *parent, u8 bit_idx)
{
return clk_register_gate(NULL, name, parent, 0,
(void __iomem *)CLOCK_GATING_CONTROL,
bit_idx, 0, &gating_lock);
}
static void __init dove_clk_init(void)
{
struct clk *usb0, *usb1, *sata, *pex0, *pex1, *sdio0, *sdio1;
struct clk *nand, *camera, *i2s0, *i2s1, *crypto, *ac97, *pdma;
struct clk *xor0, *xor1, *ge;
tclk = clk_register_fixed_rate(NULL, "tclk", NULL, 0, dove_tclk);
usb0 = dove_register_gate("usb0", "tclk", CLOCK_GATING_BIT_USB0);
usb1 = dove_register_gate("usb1", "tclk", CLOCK_GATING_BIT_USB1);
Annotation
- Immediate include surface: `linux/clk-provider.h`, `linux/dma-mapping.h`, `linux/init.h`, `linux/io.h`, `linux/platform_data/dma-mv_xor.h`, `linux/platform_data/usb-ehci-orion.h`, `linux/platform_device.h`, `linux/soc/dove/pmu.h`.
- Detected declarations: `function dove_map_io`, `function dove_clk_init`, `function dove_ehci0_init`, `function dove_ehci1_init`, `function dove_ge00_init`, `function dove_rtc_init`, `function dove_sata_init`, `function dove_uart0_init`, `function dove_uart1_init`, `function dove_uart2_init`.
- 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.