arch/arm/mach-sa1100/generic.c
Source file repositories/reference/linux-study-clean/arch/arm/mach-sa1100/generic.c
File Facts
- System
- Linux kernel
- Corpus path
arch/arm/mach-sa1100/generic.c- Extension
.c- Size
- 11273 bytes
- Lines
- 471
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/gpio.hlinux/gpio/machine.hlinux/module.hlinux/kernel.hlinux/init.hlinux/delay.hlinux/dma-mapping.hlinux/pm.hlinux/cpufreq.hlinux/ioport.hlinux/platform_device.hlinux/reboot.hlinux/regulator/fixed.hlinux/regulator/machine.hlinux/irqchip/irq-sa11x0.hvideo/sa1100fb.hsoc/sa1100/pwer.hasm/div64.hasm/mach/map.hasm/mach/flash.hasm/irq.hasm/system_misc.hmach/hardware.hmach/irqs.hmach/reset.hgeneric.hclocksource/pxa.h
Detected Declarations
function sa11x0_getspeedfunction sa1100_power_offfunction sa11x0_restartfunction sa11x0_register_devicefunction sa11x0_ppc_configure_mcpfunction sa11x0_register_mcpfunction sa11x0_register_lcdfunction sa11x0_register_pcmciafunction sa11x0_register_mtdfunction sa1100_initfunction sa11x0_init_latefunction sa11x0_register_fixed_regulatorfunction sa1100_map_iofunction sa1100_timer_initfunction sa1100_init_irqfunction sa1110_mb_disablefunction sa1110_mb_enablefunction sa11x0_gpio_set_wakefunction sa11x0_sc_set_wake
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* linux/arch/arm/mach-sa1100/generic.c
*
* Author: Nicolas Pitre
*
* Code common to all SA11x0 machines.
*/
#include <linux/gpio.h>
#include <linux/gpio/machine.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/dma-mapping.h>
#include <linux/pm.h>
#include <linux/cpufreq.h>
#include <linux/ioport.h>
#include <linux/platform_device.h>
#include <linux/reboot.h>
#include <linux/regulator/fixed.h>
#include <linux/regulator/machine.h>
#include <linux/irqchip/irq-sa11x0.h>
#include <video/sa1100fb.h>
#include <soc/sa1100/pwer.h>
#include <asm/div64.h>
#include <asm/mach/map.h>
#include <asm/mach/flash.h>
#include <asm/irq.h>
#include <asm/system_misc.h>
#include <mach/hardware.h>
#include <mach/irqs.h>
#include <mach/reset.h>
#include "generic.h"
#include <clocksource/pxa.h>
#define NR_FREQS 16
/*
* This table is setup for a 3.6864MHz Crystal.
*/
struct cpufreq_frequency_table sa11x0_freq_table[NR_FREQS+1] = {
{ .frequency = 59000, /* 59.0 MHz */},
{ .frequency = 73700, /* 73.7 MHz */},
{ .frequency = 88500, /* 88.5 MHz */},
{ .frequency = 103200, /* 103.2 MHz */},
{ .frequency = 118000, /* 118.0 MHz */},
{ .frequency = 132700, /* 132.7 MHz */},
{ .frequency = 147500, /* 147.5 MHz */},
{ .frequency = 162200, /* 162.2 MHz */},
{ .frequency = 176900, /* 176.9 MHz */},
{ .frequency = 191700, /* 191.7 MHz */},
{ .frequency = 206400, /* 206.4 MHz */},
{ .frequency = 221200, /* 221.2 MHz */},
{ .frequency = 235900, /* 235.9 MHz */},
{ .frequency = 250700, /* 250.7 MHz */},
{ .frequency = 265400, /* 265.4 MHz */},
{ .frequency = 280200, /* 280.2 MHz */},
{ .frequency = CPUFREQ_TABLE_END, },
};
unsigned int sa11x0_getspeed(unsigned int cpu)
{
if (cpu)
return 0;
return sa11x0_freq_table[PPCR & 0xf].frequency;
}
/*
* Default power-off for SA1100
*/
static void sa1100_power_off(void)
{
mdelay(100);
local_irq_disable();
/* disable internal oscillator, float CS lines */
PCFR = (PCFR_OPDE | PCFR_FP | PCFR_FS);
/* enable wake-up on GPIO0 (Assabet...) */
PWER = GFER = GRER = 1;
/*
* set scratchpad to zero, just in case it is used as a
* restart address by the bootloader.
*/
PSPR = 0;
/* enter sleep mode */
Annotation
- Immediate include surface: `linux/gpio.h`, `linux/gpio/machine.h`, `linux/module.h`, `linux/kernel.h`, `linux/init.h`, `linux/delay.h`, `linux/dma-mapping.h`, `linux/pm.h`.
- Detected declarations: `function sa11x0_getspeed`, `function sa1100_power_off`, `function sa11x0_restart`, `function sa11x0_register_device`, `function sa11x0_ppc_configure_mcp`, `function sa11x0_register_mcp`, `function sa11x0_register_lcd`, `function sa11x0_register_pcmcia`, `function sa11x0_register_mtd`, `function sa1100_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.