Skip to contentSkip to conversation

Use mmio-sram driver for Keystone MSMC RAM

PATCH Applied Suman Anna 2 participants 11 messages Jan 6, 2017 – Jan 7, 2017

Subsystems (2)
lore
Share & tools
lore

Suman Anna

author
#0 lore raw

v2 cover Use mmio-sram driver for Keystone MSMC RAM

Hi,

The Keystone 2 family of SoCs have an on-chip RAM called the Multicore Shared Memory (MSM) RAM. This RAM is accessible through the Multicore Shared Memory Controller (MSMC). This series represents these on-chip RAMs as sram nodes so that the memory allocations can be managed by the in-kernel mmio-sram driver.

This is v2 of the previous series [1], and now includes 4 additional patches that reserve the portions of the MSMC RAM used by the Keystone Boot Monitor. The first 5 patches are essentially the same as in v1, with minor commit description updates for using the proper SoC names, but no code changes.

Patches baselined on 4.10-rc1.

regards
Suman

[1] http://marc.info/?l=linux-arm-kernel&m=147277092730387&w=2

Suman Anna (9):
ARM: dts: keystone-k2hk: Add MSM RAM node
ARM: dts: keystone-k2l: Add MSM RAM node
ARM: dts: keystone-k2e: Add MSM RAM node
ARM: dts: keystone-k2g: Add MSM RAM node
ARM: configs: keystone: Enable Generic on-chip SRAM driver
ARM: dts: keystone-k2hk: Reserve MSM RAM for boot monitor
ARM: dts: keystone-k2l: Reserve MSM RAM for boot monitor
ARM: dts: keystone-k2e: Reserve MSM RAM for boot monitor
ARM: dts: keystone-k2g: Reserve MSM RAM for boot monitor

 arch/arm/boot/dts/keystone-k2e.dtsi  | 12 ++++++++++++
 arch/arm/boot/dts/keystone-k2g.dtsi  | 12 ++++++++++++
 arch/arm/boot/dts/keystone-k2hk.dtsi | 12 ++++++++++++
 arch/arm/boot/dts/keystone-k2l.dtsi  | 12 ++++++++++++
 arch/arm/configs/keystone_defconfig  |  1 +
 5 files changed, 49 insertions(+)
Signature · 1 line
2.10.2
author
#1 lore raw

PATCH v2 1/9 ARM: dts: keystone-k2hk: Add MSM RAM node

Add the RAM managed by the Multicore Shared Memory Controller (MSMC) as a mmio-sram node. The 66AK2H SoCs have 6 MB of such memory. Any specific MSM memory range needed by a software module ought to be reserved using an appropriate child node.

---
v2: No code changes, SoC name in commit message corrected to use 66AK2H

 arch/arm/boot/dts/keystone-k2hk.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm/boot/dts/keystone-k2hk.dtsi +8 -0
index 8f67fa8df936..39e88d815235 100644
@@ -46,6 +46,14 @@
 	soc {
 		/include/ "keystone-k2hk-clocks.dtsi"
 
+		msm_ram: msmram at 0c000000 {
+			compatible = "mmio-sram";
+			reg = <0x0c000000 0x600000>;
+			ranges = <0x0 0x0c000000 0x600000>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+		};
+
 		dspgpio0: keystone_dsp_gpio at 02620240 {
 			compatible = "ti,keystone-dsp-gpio";
 			gpio-controller;
Signature · 1 line
2.10.2
author
#2 lore raw

PATCH v2 2/9 ARM: dts: keystone-k2l: Add MSM RAM node

In reply to Suman Anna

Add the RAM managed by the Multicore Shared Memory Controller (MSMC) as a mmio-sram node. The 66AK2L SoCs have 2 MB of such memory. Any specific MSM memory range needed by a software module ought to be reserved using an appropriate child node.

---
v2: No code changes, SoC name in commit message corrected to use 66AK2L

 arch/arm/boot/dts/keystone-k2l.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm/boot/dts/keystone-k2l.dtsi +8 -0
index 0c5e74e79ba2..edc08de4e196 100644
@@ -204,6 +204,14 @@
 			};
 		};
 
