2017-07-28 23:19:56

by Suman Anna

[permalink] [raw]
Subject: [PATCH 0/6] Add DSP DT nodes on Keystone platforms

Hi Santosh,

The following series adds the DT nodes for the DSP devices present
on the Keystone2 66AK2H/K, 66AK2L and 66AK2E SoCs. They are disabled
in the base dts files, and enabled in the corresponding board files
alongside an added common reserved CMA pool that is used by all the
DSP devices. The bindings and driver support were added to mainline
in 4.13-rc1, and this series adds the dt portions. Nodes are added
as per bindings in
Documentation/devicetree/bindings/remoteproc/ti,keystone-rproc.txt

Validation done on K2HK EVM, K2L EVM and K2E EVM. Supported features
include basic load/boot (tested with rpmsg_client_sample) and Error
Recovery (after reverting a patch merged in 4.13-rc1 that has caused
a kernel crash, see [1]). Functionality with CMA nodes from HighMem
require a patch in the virtio_rpmsg_bus core [2].

regards
Suman

[1] http://marc.info/?l=linux-arm-kernel&m=150127179030802&w=2
[2] https://patchwork.kernel.org/patch/9549911/

Sam Nelson (3):
ARM: dts: keystone-k2hk-evm: Add and enable common DSP CMA memory pool
ARM: dts: keystone-k2l-evm: Add and enable common DSP CMA memory pool
ARM: dts: keystone-k2e-evm: Add and enable DSP CMA memory pool

Suman Anna (3):
ARM: dts: keystone-k2hk: Add DSP nodes
ARM: dts: keystone-k2l: Add DSP nodes
ARM: dts: keystone-k2e: Add DSP node

arch/arm/boot/dts/keystone-k2e-evm.dts | 18 +++++
arch/arm/boot/dts/keystone-k2e.dtsi | 20 +++++
arch/arm/boot/dts/keystone-k2hk-evm.dts | 53 ++++++++++++
arch/arm/boot/dts/keystone-k2hk.dtsi | 139 ++++++++++++++++++++++++++++++++
arch/arm/boot/dts/keystone-k2l-evm.dts | 33 ++++++++
arch/arm/boot/dts/keystone-k2l.dtsi | 71 ++++++++++++++++
6 files changed, 334 insertions(+)

--
2.13.1


2017-07-28 23:19:54

by Suman Anna

[permalink] [raw]
Subject: [PATCH 6/6] ARM: dts: keystone-k2e-evm: Add and enable DSP CMA memory pool

From: Sam Nelson <[email protected]>

A CMA memory pool reserved memory node is added, and is attached to
the DSP node through the 'memory-region' property on the K2E EVM board.
This area will be used for allocating virtio rings and buffers. This
node allows the DSP Memory Protection and Address Extension (MPAX)
module to be configured properly for the DSP processor, and matches
the values used on the other Keystone 2 boards for software
compatibility.

The reserved memory node and the user DSP node are also marked okay
to enable the DSP on the 66AK2E EVM board.

Signed-off-by: Sam Nelson <[email protected]>
Signed-off-by: Suman Anna <[email protected]>
---
arch/arm/boot/dts/keystone-k2e-evm.dts | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)

diff --git a/arch/arm/boot/dts/keystone-k2e-evm.dts b/arch/arm/boot/dts/keystone-k2e-evm.dts
index ae1ebe7ee021..f1f32c54e72f 100644
--- a/arch/arm/boot/dts/keystone-k2e-evm.dts
+++ b/arch/arm/boot/dts/keystone-k2e-evm.dts
@@ -16,6 +16,19 @@
compatible = "ti,k2e-evm", "ti,k2e", "ti,keystone";
model = "Texas Instruments Keystone 2 Edison EVM";

+ reserved-memory {
+ #address-cells = <2>;
+ #size-cells = <2>;
+ ranges;
+
+ dsp_common_memory: dsp-common-memory@81f800000 {
+ compatible = "shared-dma-pool";
+ reg = <0x00000008 0x1f800000 0x00000000 0x800000>;
+ reusable;
+ status = "okay";
+ };
+ };
+
soc {

clocks {
@@ -160,3 +173,8 @@
reg = <1>;
};
};
+
+&dsp0 {
+ memory-region = <&dsp_common_memory>;
+ status = "okay";
+};
--
2.13.1

