Skip to content

Commit 0d58327

Browse files
committed
Merge branch 'baikal/drivers' into arm/drivers
[arnd: This is a patch series from Serge Semin to add a few drivers that don't have any other subsystem maintainer tree to go through, so I'm picking them up through the soc tree, full series description from the mailing list below] Baikal-T1 SoC CPU is based on two MIPS Warrior P5600 cores. Their main memory Non-Coherent IO interface is connected to the OCP2AXI bridge, which in turn is then connected to the DW AMBA 3 AXI Interconnect (so called Main Interconnect) with nine masters and four slaves ports. Main Interconnect is responsible for the AXI-bus traffic arbitration (QoS) and its routing from one component to another. In addition there is a Errors Handler Block (EHB) accesible by means of the Baikal-T1 SoC System Controller responsible to detect AXI protocol errors and device not responding situations built on top the interconnect. Baikal-T1 AXI-bus driver included in this patchset will be responsible for working with that functionality, though currently it doesn't support QoS tuning. Instead it's capable of detecting the error events, reporting an info about them to the system log, injecting artificial errors to test the driver functionality. Since AXI Interconnect doesn't provide a way to find out which devices are connected to it, so its DT node is supposed to be compatible with "simple-bus" driver, while sub-nodes shall represent the masters attached to the bus. One of the AXI Interconnect slaves is an AXI-APB bridge used to access the Baikal-T1 SoC subsystems CSRs. MMIO request from CPU and DMAC masters are routed there if they are detected to be within [0x08000000 0x1FFFFFFF] range of the physical memory. In case if an attempted APB transaction stays with no response for a pre-defined time it will be detected by the APB-bus Errors Handler Block (EHB), which will raise an interrupt, then the bus gets freed for a next operation. The APB-bus driver provides the interrupt handler to detect the erroneous address, update an errors counter and prints an error message about the faulty address. The counter and the APB-bus operations timeout can be accessed via corresponding sysfs nodes. A dedicated sysfs-node can be also used to artificially cause the bus errors described above. Since APB-bus is a platform bus, it doesn't provide a way to detect slave devices connected to it, so similarly to the AXI-bus it's also supposed to be compatible with "simple-bus" driver. Aside from PCIe/SATA/DDR/I2C/EHB/CPU/reboot specific settings the Baikal-T1 System Controller provides a MIPS P5600 CM2 L2-cache tuning block. It is responsible for the setting up the Tag/Data/WS L2-to-RAM latencies. The last small patch in this patchset provides a driver and DT-schema-based binding for the described device. So that the latencies can be tuned up by means of dedicated DT properties and sysfs nodes. This patchset is rebased and tested on the mainline Linux kernel 5.7-rc4. Changelog v2 (AXI/APB bus): - Assign dual GPL/BSD licenses to the bindings. - Use single lined copyright headers in the bindings. - Replace "additionalProperties: false" property with "unevaluatedProperties: false" in the bindings. - Don't use a multi-arg clock phandle reference in DT binding examples. Thus remove includes from there. - Fix some commit message and Kconfig help text spelling. - Move drivers from soc to the bus subsystem. - Convert a simple EHB drivers to the Baikal-T1 AXI and APB bus ones. - Convert APB bus driver to using regmap MMIO API. - Use syscon regmap to access the AXI-bus erroneous address. - Add reset line support. - Add Main Interconnect clock support to the AXI-bus driver. - Remove probe-status info string printout. - Discard of_match_ptr() macro utilization. - Don't print error-message if no platform IRQ found. Just return an error. - Use generic FIELD_{GET,PREP} macros instead of handwritten ones in the AXI-bus driver. Changelog v2 (l2 driver): - Fix some commit message and Kconfig help text spelling. - Move the driver to the memory subsystem. - Assign dual GPL/BSD license to the DT binding. - Use single lined copyright header in the binding. - Discard reg property and syscon compatible string. - Move "allOf" restrictions to the root level of the properties. - The DT node is supposed to be a child of the Baikal-T1 system controller node. So regmap will be fetched from there. - Use generic FIELD_{GET,PREP} macro. - Remove probe-status info string printout. - Since the driver depends on the OF config we can remove of_match_ptr() macro utilization. Changelog v3: - Combine l2 and AXI/APB bus patches in a single patchset. - Retrieve AXI-bus QoS registers by resource name "qos". - Discard CONFIG_OF dependency since there is none at compile-time. - Add syscon EHB registers range to the AXI-bus reg property as optional entry. - Fix invalid of_property_read_u32() return value test in the l2-ctl driver. - Get the reg property back into the l2-ctl DT bindings even though the driver is using the parental syscon regmap. - The l2-ctl DT schema will live separately from the system controller, but the corresponding sub-node of the later DT schema will $ref this one. - Set non-default latencies in the l2-ctl DT example. * baikal/drivers: memory: Add Baikal-T1 L2-cache Control Block driver bus: Add Baikal-T1 APB-bus driver bus: Add Baikal-T1 AXI-bus driver dt-bindings: bus: Add Baikal-T1 APB-bus binding dt-bindings: bus: Add Baikal-T1 AXI-bus binding Link: https://lore.kernel.org/lkml/20200526130841.ap6qlxv7hqmabnh5@mobilestation/ Signed-off-by: Arnd Bergmann <[email protected]>
2 parents 9536a31 + 83ca8b3 commit 0d58327

