[RESEND PATCH v2] board: gateworks: venice: add imx8mn-gw7902 support

2022-01-10 Thread Tim Harvey
The GW7902 is based on the i.MX 8M Mini / Nano SoC featuring:
 - LPDDR4 DRAM
 - eMMC FLASH
 - Gateworks System Controller
 - LTE CAT M1 modem
 - USB 2.0 HUB
 - M.2 Socket with USB2.0, PCIe, and dual-SIM
 - IMX8M FEC
 - PCIe based GbE
 - RS232/RS485/RS422 serial transceiver
 - GPS
 - CAN bus
 - WiFi / Bluetooth
 - MIPI header (DSI/CSI/GPIO/PWM/I2S)
 - PMIC

To add support for the i.MX8M Nano GW7902:
 - Add imx8mn-venice dts/defconfig/include
 - Add imx8mn-gw7902 dts
 - Add imx8mn-2gb lpddr4 dram configs
 - Add misc support for IMX8M Nano SoC
 - rename imx8mm-venice.c to venice.c as it is no longer imx8mm specific
 - update README with differences for IMX8MN vs IMX8MM

Signed-off-by: Tim Harvey 
---
v2:
 - resend due to patch missing from patchwork
 - rebase on origin/master
 - remove unused fdt_pack_reg function
---
 arch/arm/dts/Makefile |2 +
 arch/arm/dts/imx8mn-venice-gw7902-u-boot.dtsi |   29 +
 arch/arm/dts/imx8mn-venice-gw7902.dts |  888 ++
 arch/arm/dts/imx8mn-venice-u-boot.dtsi|  222 +++
 arch/arm/dts/imx8mn-venice.dts|  152 ++
 arch/arm/mach-imx/imx8m/Kconfig   |7 +
 board/gateworks/venice/Kconfig|   15 +
 board/gateworks/venice/MAINTAINERS|6 +-
 board/gateworks/venice/Makefile   |   10 +-
 board/gateworks/venice/README |3 +-
 board/gateworks/venice/gsc.c  |   13 +
 .../gateworks/venice/imximage-8mn-lpddr4.cfg  |   10 +
 board/gateworks/venice/lpddr4_timing.h|5 +
 ...lpddr4_timing.c => lpddr4_timing_imx8mm.c} |0
 .../lpddr4_timing_imx8mn_2gb_dual_die.c   | 1444 
 .../lpddr4_timing_imx8mn_2gb_single_die.c | 1445 +
 board/gateworks/venice/spl.c  |   31 +-
 .../venice/{imx8mm_venice.c => venice.c}  |0
 configs/imx8mn_venice_defconfig   |  114 ++
 include/configs/imx8mn_venice.h   |  114 ++
 20 files changed, 4503 insertions(+), 7 deletions(-)
 create mode 100644 arch/arm/dts/imx8mn-venice-gw7902-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx8mn-venice-gw7902.dts
 create mode 100644 arch/arm/dts/imx8mn-venice-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx8mn-venice.dts
 create mode 100644 board/gateworks/venice/imximage-8mn-lpddr4.cfg
 rename board/gateworks/venice/{lpddr4_timing.c => lpddr4_timing_imx8mm.c} 