2017-07-28 23:19:52

by Suman Anna

[permalink] [raw]
Subject: [PATCH 1/6] ARM: dts: keystone-k2hk: Add DSP nodes

The Keystone 2 66AK2H/66AK2K SoCs have upto 8 TMS320C66x DSP Core
Subsystems (C66x CorePacs), each with a 1.0 GHz or 1.2 GHz C66x
Fixed/Floating-Point DSP Core, and 32 KB of L1P & L1D SRAMs and a
1 MB L2 SRAM. Add the DT nodes for these DSP processor sub-systems.
The processors do not have an MMU, and use various IPC Generation
registers and shared memory for inter-processor communication.
The aliases with a stem 'rproc' have also been added for all the
DSPs, they provide a fixed remoteproc id to each DSP processor.

Signed-off-by: Suman Anna <[email protected]>
Signed-off-by: Sam Nelson <[email protected]>
Signed-off-by: Andrew F. Davis <[email protected]>
---
arch/arm/boot/dts/keystone-k2hk.dtsi | 139 +++++++++++++++++++++++++++++++++++
1 file changed, 139 insertions(+)

diff --git a/arch/arm/boot/dts/keystone-k2hk.dtsi b/arch/arm/boot/dts/keystone-k2hk.dtsi
index 69d449430511..31dc00e4e5fd 100644
--- a/arch/arm/boot/dts/keystone-k2hk.dtsi
+++ b/arch/arm/boot/dts/keystone-k2hk.dtsi
@@ -45,6 +45,17 @@
};
};

+ aliases {
+ rproc0 = &dsp0;
+ rproc1 = &dsp1;
+ rproc2 = &dsp2;
+ rproc3 = &dsp3;
+ rproc4 = &dsp4;
+ rproc5 = &dsp5;
+ rproc6 = &dsp6;
+ rproc7 = &dsp7;
+ };
+
soc {
/include/ "keystone-k2hk-clocks.dtsi"

@@ -134,6 +145,134 @@
gpio,syscon-dev = <&devctrl 0x25c>;
};