File tree

9 files changed

+1305
-0
lines changed

9 files changed

+1305
-0
lines changed
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
# Copyright (C) 2020 BAIKAL ELECTRONICS, JSC
3+
%YAML 1.2
4+
---
5+
$id: http://devicetree.org/schemas/bus/baikal,bt1-apb.yaml#
6+
$schema: http://devicetree.org/meta-schemas/core.yaml#
7+
8+
title: Baikal-T1 APB-bus
9+
10+
maintainers:
11+
- Serge Semin <[email protected]>
12+
13+
description: |
14+
Baikal-T1 CPU or DMAC MMIO requests are handled by the AMBA 3 AXI Interconnect
15+
which routes them to the AXI-APB bridge. This interface is a single master
16+
multiple slaves bus in turn serializing IO accesses and routing them to the
17+
addressed APB slave devices. In case of any APB protocol collisions, slave
18+
device not responding on timeout an IRQ is raised with an erroneous address
19+
reported to the APB terminator (APB Errors Handler Block).
20+
21+
allOf:
22+
- $ref: /schemas/simple-bus.yaml#
23+
24+
properties:
25+
compatible:
26+
contains:
27+
const: baikal,bt1-apb
28+
29+
reg:
30+
items:
31+
- description: APB EHB MMIO registers
32+
- description: APB MMIO region with no any device mapped
33+
34+
reg-names:
35+
items:
36+
- const: ehb
37+
- const: nodev
38+
39+
interrupts:
40+
maxItems: 1
41+
42+
clocks:
43+
items:
44+
- description: APB reference clock
45+
46+
clock-names:
47+
items:
48+
- const: pclk
49+
50+
resets:
51+
items:
52+
- description: APB domain reset line
53+
54+
reset-names:
55+
items:
56+
- const: prst
57+
58+
unevaluatedProperties: false
59+
60+
required:
61+
- compatible
62+
- reg
63+
- reg-names
64+
- interrupts
65+
- clocks
66+
- clock-names
67+
68+
examples:
69+
- |
70+
#include <dt-bindings/interrupt-controller/mips-gic.h>
71+
72+
bus@1f059000 {
73+
compatible = "baikal,bt1-apb", "simple-bus";
74+
reg = <0 0x1f059000 0 0x1000>,
75+
<0 0x1d000000 0 0x2040000>;
76+
reg-names = "ehb", "nodev";
77+
#address-cells = <1>;
78+
#size-cells = <1>;
79+
80+
ranges;
81+
82+
interrupts = <GIC_SHARED 16 IRQ_TYPE_LEVEL_HIGH>;
83+
84+
clocks = <&ccu_sys 1>;
85+
clock-names = "pclk";
86+
87+
resets = <&ccu_sys 1>;
88+
reset-names = "prst";
89+
};
90+
...
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
# Copyright (C) 2020 BAIKAL ELECTRONICS, JSC
3+
%YAML 1.2
4+
---
5+
$id: http://devicetree.org/schemas/bus/baikal,bt1-axi.yaml#
6+
$schema: http://devicetree.org/meta-schemas/core.yaml#
7+
8+
title: Baikal-T1 AXI-bus
9+
10+
maintainers:
11+
- Serge Semin <[email protected]>
12+
13+
description: |
14+
AXI3-bus is the main communication bus of Baikal-T1 SoC connecting all
15+
high-speed peripheral IP-cores with RAM controller and with MIPS P5600
16+
cores. Traffic arbitration is done by means of DW AXI Interconnect (so
17+
called AXI Main Interconnect) routing IO requests from one block to
18+
another: from CPU to SoC peripherals and between some SoC peripherals
19+
(mostly between peripheral devices and RAM, but also between DMA and
20+
some peripherals). In case of any protocol error, device not responding
21+
an IRQ is raised and a faulty situation is reported to the AXI EHB
22+
(Errors Handler Block) embedded on top of the DW AXI Interconnect and
23+
accessible by means of the Baikal-T1 System Controller.
24+
25+
allOf:
26+
- $ref: /schemas/simple-bus.yaml#
27+
28+
properties:
29+
compatible:
30+
contains:
31+
const: baikal,bt1-axi
32+
33+
reg:
34+
minItems: 1
35+
items:
36+
- description: Synopsys DesignWare AXI Interconnect QoS registers
37+
- description: AXI EHB MMIO system controller registers
38+
39+
reg-names:
40+
minItems: 1
41+
items:
42+
- const: qos
43+
- const: ehb
44+
45+
'#interconnect-cells':
46+
const: 1
47+
48+
syscon:
49+
$ref: /schemas/types.yaml#definitions/phandle
50+
description: Phandle to the Baikal-T1 System Controller DT node
51+
52+
interrupts:
53+
maxItems: 1
54+
55+
clocks:
56+
items:
57+
- description: Main Interconnect uplink reference clock
58+
59+
clock-names:
60+
items:
61+
- const: aclk
62+
63+
resets:
64+
items:
65+
- description: Main Interconnect reset line
66+
67+
reset-names:
68+
items:
69+
- const: arst
70+
71+
unevaluatedProperties: false
72+
73+
required:
74+
- compatible
75+
- reg
76+
- reg-names
77+
- syscon
78+
- interrupts
79+
- clocks
80+
- clock-names
81+
82+
examples:
83+
- |
84+
#include <dt-bindings/interrupt-controller/mips-gic.h>
85+
86+
bus@1f05a000 {
87+
compatible = "baikal,bt1-axi", "simple-bus";
88+
reg = <0 0x1f05a000 0 0x1000>,
89+
<0 0x1f04d110 0 0x8>;
90+
reg-names = "qos", "ehb";
91+
#address-cells = <1>;
92+
#size-cells = <1>;
93+
#interconnect-cells = <1>;
94+
95+
syscon = <&syscon>;
96+
97+
ranges;
98+
99+
interrupts = <GIC_SHARED 127 IRQ_TYPE_LEVEL_HIGH>;
100+
101+
clocks = <&ccu_axi 0>;
102+
clock-names = "aclk";
103+
104+
resets = <&ccu_axi 0>;
105+
reset-names = "arst";
106+
};
107+
...