(100%)
 create mode 100644 board/gateworks/venice/lpddr4_timing_imx8mn_2gb_dual_die.c
 create mode 100644 board/gateworks/venice/lpddr4_timing_imx8mn_2gb_single_die.c
 rename board/gateworks/venice/{imx8mm_venice.c => venice.c} (100%)
 create mode 100644 configs/imx8mn_venice_defconfig
 create mode 100644 include/configs/imx8mn_venice.h

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index b3e2a9c9d77b..d1a6667953f1 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -903,6 +903,8 @@ dtb-$(CONFIG_ARCH_IMX8M) += \
imx8mn-ddr4-evk.dtb \
imx8mq-cm.dtb \
imx8mn-evk.dtb \
+   imx8mn-venice.dtb \
+   imx8mn-venice-gw7902.dtb \
imx8mq-evk.dtb \
imx8mm-beacon-kit.dtb \
imx8mn-beacon-kit.dtb \
diff --git a/arch/arm/dts/imx8mn-venice-gw7902-u-boot.dtsi 
b/arch/arm/dts/imx8mn-venice-gw7902-u-boot.dtsi
new file mode 100644
index ..f6f0aa7cb5c0
--- /dev/null
+++ b/arch/arm/dts/imx8mn-venice-gw7902-u-boot.dtsi
@@ -0,0 +1,29 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2021 Gateworks Corporation
+ */
+
+#include "imx8mn-venice-u-boot.dtsi"
+
+ {
+   phy-reset-gpios = < 10 GPIO_ACTIVE_LOW>;
+   phy-reset-duration = <1>;
+   phy-reset-post-delay = <1>;
+};
+
+_fec1 {
+   u-boot,dm-spl;
+};
+
+&{/soc@0/bus@3080/i2c@30a2/pmic@4b} {
+   u-boot,dm-spl;
+};
+
+&{/soc@0/bus@3080/i2c@30a2/pmic@4b/regulators} {
+   u-boot,dm-spl;
+};
+
+_pmic {
+   u-boot,dm-spl;
+};
+
diff --git a/arch/arm/dts/imx8mn-venice-gw7902.dts 
b/arch/arm/dts/imx8mn-venice-gw7902.dts
new file mode 100644
index ..06ee4cf79480
--- /dev/null
+++ b/arch/arm/dts/imx8mn-venice-gw7902.dts
@@ -0,0 +1,888 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright 2021 Gateworks Corporation
+ */
+
+/dts-v1/;
+
+#include 
+#include 
+#include 
+#include 
+
+#include "imx8mn.dtsi"
+
+/ {
+   model = "Gateworks Venice GW7902 i.MX8MN board";
+   compatible = "gw,imx8mn-gw7902", "fsl,imx8mn";
+
+   aliases {
+   usb0 = 
+   };
+
+   chosen {
+   stdout-path = 
+   };
+
+   memory@4000 {
+   device_type = "memory";
+   reg = <0x0 0x4000 0 0x8000>;
+   };
+
+   can20m: can20m {
+   compatible = "fixed-clock";
+   #clock-cells = <0>;
+   clock-frequency = <2000>;
+   clock-output-names = "can20m";
+   };
+
+   gpio-keys {
+   compatible = "gpio-keys";
+
+

Re: [PATCH v2] board: gateworks: venice: add imx8mn-gw7902 support

2021-10-15 Thread Jan Kiszka
On 15.10.21 19:06, Tim Harvey wrote:
> A grep for SERIAL_SUPPORT (which was renamed to SERIAL) shows all the
> boards in your master-next that got merged like mine that currently
> likely need fixups:
> $ git grep SERIAL_SUPPORT configs/
> configs/imx8mm-cl-iot-gate-optee_defconfig:CONFIG_SPL_SERIAL_SUPPORT=y
> configs/imx8mn_venice_defconfig:CONFIG_SPL_SERIAL_SUPPORT=y
> configs/iot2050_defconfig:CONFIG_SPL_SERIAL_SUPPORT=y

Thanks, but this board was already fixed in master (ce543d0d).

Jan

-- 
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux


Re: [PATCH v2] board: gateworks: venice: add imx8mn-gw7902 support

2021-10-15 Thread Tim Harvey
On Wed, Oct 6, 2021 at 4:45 PM Tim Harvey  wrote:
>
> The GW7902 is based on the i.MX 8M Mini / Nano SoC featuring:
>  - LPDDR4 DRAM
>  - eMMC FLASH
>  - Gateworks System Controller
>  - LTE CAT M1 modem
>  - USB 2.0 HUB
>  - M.2 Socket with USB2.0, PCIe, and dual-SIM
>  - IMX8M FEC
>  - PCIe based GbE
>  - RS232/RS485/RS422 serial transceiver
>  - GPS
>  - CAN bus
>  - WiFi / Bluetooth
>  - MIPI header (DSI/CSI/GPIO/PWM/I2S)
>  - PMIC
>
> To add support for the i.MX8M Nano GW7902:
>  - Add imx8mn-venice dts/defconfig/include
>  - Add imx8mn-gw7902 dts
>  - Add imx8mn-2gb lpddr4 dram configs
>  - Add misc support for IMX8M Nano SoC
>  - rename imx8mm-venice.c to venice.c as it is no longer imx8mm specific
>  - update README with differences for IMX8MN vs IMX8MM
>
> Signed-off-by: Tim Harvey 
> ---
> v2:
>  - rebase on origin/master
>  - remove unused fdt_pack_reg function
> ---
>  arch/arm/dts/Makefile |2 +
>  arch/arm/dts/imx8mn-venice-gw7902-u-boot.dtsi |   29 +
>  arch/arm/dts/imx8mn-venice-gw7902.dts |  888 ++
>  arch/arm/dts/imx8mn-venice-u-boot.dtsi|  222 +++
>  arch/arm/dts/imx8mn-venice.dts|  152 ++
>  arch/arm/mach-imx/imx8m/Kconfig   |7 +
>  board/gateworks/venice/Kconfig|   15 +
>  board/gateworks/venice/MAINTAINERS|6 +-
>  board/gateworks/venice/Makefile   |   10 +-
>  board/gateworks/venice/README |3 +-
>  board/gateworks/venice/gsc.c  |   13 +
>  .../gateworks/venice/imximage-8mn-lpddr4.cfg  |   10 +
>  board/gateworks/venice/lpddr4_timing.h|5 +
>  ...lpddr4_timing.c => lpddr4_timing_imx8mm.c} |0
>  .../lpddr4_timing_imx8mn_2gb_dual_die.c   | 1444 
>  .../lpddr4_timing_imx8mn_2gb_single_die.c | 1445 +
>  board/gateworks/venice/spl.c  |   31 +-
>  .../venice/{imx8mm_venice.c => venice.c}  |0
>  configs/imx8mn_venice_defconfig   |  114 ++
>  include/configs/imx8mn_venice.h   |  114 ++
>  20 files changed, 4503 insertions(+), 7 deletions(-)
>  create mode 100644 arch/arm/dts/imx8mn-venice-gw7902-u-boot.dtsi
>  create mode 100644 arch/arm/dts/imx8mn-venice-gw7902.dts
>  create mode 100644 arch/arm/dts/imx8mn-venice-u-boot.dtsi
>  create mode 100644 arch/arm/dts/imx8mn-venice.dts
>  create mode 100644 board/gateworks/venice/imximage-8mn-lpddr4.cfg
>  rename board/gateworks/venice/{lpddr4_timing.c => lpddr4_timing_imx8mm.c} 
> (100%)
>  create mode 100644 board/gateworks/venice/lpddr4_timing_imx8mn_2gb_dual_die.c
>  create mode 100644 
> board/gateworks/venice/lpddr4_timing_imx8mn_2gb_single_die.c
>  rename board/gateworks/venice/{imx8mm_venice.c => venice.c} (100%)
>  create mode 100644 configs/imx8mn_venice_defconfig
>  create mode 100644 include/configs/imx8mn_venice.h
>

Stefano,

I noticed you have applied my first version of this patch into your
imx master-next tree which is now broken because of some other patches
that required it to be rebased:
7abf178bb815 power: Tidy up #undef of CONFIG_DM_PMIC
2a7360666871 serial: Rename SERIAL_SUPPORT to SERIAL
103c5f180694 mmc: Rename MMC_SUPPORT to MMC
7cfbba36e9f8 Convert CONFIG_SYS_MALLOC_LEN to Kconfig
148b8bb4b6bd imx: Finish migration of IMX_CONFIG to Kconfig
49c8ef0e45a9 Convert CONFIG_SYS_LOAD_ADDR to Kconfig
72d81360aabd global: Convert CONFIG_LOADADDR to CONFIG_SYS_LOADADDR
15e7b7682474 Convert CONFIG_SYS_I2C_MXC et al to Kconfig

This v2 patch here was rebased on top of origin/master to take care of this.

A grep for SERIAL_SUPPORT (which was renamed to SERIAL) shows all the
boards in your master-next that got merged like mine that currently
likely need fixups:
$ git grep SERIAL_SUPPORT configs/
configs/imx8mm-cl-iot-gate-optee_defconfig:CONFIG_SPL_SERIAL_SUPPORT=y
configs/imx8mn_venice_defconfig:CONFIG_SPL_SERIAL_SUPPORT=y
configs/iot2050_defconfig:CONFIG_SPL_SERIAL_SUPPORT=y
configs/kontron-sl-mx6ul_defconfig:CONFIG_SPL_SERIAL_SUPPORT=y
configs/kontron-sl-mx8mm_defconfig:CONFIG_SPL_SERIAL_SUPPORT=y

A quick test shows all the above with the exception of perhaps
iot2050_defconfig are not buildable.

How do you wish us to proceed? I have a set of patches that I can
submit to resolve this but I'm not clear if I should squash them and
if you should perhaps squash them into the original commit before
requesting a git pull to master?
imx8mn_venice: fix SERIAL
imx8mn_venice: fix MMC_SUPPORT
imx8mn_venice: fix SYS_MALLOC_LEN
imx8mn-venice: fix IMX_CONFIG
imx8mn_venice: fix loadaddr
imx8mn-venice: fix I2C

Or should you revert and instead apply this v2 version that takes care
of these things?

What are your plans for requesting a git pull to master?

Best regards,

Tim
[1] https://source.denx.de/u-boot/custodians/u-boot-imx/-/tree/master-next


> --
> 2.17.1
>


[PATCH v2] board: gateworks: venice: add imx8mn-gw7902 support

2021-10-06 Thread Tim Harvey
The GW7902 is based on the i.MX 8M Mini / Nano SoC featuring:
 - LPDDR4 DRAM
 - eMMC FLASH
 - Gateworks System Controller
 - LTE CAT M1 modem
 - USB 2.0 HUB
 - M.2 Socket with USB2.0, PCIe, and dual-SIM
 - IMX8M FEC
 - PCIe based GbE
 - RS232/RS485/RS422 serial transceiver
 - GPS
 - CAN bus
 - WiFi / Bluetooth
 - MIPI header (DSI/CSI/GPIO/PWM/I2S)
 - PMIC

To add support for the i.MX8M Nano GW7902:
 - Add imx8mn-venice dts/defconfig/include
 - Add imx8mn-gw7902 dts
 - Add imx8mn-2gb lpddr4 dram configs
 - Add misc support for IMX8M Nano SoC
 - rename imx8mm-venice.c to venice.c as it is no longer imx8mm specific
 - update README with differences for IMX8MN vs IMX8MM

Signed-off-by: Tim Harvey 
---
v2:
 - rebase on origin/master
 - remove unused fdt_pack_reg function
---
 arch/arm/dts/Makefile |2 +
 arch/arm/dts/imx8mn-venice-gw7902-u-boot.dtsi |   29 +
 arch/arm/dts/imx8mn-venice-gw7902.dts |  888 ++
 arch/arm/dts/imx8mn-venice-u-boot.dtsi|  222 +++
 arch/arm/dts/imx8mn-venice.dts|  152 ++
 arch/arm/mach-imx/imx8m/Kconfig   |7 +
 board/gateworks/venice/Kconfig|   15 +
 board/gateworks/venice/MAINTAINERS|6 +-
 board/gateworks/venice/Makefile   |   10 +-
 board/gateworks/venice/README |3 +-
 board/gateworks/venice/gsc.c  |   13 +
 .../gateworks/venice/imximage-8mn-lpddr4.cfg  |   10 +
 board/gateworks/venice/lpddr4_timing.h|5 +
 ...lpddr4_timing.c => lpddr4_timing_imx8mm.c} |0
 .../lpddr4_timing_imx8mn_2gb_dual_die.c   | 1444 
 .../lpddr4_timing_imx8mn_2gb_single_die.c | 1445 +
 board/gateworks/venice/spl.c  |   31 +-
 .../venice/{imx8mm_venice.c => venice.c}  |0
 configs/imx8mn_venice_defconfig   |  114 ++
 include/configs/imx8mn_venice.h   |  114 ++
 20 files changed, 4503 insertions(+), 7 deletions(-)
 create mode 100644 arch/arm/dts/imx8mn-venice-gw7902-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx8mn-venice-gw7902.dts
 create mode 100644 arch/arm/dts/imx8mn-venice-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx8mn-venice.dts
 create mode 100644 board/gateworks/venice/imximage-8mn-lpddr4.cfg
 rename board/gateworks/venice/{lpddr4_timing.c => lpddr4_timing_imx8mm.c} 