+ dsp0: dsp@10800000 {
+ compatible = "ti,k2hk-dsp";
+ reg = <0x10800000 0x00100000>,
+ <0x10e00000 0x00008000>,
+ <0x10f00000 0x00008000>;
+ reg-names = "l2sram", "l1pram", "l1dram";
+ clocks = <&clkgem0>;
+ ti,syscon-dev = <&devctrl 0x40>;
+ resets = <&pscrst 0>;
+ interrupt-parent = <&kirq0>;
+ interrupts = <0 8>;
+ interrupt-names = "vring", "exception";
+ kick-gpios = <&dspgpio0 27 0>;
+ status = "disabled";
+ };
+
+ dsp1: dsp@11800000 {
+ compatible = "ti,k2hk-dsp";
+ reg = <0x11800000 0x00100000>,
+ <0x11e00000 0x00008000>,
+ <0x11f00000 0x00008000>;
+ reg-names = "l2sram", "l1pram", "l1dram";
+ clocks = <&clkgem1>;
+ ti,syscon-dev = <&devctrl 0x44>;
+ resets = <&pscrst 1>;
+ interrupt-parent = <&kirq0>;
+ interrupts = <1 9>;
+ interrupt-names = "vring", "exception";
+ kick-gpios = <&dspgpio1 27 0>;
+ status = "disabled";
+ };
+
+ dsp2: dsp@12800000 {
+ compatible = "ti,k2hk-dsp";
+ reg = <0x12800000 0x00100000>,
+ <0x12e00000 0x00008000>,
+ <0x12f00000 0x00008000>;
+ reg-names = "l2sram", "l1pram", "l1dram";
+ clocks = <&clkgem2>;
+ ti,syscon-dev = <&devctrl 0x48>;
+ resets = <&pscrst 2>;
+ interrupt-parent = <&kirq0>;
+ interrupts = <2 10>;
+ interrupt-names = "vring", "exception";
+ kick-gpios = <&dspgpio2 27 0>;
+ status = "disabled";
+ };
+
+ dsp3: dsp@13800000 {
+ compatible = "ti,k2hk-dsp";
+ reg = <0x13800000 0x00100000>,
+ <0x13e00000 0x00008000>,
+ <0x13f00000 0x00008000>;
+ reg-names = "l2sram", "l1pram", "l1dram";
+ clocks = <&clkgem3>;
+ ti,syscon-dev = <&devctrl 0x4c>;
+ resets = <&pscrst 3>;
+ interrupt-parent = <&kirq0>;
+ interrupts = <3 11>;
+ interrupt-names = "vring", "exception";
+ kick-gpios = <&dspgpio3 27 0>;
+ status = "disabled";
+ };
+
+ dsp4: dsp@14800000 {
+ compatible = "ti,k2hk-dsp";
+ reg = <0x14800000 0x00100000>,
+ <0x14e00000 0x00008000>,
+ <0x14f00000 0x00008000>;
+ reg-names = "l2sram", "l1pram", "l1dram";
+ clocks = <&clkgem4>;
+ ti,syscon-dev = <&devctrl 0x50>;
+ resets = <&pscrst 4>;
+ interrupt-parent = <&kirq0>;
+ interrupts = <4 12>;
+ interrupt-names = "vring", "exception";
+ kick-gpios = <&dspgpio4 27 0>;
+ status = "disabled";
+ };
+
+ dsp5: dsp@15800000 {
+ compatible = "ti,k2hk-dsp";
+ reg = <0x15800000 0x00100000>,
+ <0x15e00000 0x00008000>,
+ <0x15f00000 0x00008000>;
+ reg-names = "l2sram", "l1pram", "l1dram";
+ clocks = <&clkgem5>;
+ ti,syscon-dev = <&devctrl 0x54>;
+ resets = <&pscrst 5>;
+ interrupt-parent = <&kirq0>;
+ interrupts = <5 13>;
+ interrupt-names = "vring", "exception";
+ kick-gpios = <&dspgpio5 27 0>;
+ status = "disabled";
+ };
+
+ dsp6: dsp@16800000 {
+ compatible = "ti,k2hk-dsp";
+ reg = <0x16800000 0x00100000>,
+ <0x16e00000 0x00008000>,
+ <0x16f00000 0x00008000>;
+ reg-names = "l2sram", "l1pram", "l1dram";
+ clocks = <&clkgem6>;
+ ti,syscon-dev = <&devctrl 0x58>;
+ resets = <&pscrst 6>;
+ interrupt-parent = <&kirq0>;
+ interrupts = <6 14>;
+ interrupt-names = "vring", "exception";
+ kick-gpios = <&dspgpio6 27 0>;
+ status = "disabled";
+ };
+
+ dsp7: dsp@17800000 {
+ compatible = "ti,k2hk-dsp";
+ reg = <0x17800000 0x00100000>,
+ <0x17e00000 0x00008000>,
+ <0x17f00000 0x00008000>;
+ reg-names = "l2sram", "l1pram", "l1dram";
+ clocks = <&clkgem7>;
+ ti,syscon-dev = <&devctrl 0x5c>;
+ resets = <&pscrst 7>;
+ interrupt-parent = <&kirq0>;
+ interrupts = <7 15>;
+ interrupt-names = "vring", "exception";
+ kick-gpios = <&dspgpio7 27 0>;
+ status = "disabled";
+ };
+
mdio: mdio@02090300 {
compatible = "ti,keystone_mdio", "ti,davinci_mdio";
#address-cells = <1>;
--
2.13.1

2017-07-28 23:20:26

by Suman Anna

[permalink] [raw]
Subject: [PATCH 5/6] ARM: dts: keystone-k2l-evm: Add and enable common DSP CMA memory pool

From: Sam Nelson <[email protected]>

A common CMA memory pool reserved memory node is added, and is attached
to all the DSP nodes through the 'memory-region' property on the 66AK2L
EVM board. This area will be used for allocating virtio rings and buffers.
The common node allows the DSP Memory Protection and Address Extension
(MPAX) module to be configured uniformly across all the DSP processors.

The reserved memory node and all the user DSP nodes are also marked okay
to enable the DSPs on the 66AK2L EVM board.

Signed-off-by: Sam Nelson <[email protected]>
Signed-off-by: Suman Anna <[email protected]>
---
arch/arm/boot/dts/keystone-k2l-evm.dts | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)

