Skip to content

Commit 917846e

Browse files
committed
Merge tag 'mailbox-v6.14' of git://git.kernel.org/pub/scm/linux/kernel/git/jassibrar/mailbox
Pull mailbox updates from Jassi Brar: - samsung: add gs101-mbox driver - microchip: add sbi-ipc driver - zynqmp: fix invalid __percpu annotation - qcom: add IPQ5424 APCS compatible - mpfs fix copy and paste bug - th1520: Fix NULL vs IS_ERR() and a memory corruption bug - tegra-hsp: clear mailbox before using message * tag 'mailbox-v6.14' of git://git.kernel.org/pub/scm/linux/kernel/git/jassibrar/mailbox: riscv: export __cpuid_to_hartid_map riscv: sbi: vendorid_list: Add Microchip Technology to the vendor list mailbox: th1520: Fix memory corruption due to incorrect array size mailbox: zynqmp: Remove invalid __percpu annotation in zynqmp_ipi_probe() MAINTAINERS: add entry for Samsung Exynos mailbox driver mailbox: add Samsung Exynos driver dt-bindings: mailbox: add google,gs101-mbox mailbox: qcom: Add support for IPQ5424 APCS IPC dt-bindings: mailbox: qcom: Add IPQ5424 APCS compatible mailbox: qcom-ipcc: Reset CLEAR_ON_RECV_RD if set from boot firmware mailbox: add Microchip IPC support dt-bindings: mailbox: add binding for Microchip IPC mailbox controller mailbox: tegra-hsp: Clear mailbox before using message mailbox: mpfs: fix copy and paste bug in probe mailbox: th1520: Fix a NULL vs IS_ERR() bug
2 parents 9d5db4e + 4783ce3 commit 917846e

File tree

18 files changed

+973
-6
lines changed

18 files changed

