Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 624bbdfa authored by Thomas Gleixner's avatar Thomas Gleixner
Browse files

Merge branch 'timers/core' into sched/hrtimers

Merge sched/core and timers/core so we can apply the sched balancing
patch queue, which depends on both.
parents 6f9aad0b 887d9dc9
Loading
Loading
Loading
Loading
+26 −0
Original line number Diff line number Diff line
* ARMv7M System Timer

ARMv7-M includes a system timer, known as SysTick. Current driver only
implements the clocksource feature.

Required properties:
- compatible	  : Should be "arm,armv7m-systick"
- reg		  : The address range of the timer

Required clocking property, have to be one of:
- clocks	  : The input clock of the timer
- clock-frequency : The rate in HZ in input of the ARM SysTick

Examples:

systick: timer@e000e010 {
	compatible = "arm,armv7m-systick";
	reg = <0xe000e010 0x10>;
	clocks = <&clk_systick>;
};

systick: timer@e000e010 {
	compatible = "arm,armv7m-systick";
	reg = <0xe000e010 0x10>;
	clock-frequency = <90000000>;
};
+26 −0
Original line number Diff line number Diff line
* NXP LPC3220 timer

The NXP LPC3220 timer is used on a wide range of NXP SoCs. This
includes LPC32xx, LPC178x, LPC18xx and LPC43xx parts.

Required properties:
- compatible:
	Should be "nxp,lpc3220-timer".
- reg:
	Address and length of the register set.
- interrupts:
	Reference to the timer interrupt
- clocks:
	Should contain a reference to timer clock.
- clock-names:
	Should contain "timerclk".

Example:

timer1: timer@40085000 {
	compatible = "nxp,lpc3220-timer";
	reg = <0x40085000 0x1000>;
	interrupts = <13>;
	clocks = <&ccu1 CLK_CPU_TIMER1>;
	clock-names = "timerclk";
};
+22 −0
Original line number Diff line number Diff line
. STMicroelectronics STM32 timer

The STM32 MCUs family has several general-purpose 16 and 32 bits timers.

Required properties:
- compatible : Should be "st,stm32-timer"
- reg : Address and length of the register set
- clocks : Reference on the timer input clock
- interrupts : Reference to the timer interrupt

Optional properties:
- resets: Reference to a reset controller asserting the timer

Example:

timer5: timer@40000c00 {
	compatible = "st,stm32-timer";
	reg = <0x40000c00 0x400>;
	interrupts = <50>;
	resets = <&rrc 259>;
	clocks = <&clk_pmtr1>;
};
+27 −7
Original line number Diff line number Diff line
@@ -2,8 +2,9 @@
# Kbuild for top-level directory of the kernel
# This file takes care of the following:
# 1) Generate bounds.h
# 2) Generate asm-offsets.h (may need bounds.h)
# 3) Check for missing system calls
# 2) Generate timeconst.h
# 3) Generate asm-offsets.h (may need bounds.h and timeconst.h)
# 4) Check for missing system calls

# Default sed regexp - multiline due to syntax constraints
define sed-y
@@ -47,7 +48,26 @@ $(obj)/$(bounds-file): kernel/bounds.s FORCE
	$(call filechk,offsets,__LINUX_BOUNDS_H__)

#####
# 2) Generate asm-offsets.h
# 2) Generate timeconst.h

timeconst-file := include/generated/timeconst.h

#always  += $(timeconst-file)
targets += $(timeconst-file)

quiet_cmd_gentimeconst = GEN     $@
define cmd_gentimeconst
	(echo $(CONFIG_HZ) | bc -q $< ) > $@
endef
define filechk_gentimeconst
	(echo $(CONFIG_HZ) | bc -q $< )
endef

$(obj)/$(timeconst-file): kernel/time/timeconst.bc FORCE
	$(call filechk,gentimeconst)

#####
# 3) Generate asm-offsets.h
#

offsets-file := include/generated/asm-offsets.h
@@ -57,7 +77,7 @@ targets += arch/$(SRCARCH)/kernel/asm-offsets.s

# We use internal kbuild rules to avoid the "is up to date" message from make
arch/$(SRCARCH)/kernel/asm-offsets.s: arch/$(SRCARCH)/kernel/asm-offsets.c \
                                      $(obj)/$(bounds-file) FORCE
                                      $(obj)/$(timeconst-file) $(obj)/$(bounds-file) FORCE
	$(Q)mkdir -p $(dir $@)
	$(call if_changed_dep,cc_s_c)

@@ -65,7 +85,7 @@ $(obj)/$(offsets-file): arch/$(SRCARCH)/kernel/asm-offsets.s FORCE
	$(call filechk,offsets,__ASM_OFFSETS_H__)

#####
# 3) Check for missing system calls
# 4) Check for missing system calls
#

always += missing-syscalls
@@ -77,5 +97,5 @@ quiet_cmd_syscalls = CALL $<
missing-syscalls: scripts/checksyscalls.sh $(offsets-file) FORCE
	$(call cmd,syscalls)

# Keep these two files during make clean
no-clean-files := $(bounds-file) $(offsets-file)
# Keep these three files during make clean
no-clean-files := $(bounds-file) $(offsets-file) $(timeconst-file)
+3 −2
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@
#define _ASM_S390_TIMEX_H

#include <asm/lowcore.h>
#include <linux/time64.h>

/* The value of the TOD clock for 1.1.1970. */
#define TOD_UNIX_EPOCH 0x7d91048bca000000ULL
@@ -108,10 +109,10 @@ int get_sync_clock(unsigned long long *clock);
void init_cpu_timer(void);
unsigned long long monotonic_clock(void);

void tod_to_timeval(__u64, struct timespec *);
void tod_to_timeval(__u64 todval, struct timespec64 *xt);

static inline
void stck_to_timespec(unsigned long long stck, struct timespec *ts)
void stck_to_timespec64(unsigned long long stck, struct timespec64 *ts)
{
	tod_to_timeval(stck - TOD_UNIX_EPOCH, ts);
}
Loading