Skip to content

Commit bd2fad8

Browse files
committed
Merge tag 'arm-soc/for-5.10/drivers' of https://github.com/Broadcom/stblinux into arm/drivers
This pull request contains Broadcom SoCs drivers changes for 5.10, please pull the following: - Alvaro adds support for the BCM63xx (DSL) SoCs power domain controller and adds support for the 6318, 6328, 6362, 63268. - Florian adds support for tuning the Bus Interface Unit on 72164 and 72165, enables the Brahma-B53 and Cortex-A72 read-ahead cache for the 64-bit capable ARCH_BRCMSTB platforms, and finally updates the GISB driver to support breakpoint notifications. * tag 'arm-soc/for-5.10/drivers' of https://github.com/Broadcom/stblinux: bus: brcmstb_gisb: Add support for breakpoint interrupts dt-bindings: bus: Document breakpoint interrupt for gisb-arb soc: bcm: brcmstb: biuctrl: Change RAC data line prefetching after 4 consecutive lines soc: bcm: brcmstb: biuctrl: Change RAC prefetch distance from +/-1 to +/- 2 soc: bcm: brcmstb: biuctrl: Tune MCP settings for 72165 soc: bcm: brcmstb: biuctrl: Tune MCP settings for 72164 MIPS: BMIPS: dts: add BCM63268 power domain support MIPS: BMIPS: dts: add BCM6362 power domain support MIPS: BMIPS: dts: add BCM6328 power domain support soc: bcm: add BCM63xx power domain driver MIPS: BMIPS: add BCM6318 power domain definitions MIPS: BMIPS: add BCM63268 power domain definitions MIPS: BMIPS: add BCM6362 power domain definitions MIPS: BMIPS: add BCM6328 power domain definitions dt-bindings: soc: brcm: add BCM63xx power domain binding soc: bcm: brcmstb: biuctrl: Enable Read-ahead cache bus: brcmstb_gisb: Shorten prints Link: https://lore.kernel.org/r/20200912032153.1216354-3-f.fainelli@gmail.com Signed-off-by: Olof Johansson <olof@lixom.net>
2 parents bac9bd9 + fb8a0b8 commit bd2fad8

17 files changed

Lines changed: 736 additions & 14 deletions

File tree

Documentation/devicetree/bindings/bus/brcm,gisb-arb.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ Required properties:
1010
"brcm,bcm7038-gisb-arb" for 130nm chips
1111
- reg: specifies the base physical address and size of the registers
1212
- interrupts: specifies the two interrupts (timeout and TEA) to be used from
13-
the parent interrupt controller
13+
the parent interrupt controller. A third optional interrupt may be specified
14+
for breakpoints.
1415