(100%)
 create mode 100644 board/gateworks/venice/lpddr4_timing_imx8mn_2gb_dual_die.c
 create mode 100644 board/gateworks/venice/lpddr4_timing_imx8mn_2gb_single_die.c
 rename board/gateworks/venice/{imx8mm_venice.c => venice.c} (100%)
 create mode 100644 configs/imx8mn_venice_defconfig
 create mode 100644 include/configs/imx8mn_venice.h

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 9438bf735a..a338814d2c 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -881,6 +881,8 @@ dtb-$(CONFIG_ARCH_IMX8M) += \
imx8mn-ddr4-evk.dtb \
imx8mq-cm.dtb \
imx8mn-evk.dtb \
+   imx8mn-venice.dtb \
+   imx8mn-venice-gw7902.dtb \
imx8mq-evk.dtb \
imx8mm-beacon-kit.dtb \
imx8mn-beacon-kit.dtb \
diff --git a/arch/arm/dts/imx8mn-venice-gw7902-u-boot.dtsi 
b/arch/arm/dts/imx8mn-venice-gw7902-u-boot.dtsi
new file mode 100644
index 00..f6f0aa7cb5
--- /dev/null
+++ b/arch/arm/dts/imx8mn-venice-gw7902-u-boot.dtsi
@@ -0,0 +1,29 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2021 Gateworks Corporation
+ */
+
+#include "imx8mn-venice-u-boot.dtsi"
+
+ {
+   phy-reset-gpios = < 10 GPIO_ACTIVE_LOW>;
+   phy-reset-duration = <1>;
+   phy-reset-post-delay = <1>;
+};
+
+_fec1 {
+   u-boot,dm-spl;
+};
+
+&{/soc@0/bus@3080/i2c@30a2/pmic@4b} {
+   u-boot,dm-spl;
+};
+
+&{/soc@0/bus@3080/i2c@30a2/pmic@4b/regulators} {
+   u-boot,dm-spl;
+};
+
+_pmic {
+   u-boot,dm-spl;
+};
+
diff --git a/arch/arm/dts/imx8mn-venice-gw7902.dts 
b/arch/arm/dts/imx8mn-venice-gw7902.dts
new file mode 100644
index 00..06ee4cf794
--- /dev/null
+++ b/arch/arm/dts/imx8mn-venice-gw7902.dts
@@ -0,0 +1,888 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright 2021 Gateworks Corporation
+ */
+
+/dts-v1/;
+
+#include 
+#include 
+#include 
+#include 
+
+#include "imx8mn.dtsi"
+
+/ {
+   model = "Gateworks Venice GW7902 i.MX8MN board";
+   compatible = "gw,imx8mn-gw7902", "fsl,imx8mn";
+
+   aliases {
+   usb0 = 
+   };
+
+   chosen {
+   stdout-path = 
+   };
+
+   memory@4000 {
+   device_type = "memory";
+   reg = <0x0 0x4000 0 0x8000>;
+   };
+
+   can20m: can20m {
+   compatible = "fixed-clock";
+   #clock-cells = <0>;
+   clock-frequency = <2000>;
+   clock-output-names = "can20m";
+   };
+
+   gpio-keys {
+   compatible = "gpio-keys";
+
+   user-pb {
+   label =