Re: [PATCH v3] configs: arm64: add emmc inmate configuration for k3-am654-idk

2022-03-14 Thread Jan Kiszka
On 14.03.22 07:19, 'Matt Ranostay' via Jailhouse wrote:
> Add eMMC support for k3-am654-idk in a linux inmate cell using
> ENABLE_INMATE_CELL_EMMC macro, and respective device tree changes
> 
> Signed-off-by: Matt Ranostay 
> ---
> Changes from v1:
> * Split out eMMC enablement to its own inmate configuration
> 
> Changes from v2:
> * Recombined eMMC enablement to one configuration that is enabled
>   with ENABLE_INMATE_CELL_EMMC define
> * Dropped patches that were already merged
> 
>  .../arm64/dts/inmate-k3-am654-idk-emmc.dts| 45 +++
>  configs/arm64/k3-am654-idk-linux-demo.c   | 22 -
>  2 files changed, 66 insertions(+), 1 deletion(-)
>  create mode 100644 configs/arm64/dts/inmate-k3-am654-idk-emmc.dts
> 
> diff --git a/configs/arm64/dts/inmate-k3-am654-idk-emmc.dts 
> b/configs/arm64/dts/inmate-k3-am654-idk-emmc.dts
> new file mode 100644
> index ..150e31fe
> --- /dev/null
> +++ b/configs/arm64/dts/inmate-k3-am654-idk-emmc.dts
> @@ -0,0 +1,45 @@
> +/dts-v1/;
> +
> +#include "inmate-k3-am654-idk.dts"
> +
> +/ {
> + sdhci0: mmc@4f8 {
> + compatible = "ti,am654-sdhci-5.1";
> + reg = <0x0 0x4f8 0x0 0x260>, <0x0 0x4f9 0x0 0x134>;
> + power-domains = <_pds 47 1>;
> + clocks = <_clks 47 0>, <_clks 47 1>;
> + clock-names = "clk_ahb", "clk_xin";
> + interrupts = ;
> + mmc-ddr-1_8v;
> + mmc-hs200-1_8v;
> + ti,otap-del-sel-legacy = <0x0>;
> + ti,otap-del-sel-mmc-hs = <0x0>;
> + ti,otap-del-sel-sd-hs = <0x0>;
> + ti,otap-del-sel-sdr12 = <0x0>;
> + ti,otap-del-sel-sdr25 = <0x0>;
> + ti,otap-del-sel-sdr50 = <0x8>;
> + ti,otap-del-sel-sdr104 = <0x7>;
> + ti,otap-del-sel-ddr50 = <0x5>;
> + ti,otap-del-sel-ddr52 = <0x5>;
> + ti,otap-del-sel-hs200 = <0x5>;
> + ti,otap-del-sel-hs400 = <0x0>;
> + ti,trm-icp = <0x8>;
> + dma-coherent;
> + };
> +};
> +
> +_uart0 {
> + power-domains = <_pds 149 1>;
> +};
> +
> +_pds {
> + #power-domain-cells = <2>;
> +};
> +
> + {
> + /* eMMC */
> + non-removable;
> + ti,driver-strength-ohm = <50>;
> + bus-width = <8>;
> + disable-wp;
> +};
> diff --git a/configs/arm64/k3-am654-idk-linux-demo.c 
> b/configs/arm64/k3-am654-idk-linux-demo.c
> index fdf5fea8..844554a7 100644
> --- a/configs/arm64/k3-am654-idk-linux-demo.c
> +++ b/configs/arm64/k3-am654-idk-linux-demo.c
> @@ -23,7 +23,7 @@
>  struct {
>   struct jailhouse_cell_desc cell;
>   __u64 cpus[1];
> - struct jailhouse_memory mem_regions[17];
> + struct jailhouse_memory mem_regions[19];

This does not give warnings if emmc is off? If not, I'm still not sure
right now if Jailhouse handles Null memregions well. Should at least be
tested. configs/x86/linux-x86-demo.c does that differently, though.

>   struct jailhouse_irqchip irqchips[3];
>   struct jailhouse_pci_device pci_devices[2];
>  } __attribute__((packed)) config = {
> @@ -112,6 +112,22 @@ struct {
>   .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
>   JAILHOUSE_MEM_IO,
>   },
> +#ifdef ENABLE_INMATE_CELL_EMMC

CONFIG_AM654_INMATE_CELL_EMMC

> + /* sdhci0 */ {
> + .phys_start = 0x4f8,
> + .virt_start = 0x4f8,
> + .size = 0x1000,
> + .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
> + JAILHOUSE_MEM_IO,
> + },
> + /* sdhci0 */ {
> + .phys_start = 0x4f9,
> + .virt_start = 0x4f9,
> + .size = 0x1000,
> + .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
> + JAILHOUSE_MEM_IO,
> + },
> +#endif
>   /* main sproxy target_data host_id=A53_3 */ {
>   .phys_start = 0x3240f000,
>   .virt_start = 0x3240f000,
> @@ -153,6 +169,10 @@ struct {
>   .address = 0x0180,
>   .pin_base = 160,
>   .pin_bitmap = {
> +#ifdef ENABLE_INMATE_CELL_EMMC
> + /* sdhc */
> + 1 << (168 - 160) |
> +#endif
>   /* vpci */
>   1 << (189 - 160) |
>   1 << (190 - 160),

Jan

-- 
Siemens AG, Technology
Competence Center Embedded Linux

-- 
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jailhouse-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jailhouse-dev/495ff8d1-23e1-6c5c-dceb-de7200eb05b5%40siemens.com.


[PATCH v3] configs: arm64: add emmc inmate configuration for k3-am654-idk

2022-03-14 Thread 'Matt Ranostay' via Jailhouse
Add eMMC support for k3-am654-idk in a linux inmate cell using
ENABLE_INMATE_CELL_EMMC macro, and respective device tree changes

Signed-off-by: Matt Ranostay 
---
Changes from v1:
* Split out eMMC enablement to its own inmate configuration

Changes from v2:
* Recombined eMMC enablement to one configuration that is enabled
  with ENABLE_INMATE_CELL_EMMC define
* Dropped patches that were already merged

 .../arm64/dts/inmate-k3-am654-idk-emmc.dts| 45 +++
 configs/arm64/k3-am654-idk-linux-demo.c   | 22 -
 2 files changed, 66 insertions(+), 1 deletion(-)
 create mode 100644 configs/arm64/dts/inmate-k3-am654-idk-emmc.dts

diff --git a/configs/arm64/dts/inmate-k3-am654-idk-emmc.dts 
b/configs/arm64/dts/inmate-k3-am654-idk-emmc.dts
new file mode 100644
index ..150e31fe
--- /dev/null
+++ b/configs/arm64/dts/inmate-k3-am654-idk-emmc.dts
@@ -0,0 +1,45 @@
+/dts-v1/;
+
+#include "inmate-k3-am654-idk.dts"
+
+/ {
+   sdhci0: mmc@4f8 {
+   compatible = "ti,am654-sdhci-5.1";
+   reg = <0x0 0x4f8 0x0 0x260>, <0x0 0x4f9 0x0 0x134>;
+   power-domains = <_pds 47 1>;
+   clocks = <_clks 47 0>, <_clks 47 1>;
+   clock-names = "clk_ahb", "clk_xin";
+   interrupts = ;
+   mmc-ddr-1_8v;
+   mmc-hs200-1_8v;
+   ti,otap-del-sel-legacy = <0x0>;
+   ti,otap-del-sel-mmc-hs = <0x0>;
+   ti,otap-del-sel-sd-hs = <0x0>;
+   ti,otap-del-sel-sdr12 = <0x0>;
+   ti,otap-del-sel-sdr25 = <0x0>;
+   ti,otap-del-sel-sdr50 = <0x8>;
+   ti,otap-del-sel-sdr104 = <0x7>;
+   ti,otap-del-sel-ddr50 = <0x5>;
+   ti,otap-del-sel-ddr52 = <0x5>;
+   ti,otap-del-sel-hs200 = <0x5>;
+   ti,otap-del-sel-hs400 = <0x0>;
+   ti,trm-icp = <0x8>;
+   dma-coherent;
+   };
+};
+
+_uart0 {
+   power-domains = <_pds 149 1>;
+};
+
+_pds {
+   #power-domain-cells = <2>;
+};
+
+ {
+   /* eMMC */
+   non-removable;
+   ti,driver-strength-ohm = <50>;
+   bus-width = <8>;
+   disable-wp;
+};
diff --git a/configs/arm64/k3-am654-idk-linux-demo.c 
b/configs/arm64/k3-am654-idk-linux-demo.c
index fdf5fea8..844554a7 100644
--- a/configs/arm64/k3-am654-idk-linux-demo.c
+++ b/configs/arm64/k3-am654-idk-linux-demo.c
@@ -23,7 +23,7 @@
 struct {
struct jailhouse_cell_desc cell;
__u64 cpus[1];
-   struct jailhouse_memory mem_regions[17];
+   struct jailhouse_memory mem_regions[19];
struct jailhouse_irqchip irqchips[3];
struct jailhouse_pci_device pci_devices[2];
 } __attribute__((packed)) config = {
@@ -112,6 +112,22 @@ struct {
.flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
JAILHOUSE_MEM_IO,
},
+#ifdef ENABLE_INMATE_CELL_EMMC
+   /* sdhci0 */ {
+   .phys_start = 0x4f8,
+   .virt_start = 0x4f8,
+   .size = 0x1000,
+   .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
+   JAILHOUSE_MEM_IO,
+   },
+   /* sdhci0 */ {
+   .phys_start = 0x4f9,
+   .virt_start = 0x4f9,
+   .size = 0x1000,
+   .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
+   JAILHOUSE_MEM_IO,
+   },
+#endif
/* main sproxy target_data host_id=A53_3 */ {
.phys_start = 0x3240f000,
.virt_start = 0x3240f000,
@@ -153,6 +169,10 @@ struct {
.address = 0x0180,
.pin_base = 160,
.pin_bitmap = {
+#ifdef ENABLE_INMATE_CELL_EMMC
+   /* sdhc */
+   1 << (168 - 160) |
+#endif
/* vpci */
1 << (189 - 160) |
1 << (190 - 160),
-- 
2.30.2

-- 
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jailhouse-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jailhouse-dev/20220314061938.3304-1-mranostay%40ti.com.