Release 4.11 arch/arm/mach-pxa/pxa25x.c
/*
* linux/arch/arm/mach-pxa/pxa25x.c
*
* Author: Nicolas Pitre
* Created: Jun 15, 2001
* Copyright: MontaVista Software Inc.
*
* Code specific to PXA21x/25x/26x variants.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* Since this file should be linked before any other machine specific file,
* the __initcall() here will be executed first. This serves as default
* initialization stuff for PXA machines which can be overridden later if
* need be.
*/
#include <linux/gpio.h>
#include <linux/gpio-pxa.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/suspend.h>
#include <linux/syscore_ops.h>
#include <linux/irq.h>
#include <linux/irqchip.h>
#include <asm/mach/map.h>
#include <asm/suspend.h>
#include <mach/hardware.h>
#include <mach/irqs.h>
#include "pxa25x.h"
#include <mach/reset.h>
#include "pm.h"
#include <mach/dma.h>
#include <mach/smemc.h>
#include "generic.h"
#include "devices.h"
/*
* Various clock factors driven by the CCCR register.
*/
#ifdef CONFIG_PM
#define SAVE(x) sleep_save[SLEEP_SAVE_##x] = x
#define RESTORE(x) x = sleep_save[SLEEP_SAVE_##x]
/*
* List of global PXA peripheral registers to preserve.
* More ones like CP and general purpose register values are preserved
* with the stack pointer in sleep.S.
*/
enum {
SLEEP_SAVE_PSTR,
SLEEP_SAVE_COUNT
};
static void pxa25x_cpu_pm_save(unsigned long *sleep_save)
{
SAVE(PSTR);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Eric Miao | 15 | 93.75% | 1 | 50.00% |
Todd Android Poynor | 1 | 6.25% | 1 | 50.00% |
Total | 16 | 100.00% | 2 | 100.00% |
static void pxa25x_cpu_pm_restore(unsigned long *sleep_save)
{
RESTORE(PSTR);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Eric Miao | 16 | 100.00% | 1 | 100.00% |
Total | 16 | 100.00% | 1 | 100.00% |
static void pxa25x_cpu_pm_enter(suspend_state_t state)
{
/* Clear reset status */
RCSR = RCSR_HWR | RCSR_WDR | RCSR_SMR | RCSR_GPR;
switch (state) {
case PM_SUSPEND_MEM:
cpu_suspend(PWRMODE_SLEEP, pxa25x_finish_suspend);
break;
}
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Russell King | 21 | 56.76% | 3 | 60.00% |
Todd Android Poynor | 13 | 35.14% | 1 | 20.00% |
Eric Miao | 3 | 8.11% | 1 | 20.00% |
Total | 37 | 100.00% | 5 | 100.00% |
static int pxa25x_cpu_pm_prepare(void)
{
/* set resume return address */
PSPR = __pa_symbol(cpu_resume);
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Russell King | 11 | 57.89% | 2 | 50.00% |
Todd Android Poynor | 7 | 36.84% | 1 | 25.00% |
Florian Fainelli | 1 | 5.26% | 1 | 25.00% |
Total | 19 | 100.00% | 4 | 100.00% |
static void pxa25x_cpu_pm_finish(void)
{
/* ensure not to come back here if it wasn't intended */
PSPR = 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Russell King | 12 | 92.31% | 1 | 50.00% |
Todd Android Poynor | 1 | 7.69% | 1 | 50.00% |
Total | 13 | 100.00% | 2 | 100.00% |
static struct pxa_cpu_pm_fns pxa25x_cpu_pm_fns = {
.save_count = SLEEP_SAVE_COUNT,
.valid = suspend_valid_only_mem,
.save = pxa25x_cpu_pm_save,
.restore = pxa25x_cpu_pm_restore,
.enter = pxa25x_cpu_pm_enter,
.prepare = pxa25x_cpu_pm_prepare,
.finish = pxa25x_cpu_pm_finish,
};
static void __init pxa25x_init_pm(void)
{
pxa_cpu_pm_fns = &pxa25x_cpu_pm_fns;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Eric Miao | 14 | 100.00% | 1 | 100.00% |
Total | 14 | 100.00% | 1 | 100.00% |
#else
static inline void pxa25x_init_pm(void) {}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Eric Miao | 8 | 100.00% | 1 | 100.00% |
Total | 8 | 100.00% | 1 | 100.00% |
#endif
/* PXA25x: supports wakeup from GPIO0..GPIO15 and RTC alarm
*/
static int pxa25x_set_wake(struct irq_data *d, unsigned int on)
{
int gpio = pxa_irq_to_gpio(d->irq);
uint32_t mask = 0;
if (gpio >= 0 && gpio < 85)
return gpio_set_wake(gpio, on);
if (d->irq == IRQ_RTCAlrm) {
mask = PWER_RTC;
goto set_pwer;
}
return -EINVAL;
set_pwer:
if (on)
PWER |= mask;
else
PWER &=~mask;
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Eric Miao | 79 | 89.77% | 2 | 50.00% |
Lennert Buytenhek | 8 | 9.09% | 1 | 25.00% |
Haojian Zhuang | 1 | 1.14% | 1 | 25.00% |
Total | 88 | 100.00% | 4 | 100.00% |
void __init pxa25x_init_irq(void)
{
pxa_init_irq(32, pxa25x_set_wake);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Eric Miao | 15 | 100.00% | 3 | 100.00% |
Total | 15 | 100.00% | 3 | 100.00% |
#ifdef CONFIG_CPU_PXA26x
void __init pxa26x_init_irq(void)
{
pxa_init_irq(32, pxa25x_set_wake);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Eric Miao | 15 | 100.00% | 1 | 100.00% |
Total | 15 | 100.00% | 1 | 100.00% |
#endif
static int __init __init
pxa25x_dt_init_irq(struct device_node *node, struct device_node *parent)
{
pxa_dt_irq_init(pxa25x_set_wake);
set_handle_irq(icip_handle_irq);
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Robert Jarzmik | 31 | 100.00% | 3 | 100.00% |
Total | 31 | 100.00% | 3 | 100.00% |
IRQCHIP_DECLARE(pxa25x_intc, "marvell,pxa-intc", pxa25x_dt_init_irq);
static struct map_desc pxa25x_io_desc[] __initdata = {
{ /* Mem Ctl */
.virtual = (unsigned long)SMEMC_VIRT,
.pfn = __phys_to_pfn(PXA2XX_SMEMC_BASE),
.length = SMEMC_SIZE,
.type = MT_DEVICE
}, { /* UNCACHED_PHYS_0 */
.virtual = UNCACHED_PHYS_0,
.pfn = __phys_to_pfn(0x00000000),
.length = UNCACHED_PHYS_0_SIZE,
.type = MT_DEVICE
},
};
void __init pxa25x_map_io(void)
{
pxa_map_io();
iotable_init(ARRAY_AND_SIZE(pxa25x_io_desc));
pxa25x_get_clk_frequency_khz(1);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Marek Vašut | 24 | 100.00% | 1 | 100.00% |
Total | 24 | 100.00% | 1 | 100.00% |
static struct pxa_gpio_platform_data pxa25x_gpio_info __initdata = {
.irq_base = PXA_GPIO_TO_IRQ(0),
.gpio_set_wake = gpio_set_wake,
};
static struct platform_device *pxa25x_devices[] __initdata = {
&pxa25x_device_udc,
&pxa_device_pmu,
&pxa_device_i2s,
&sa1100_device_rtc,
&pxa25x_device_ssp,
&pxa25x_device_nssp,
&pxa25x_device_assp,
&pxa25x_device_pwm0,
&pxa25x_device_pwm1,
&pxa_device_asoc_platform,
};
static int __init pxa25x_init(void)
{
int ret = 0;
if (cpu_is_pxa25x()) {
reset_status = RCSR;
pxa25x_init_pm();
register_syscore_ops(&pxa_irq_syscore_ops);
register_syscore_ops(&pxa2xx_mfp_syscore_ops);
if (!of_have_populated_dt()) {
pxa2xx_set_dmac_info(16, 40);
pxa_register_device(&pxa25x_device_gpio, &pxa25x_gpio_info);
ret = platform_add_devices(pxa25x_devices,
ARRAY_SIZE(pxa25x_devices));
}
}
return ret;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Russell King | 32 | 40.51% | 2 | 16.67% |
Eric Miao | 17 | 21.52% | 4 | 33.33% |
Robert Jarzmik | 15 | 18.99% | 3 | 25.00% |
Andrea Adami | 8 | 10.13% | 1 | 8.33% |
Rafael J. Wysocki | 6 | 7.59% | 1 | 8.33% |
Haojian Zhuang | 1 | 1.27% | 1 | 8.33% |
Total | 79 | 100.00% | 12 | 100.00% |
postcore_initcall(pxa25x_init);
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Eric Miao | 253 | 38.51% | 16 | 28.07% |
Russell King | 141 | 21.46% | 12 | 21.05% |
Robert Jarzmik | 64 | 9.74% | 8 | 14.04% |
Marek Vašut | 62 | 9.44% | 2 | 3.51% |
Laurent Pinchart | 27 | 4.11% | 2 | 3.51% |
Nico Pitre | 23 | 3.50% | 2 | 3.51% |
Todd Android Poynor | 22 | 3.35% | 1 | 1.75% |
Andrea Adami | 21 | 3.20% | 1 | 1.75% |
Haojian Zhuang | 13 | 1.98% | 4 | 7.02% |
Lennert Buytenhek | 11 | 1.67% | 1 | 1.75% |
Rafael J. Wysocki | 9 | 1.37% | 3 | 5.26% |
Arnd Bergmann | 6 | 0.91% | 2 | 3.51% |
Dmitry Baryshkov | 3 | 0.46% | 1 | 1.75% |
Florian Fainelli | 1 | 0.15% | 1 | 1.75% |
Philipp Zabel | 1 | 0.15% | 1 | 1.75% |
Total | 657 | 100.00% | 57 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.