Skip to content

Commit bddf944

Browse files
committed
Merge tag 'memory-controller-drv-6.16' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl into soc/drivers
Memory controller drivers for v6.16 1. Mediatek: Add support for MT6893 MTK SMI. 2. STM32: Add new driver for STM32 Octo Memory Manager (OMM), which manages muxing between two OSPI busses. 3. Several cleanups and minor improvements (OMAP GPMC, Kconfig entries, BT1 L2). * tag 'memory-controller-drv-6.16' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl: MAINTAINERS: add entry for STM32 OCTO MEMORY MANAGER driver memory: Add STM32 Octo Memory Manager driver dt-bindings: memory-controllers: Add STM32 Octo Memory Manager controller bus: firewall: Fix missing static inline annotations for stubs memory: bt1-l2-ctl: replace scnprintf() with sysfs_emit() memory: mtk-smi: Add support for Dimensity 1200 MT6893 SMI dt-bindings: memory: mtk-smi: Add support for MT6893 memory: tegra: Do not enable by default during compile testing memory: Simplify 'default' choice in Kconfig memory: omap-gpmc: remove GPIO set() and direction_output() callbacks memory: omap-gpmc: use the dedicated define for GPIO direction Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnd Bergmann <[email protected]>
2 parents 9a977b0 + 02eaee7 commit bddf944

File tree

12 files changed

+798
-28
lines changed

12 files changed

+798
-28
lines changed

Documentation/devicetree/bindings/memory-controllers/mediatek,smi-common.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ properties:
3333
- mediatek,mt2712-smi-common
3434
- mediatek,mt6779-smi-common
3535
- mediatek,mt6795-smi-common
36+
- mediatek,mt6893-smi-common
3637
- mediatek,mt8167-smi-common
3738
- mediatek,mt8173-smi-common
3839
- mediatek,mt8183-smi-common