diff --git a/arch/arm/boot/dts/keystone-k2l-evm.dts b/arch/arm/boot/dts/keystone-k2l-evm.dts
index 056b42f99d7a..528667618db4 100644
--- a/arch/arm/boot/dts/keystone-k2l-evm.dts
+++ b/arch/arm/boot/dts/keystone-k2l-evm.dts
@@ -16,6 +16,19 @@
compatible = "ti,k2l-evm", "ti,k2l", "ti,keystone";
model = "Texas Instruments Keystone 2 Lamarr EVM";

+ reserved-memory {
+ #address-cells = <2>;
+ #size-cells = <2>;
+ ranges;
+
+ dsp_common_memory: dsp-common-memory@81f800000 {
+ compatible = "shared-dma-pool";
+ reg = <0x00000008 0x1f800000 0x00000000 0x800000>;
+ reusable;
+ status = "okay";
+ };
+ };
+
soc {
clocks {
refclksys: refclksys {
@@ -133,3 +146,23 @@
reg = <1>;
};
};
+
+&dsp0 {
+ memory-region = <&dsp_common_memory>;
+ status = "okay";
+};
+
+&dsp1 {
+ memory-region = <&dsp_common_memory>;
+ status = "okay";
+};
+
+&dsp2 {
+ memory-region = <&dsp_common_memory>;
+ status = "okay";
+};
+
+&dsp3 {
+ memory-region = <&dsp_common_memory>;
+ status = "okay";
+};
--
2.13.1

2017-07-28 23:20:40

by Suman Anna

[permalink] [raw]
Subject: [PATCH 2/6] ARM: dts: keystone-k2l: Add DSP nodes

The Keystone 2 66AK2L SoCs have 4 TMS320C66x DSP Core Subsystems
(C66x CorePacs), each with a 1.0 GHz or 1.2 GHz C66x Fixed /
Floating-Point DSP Core, and 32 KB of L1P & L1D SRAMs and a 1 MB
L2 SRAM. Add the DT nodes for these DSP processor sub-systems.
The processors do not have an MMU, and use various IPC Generation
registers and shared memory for inter-processor communication.
The aliases with a stem 'rproc' have also been added for all the
DSPs, they provide a fixed remoteproc id to each DSP processor.

Signed-off-by: Suman Anna <[email protected]>
Signed-off-by: Sam Nelson <[email protected]>
Signed-off-by: Andrew F. Davis <[email protected]>
---
arch/arm/boot/dts/keystone-k2l.dtsi | 71 +++++++++++++++++++++++++++++++++++++
1 file changed, 71 insertions(+)

diff --git a/arch/arm/boot/dts/keystone-k2l.dtsi b/arch/arm/boot/dts/keystone-k2l.dtsi
index 148650406cf7..4431310bc922 100644
--- a/arch/arm/boot/dts/keystone-k2l.dtsi
+++ b/arch/arm/boot/dts/keystone-k2l.dtsi
@@ -33,6 +33,13 @@
};
};

+ aliases {
+ rproc0 = &dsp0;
+ rproc1 = &dsp1;
+ rproc2 = &dsp2;
+ rproc3 = &dsp3;
+ };
+
soc {
/include/ "keystone-k2l-clocks.dtsi"

@@ -268,6 +275,70 @@
gpio,syscon-dev = <&devctrl 0x24c>;
};