drivers/bus/Kconfig

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,36 @@ config BRCMSTB_GISB_ARB
2929
arbiter. This driver provides timeout and target abort error handling
3030
and internal bus master decoding.
3131

32+
config BT1_APB
33+
tristate "Baikal-T1 APB-bus driver"
34+
depends on MIPS_BAIKAL_T1 || COMPILE_TEST
35+
select REGMAP_MMIO
36+
help
37+
Baikal-T1 AXI-APB bridge is used to access the SoC subsystem CSRs.
38+
IO requests are routed to this bus by means of the DW AMBA 3 AXI
39+
Interconnect. In case of any APB protocol collisions, slave device
40+
not responding on timeout an IRQ is raised with an erroneous address
41+
reported to the APB terminator (APB Errors Handler Block). This
42+
driver provides the interrupt handler to detect the erroneous
43+
address, prints an error message about the address fault, updates an
44+
errors counter. The counter and the APB-bus operations timeout can be
45+
accessed via corresponding sysfs nodes.
46+
47+
config BT1_AXI
48+
tristate "Baikal-T1 AXI-bus driver"
49+
depends on MIPS_BAIKAL_T1 || COMPILE_TEST
50+
select MFD_SYSCON
51+
help
52+
AXI3-bus is the main communication bus connecting all high-speed
53+
peripheral IP-cores with RAM controller and with MIPS P5600 cores on
54+
Baikal-T1 SoC. Traffic arbitration is done by means of DW AMBA 3 AXI
55+
Interconnect (so called AXI Main Interconnect) routing IO requests
56+
from one SoC block to another. This driver provides a way to detect
57+
any bus protocol errors and device not responding situations by
58+
means of an embedded on top of the interconnect errors handler
59+
block (EHB). AXI Interconnect QoS arbitration tuning is currently
60+
unsupported.
61+
3262
config MOXTET
3363
tristate "CZ.NIC Turris Mox module configuration bus"
3464
depends on SPI_MASTER && OF

drivers/bus/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ obj-$(CONFIG_MOXTET) += moxtet.o
1313
# DPAA2 fsl-mc bus
1414
obj-$(CONFIG_FSL_MC_BUS) += fsl-mc/
1515

16+
obj-$(CONFIG_BT1_APB) += bt1-apb.o
17+
obj-$(CONFIG_BT1_AXI) += bt1-axi.o
1618
obj-$(CONFIG_IMX_WEIM) += imx-weim.o
1719
obj-$(CONFIG_MIPS_CDMM) += mips_cdmm.o
1820
obj-$(CONFIG_MVEBU_MBUS) += mvebu-mbus.o

0 commit comments

Comments
 (0)