Documentation/devicetree/bindings/memory-controllers/mediatek,smi-larb.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ properties:
2121
- mediatek,mt2712-smi-larb
2222
- mediatek,mt6779-smi-larb
2323
- mediatek,mt6795-smi-larb
24+
- mediatek,mt6893-smi-larb
2425
- mediatek,mt8167-smi-larb
2526
- mediatek,mt8173-smi-larb
2627
- mediatek,mt8183-smi-larb
Lines changed: 226 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,226 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/memory-controllers/st,stm32mp25-omm.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: STM32 Octo Memory Manager (OMM)
8+
9+
maintainers:
10+
- Patrice Chotard <[email protected]>
11+
12+
description: |
13+
The STM32 Octo Memory Manager is a low-level interface that enables an
14+
efficient OCTOSPI pin assignment with a full I/O matrix (before alternate
15+
function map) and multiplex of single/dual/quad/octal SPI interfaces over
16+
the same bus. It Supports up to:
17+
- Two single/dual/quad/octal SPI interfaces
18+
- Two ports for pin assignment
19+
20+
properties:
21+
compatible:
22+
const: st,stm32mp25-omm
23+
24+
"#address-cells":
25+
const: 2
26+
27+
"#size-cells":
28+
const: 1
29+
30+
ranges:
31+
description: |
32+
Reflects the memory layout per OSPI instance.
33+
Format:
34+
<chip-select> 0 <registers base address> <size>
35+
minItems: 2
36+
maxItems: 2
37+
38+
reg:
39+
items:
40+
- description: OMM registers
41+
- description: OMM memory map area
42+
43+
reg-names:
44+
items:
45+
- const: regs
46+
- const: memory_map
47+
48+
memory-region:
49+
description:
50+
Memory region shared between the 2 OCTOSPI instance.
51+
One or two phandle to a node describing a memory mapped region
52+
depending of child number.
53+
minItems: 1
54+
maxItems: 2
55+
56+
memory-region-names:
57+
description:
58+
Identify to which OSPI instance the memory region belongs to.
59+
items:
60+
enum: [ospi1, ospi2]
61+
minItems: 1
62+
maxItems: 2
63+
64+
clocks:
65+
maxItems: 3
66+
67+
clock-names:
68+
items:
69+
- const: omm
70+
- const: ospi1
71+
- const: ospi2
72+
73+
resets:
74+
maxItems: 3
75+
76+
reset-names:
77+
items:
78+
- const: omm
79+
- const: ospi1
80+
- const: ospi2
81+
82+
access-controllers:
83+
maxItems: 1
84+
85+
power-domains:
86+
maxItems: 1
87+
88+
st,syscfg-amcr:
89+
$ref: /schemas/types.yaml#/definitions/phandle-array
90+
description: |
91+
The Address Mapping Control Register (AMCR) is used to split the 256MB
92+
memory map area shared between the 2 OSPI instance. The Octo Memory
93+
Manager sets the AMCR depending of the memory-region configuration.
94+
The memory split bitmask description is:
95+
- 000: OCTOSPI1 (256 Mbytes), OCTOSPI2 unmapped
96+
- 001: OCTOSPI1 (192 Mbytes), OCTOSPI2 (64 Mbytes)
97+
- 010: OCTOSPI1 (128 Mbytes), OCTOSPI2 (128 Mbytes)
98+
- 011: OCTOSPI1 (64 Mbytes), OCTOSPI2 (192 Mbytes)
99+
- 1xx: OCTOSPI1 unmapped, OCTOSPI2 (256 Mbytes)
100+
items:
101+
- items:
102+
- description: phandle to syscfg
103+
- description: register offset within syscfg
104+
- description: register bitmask for memory split
105+
106+
st,omm-req2ack-ns:
107+
description:
108+
In multiplexed mode (MUXEN = 1), this field defines the time in
109+
nanoseconds between two transactions.
110+
default: 0
111+
112+
st,omm-cssel-ovr:
113+
$ref: /schemas/types.yaml#/definitions/uint32
114+
description: |
115+
Configure the chip select selector override for the 2 OCTOSPIs.
116+
- 0: OCTOSPI1 chip select send to NCS1 OCTOSPI2 chip select send to NCS1
117+
- 1: OCTOSPI1 chip select send to NCS2 OCTOSPI2 chip select send to NCS1
118+
- 2: OCTOSPI1 chip select send to NCS1 OCTOSPI2 chip select send to NCS2
119+
- 3: OCTOSPI1 chip select send to NCS2 OCTOSPI2 chip select send to NCS2
120+
minimum: 0
121+
maximum: 3
122+
default: 0
123+
124+
st,omm-mux:
125+
$ref: /schemas/types.yaml#/definitions/uint32
126+
description: |
127+
Configure the muxing between the 2 OCTOSPIs busses and the 2 output ports.
128+
- 0: direct mode
129+
- 1: mux OCTOSPI1 and OCTOSPI2 to port 1
130+
- 2: swapped mode
131+
- 3: mux OCTOSPI1 and OCTOSPI2 to port 2
132+
minimum: 0
133+
maximum: 3
134+
default: 0
135+
136+
patternProperties:
137+
^spi@[0-9]:
138+
type: object
139+
$ref: /schemas/spi/st,stm32mp25-ospi.yaml#
140+
description: Required spi child node
141+
142+
required:
143+
- compatible
144+
- reg
145+
- "#address-cells"
146+
- "#size-cells"
147+
- clocks
148+
- clock-names
149+
- resets
150+
- reset-names
151+
- st,syscfg-amcr
152+
- ranges
153+
154+
additionalProperties: false
155+
156+
examples:
157+
- |
158+
#include <dt-bindings/clock/st,stm32mp25-rcc.h>
159+
#include <dt-bindings/interrupt-controller/arm-gic.h>
160+
#include <dt-bindings/reset/st,stm32mp25-rcc.h>
161+
ommanager@40500000 {
162+
compatible = "st,stm32mp25-omm";
163+
reg = <0x40500000 0x400>, <0x60000000 0x10000000>;
164+
reg-names = "regs", "memory_map";
165+
ranges = <0 0 0x40430000 0x400>,
166+
<1 0 0x40440000 0x400>;
167+
memory-region = <&mm_ospi1>, <&mm_ospi2>;
168+
memory-region-names = "ospi1", "ospi2";
169+
pinctrl-0 = <&ospi_port1_clk_pins_a
170+
&ospi_port1_io03_pins_a
171+
&ospi_port1_cs0_pins_a>;
172+
pinctrl-1 = <&ospi_port1_clk_sleep_pins_a
173+
&ospi_port1_io03_sleep_pins_a
174+
&ospi_port1_cs0_sleep_pins_a>;
175+
pinctrl-names = "default", "sleep";
176+
clocks = <&rcc CK_BUS_OSPIIOM>,
177+
<&scmi_clk CK_SCMI_OSPI1>,
178+
<&scmi_clk CK_SCMI_OSPI2>;
179+
clock-names = "omm", "ospi1", "ospi2";
180+
resets = <&rcc OSPIIOM_R>,
181+
<&scmi_reset RST_SCMI_OSPI1>,
182+
<&scmi_reset RST_SCMI_OSPI2>;
183+
reset-names = "omm", "ospi1", "ospi2";
184+
access-controllers = <&rifsc 111>;
185+
power-domains = <&CLUSTER_PD>;
186+
#address-cells = <2>;
187+
#size-cells = <1>;
188+
st,syscfg-amcr = <&syscfg 0x2c00 0x7>;
189+
st,omm-req2ack-ns = <0>;
190+
st,omm-mux = <0>;
191+
st,omm-cssel-ovr = <0>;
192+
193+
spi@0 {
194+
compatible = "st,stm32mp25-ospi";
195+
reg = <0 0 0x400>;
196+
memory-region = <&mm_ospi1>;
197+
interrupts = <GIC_SPI 163 IRQ_TYPE_LEVEL_HIGH>;
198+
dmas = <&hpdma 2 0x62 0x00003121 0x0>,
199+
<&hpdma 2 0x42 0x00003112 0x0>;
200+
dma-names = "tx", "rx";
201+
clocks = <&scmi_clk CK_SCMI_OSPI1>;
202+
resets = <&scmi_reset RST_SCMI_OSPI1>, <&scmi_reset RST_SCMI_OSPI1DLL>;
203+
access-controllers = <&rifsc 74>;
204+
power-domains = <&CLUSTER_PD>;
205+
#address-cells = <1>;
206+
#size-cells = <0>;
207+
st,syscfg-dlyb = <&syscfg 0x1000>;
208+
};
209+
210+
spi@1 {
211+
compatible = "st,stm32mp25-ospi";
212+
reg = <1 0 0x400>;
213+
memory-region = <&mm_ospi1>;
214+
interrupts = <GIC_SPI 164 IRQ_TYPE_LEVEL_HIGH>;
215+
dmas = <&hpdma 3 0x62 0x00003121 0x0>,
216+
<&hpdma 3 0x42 0x00003112 0x0>;
217+
dma-names = "tx", "rx";
218+
clocks = <&scmi_clk CK_KER_OSPI2>;
219+
resets = <&scmi_reset RST_SCMI_OSPI2>, <&scmi_reset RST_SCMI_OSPI1DLL>;
220+
access-controllers = <&rifsc 75>;
221+
power-domains = <&CLUSTER_PD>;
222+
#address-cells = <1>;
223+
#size-cells = <0>;
224+
st,syscfg-dlyb = <&syscfg 0x1000>;
225+
};
226+
};