+ dsp0: dsp@10800000 {
+ compatible = "ti,k2l-dsp";
+ reg = <0x10800000 0x00100000>,
+ <0x10e00000 0x00008000>,
+ <0x10f00000 0x00008000>;
+ reg-names = "l2sram", "l1pram", "l1dram";
+ clocks = <&clkgem0>;
+ ti,syscon-dev = <&devctrl 0x844>;
+ resets = <&pscrst 0>;
+ interrupt-parent = <&kirq0>;
+ interrupts = <0 8>;
+ interrupt-names = "vring", "exception";
+ kick-gpios = <&dspgpio0 27 0>;
+ status = "disabled";
+ };
+
+ dsp1: dsp@11800000 {
+ compatible = "ti,k2l-dsp";
+ reg = <0x11800000 0x00100000>,
+ <0x11e00000 0x00008000>,
+ <0x11f00000 0x00008000>;
+ reg-names = "l2sram", "l1pram", "l1dram";
+ clocks = <&clkgem1>;
+ ti,syscon-dev = <&devctrl 0x848>;
+ resets = <&pscrst 1>;
+ interrupt-parent = <&kirq0>;
+ interrupts = <1 9>;
+ interrupt-names = "vring", "exception";
+ kick-gpios = <&dspgpio1 27 0>;
+ status = "disabled";
+ };
+
+ dsp2: dsp@12800000 {
+ compatible = "ti,k2l-dsp";
+ reg = <0x12800000 0x00100000>,
+ <0x12e00000 0x00008000>,
+ <0x12f00000 0x00008000>;
+ reg-names = "l2sram", "l1pram", "l1dram";
+ clocks = <&clkgem2>;
+ ti,syscon-dev = <&devctrl 0x84c>;
+ resets = <&pscrst 2>;
+ interrupt-parent = <&kirq0>;
+ interrupts = <2 10>;
+ interrupt-names = "vring", "exception";
+ kick-gpios = <&dspgpio2 27 0>;
+ status = "disabled";
+ };
+
+ dsp3: dsp@13800000 {
+ compatible = "ti,k2l-dsp";
+ reg = <0x13800000 0x00100000>,
+ <0x13e00000 0x00008000>,
+ <0x13f00000 0x00008000>;
+ reg-names = "l2sram", "l1pram", "l1dram";
+ clocks = <&clkgem3>;
+ ti,syscon-dev = <&devctrl 0x850>;
+ resets = <&pscrst 3>;
+ interrupt-parent = <&kirq0>;
+ interrupts = <3 11>;
+ interrupt-names = "vring", "exception";
+ kick-gpios = <&dspgpio3 27 0>;
+ status = "disabled";
+ };
+
mdio: mdio@26200f00 {
compatible = "ti,keystone_mdio", "ti,davinci_mdio";
#address-cells = <1>;
--
2.13.1

2017-07-28 23:19:50

by Suman Anna

[permalink] [raw]
Subject: [PATCH 4/6] ARM: dts: keystone-k2hk-evm: Add and enable common DSP CMA memory pool

From: Sam Nelson <[email protected]>

A common CMA memory pool reserved memory node is added, and is attached
to all the DSP nodes through the 'memory-region' property on the 66AK2H
EVM board. This area will be used for allocating virtio rings and buffers.
The common node allows the DSP Memory Protection and Address Extension
(MPAX) module to be configured uniformly across all the DSP processors.

The reserved memory node and all the user DSP nodes are also marked okay
to enable the DSPs on the 66AK2K EVM board.

Signed-off-by: Sam Nelson <[email protected]>
Signed-off-by: Suman Anna <[email protected]>
---
arch/arm/boot/dts/keystone-k2hk-evm.dts | 53 +++++++++++++++++++++++++++++++++
1 file changed, 53 insertions(+)

diff --git a/arch/arm/boot/dts/keystone-k2hk-evm.dts b/arch/arm/boot/dts/keystone-k2hk-evm.dts
index 2156ff92d08f..6dd13b98aaba 100644
--- a/arch/arm/boot/dts/keystone-k2hk-evm.dts
+++ b/arch/arm/boot/dts/keystone-k2hk-evm.dts
@@ -16,6 +16,19 @@
compatible = "ti,k2hk-evm", "ti,k2hk", "ti,keystone";
model = "Texas Instruments Keystone 2 Kepler/Hawking EVM";

+ reserved-memory {
+ #address-cells = <2>;
+ #size-cells = <2>;
+ ranges;
+
+ dsp_common_memory: dsp-common-memory@81f800000 {
+ compatible = "shared-dma-pool";
+ reg = <0x00000008 0x1f800000 0x00000000 0x800000>;
+ reusable;
+ status = "okay";
+ };
+ };
+
soc {
clocks {
refclksys: refclksys {
@@ -184,3 +197,43 @@
reg = <1>;
};
};
+
+&dsp0 {
+ memory-region = <&dsp_common_memory>;
+ status = "okay";
+};
+
+&dsp1 {
+ memory-region = <&dsp_common_memory>;
+ status = "okay";
+};
+
+&dsp2 {
+ memory-region = <&dsp_common_memory>;
+ status = "okay";
+};
+
+&dsp3 {
+ memory-region = <&dsp_common_memory>;
+ status = "okay";
+};
+
+&dsp4 {
+ memory-region = <&dsp_common_memory>;
+ status = "okay";
+};
+
+&dsp5 {
+ memory-region = <&dsp_common_memory>;
+ status = "okay";
+};
+
+&dsp6 {
+ memory-region = <&dsp_common_memory>;
+ status = "okay";
+};
+
+&dsp7 {
+ memory-region = <&dsp_common_memory>;
+ status = "okay";
+};
--
2.13.1

2017-07-28 23:19:47

by Suman Anna

[permalink] [raw]
Subject: [PATCH 3/6] ARM: dts: keystone-k2e: Add DSP node

The Keystone 2 66AK2E SoC has one TMS320C66x DSP Core Subsystem
(C66x CorePac), with a 1.4 GHz C66x Fixed or Floating-Point DSP
Core, and 32 KB of L1P & L1D SRAMs and a 1 MB L2 SRAM. Add the
DT node for this DSP processor sub-system. The processor does
not have a MMU, and uses various IPC Generation registers and
shared memory for inter-processor communication. The alias with
a stem 'rproc' has also been added for the DSP, it provides a
fixed remoteproc id for the DSP processor.

Signed-off-by: Suman Anna <[email protected]>
Signed-off-by: Sam Nelson <[email protected]>
Signed-off-by: Andrew F. Davis <[email protected]>
---
arch/arm/boot/dts/keystone-k2e.dtsi | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)

diff --git a/arch/arm/boot/dts/keystone-k2e.dtsi b/arch/arm/boot/dts/keystone-k2e.dtsi
index 0dd4cdd6d40c..819ab8345916 100644
--- a/arch/arm/boot/dts/keystone-k2e.dtsi
+++ b/arch/arm/boot/dts/keystone-k2e.dtsi
@@ -45,6 +45,10 @@
};
};