+973
-6
lines changed
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
# Copyright 2024 Linaro Ltd.
3+
%YAML 1.2
4+
---
5+
$id: http://devicetree.org/schemas/mailbox/google,gs101-mbox.yaml#
6+
$schema: http://devicetree.org/meta-schemas/core.yaml#
7+
8+
title: Samsung Exynos Mailbox Controller
9+
10+
maintainers:
11+
- Tudor Ambarus <tudor.ambarus@linaro.org>
12+
13+
description:
14+
The Samsung Exynos mailbox controller, used on Google GS101 SoC, has 16 flag
15+
bits for hardware interrupt generation and a shared register for passing
16+
mailbox messages. When the controller is used by the ACPM interface
17+
the shared register is ignored and the mailbox controller acts as a doorbell.
18+
The controller just raises the interrupt to the firmware after the
19+
ACPM interface has written the message to SRAM.
20+
21+
properties:
22+
compatible:
23+
const: google,gs101-mbox
24+
25+
reg:
26+
maxItems: 1
27+
28+
clocks:
29+
maxItems: 1
30+
31+
clock-names:
32+
items:
33+
- const: pclk
34+
35+
interrupts:
36+
description: IRQ line for the RX mailbox.
37+
maxItems: 1
38+
39+
'#mbox-cells':
40+
const: 0
41+
42+
required:
43+
- compatible
44+
- reg
45+
- clocks
46+
- clock-names
47+
- interrupts
48+
- '#mbox-cells'
49+
50+
additionalProperties: false
51+
52+
examples:
53+
- |
54+
#include <dt-bindings/interrupt-controller/arm-gic.h>
55+
#include <dt-bindings/clock/google,gs101.h>
56+
57+
soc {
58+
#address-cells = <1>;
59+
#size-cells = <1>;
60+
61+
ap2apm_mailbox: mailbox@17610000 {
62+
compatible = "google,gs101-mbox";
63+
reg = <0x17610000 0x1000>;
64+
clocks = <&cmu_apm CLK_GOUT_APM_MAILBOX_APM_AP_PCLK>;
65+
clock-names = "pclk";
66+
interrupts = <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH 0>;
67+
#mbox-cells = <0>;
68+
};
69+
};
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/mailbox/microchip,sbi-ipc.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Microchip Inter-processor communication (IPC) mailbox controller
8+
9+
maintainers:
10+
- Valentina Fernandez <valentina.fernandezalanis@microchip.com>
11+
12+
description:
13+
The Microchip Inter-processor Communication (IPC) facilitates
14+
message passing between processors using an interrupt signaling
15+
mechanism.
16+
17+
properties:
18+
compatible:
19+
oneOf:
20+
- description:
21+
Intended for use by software running in supervisor privileged
22+
mode (s-mode). This SBI interface is compatible with the Mi-V
23+
Inter-hart Communication (IHC) IP.
24+
const: microchip,sbi-ipc
25+
26+
- description:
27+
Intended for use by the SBI implementation in machine mode
28+
(m-mode), this compatible string is for the MIV_IHC Soft-IP.
29+
const: microchip,miv-ihc-rtl-v2
30+
31+
reg:
32+
maxItems: 1
33+
34+
interrupts:
35+
minItems: 1
36+
maxItems: 5
37+
38+
interrupt-names:
39+
minItems: 1
40+
maxItems: 5
41+
items:
42+
enum:
43+
- hart-0
44+
- hart-1
45+
- hart-2
46+
- hart-3
47+
- hart-4
48+
- hart-5
49+
50+
"#mbox-cells":
51+
description: >
52+
For "microchip,sbi-ipc", the cell represents the global "logical"
53+
channel IDs. The meaning of channel IDs are platform firmware dependent.
54+
55+
For "microchip,miv-ihc-rtl-v2", the cell represents the physical
56+
channel and does not vary based on the platform firmware.
57+
const: 1
58+
59+
microchip,ihc-chan-disabled-mask:
60+
description: >
61+
Represents the enable/disable state of the bi-directional IHC
62+
channels within the MIV-IHC IP configuration.
63+
64+
A bit set to '1' indicates that the corresponding channel is disabled,
65+
and any read or write operations to that channel will return zero.
66+
67+
A bit set to '0' indicates that the corresponding channel is enabled
68+
and will be accessible through its dedicated address range registers.
69+
70+
The actual enable/disable state of each channel is determined by the
71+
IP block’s configuration.
72+
$ref: /schemas/types.yaml#/definitions/uint16
73+
maximum: 0x7fff
74+
default: 0
75+
76+
required:
77+
- compatible
78+
- interrupts
79+
- interrupt-names
80+
- "#mbox-cells"
81+
82+
allOf:
83+
- if:
84+
properties:
85+
compatible:
86+
contains:
87+
const: microchip,sbi-ipc
88+
then:
89+
properties:
90+
reg:
91+
not: {}
92+
description:
93+
The 'microchip,sbi-ipc' operates in a programming model
94+
that does not require memory-mapped I/O (MMIO) registers
95+
since it uses SBI ecalls provided by the m-mode/firmware
96+
SBI implementation to access hardware registers.
97+
microchip,ihc-chan-disabled-mask: false
98+
else:
99+
required:
100+
- reg
101+
- microchip,ihc-chan-disabled-mask
102+
103+
additionalProperties: false
104+
105+
examples:
106+
- |
107+
mailbox {
108+
compatible = "microchip,sbi-ipc";
109+
interrupt-parent = <&plic>;
110+
interrupts = <180>, <179>, <178>;
111+
interrupt-names = "hart-1", "hart-2", "hart-3";
112+
#mbox-cells = <1>;
113+
};
114+
- |
115+
mailbox@50000000 {
116+
compatible = "microchip,miv-ihc-rtl-v2";
117+
microchip,ihc-chan-disabled-mask = /bits/ 16 <0>;
118+
reg = <0x50000000 0x1c000>;
119+
interrupt-parent = <&plic>;
120+
interrupts = <180>, <179>, <178>;
121+
interrupt-names = "hart-1", "hart-2", "hart-3";
122+
#mbox-cells = <1>;
123+
};

Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ properties:
2020
- enum:
2121
- qcom,ipq5018-apcs-apps-global
2222
- qcom,ipq5332-apcs-apps-global
23+
- qcom,ipq5424-apcs-apps-global
2324
- qcom,ipq8074-apcs-apps-global
2425
- qcom,ipq9574-apcs-apps-global
2526
- const: qcom,ipq6018-apcs-apps-global

