Skip to content

Commit 5c6bd5d

Browse files
committed
Merge tag 'mips_5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux
Pull MIPS updates from Paul Burton: "Main MIPS changes: - boot_mem_map is removed, providing a nice cleanup made possible by the recent removal of bootmem. - Some fixes to atomics, in general providing compiler barriers for smp_mb__{before,after}_atomic plus fixes specific to Loongson CPUs or MIPS32 systems using cmpxchg64(). - Conversion to the new generic VDSO infrastructure courtesy of Vincenzo Frascino. - Removal of undefined behavior in set_io_port_base(), fixing the behavior of some MIPS kernel configurations when built with recent clang versions. - Initial MIPS32 huge page support, functional on at least Ingenic SoCs. - pte_special() is now supported for some configurations, allowing among other things generic fast GUP to be used. - Miscellaneous fixes & cleanups. And platform specific changes: - Major improvements to Ingenic SoC support from Paul Cercueil, mostly enabled by the inclusion of the new TCU (timer-counter unit) drivers he's spent a very patient year or so working on. Plus some fixes for X1000 SoCs from Zhou Yanjie. - Netgear R6200 v1 systems are now supported by the bcm47xx platform. - DT updates for BMIPS, Lantiq & Microsemi Ocelot systems" * tag 'mips_5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux: (89 commits) MIPS: Detect bad _PFN_SHIFT values MIPS: Disable pte_special() for MIPS32 with RiXi MIPS: ralink: deactivate PCI support for SOC_MT7621 mips: compat: vdso: Use legacy syscalls as fallback MIPS: Drop Loongson _CACHE_* definitions MIPS: tlbex: Remove cpu_has_local_ebase MIPS: tlbex: Simplify r3k check MIPS: Select R3k-style TLB in Kconfig MIPS: PCI: refactor ioc3 special handling mips: remove ioremap_cachable mips/atomic: Fix smp_mb__{before,after}_atomic() mips/atomic: Fix loongson_llsc_mb() wreckage mips/atomic: Fix cmpxchg64 barriers MIPS: Octeon: remove duplicated include from dma-octeon.c firmware: bcm47xx_nvram: Allow COMPILE_TEST firmware: bcm47xx_nvram: Correct size_t printf format MIPS: Treat Loongson Extensions as ASEs MIPS: Remove dev_err() usage after platform_get_irq() MIPS: dts: mscc: describe the PTP ready interrupt MIPS: dts: mscc: describe the PTP register range ...
2 parents f7c3bf8 + 05d013a commit 5c6bd5d

143 files changed

Lines changed: 2916 additions & 4954 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Documentation/devicetree/bindings/pwm/ingenic,jz47xx-pwm.txt‎