MAINTAINERS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22939,6 +22939,12 @@ L: [email protected]
2293922939
S: Maintained
2294022940
F: drivers/i2c/busses/i2c-stm32*
2294122941

22942+
ST STM32 OCTO MEMORY MANAGER
22943+
M: Patrice Chotard <[email protected]>
22944+
S: Maintained
22945+
F: Documentation/devicetree/bindings/memory-controllers/st,stm32mp25-omm.yaml
22946+
F: drivers/memory/stm32_omm.c
22947+
2294222948
ST STM32 SPI DRIVER
2294322949
M: Alain Volmat <[email protected]>
2294422950

drivers/memory/Kconfig

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ config ARM_PL172_MPMC
3232

3333
config ATMEL_EBI
3434
bool "Atmel EBI driver"
35-
default y if ARCH_AT91
35+
default ARCH_AT91
3636
depends on ARCH_AT91 || COMPILE_TEST
3737
depends on OF
3838
select MFD_SYSCON
@@ -147,7 +147,7 @@ config FPGA_DFL_EMIF
147147

148148
config MVEBU_DEVBUS
149149
bool "Marvell EBU Device Bus Controller"
150-
default y if PLAT_ORION
150+
default PLAT_ORION
151151
depends on PLAT_ORION || COMPILE_TEST
152152
depends on OF
153153
help
@@ -198,7 +198,7 @@ config DA8XX_DDRCTL
198198