+		msm_ram: msmram at 0c000000 {
+			compatible = "mmio-sram";
+			reg = <0x0c000000 0x200000>;
+			ranges = <0x0 0x0c000000 0x200000>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+		};
+
 		dspgpio0: keystone_dsp_gpio at 02620240 {
 			compatible = "ti,keystone-dsp-gpio";
 			gpio-controller;
Signature · 1 line
2.10.2
author
#3 lore raw

PATCH v2 3/9 ARM: dts: keystone-k2e: Add MSM RAM node

In reply to Suman Anna

Add the RAM managed by the Multicire Shared Memory Controller (MSMC) as a mmio-sram node. The 66AK2E SoCs have 2 MB of such memory. Any specific MSM memory range needed by a software module ought to be reserved using an appropriate child node.

---
v2: No code changes, SoC name in commit message corrected to use 66AK2E

 arch/arm/boot/dts/keystone-k2e.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm/boot/dts/keystone-k2e.dtsi +8 -0
index 497c417db5b6..256dcc87f36a 100644
@@ -82,6 +82,14 @@
 			};
 		};
 
+		msm_ram: msmram at 0c000000 {
+			compatible = "mmio-sram";
+			reg = <0x0c000000 0x200000>;
+			ranges = <0x0 0x0c000000 0x200000>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+		};
+
 		dspgpio0: keystone_dsp_gpio at 02620240 {
 			compatible = "ti,keystone-dsp-gpio";
 			gpio-controller;
Signature · 1 line
2.10.2
author
#4 lore raw

PATCH v2 4/9 ARM: dts: keystone-k2g: Add MSM RAM node

In reply to Suman Anna

Add the RAM managed by the Multicore Shared Memory Controller (MSMC) as a mmio-sram node. The 66AK2G SoCs have 1 MB of such memory. Any specific MSM memory range needed by a software module ought to be reserved using an appropriate child node.

---
v2: No code changes, SoC name in commit message corrected to use 66AK2G

 arch/arm/boot/dts/keystone-k2g.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm/boot/dts/keystone-k2g.dtsi +8 -0
index 63c7cf0c6b6d..e63e57e03b7c 100644
@@ -77,6 +77,14 @@
 		ranges = <0x0 0x0 0x0 0xc0000000>;
 		dma-ranges = <0x80000000 0x8 0x00000000 0x80000000>;
 
+		msm_ram: msmram at 0c000000 {
+			compatible = "mmio-sram";
+			reg = <0x0c000000 0x100000>;
+			ranges = <0x0 0x0c000000 0x100000>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+		};
+
 		k2g_pinctrl: pinmux at 02621000 {
 			compatible = "pinctrl-single";
 			reg = <0x02621000 0x410>;
Signature · 1 line
2.10.2
author
#5 lore raw

PATCH v2 5/9 ARM: configs: keystone: Enable Generic on-chip SRAM driver

In reply to Suman Anna

All the Keystone 2 SoCs have an on-chip RAM called the MultiCore Shared Memory (MSM) RAM managed by the Multicore Shared Memory Controller (MSMC) that provides faster access compared to normal DDR.

This patch enables the Generic on-chip SRAM driver that manages this memory in software.

---
v2: No changes

 arch/arm/configs/keystone_defconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm/configs/keystone_defconfig +1 -0
index 78cd2f197e01..1331f6dc456a 100644
@@ -126,6 +126,7 @@ CONFIG_MTD_NAND_DAVINCI=y
 CONFIG_MTD_SPI_NOR=y
 CONFIG_MTD_UBI=y
 CONFIG_BLK_DEV_LOOP=y
+CONFIG_SRAM=y
 CONFIG_EEPROM_AT24=y
 CONFIG_SCSI=y
 CONFIG_BLK_DEV_SD=y
Signature · 1 line
2.10.2
author
#6 lore raw

PATCH v2 6/9 ARM: dts: keystone-k2hk: Reserve MSM RAM for boot monitor

In reply to Suman Anna

The Keystone 2 boot monitor uses 32 KB of the MSM RAM @ 0x0c5f0000 on 66AK2H SoCs, so add a reserved child node for the same.

This address is aligned to the values used within the latest boot monitor firmware [1] as of commit cf8b431e8b3b ("soc: Move load address to end of MSMC").

[1] git://git.ti.com/processor-firmware/ks2-boot-monitor.git

---
 arch/arm/boot/dts/keystone-k2hk.dtsi | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/boot/dts/keystone-k2hk.dtsi +4 -0
index 39e88d815235..e0780f111537 100644
@@ -52,6 +52,10 @@
 			ranges = <0x0 0x0c000000 0x600000>;
 			#address-cells = <1>;
 			#size-cells = <1>;
+
+			sram-bm at 5f0000 {
+				reg = <0x5f0000 0x8000>;
+			};
 		};
 
 		dspgpio0: keystone_dsp_gpio at 02620240 {
Signature · 1 line
2.10.2
author
#7 lore raw

PATCH v2 7/9 ARM: dts: keystone-k2l: Reserve MSM RAM for boot monitor

In reply to Suman Anna

The Keystone 2 boot monitor uses 32 KB of the MSM RAM @ 0x0c1f8000 on 66AK2L SoCs, so add a reserved child node for the same.

This address is aligned to the values used within the latest boot monitor firmware [1] as of commit cf8b431e8b3b ("soc: Move load address to end of MSMC").

[1] git://git.ti.com/processor-firmware/ks2-boot-monitor.git

---
 arch/arm/boot/dts/keystone-k2l.dtsi | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/boot/dts/keystone-k2l.dtsi +4 -0
index edc08de4e196..b58015737a35 100644
@@ -210,6 +210,10 @@
 			ranges = <0x0 0x0c000000 0x200000>;
 			#address-cells = <1>;
 			#size-cells = <1>;
+
+			sram-bm at 1f8000 {
+				reg = <0x001f8000 0x8000>;
+			};
 		};
 
 		dspgpio0: keystone_dsp_gpio at 02620240 {
Signature · 1 line
2.10.2
author
#8 lore raw

PATCH v2 8/9 ARM: dts: keystone-k2e: Reserve MSM RAM for boot monitor

In reply to Suman Anna

The Keystone 2 boot monitor uses 32 KB of the MSM RAM @ 0x0c1f0000 on 66AK2E SoCs, so add a reserved child node for the same.

This address is aligned to the values used within the latest boot monitor firmware [1] as of commit cf8b431e8b3b ("soc: Move load address to end of MSMC").

[1] git://git.ti.com/processor-firmware/ks2-boot-monitor.git

---
 arch/arm/boot/dts/keystone-k2e.dtsi | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/boot/dts/keystone-k2e.dtsi +4 -0
index 256dcc87f36a..9d1d8a64d10e 100644
@@ -88,6 +88,10 @@
 			ranges = <0x0 0x0c000000 0x200000>;
 			#address-cells = <1>;
 			#size-cells = <1>;
+
+			sram-bm at 1f0000 {
+				reg = <0x001f0000 0x8000>;
+			};
 		};
 
 		dspgpio0: keystone_dsp_gpio at 02620240 {
Signature · 1 line
2.10.2
author
#9 lore raw

PATCH v2 9/9 ARM: dts: keystone-k2g: Reserve MSM RAM for boot monitor

In reply to Suman Anna

The Keystone 2 boot monitor uses 32 KB of the MSM RAM @ 0x0c0f7000 on 66AK2G SoCs, so add a reserved child node for the same.

This address is aligned to the values used within the latest boot monitor firmware [1] as of commit cf8b431e8b3b ("soc: Move load address to end of MSMC").

[1] git://git.ti.com/processor-firmware/ks2-boot-monitor.git

---
 arch/arm/boot/dts/keystone-k2g.dtsi | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/boot/dts/keystone-k2g.dtsi +4 -0
index e63e57e03b7c..c36d168bc874 100644
@@ -83,6 +83,10 @@
 			ranges = <0x0 0x0c000000 0x100000>;
 			#address-cells = <1>;
 			#size-cells = <1>;
+
+			sram-bm at f7000 {
+				reg = <0x000f7000 0x8000>;
+			};
 		};
 
 		k2g_pinctrl: pinmux at 02621000 {
Signature · 1 line
2.10.2
#10 lore raw
In reply to Suman Anna
Quoted 8 lines · Suman Anna

Hi,

The Keystone 2 family of SoCs have an on-chip RAM called the Multicore Shared Memory (MSM) RAM. This RAM is accessible through the Multicore Shared Memory Controller (MSMC). This series represents these on-chip RAMs as sram nodes so that the memory allocations can be managed by the in-kernel mmio-sram driver.

Quoted 8 lines

This is v2 of the previous series [1], and now includes 4 additional patches that reserve the portions of the MSMC RAM used by the Keystone Boot Monitor. The first 5 patches are essentially the same as in v1, with minor commit description updates for using the proper SoC names, but no code changes.

Patches baselined on 4.10-rc1.

Applied. Should start showing up next soon. thanks !!

Regards,
Santosh