Lines changed: 0 additions & 22 deletions
This file was deleted.
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
Ingenic JZ47xx SoCs Timer/Counter Unit devicetree bindings
2+
==========================================================
3+
4+
For a description of the TCU hardware and drivers, have a look at
5+
Documentation/mips/ingenic-tcu.txt.
6+
7+
Required properties:
8+
9+
- compatible: Must be one of:
10+
* ingenic,jz4740-tcu
11+
* ingenic,jz4725b-tcu
12+
* ingenic,jz4770-tcu
13+
followed by "simple-mfd".
14+
- reg: Should be the offset/length value corresponding to the TCU registers
15+
- clocks: List of phandle & clock specifiers for clocks external to the TCU.
16+
The "pclk", "rtc" and "ext" clocks should be provided. The "tcu" clock
17+
should be provided if the SoC has it.
18+
- clock-names: List of name strings for the external clocks.
19+
- #clock-cells: Should be <1>;
20+
Clock consumers specify this argument to identify a clock. The valid values
21+
may be found in <dt-bindings/clock/ingenic,tcu.h>.
22+
- interrupt-controller : Identifies the node as an interrupt controller
23+
- #interrupt-cells : Specifies the number of cells needed to encode an
24+
interrupt source. The value should be 1.
25+
- interrupts : Specifies the interrupt the controller is connected to.
26+
27+
Optional properties:
28+
29+
- ingenic,pwm-channels-mask: Bitmask of TCU channels reserved for PWM use.
30+
Default value is 0xfc.
31+
32+
33+
Children nodes
34+
==========================================================
35+
36+
37+
PWM node:
38+
---------
39+
40+
Required properties:
41+
42+
- compatible: Must be one of:
43+
* ingenic,jz4740-pwm
44+
* ingenic,jz4725b-pwm
45+
- #pwm-cells: Should be 3. See ../pwm/pwm.txt for a description of the cell
46+
format.
47+
- clocks: List of phandle & clock specifiers for the TCU clocks.
48+
- clock-names: List of name strings for the TCU clocks.
49+
50+
51+
Watchdog node:
52+
--------------
53+
54+
Required properties:
55+
56+
- compatible: Must be "ingenic,jz4740-watchdog"
57+
- clocks: phandle to the WDT clock
58+
- clock-names: should be "wdt"
59+
60+
61+
OS Timer node:
62+
---------
63+
64+
Required properties:
65+
66+
- compatible: Must be one of:
67+
* ingenic,jz4725b-ost
68+
* ingenic,jz4770-ost
69+
- clocks: phandle to the OST clock
70+
- clock-names: should be "ost"
71+
- interrupts : Specifies the interrupt the OST is connected to.
72+
73+
74+
Example
75+
==========================================================
76+
77+
#include <dt-bindings/clock/jz4770-cgu.h>
78+
#include <dt-bindings/clock/ingenic,tcu.h>
79+
80+
/ {
81+
tcu: timer@10002000 {
82+
compatible = "ingenic,jz4770-tcu", "simple-mfd";
83+
reg = <0x10002000 0x1000>;
84+
#address-cells = <1>;
85+
#size-cells = <1>;
86+
ranges = <0x0 0x10002000 0x1000>;
87+
88+
#clock-cells = <1>;
89+
90+
clocks = <&cgu JZ4770_CLK_RTC
91+
&cgu JZ4770_CLK_EXT
92+
&cgu JZ4770_CLK_PCLK>;
93+
clock-names = "rtc", "ext", "pclk";
94+
95+
interrupt-controller;
96+
#interrupt-cells = <1>;
97+
98+
interrupt-parent = <&intc>;
99+
interrupts = <27 26 25>;
100+
101+
watchdog: watchdog@0 {
102+
compatible = "ingenic,jz4740-watchdog";
103+
reg = <0x0 0xc>;
104+
105+
clocks = <&tcu TCU_CLK_WDT>;
106+
clock-names = "wdt";
107+
};
108+
109+
pwm: pwm@40 {
110+
compatible = "ingenic,jz4740-pwm";
111+
reg = <0x40 0x80>;
112+
113+
#pwm-cells = <3>;
114+
115+
clocks = <&tcu TCU_CLK_TIMER0
116+
&tcu TCU_CLK_TIMER1
117+
&tcu TCU_CLK_TIMER2
118+
&tcu TCU_CLK_TIMER3
119+
&tcu TCU_CLK_TIMER4
120+
&tcu TCU_CLK_TIMER5
121+
&tcu TCU_CLK_TIMER6
122+
&tcu TCU_CLK_TIMER7>;
123+
clock-names = "timer0", "timer1", "timer2", "timer3",
124+
"timer4", "timer5", "timer6", "timer7";
125+
};
126+
127+
ost: timer@e0 {
128+
compatible = "ingenic,jz4770-ost";
129+
reg = <0xe0 0x20>;
130+
131+
clocks = <&tcu TCU_CLK_OST>;
132+
clock-names = "ost";
133+
134+
interrupts = <15>;
135+
};
136+
};
137+
};

‎Documentation/devicetree/bindings/watchdog/ingenic,jz4740-wdt.txt‎

Lines changed: 0 additions & 17 deletions
This file was deleted.

‎Documentation/index.rst‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,16 +144,15 @@ implementation.
144144
.. toctree::
145145
:maxdepth: 2
146146