199199
config PL353_SMC
200200
tristate "ARM PL35X Static Memory Controller(SMC) driver"
201-
default y if ARM
201+
default ARM
202202
depends on ARM || COMPILE_TEST
203203
depends on ARM_AMBA
204204
help
@@ -225,6 +225,23 @@ config STM32_FMC2_EBI
225225
devices (like SRAM, ethernet adapters, FPGAs, LCD displays, ...) on
226226
SOCs containing the FMC2 External Bus Interface.
227227

228+
config STM32_OMM
229+
tristate "STM32 Octo Memory Manager"
230+
depends on SPI_STM32_OSPI || COMPILE_TEST
231+
help
232+
This driver manages the muxing between the 2 OSPI busses and
233+
the 2 output ports. There are 4 possible muxing configurations:
234+
- direct mode (no multiplexing): OSPI1 output is on port 1 and OSPI2
235+
output is on port 2
236+
- OSPI1 and OSPI2 are multiplexed over the same output port 1
237+
- swapped mode (no multiplexing), OSPI1 output is on port 2,
238+
OSPI2 output is on port 1
239+
- OSPI1 and OSPI2 are multiplexed over the same output port 2
240+
It also manages :
241+
- the split of the memory area shared between the 2 OSPI instances.
242+
- chip select selection override.
243+
- the time between 2 transactions in multiplexed mode.
244+
228245
source "drivers/memory/samsung/Kconfig"
229246
source "drivers/memory/tegra/Kconfig"
230247

drivers/memory/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ obj-$(CONFIG_DA8XX_DDRCTL) += da8xx-ddrctl.o
2424
obj-$(CONFIG_PL353_SMC) += pl353-smc.o
2525
obj-$(CONFIG_RENESAS_RPCIF) += renesas-rpc-if.o
2626
obj-$(CONFIG_STM32_FMC2_EBI) += stm32-fmc2-ebi.o
27+
obj-$(CONFIG_STM32_OMM) += stm32_omm.o
2728

2829
obj-$(CONFIG_SAMSUNG_MC) += samsung/
2930
obj-$(CONFIG_TEGRA_MC) += tegra/

drivers/memory/bt1-l2-ctl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ static ssize_t l2_ctl_latency_show(struct device *dev,
222222
if (ret)
223223
return ret;
224224

225-
return scnprintf(buf, PAGE_SIZE, "%u\n", data);
225+
return sysfs_emit(buf, "%u\n", data);
226226
}
227227

228228
static ssize_t l2_ctl_latency_store(struct device *dev,

0 commit comments

Comments
 (0)