MAINTAINERS

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3064,6 +3064,7 @@ F: drivers/*/*s3c24*
30643064
F: drivers/*/*s3c64xx*
30653065
F: drivers/*/*s5pv210*
30663066
F: drivers/clocksource/samsung_pwm_timer.c
3067+
F: drivers/mailbox/exynos-mailbox.c
30673068
F: drivers/memory/samsung/
30683069
F: drivers/pwm/pwm-samsung.c
30693070
F: drivers/soc/samsung/
@@ -20826,6 +20827,15 @@ F: arch/arm64/boot/dts/exynos/exynos850*
2082620827
F: drivers/clk/samsung/clk-exynos850.c
2082720828
F: include/dt-bindings/clock/exynos850.h
2082820829

20830+
SAMSUNG EXYNOS MAILBOX DRIVER
20831+
M: Tudor Ambarus <tudor.ambarus@linaro.org>
20832+
L: linux-kernel@vger.kernel.org
20833+
L: linux-samsung-soc@vger.kernel.org
20834+
S: Supported
20835+
F: Documentation/devicetree/bindings/mailbox/google,gs101-mbox.yaml
20836+
F: drivers/mailbox/exynos-mailbox.c
20837+
F: include/linux/mailbox/exynos-message.h
20838+
2082920839
SAMSUNG EXYNOS PSEUDO RANDOM NUMBER GENERATOR (RNG) DRIVER
2083020840
M: Krzysztof Kozlowski <krzk@kernel.org>
2083120841
L: linux-crypto@vger.kernel.org

arch/riscv/include/asm/vendorid_list.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#define ASM_VENDOR_LIST_H
77

88
#define ANDES_VENDOR_ID 0x31e
9+
#define MICROCHIP_VENDOR_ID 0x029
910
#define SIFIVE_VENDOR_ID 0x489
1011
#define THEAD_VENDOR_ID 0x5b7
1112

arch/riscv/kernel/smp.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ enum ipi_message_type {
4343
unsigned long __cpuid_to_hartid_map[NR_CPUS] __ro_after_init = {
4444
[0 ... NR_CPUS-1] = INVALID_HARTID
4545
};
46+
EXPORT_SYMBOL_GPL(__cpuid_to_hartid_map);
4647

4748
void __init smp_setup_processor_id(void)
4849
{

drivers/mailbox/Kconfig

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,17 @@ config ARM_MHU_V3
3636
that provides different means of transports: supported extensions
3737
will be discovered and possibly managed at probe-time.
3838

39+
config EXYNOS_MBOX
40+
tristate "Exynos Mailbox"
41+
depends on ARCH_EXYNOS || COMPILE_TEST
42+
help
43+
Say Y here if you want to build the Samsung Exynos Mailbox controller
44+
driver. The controller has 16 flag bits for hardware interrupt
45+
generation and a shared register for passing mailbox messages.
46+
When the controller is used by the ACPM interface the shared register
47+
is ignored and the mailbox controller acts as a doorbell that raises
48+
the interrupt to the ACPM firmware.
49+
3950
config IMX_MBOX
4051
tristate "i.MX Mailbox"
4152
depends on ARCH_MXC || COMPILE_TEST
@@ -178,6 +189,19 @@ config POLARFIRE_SOC_MAILBOX
178189

179190
If unsure, say N.
180191

192+
config MCHP_SBI_IPC_MBOX
193+
tristate "Microchip Inter-processor Communication (IPC) SBI driver"
194+
depends on RISCV_SBI || COMPILE_TEST
195+
depends on ARCH_MICROCHIP
196+
help
197+
Mailbox implementation for Microchip devices with an
198+
Inter-process communication (IPC) controller.
199+
200+
To compile this driver as a module, choose M here. the
201+
module will be called mailbox-mchp-ipc-sbi.
202+
203+
If unsure, say N.
204+
181205
config QCOM_APCS_IPC
182206
tristate "Qualcomm APCS IPC driver"
183207
depends on ARCH_QCOM || COMPILE_TEST

drivers/mailbox/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ obj-$(CONFIG_ARM_MHU_V2) += arm_mhuv2.o
1111

1212
obj-$(CONFIG_ARM_MHU_V3) += arm_mhuv3.o
1313

14+
obj-$(CONFIG_EXYNOS_MBOX) += exynos-mailbox.o
15+
1416
obj-$(CONFIG_IMX_MBOX) += imx-mailbox.o
1517

1618
obj-$(CONFIG_ARMADA_37XX_RWTM_MBOX) += armada-37xx-rwtm-mailbox.o
@@ -45,6 +47,8 @@ obj-$(CONFIG_BCM_FLEXRM_MBOX) += bcm-flexrm-mailbox.o
4547

4648
obj-$(CONFIG_POLARFIRE_SOC_MAILBOX) += mailbox-mpfs.o
4749

50+
obj-$(CONFIG_MCHP_SBI_IPC_MBOX) += mailbox-mchp-ipc-sbi.o
51+
4852
obj-$(CONFIG_QCOM_APCS_IPC) += qcom-apcs-ipc-mailbox.o
4953

5054
obj-$(CONFIG_TEGRA_HSP_MBOX) += tegra-hsp.o

0 commit comments

Comments
 (0)