1516
Optional properties:
1617

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: "http://devicetree.org/schemas/power/brcm,bcm63xx-power.yaml#"
5+
$schema: "http://devicetree.org/meta-schemas/core.yaml#"
6+
7+
title: BCM63xx power domain driver
8+
9+
maintainers:
10+
- Álvaro Fernández Rojas <noltari@gmail.com>
11+
12+
description: |
13+
BCM6318, BCM6328, BCM6362 and BCM63268 SoCs have a power domain controller
14+
to enable/disable certain components in order to save power.
15+
16+
properties:
17+
compatible:
18+
items:
19+
- enum:
20+
- brcm,bcm6318-power-controller
21+
- brcm,bcm6328-power-controller
22+
- brcm,bcm6362-power-controller
23+
- brcm,bcm63268-power-controller
24+
25+
reg:
26+
maxItems: 1
27+
28+
"#power-domain-cells":
29+
const: 1
30+
31+
required:
32+
- compatible
33+
- reg
34+
- "#power-domain-cells"
35+
36+
additionalProperties: false
37+
38+
examples:
39+
- |
40+
periph_pwr: power-controller@10001848 {
41+
compatible = "brcm,bcm6328-power-controller";
42+
reg = <0x10001848 0x4>;
43+
#power-domain-cells = <1>;
44+
};

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3491,6 +3491,7 @@ F: arch/mips/bmips/*
34913491
F: arch/mips/boot/dts/brcm/bcm*.dts*
34923492
F: arch/mips/include/asm/mach-bmips/*
34933493
F: arch/mips/kernel/*bmips*
3494+
F: drivers/soc/bcm/bcm63xx
34943495
F: drivers/irqchip/irq-bcm63*
34953496
F: drivers/irqchip/irq-bcm7*
34963497
F: drivers/irqchip/irq-brcmstb*

arch/mips/boot/dts/brcm/bcm63268.dtsi

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,12 @@
117117
status = "disabled";
118118
};
119119

120+
periph_pwr: power-controller@1000184c {
121+
compatible = "brcm,bcm6328-power-controller";
122+
reg = <0x1000184c 0x4>;
123+
#power-domain-cells = <1>;
124+
};
125+
120126
ehci: usb@10002500 {
121127
compatible = "brcm,bcm63268-ehci", "generic-ehci";
122128
reg = <0x10002500 0x100>;

arch/mips/boot/dts/brcm/bcm6328.dtsi

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,12 @@
110110
status = "disabled";
111111
};
112112

113+
periph_pwr: power-controller@10001848 {
114+
compatible = "brcm,bcm6328-power-controller";
115+
reg = <0x10001848 0x4>;
116+
#power-domain-cells = <1>;
117+
};
118+
113119
ehci: usb@10002500 {
114120
compatible = "brcm,bcm6328-ehci", "generic-ehci";
115121
reg = <0x10002500 0x100>;

arch/mips/boot/dts/brcm/bcm6362.dtsi

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,12 @@
108108
status = "disabled";
109109
};
110110

111+
periph_pwr: power-controller@10001848 {
112+
compatible = "brcm,bcm6362-power-controller";
113+
reg = <0x10001848 0x4>;
114+
#power-domain-cells = <1>;
115+
};
116+
111117
leds0: led-controller@10001900 {
112118
#address-cells = <1>;
113119
#size-cells = <0>;

drivers/bus/brcmstb_gisb.c

Lines changed: 97 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,22 @@
3030
#define ARB_ERR_CAP_STATUS_WRITE (1 << 1)
3131
#define ARB_ERR_CAP_STATUS_VALID (1 << 0)
3232

33+
#define ARB_BP_CAP_CLEAR (1 << 0)
34+
#define ARB_BP_CAP_STATUS_PROT_SHIFT 14
35+
#define ARB_BP_CAP_STATUS_TYPE (1 << 13)
36+
#define ARB_BP_CAP_STATUS_RSP_SHIFT 10
37+
#define ARB_BP_CAP_STATUS_MASK GENMASK(1, 0)
38+
#define ARB_BP_CAP_STATUS_BS_SHIFT 2
39+
#define ARB_BP_CAP_STATUS_WRITE (1 << 1)
40+
#define ARB_BP_CAP_STATUS_VALID (1 << 0)
41+
3342
enum {
3443
ARB_TIMER,
44+
ARB_BP_CAP_CLR,
45+
ARB_BP_CAP_HI_ADDR,
46+
ARB_BP_CAP_ADDR,
47+
ARB_BP_CAP_STATUS,
48+
ARB_BP_CAP_MASTER,
3549
ARB_ERR_CAP_CLR,
3650
ARB_ERR_CAP_HI_ADDR,
3751
ARB_ERR_CAP_ADDR,
@@ -41,6 +55,11 @@ enum {
4155

4256
static const int gisb_offsets_bcm7038[] = {
4357
[ARB_TIMER] = 0x00c,
58+
[ARB_BP_CAP_CLR] = 0x014,
59+
[ARB_BP_CAP_HI_ADDR] = -1,
60+
[ARB_BP_CAP_ADDR] = 0x0b8,
61+
[ARB_BP_CAP_STATUS] = 0x0c0,
62+
[ARB_BP_CAP_MASTER] = -1,
4463
[ARB_ERR_CAP_CLR] = 0x0c4,
4564
[ARB_ERR_CAP_HI_ADDR] = -1,
4665
[ARB_ERR_CAP_ADDR] = 0x0c8,
@@ -50,6 +69,11 @@ static const int gisb_offsets_bcm7038[] = {
5069

5170
static const int gisb_offsets_bcm7278[] = {
5271
[ARB_TIMER] = 0x008,
72+
[ARB_BP_CAP_CLR] = 0x01c,
73+
[ARB_BP_CAP_HI_ADDR] = -1,
74+
[ARB_BP_CAP_ADDR] = 0x220,
75+
[ARB_BP_CAP_STATUS] = 0x230,
76+
[ARB_BP_CAP_MASTER] = 0x234,
5377
[ARB_ERR_CAP_CLR] = 0x7f8,
5478
[ARB_ERR_CAP_HI_ADDR] = -1,
5579
[ARB_ERR_CAP_ADDR] = 0x7e0,
@@ -59,6 +83,11 @@ static const int gisb_offsets_bcm7278[] = {
5983

6084
static const int gisb_offsets_bcm7400[] = {
6185
[ARB_TIMER] = 0x00c,
86+
[ARB_BP_CAP_CLR] = 0x014,
87+
[ARB_BP_CAP_HI_ADDR] = -1,
88+
[ARB_BP_CAP_ADDR] = 0x0b8,
89+
[ARB_BP_CAP_STATUS] = 0x0c0,
90+
[ARB_BP_CAP_MASTER] = 0x0c4,
6291
[ARB_ERR_CAP_CLR] = 0x0c8,
6392
[ARB_ERR_CAP_HI_ADDR] = -1,
6493
[ARB_ERR_CAP_ADDR] = 0x0cc,
@@ -68,6 +97,11 @@ static const int gisb_offsets_bcm7400[] = {
6897

6998
static const int gisb_offsets_bcm7435[] = {
7099
[ARB_TIMER] = 0x00c,
100+
[ARB_BP_CAP_CLR] = 0x014,
101+
[ARB_BP_CAP_HI_ADDR] = -1,
102+
[ARB_BP_CAP_ADDR] = 0x158,
103+
[ARB_BP_CAP_STATUS] = 0x160,
104+
[ARB_BP_CAP_MASTER] = 0x164,
71105
[ARB_ERR_CAP_CLR] = 0x168,
72106
[ARB_ERR_CAP_HI_ADDR] = -1,
73107
[ARB_ERR_CAP_ADDR] = 0x16c,
@@ -77,6 +111,11 @@ static const int gisb_offsets_bcm7435[] = {
77111

78112
static const int gisb_offsets_bcm7445[] = {
79113
[ARB_TIMER] = 0x008,
114+
[ARB_BP_CAP_CLR] = 0x010,
115+
[ARB_BP_CAP_HI_ADDR] = -1,
116+
[ARB_BP_CAP_ADDR] = 0x1d8,
117+
[ARB_BP_CAP_STATUS] = 0x1e0,
118+
[ARB_BP_CAP_MASTER] = 0x1e4,
80119
[ARB_ERR_CAP_CLR] = 0x7e4,
81120
[ARB_ERR_CAP_HI_ADDR] = 0x7e8,
82121
[ARB_ERR_CAP_ADDR] = 0x7ec,
@@ -125,6 +164,16 @@ static u64 gisb_read_address(struct brcmstb_gisb_arb_device *gdev)
125164
return value;
126165
}
127166

167+
static u64 gisb_read_bp_address(struct brcmstb_gisb_arb_device *gdev)
168+
{
169+
u64 value;
170+
171+
value = gisb_read(gdev, ARB_BP_CAP_ADDR);
172+
value |= (u64)gisb_read(gdev, ARB_BP_CAP_HI_ADDR) << 32;
173+
174+
return value;
175+
}
176+
128177
static void gisb_write(struct brcmstb_gisb_arb_device *gdev, u32 val, int reg)
129178
{
130179
int offset = gdev->gisb_offsets[reg];
@@ -210,8 +259,8 @@ static int brcmstb_gisb_arb_decode_addr(struct brcmstb_gisb_arb_device *gdev,
210259
m_name = m_fmt;
211260
}
212261

213-
pr_crit("%s: %s at 0x%llx [%c %s], core: %s\n",
214-
__func__, reason, arb_addr,
262+
pr_crit("GISB: %s at 0x%llx [%c %s], core: %s\n",
263+
reason, arb_addr,
215264
cap_status & ARB_ERR_CAP_STATUS_WRITE ? 'W' : 'R',
216265
cap_status & ARB_ERR_CAP_STATUS_TIMEOUT ? "timeout" : "",
217266
m_name);
@@ -259,6 +308,41 @@ static irqreturn_t brcmstb_gisb_tea_handler(int irq, void *dev_id)
259308
return IRQ_HANDLED;
260309
}
261310

311+
static irqreturn_t brcmstb_gisb_bp_handler(int irq, void *dev_id)
312+
{
313+
struct brcmstb_gisb_arb_device *gdev = dev_id;
314+
const char *m_name;
315+
u32 bp_status;
316+
u64 arb_addr;
317+
u32 master;
318+
char m_fmt[11];
319+
320+
bp_status = gisb_read(gdev, ARB_BP_CAP_STATUS);
321+
322+
/* Invalid captured address, bail out */
323+
if (!(bp_status & ARB_BP_CAP_STATUS_VALID))
324+
return IRQ_HANDLED;
325+
326+
/* Read the address and master */
327+
arb_addr = gisb_read_bp_address(gdev);
328+
master = gisb_read(gdev, ARB_BP_CAP_MASTER);
329+
330+
m_name = brcmstb_gisb_master_to_str(gdev, master);
331+
if (!m_name) {
332+
snprintf(m_fmt, sizeof(m_fmt), "0x%08x", master);
333+
m_name = m_fmt;
334+
}
335+
336+
pr_crit("GISB: breakpoint at 0x%llx [%c], core: %s\n",
337+
arb_addr, bp_status & ARB_BP_CAP_STATUS_WRITE ? 'W' : 'R',
338+
m_name);
339+
340+
/* clear the GISB error */
341+
gisb_write(gdev, ARB_ERR_CAP_CLEAR, ARB_ERR_CAP_CLR);
342+
343+
return IRQ_HANDLED;
344+
}
345+
262346
/*
263347
* Dump out gisb errors on die or panic.
264348
*/
@@ -317,13 +401,14 @@ static int __init brcmstb_gisb_arb_probe(struct platform_device *pdev)
317401
struct brcmstb_gisb_arb_device *gdev;
318402
const struct of_device_id *of_id;
319403
struct resource *r;
320-
int err, timeout_irq, tea_irq;
404+
int err, timeout_irq, tea_irq, bp_irq;
321405
unsigned int num_masters, j = 0;
322406
int i, first, last;
323407

