mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-23 12:17:16 +07:00
dfc25e4503
These cleanup patches are mainly move stuff around and should all be harmless. They are mainly split out so that other branches can be based on top to avoid conflicts. Notable changes are: * We finally remove all mach/timex.h, after CLOCK_TICK_RATE is no longer used. (Uwe Kleine-König) * The Qualcomm MSM platform is split out into legacy mach-msm and new-style mach-qcom, to allow easier maintainance of the new hardware support without regressions. (Kumar Gala) * A rework of some of the Kconfig logic to simplify multiplatform support (Rob Herring) * Samsung Exynos gets closer to supporting multiplatform (Sachin Kamat and others) * mach-bcm3528 gets merged into mach-bcm (Stephen Warren) * at91 gains some common clock framework support (Alexandre Belloni, Jean-Jacques Hiblot and other French people). -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQIVAwUAUz/yOWCrR//JCVInAQLOPBAAwTMkMrD8S8ggz6vfiQHZNdRPAC7NUJ46 +eYKmBVi5d6EdnjNuRElWENsh0ZosSAUFHrXsIC2NdH9sAJ9HOqWNNLymuA59Jo9 HZ/Ze6xQXDPNV7TROPoXuIli/2OCOXyyQHJsfI7h9V3PCx31qo0B5OdCxU0mtXK6 r1giREhnJFwfQMF/FTdnzhalFJoSjWwv/nkpNmQDJKRLKj9GzwQqItqw68gV6RzU Gnt6YK+9xC1B0cfWTFhAm6kbr9i7mvHoMG5tE3no2uuJMn4K7TgeMqOyvPWhmUeB EZi656szT1m5VfRWOqG+7coZO2VM4GO4NI0Xfin3GHllugOYls1il/FAfCPMLiwh RvuOmQGCkLIpdkuHop5QaI/h1EzlHA59nzTjmGf1+wWPsm0CIg08XOD9izQbRnN9 EmRqn1/8POIi17xcWyeMp8LB0APsTI+IflZFaYprEY9VlLLA/Pd+7udULhs8Bq8y 1l6fB6aPZKnDKCBy/PEIR+y+EHFEbwfrx6zm/pxVDX6P5DlQMFWL78pdBoJUa2h8 3pm/bSzNU5OSz1nJMLJv2jBTtnM5BvFgQBUi2qJ9Lr+nUhJXKCJ80kE/nOlXoCIU J952p3OhkYTQQcjuUVQeTXvRUOGB7mKok0pDFZNE6c7faqxTCudMABQq/KbMFstU eE3cH5FyYj4= =GcBb -----END PGP SIGNATURE----- Merge tag 'cleanup-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc Pull ARM SoC cleanups from Arnd Bergmann: "These cleanup patches are mainly move stuff around and should all be harmless. They are mainly split out so that other branches can be based on top to avoid conflicts. Notable changes are: - We finally remove all mach/timex.h, after CLOCK_TICK_RATE is no longer used (Uwe Kleine-König) - The Qualcomm MSM platform is split out into legacy mach-msm and new-style mach-qcom, to allow easier maintainance of the new hardware support without regressions (Kumar Gala) - A rework of some of the Kconfig logic to simplify multiplatform support (Rob Herring) - Samsung Exynos gets closer to supporting multiplatform (Sachin Kamat and others) - mach-bcm3528 gets merged into mach-bcm (Stephen Warren) - at91 gains some common clock framework support (Alexandre Belloni, Jean-Jacques Hiblot and other French people)" * tag 'cleanup-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (89 commits) ARM: hisi: select HAVE_ARM_SCU only for SMP ARM: efm32: allow uncompress debug output ARM: prima2: build reset code standalone ARM: at91: add PWM clock ARM: at91: move sam9261 SoC to common clk ARM: at91: prepare common clk transition for sam9261 SoC ARM: at91: updated the at91_dt_defconfig with support for the ADS7846 ARM: at91: dt: sam9261: Device Tree support for the at91sam9261ek ARM: at91: dt: defconfig: Added the sam9261 to the list of DT-enabled SOCs ARM: at91: dt: Add at91sam9261 dt SoC support ARM: at91: switch sam9rl to common clock framework ARM: at91/dt: define main clk frequency of at91sam9rlek ARM: at91/dt: define at91sam9rl clocks ARM: at91: prepare common clk transition for sam9rl SoCs ARM: at91: prepare sam9 dt boards transition to common clk ARM: at91: dt: sam9rl: Device Tree for the at91sam9rlek ARM: at91/defconfig: Add the sam9rl to the list of DT-enabled SOCs ARM: at91: Add at91sam9rl DT SoC support ARM: at91: prepare at91sam9rl DT transition ARM: at91/defconfig: refresh at91sam9260_9g20_defconfig ...
93 lines
2.1 KiB
C
93 lines
2.1 KiB
C
/*
|
|
* linux/arch/arm/common/time-acorn.c
|
|
*
|
|
* Copyright (c) 1996-2000 Russell King.
|
|
*
|
|
* 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.
|
|
*
|
|
* 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/timex.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_timer_gettimeoffset(void)
|
|
{
|
|
unsigned int count1, count2, status;
|
|
long offset;
|
|
|
|
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);
|
|
|
|
offset = count2;
|
|
if (count2 < count1) {
|
|
/*
|
|
* We have not had an interrupt between reading count1
|
|
* and count2.
|
|
*/
|
|
if (status & (1 << 5))
|
|
offset -= RPC_LATCH;
|
|
} else if (count2 > count1) {
|
|
/*
|
|
* We have just had another interrupt between reading
|
|
* count1 and count2.
|
|
*/
|
|
offset -= RPC_LATCH;
|
|
}
|
|
|
|
offset = (RPC_LATCH - offset) * (tick_nsec / 1000);
|
|
return DIV_ROUND_CLOSEST(offset, RPC_LATCH) * 1000;
|
|
}
|
|
|
|
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)
|
|
{
|
|
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)
|
|
{
|
|
arch_gettimeoffset = ioc_timer_gettimeoffset;
|
|
ioctime_init();
|
|
setup_irq(IRQ_TIMER0, &ioc_timer_irq);
|
|
}
|