147-
sh/index
148147
arm/index
149148
arm64/index
150149
ia64/index
151150
m68k/index
152-
powerpc/index
153151
mips/index
154152
nios2/nios2
155153
openrisc/index
156154
parisc/index
155+
powerpc/index
157156
riscv/index
158157
s390/index
159158
sh/index

‎Documentation/mips/index.rst‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
.. SPDX-License-Identifier: GPL-2.0
22
3-
=================
4-
MIPS architecture
5-
=================
3+
===========================
4+
MIPS-specific Documentation
5+
===========================
66

77
.. toctree::
88
:maxdepth: 2
9+
:numbered:
10+
11+
ingenic-tcu
912

1013
au1xxx_ide
1114

‎Documentation/mips/ingenic-tcu.rst‎

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
.. SPDX-License-Identifier: GPL-2.0
2+
3+
===============================================
4+
Ingenic JZ47xx SoCs Timer/Counter Unit hardware
5+
===============================================
6+
7+
The Timer/Counter Unit (TCU) in Ingenic JZ47xx SoCs is a multi-function
8+
hardware block. It features up to to eight channels, that can be used as
9+
counters, timers, or PWM.
10+
11+
- JZ4725B, JZ4750, JZ4755 only have six TCU channels. The other SoCs all
12+
have eight channels.
13+
14+
- JZ4725B introduced a separate channel, called Operating System Timer
15+
(OST). It is a 32-bit programmable timer. On JZ4760B and above, it is
16+
64-bit.
17+
18+
- Each one of the TCU channels has its own clock, which can be reparented to three
19+
different clocks (pclk, ext, rtc), gated, and reclocked, through their TCSR register.
20+
21+
- The watchdog and OST hardware blocks also feature a TCSR register with the same
22+
format in their register space.
23+
- The TCU registers used to gate/ungate can also gate/ungate the watchdog and
24+
OST clocks.
25+
26+
- Each TCU channel works in one of two modes:
27+
28+
- mode TCU1: channels cannot work in sleep mode, but are easier to
29+
operate.
30+
- mode TCU2: channels can work in sleep mode, but the operation is a bit
31+
more complicated than with TCU1 channels.
32+
33+
- The mode of each TCU channel depends on the SoC used:
34+
35+
- On the oldest SoCs (up to JZ4740), all of the eight channels operate in
36+
TCU1 mode.
37+
- On JZ4725B, channel 5 operates as TCU2, the others operate as TCU1.
38+
- On newest SoCs (JZ4750 and above), channels 1-2 operate as TCU2, the
39+
others operate as TCU1.
40+
41+
- Each channel can generate an interrupt. Some channels share an interrupt
42+
line, some don't, and this changes between SoC versions:
43+
44+
- on older SoCs (JZ4740 and below), channel 0 and channel 1 have their
45+
own interrupt line; channels 2-7 share the last interrupt line.
46+
- On JZ4725B, channel 0 has its own interrupt; channels 1-5 share one
47+
interrupt line; the OST uses the last interrupt line.
48+
- on newer SoCs (JZ4750 and above), channel 5 has its own interrupt;
49+
channels 0-4 and (if eight channels) 6-7 all share one interrupt line;
50+
the OST uses the last interrupt line.
51+
52+
Implementation
53+
==============
54+
55+
The functionalities of the TCU hardware are spread across multiple drivers:
56+
57+
=========== =====
58+
clocks drivers/clk/ingenic/tcu.c
59+
interrupts drivers/irqchip/irq-ingenic-tcu.c
60+
timers drivers/clocksource/ingenic-timer.c
61+
OST drivers/clocksource/ingenic-ost.c
62+
PWM drivers/pwm/pwm-jz4740.c
63+
watchdog drivers/watchdog/jz4740_wdt.c
64+
=========== =====
65+
66+
Because various functionalities of the TCU that belong to different drivers
67+
and frameworks can be controlled from the same registers, all of these
68+
drivers access their registers through the same regmap.
69+
70+
For more information regarding the devicetree bindings of the TCU drivers,
71+
have a look at Documentation/devicetree/bindings/mfd/ingenic,tcu.txt.

0 commit comments

Comments
 (0)