+ aliases {
+ rproc0 = &dsp0;
+ };
+
soc {
/include/ "keystone-k2e-clocks.dtsi"

@@ -114,6 +118,22 @@
gpio,syscon-dev = <&devctrl 0x240>;
};

+ dsp0: dsp@10800000 {
+ compatible = "ti,k2e-dsp";
+ reg = <0x10800000 0x00080000>,
+ <0x10e00000 0x00008000>,
+ <0x10f00000 0x00008000>;
+ reg-names = "l2sram", "l1pram", "l1dram";
+ clocks = <&clkgem0>;
+ ti,syscon-dev = <&devctrl 0x844>;
+ resets = <&pscrst 0>;
+ interrupt-parent = <&kirq0>;
+ interrupts = <0 8>;
+ interrupt-names = "vring", "exception";
+ kick-gpios = <&dspgpio0 27 0>;
+ status = "disabled";
+ };
+
pcie1: pcie@21020000 {
compatible = "ti,keystone-pcie","snps,dw-pcie";
clocks = <&clkpcie1>;
--
2.13.1

2017-07-31 03:53:49

by Santosh Shilimkar

[permalink] [raw]
Subject: Re: [PATCH 0/6] Add DSP DT nodes on Keystone platforms

On 7/28/17 4:19 PM, Suman Anna wrote:
> Hi Santosh,
>
> The following series adds the DT nodes for the DSP devices present
> on the Keystone2 66AK2H/K, 66AK2L and 66AK2E SoCs. They are disabled
> in the base dts files, and enabled in the corresponding board files
> alongside an added common reserved CMA pool that is used by all the
> DSP devices. The bindings and driver support were added to mainline
> in 4.13-rc1, and this series adds the dt portions. Nodes are added
> as per bindings in
> Documentation/devicetree/bindings/remoteproc/ti,keystone-rproc.txt
>
> Validation done on K2HK EVM, K2L EVM and K2E EVM. Supported features
> include basic load/boot (tested with rpmsg_client_sample) and Error
> Recovery (after reverting a patch merged in 4.13-rc1 that has caused
> a kernel crash, see [1]). Functionality with CMA nodes from HighMem
> require a patch in the virtio_rpmsg_bus core [2].
>
Applied !!

Regards,
Santosh