324408
r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
325409
timeout_irq = platform_get_irq(pdev, 0);
326410
tea_irq = platform_get_irq(pdev, 1);
411+
bp_irq = platform_get_irq(pdev, 2);
327412

328413
gdev = devm_kzalloc(&pdev->dev, sizeof(*gdev), GFP_KERNEL);
329414
if (!gdev)
@@ -356,6 +441,15 @@ static int __init brcmstb_gisb_arb_probe(struct platform_device *pdev)
356441
if (err < 0)
357442
return err;
358443

444+
/* Interrupt is optional */
445+
if (bp_irq > 0) {
446+
err = devm_request_irq(&pdev->dev, bp_irq,
447+
brcmstb_gisb_bp_handler, 0, pdev->name,
448+
gdev);
449+
if (err < 0)
450+
return err;
451+
}
452+
359453
/* If we do not have a valid mask, assume all masters are enabled */
360454
if (of_property_read_u32(dn, "brcm,gisb-arb-master-mask",
361455
&gdev->valid_mask))

drivers/soc/bcm/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,15 @@ config RASPBERRYPI_POWER
2222
This enables support for the RPi power domains which can be enabled
2323
or disabled via the RPi firmware.
2424

25+
config SOC_BCM63XX
26+
bool "Broadcom 63xx SoC drivers"
27+
depends on BMIPS_GENERIC || COMPILE_TEST
28+
help
29+
Enables drivers for the Broadcom 63xx series of chips.
30+
Drivers can be enabled individually within this menu.
31+
32+
If unsure, say N.
33+
2534
config SOC_BRCMSTB
2635
bool "Broadcom STB SoC drivers"
2736
depends on ARM || ARM64 || BMIPS_GENERIC || COMPILE_TEST
@@ -33,6 +42,7 @@ config SOC_BRCMSTB
3342

3443
If unsure, say N.
3544

45+
source "drivers/soc/bcm/bcm63xx/Kconfig"
3646
source "drivers/soc/bcm/brcmstb/Kconfig"
3747

3848
endmenu

drivers/soc/bcm/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# SPDX-License-Identifier: GPL-2.0-only
22
obj-$(CONFIG_BCM2835_POWER) += bcm2835-power.o
33
obj-$(CONFIG_RASPBERRYPI_POWER) += raspberrypi-power.o
4+
obj-$(CONFIG_SOC_BCM63XX) += bcm63xx/
45
obj-$(CONFIG_SOC_BRCMSTB) += brcmstb/

drivers/soc/bcm/bcm63xx/Kconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# SPDX-License-Identifier: GPL-2.0-only
2+
if SOC_BCM63XX
3+
4+
config BCM63XX_POWER
5+
bool "BCM63xx power domain driver"
6+
depends on BMIPS_GENERIC || (COMPILE_TEST && OF)
7+
select PM_GENERIC_DOMAINS if PM
8+
help
9+
This enables support for the BCM63xx power domains controller on
10+
BCM6318, BCM6328, BCM6362 and BCM63268 SoCs.
11+
12+
endif # SOC_BCM63XX

0 commit comments

Comments
 (0)