24e44913aa
SoC platform changes. Main theme this merge window: - The Netx platform (Netx 100/500) platform is removed by Linus Walleij-- the SoC doesn't have active maintainers with hardware, and in discussions with the vendor the agreement was that it's OK to remove. - Russell King has a series of patches that cleans up and refactors SA1101 and RiscPC support. -----BEGIN PGP SIGNATURE----- iQJDBAABCAAtFiEElf+HevZ4QCAJmMQ+jBrnPN6EHHcFAl0yKOgPHG9sb2ZAbGl4 b20ubmV0AAoJEIwa5zzehBx3SNEP/iJsMeeunX0P7Ym3zNFjykhspkkUmo7sEKuz NBcexnQpkm+OLgjfwT7j3kXvOs4mzMzH56J6h7dEDSHbQP1MDIgpMw6OEzMMsQTV XL1AWz1IO7Sq/mG17daPs9c75o6NYQ7pSEd/ncbjKuJQOpGsi4DyrVrhk9WdzYl2 hcs4XOzOMZgDTsXHVdWkfpHazpWxEXPCD7v5bt6ueU0YnT3csUbzOTTvw+55JxRV fYz0lg4wTMRYMQMOejpx1HXwdmbVOHLUYkCxcLUaVqMnm88q/IddJVklBbPGWAU5 Z4gFpL+FxcFhEZtu28CoubPYzf/mHDk8Ry2UWwBiRwiGoKfblomI1fpnbyrX53aE lpO5p7MfOVVV2WNxpbUND+ilbgKOREfRHd314GLPUjwudp2sTuDRZ1GAbt3JwsIM L1HesyjCtb6itCSwGsmmGsX2Wvu+WT7slpsYwHs2qklE/X1zQq0R4Jf2xUNpwqPb FqGZAtc6CCQtyF/Mcpp6OQd+cV0tgQVIw7teKol/xR1dSzN/+1zO1J9UHk9/dWUU sb5lGa/AtBrIbWxS1qLuA5bgyDqxXYDZi0y/Bu1qMHYebRW37z9kvomtzBiMNX2o SAxvr9iGPlTxTjGjRCyBVFmsbCMYLabNoL9tuuXvo+DnjFoOilTef+qePOv7ZYZX kwUyS2eu =FX6e -----END PGP SIGNATURE----- Merge tag 'armsoc-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM SoC platform updates from Olof Johansson: "SoC platform changes. Main theme this merge window: - The Netx platform (Netx 100/500) platform is removed by Linus Walleij-- the SoC doesn't have active maintainers with hardware, and in discussions with the vendor the agreement was that it's OK to remove. - Russell King has a series of patches that cleans up and refactors SA1101 and RiscPC support" * tag 'armsoc-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (47 commits) ARM: stm32: use "depends on" instead of "if" after prompt ARM: sa1100: convert to common clock framework ARM: exynos: Cleanup cppcheck shifting warning ARM: pxa/lubbock: remove lubbock_set_misc_wr() from global view ARM: exynos: Only build MCPM support if used arm: add missing include platform-data/atmel.h ARM: davinci: Use GPIO lookup table for DA850 LEDs ARM: OMAP2: drop explicit assembler architecture ARM: use arch_extension directive instead of arch argument ARM: imx: Switch imx7d to imx-cpufreq-dt for speed-grading ARM: bcm: Enable PINCTRL for ARCH_BRCMSTB ARM: bcm: Enable ARCH_HAS_RESET_CONTROLLER for ARCH_BRCMSTB ARM: riscpc: enable chained scatterlist support ARM: riscpc: reduce IRQ handling code ARM: riscpc: move RiscPC assembly files from arch/arm/lib to mach-rpc ARM: riscpc: parse video information from tagged list ARM: riscpc: add ecard quirk for Atomwide 3port serial card MAINTAINERS: mvebu: Add git entry soc: ti: pm33xx: Add a print while entering RTC only mode with DDR in self-refresh ARM: OMAP2+: Make some variables static ...
102 lines
2.3 KiB
C
102 lines
2.3 KiB
C
// SPDX-License-Identifier: GPL-2.0-only
|
|
/*
|
|
* linux/arch/arm/common/time-acorn.c
|
|
*
|
|
* Copyright (c) 1996-2000 Russell King.
|
|
*
|
|
* Changelog:
|
|
* 24-Sep-1996 RMK Created
|
|
* 10-Oct-1996 RMK Brought up to date with arch-sa110eval
|
|
* 04-Dec-1997 RMK Updated for new arch/arm/time.c
|
|
* 13=Jun-2004 DS Moved to arch/arm/common b/c shared w/CLPS7500
|
|
*/
|
|
#include <linux/clocksource.h>
|
|
#include <linux/init.h>
|
|
#include <linux/interrupt.h>
|
|
#include <linux/irq.h>
|
|
#include <linux/io.h>
|
|
|
|
#include <mach/hardware.h>
|
|
#include <asm/hardware/ioc.h>
|
|
|
|
#include <asm/mach/time.h>
|
|
|
|
#define RPC_CLOCK_FREQ 2000000
|
|
#define RPC_LATCH DIV_ROUND_CLOSEST(RPC_CLOCK_FREQ, HZ)
|
|
|
|
static u32 ioc_time;
|
|
|
|
static u64 ioc_timer_read(struct clocksource *cs)
|
|
{
|
|
unsigned int count1, count2, status;
|
|
unsigned long flags;
|
|
u32 ticks;
|
|
|
|
local_irq_save(flags);
|
|
ioc_writeb (0, IOC_T0LATCH);
|
|
barrier ();
|
|
count1 = ioc_readb(IOC_T0CNTL) | (ioc_readb(IOC_T0CNTH) << 8);
|
|
barrier ();
|
|
status = ioc_readb(IOC_IRQREQA);
|
|
barrier ();
|
|
ioc_writeb (0, IOC_T0LATCH);
|
|
barrier ();
|
|
count2 = ioc_readb(IOC_T0CNTL) | (ioc_readb(IOC_T0CNTH) << 8);
|
|
ticks = ioc_time + RPC_LATCH - count2;
|
|
local_irq_restore(flags);
|
|
|
|
if (count2 < count1) {
|
|
/*
|
|
* The timer has not reloaded between reading count1 and
|
|
* count2, check whether an interrupt was actually pending.
|
|
*/
|
|
if (status & (1 << 5))
|
|
ticks += RPC_LATCH;
|
|
} else if (count2 > count1) {
|
|
/*
|
|
* The timer has reloaded, so count2 indicates the new
|
|
* count since the wrap. The interrupt would not have
|
|
* been processed, so add the missed ticks.
|
|
*/
|
|
ticks += RPC_LATCH;
|
|
}
|
|
|
|
return ticks;
|
|
}
|
|
|
|
static struct clocksource ioctime_clocksource = {
|
|
.read = ioc_timer_read,
|
|
.mask = CLOCKSOURCE_MASK(32),
|
|
.rating = 100,
|
|
};
|
|
|
|
void __init ioctime_init(void)
|
|
{
|
|
ioc_writeb(RPC_LATCH & 255, IOC_T0LTCHL);
|
|
ioc_writeb(RPC_LATCH >> 8, IOC_T0LTCHH);
|
|
ioc_writeb(0, IOC_T0GO);
|
|
}
|
|
|
|
static irqreturn_t
|
|
ioc_timer_interrupt(int irq, void *dev_id)
|
|
{
|
|
ioc_time += RPC_LATCH;
|
|
timer_tick();
|
|
return IRQ_HANDLED;
|
|
}
|
|
|
|
static struct irqaction ioc_timer_irq = {
|
|
.name = "timer",
|
|
.handler = ioc_timer_interrupt
|
|
};
|
|
|
|
/*
|
|
* Set up timer interrupt.
|
|
*/
|
|
void __init ioc_timer_init(void)
|
|
{
|
|
WARN_ON(clocksource_register_hz(&ioctime_clocksource, RPC_CLOCK_FREQ));
|
|
ioctime_init();
|
|
setup_irq(IRQ_TIMER0, &ioc_timer_irq);
|
|
}
|