mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* Getting serial console output on new imx7d tqma7 board UART4
@ 2020-07-29 16:52 Lars Pedersen
  2020-07-29 17:22 ` Ahmad Fatoum
  2020-08-03 10:10 ` Ahmad Fatoum
  0 siblings, 2 replies; 20+ messages in thread
From: Lars Pedersen @ 2020-07-29 16:52 UTC (permalink / raw)
  To: barebox

I have spent the last couple of days trying to port our bootloader
from u-boot to barebox 2020.07 but have yet to get any console output.
Our product is based on tqma7d i.MX7 dual core cpu and uses UART4 for
serial console and boots from internal eMMC.

I created a new board inspired from "NXP i.MX7 SabreSD board" and
tried to only add the basic in the first step to get a console output
working. The image is built using ptxdist and the imx_v7_defconfig
where the new board is selected. The image is flashed with "dd
if=barebox-image of=/dev/mmcblk0 bs=1024 skip=1 seek=1 conv=fsync".
The device works using u-boot 2020.07 with the same device trees but
we thought it was time to try out barebox since u-boot felt a little
bloated :)

So can anyone be of assistance and tell me what I'm missing?

/Lars Pedersen

From: Lars Pedersen <laa@kamstrup.com>
Date: Tue, 28 Jul 2020 08:57:57 +0000
Subject: [PATCH] Add kamstrup imx7d dev board

---
 arch/arm/boards/Makefile                           |   1 +
 arch/arm/boards/kamstrup-imx7d-tqma7d/Makefile     |   2 +
 arch/arm/boards/kamstrup-imx7d-tqma7d/board.c      |  19 ++
 .../flash-header-kamstrup-imx7d-tqma7d.imxcfg      |  79 ++++++
 arch/arm/boards/kamstrup-imx7d-tqma7d/lowlevel.c   |  35 +++
 arch/arm/dts/Makefile                              |   1 +
 arch/arm/dts/imx7d-flex-concentrator-mfg.dts       |  11 +
 arch/arm/mach-imx/Kconfig                          |   5 +
 drivers/regulator/Kconfig                          |   2 +-
 dts/src/arm/imx7d-flex-concentrator-mfg.dts        |  25 ++
 dts/src/arm/imx7d-flex-concentrator.dts            | 313 +++++++++++++++++++++
 images/Makefile.imx                                |   5 +
 12 files changed, 497 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/boards/kamstrup-imx7d-tqma7d/Makefile
 create mode 100644 arch/arm/boards/kamstrup-imx7d-tqma7d/board.c
 create mode 100644
arch/arm/boards/kamstrup-imx7d-tqma7d/flash-header-kamstrup-imx7d-tqma7d.imxcfg
 create mode 100644 arch/arm/boards/kamstrup-imx7d-tqma7d/lowlevel.c
 create mode 100644 arch/arm/dts/imx7d-flex-concentrator-mfg.dts
 create mode 100644 dts/src/arm/imx7d-flex-concentrator-mfg.dts
 create mode 100644 dts/src/arm/imx7d-flex-concentrator.dts

diff --git a/arch/arm/boards/Makefile b/arch/arm/boards/Makefile
index e9e9163d589b..58bb4cf2adab 100644
--- a/arch/arm/boards/Makefile
+++ b/arch/arm/boards/Makefile
@@ -64,6 +64,7 @@ obj-$(CONFIG_MACH_HIGHBANK)            += highbank/
 obj-$(CONFIG_MACH_IMX21ADS)            += freescale-mx21-ads/
 obj-$(CONFIG_MACH_IMX233_OLINUXINO)        += imx233-olinuxino/
 obj-$(CONFIG_MACH_IMX27ADS)            += freescale-mx27-ads/
+obj-$(CONFIG_MACH_KAMSTRUP_IMX7D_TQMA7D)    += kamstrup-imx7d-tqma7d/
 obj-$(CONFIG_MACH_KINDLE3)            += kindle3/
 obj-$(CONFIG_MACH_KONTRON_SAMX6I)        += kontron-samx6i/
 obj-$(CONFIG_MACH_LENOVO_IX4_300D)        += lenovo-ix4-300d/
diff --git a/arch/arm/boards/kamstrup-imx7d-tqma7d/Makefile
b/arch/arm/boards/kamstrup-imx7d-tqma7d/Makefile
new file mode 100644
index 000000000000..01c7a259e9a5
--- /dev/null
+++ b/arch/arm/boards/kamstrup-imx7d-tqma7d/Makefile
@@ -0,0 +1,2 @@
+obj-y += board.o
+lwl-y += lowlevel.o
diff --git a/arch/arm/boards/kamstrup-imx7d-tqma7d/board.c
b/arch/arm/boards/kamstrup-imx7d-tqma7d/board.c
new file mode 100644
index 000000000000..b3ffa851f3e6
--- /dev/null
+++ b/arch/arm/boards/kamstrup-imx7d-tqma7d/board.c
@@ -0,0 +1,19 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+// SPDX-FileCopyrightText: 2020 Kamstrup A/S
+
+/* Author: Lars Pedersen <lapeddk@gmail.com> */
+
+#include <common.h>
+#include <init.h>
+#include <io.h>
+#include <mach/imx7-regs.h>
+#include <mfd/imx7-iomuxc-gpr.h>
+
+static int kamstrup_mx7_tqma7d_coredevices_init(void)
+{
+    if (!of_machine_is_compatible("kam,imx7d-flex-concentrator"))
+        return 0;
+
+    return 0;
+}
+coredevice_initcall(kamstrup_mx7_tqma7d_coredevices_init);
diff --git a/arch/arm/boards/kamstrup-imx7d-tqma7d/flash-header-kamstrup-imx7d-tqma7d.imxcfg
b/arch/arm/boards/kamstrup-imx7d-tqma7d/flash-header-kamstrup-imx7d-tqma7d.imxcfg
new file mode 100644
index 000000000000..7656619c1b2e
--- /dev/null
+++ b/arch/arm/boards/kamstrup-imx7d-tqma7d/flash-header-kamstrup-imx7d-tqma7d.imxcfg
@@ -0,0 +1,79 @@
+soc imx7
+loadaddr 0x80000000
+dcdofs 0x400
+
+#include <mach/imx7-ddr-regs.h>
+wm 32 0x30340004 0x4F400005 /* IOMUXC_GPR_GPR1 */
+/* TODO this is copied from imx7sabresd */
+/* Clear then set bit30 to ensure exit from DDR retention */
+wm 32 0x30360388 0x40000000
+wm 32 0x30360384 0x40000000
+
+/* TQMa7x DRAM Timing REV0100 */
+/* DCD Code i.MX7D/S 528 MHz 1 GByte Samsung K4B4G1646D */
+wm 32 0x30360070 0x0070302C     /*CCM_ANALOG_PLL_DDRx*/
+wm 32  0x30360090 0x00000000    /*CCM_ANALOG_PLL_NUM*/
+wm 32  0x30360070 0x0060302C    /*CCM_ANALOG_PLL_DDRx*/
+check 32 until_any_bit_set 0x30360070 0x80000000
+wm 32 0x30391000 0x00000002     /*SRC_DDRC_RCR*/
+
+wm 32 MX7_DDRC_MSTR 0x01040001   /*DDRC_MSTR*/
+wm 32 MX7_DDRC_DFIUPD0 0x80400003   /*DDRC_DFIUPD0*/
+wm 32 MX7_DDRC_DFIUPD1 0x00100020   /*DDRC_DFIUPD1*/
+wm 32 MX7_DDRC_DFIUPD2 0x80100004   /*DDRC_DFIUPD2*/
+wm 32 MX7_DDRC_RFSHTMG 0x00200045   /*DDRC_RFSHTMG*/
+wm 32 MX7_DDRC_MP_PCTRL_0 0x00000001   /*DDRC_MP_PCTRL_0*/
+wm 32 MX7_DDRC_INIT0 0x00020081   /*DDRC_INIT0*/
+wm 32 MX7_DDRC_INIT1 0x00680000   /*DDRC_INIT1*/
+wm 32 MX7_DDRC_INIT3 0x09300004   /*DDRC_INIT3*/
+wm 32 MX7_DDRC_INIT4 0x00480000   /*DDRC_INIT4*/
+wm 32 MX7_DDRC_INIT5 0x00100004   /*DDRC_INIT5*/
+wm 32 MX7_DDRC_RANKCTL 0x0000033F   /*DDRC_RANKCTL*/
+wm 32 MX7_DDRC_DRAMTMG0 0x090E0809   /*DDRC_DRAMTMG0*/
+wm 32 MX7_DDRC_DRAMTMG1 0x0007020E   /*DDRC_DRAMTMG1*/
+wm 32 MX7_DDRC_DRAMTMG2 0x03040407   /*DDRC_DRAMTMG2*/
+wm 32 MX7_DDRC_DRAMTMG3 0x00002006   /*DDRC_DRAMTMG3*/
+wm 32 MX7_DDRC_DRAMTMG4 0x04020304   /*DDRC_DRAMTMG4*/
+wm 32 MX7_DDRC_DRAMTMG5 0x03030202   /*DDRC_DRAMTMG5*/
+wm 32 MX7_DDRC_DRAMTMG8 0x00000803   /*DDRC_DRAMTMG8*/
+wm 32 MX7_DDRC_ZQCTL0 0x00800020   /*DDRC_ZQCTL0*/
+wm 32 MX7_DDRC_DFITMG0 0x02098204   /*DDRC_DFITMG0*/
+wm 32 MX7_DDRC_DFITMG1 0x00030303   /*DDRC_DFITMG1*/
+wm 32 MX7_DDRC_ADDRMAP0 0x00000016   /*DDRC_ADDRMAP0*/
+wm 32 MX7_DDRC_ADDRMAP1 0x00171717   /*DDRC_ADDRMAP1*/
+wm 32 MX7_DDRC_ADDRMAP4 0x00000F0F   /*DDRC_ADDRMAP4*/
+wm 32 MX7_DDRC_ADDRMAP5 0x04040404   /*DDRC_ADDRMAP5*/
+wm 32 MX7_DDRC_ADDRMAP6 0x0F040404   /*DDRC_ADDRMAP6*/
+wm 32 MX7_DDRC_ODTCFG 0x06000604   /*DDRC_ODTCFG*/
+wm 32 MX7_DDRC_ODTMAP 0x00000001   /*DDRC_ODTMAP*/
+wm 32 0x30391000 0x00000000   /*SRC_DDRC_RCR*/
+wm 32 MX7_DDR_PHY_PHY_CON0 0x17420F40   /*DDR_PHY_PHY_CON0*/
+wm 32 MX7_DDR_PHY_PHY_CON1 0x10210100   /*DDR_PHY_PHY_CON1*/
+wm 32 MX7_DDR_PHY_PHY_CON4 0x00060807   /*DDR_PHY_PHY_CON4*/
+wm 32 MX7_DDR_PHY_MDLL_CON0 0x1010007E   /*DDR_PHY_MDLL_CON0*/
+wm 32 MX7_DDR_PHY_DRVDS_CON0 0x00000924   /*DDR_PHY_DRVDS_CON0*/
+/*DDR_PHY_CMD_DESKEW_CON0*/
+/*DDR_PHY_CMD_DESKEW_CON1*/
+/*DDR_PHY_CMD_DESKEW_CON2*/
+/*DDR_PHY_CMD_DESKEW_CON3*/
+/*DDR_PHY_LVL_CON0*/
+wm 32 MX7_DDR_PHY_OFFSET_RD_CON0 0x0B0B0B0B   /*DDR_PHY_OFFSET_RD_CON0 */
+wm 32 MX7_DDR_PHY_OFFSET_WR_CON0 0x06060606   /*DDR_PHY_OFFSET_WR_CON0 */
+wm 32 MX7_DDR_PHY_CMD_SDLL_CON0 0x01000010   /*DDR_PHY_CMD_SDLL_CON0*/
+wm 32 MX7_DDR_PHY_CMD_SDLL_CON0 0x00000010   /*DDR_PHY_CMD_SDLL_CON0*/
+
+wm 32 MX7_DDR_PHY_ZQ_CON0 0x0C407304   /*DDR_PHY_ZQ_CON0*/
+wm 32 MX7_DDR_PHY_ZQ_CON0 0x0C447304   /*DDR_PHY_ZQ_CON0*/
+wm 32 MX7_DDR_PHY_ZQ_CON0 0x0C447306   /*DDR_PHY_ZQ_CON0*/
+check 32 until_any_bit_set MX7_DDR_PHY_ZQ_CON0 0x1 /*ZQ Calibration
is finished*/
+wm 32 MX7_DDR_PHY_ZQ_CON0 0x0C447304   /*DDR_PHY_ZQ_CON0*/
+wm 32 MX7_DDR_PHY_ZQ_CON0 0x0C407304   /*DDR_PHY_ZQ_CON0*/
+
+wm 32 0x30384130 0x00000000 /* CCM_CCGRn */
+wm 32 0x30340020 0x00000178 /* IOMUXC_GPR_GPR8 */
+wm 32 0x30384130 0x00000002 /* CCM_CCGRn */
+wm 32 0x30790018 0x0000000f /* DDR_PHY_LP_CON0 */
+
+/* DDRC_STAT */
+check 32 until_any_bit_set 4 0x307a0004 0x1
+
diff --git a/arch/arm/boards/kamstrup-imx7d-tqma7d/lowlevel.c
b/arch/arm/boards/kamstrup-imx7d-tqma7d/lowlevel.c
new file mode 100644
index 000000000000..d8c455701edc
--- /dev/null
+++ b/arch/arm/boards/kamstrup-imx7d-tqma7d/lowlevel.c
@@ -0,0 +1,35 @@
+#include <debug_ll.h>
+#include <io.h>
+#include <common.h>
+#include <linux/sizes.h>
+#include <mach/generic.h>
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+#include <mach/imx7-ccm-regs.h>
+#include <mach/iomux-mx7.h>
+#include <mach/debug_ll.h>
+#include <asm/cache.h>
+#include <mach/esdctl.h>
+
+extern char __dtb_imx7d_flex_concentrator_mfg_start[];
+
+static inline void setup_uart(void)
+{
+    imx7_early_setup_uart_clock();
+
+    imx7_setup_pad(MX7D_PAD_SAI2_TX_BCLK__UART4_DCE_TX);
+
+    imx7_uart_setup_ll();
+
+    putc_ll('>');
+}
+
+ENTRY_FUNCTION(start_kamstrup_imx7d_tqma7d, r0, r1, r2)
+{
+    imx7_cpu_lowlevel_init();
+
+    if (IS_ENABLED(CONFIG_DEBUG_LL))
+        setup_uart();
+
+    imx7d_barebox_entry(__dtb_imx7d_flex_concentrator_mfg_start +
get_runtime_offset());
+}
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index d61a052310ce..ec3d0f372786 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -23,6 +23,7 @@ lwl-$(CONFIG_MACH_CCMX53) += imx53-ccxmx53.dtb.o
 lwl-$(CONFIG_MACH_DIGI_CCIMX6ULSBCPRO) += imx6ul-ccimx6ulsbcpro.dtb.o
 lwl-$(CONFIG_MACH_FREESCALE_MX53_VMX53) += imx53-voipac-bsb.dtb.o
 lwl-$(CONFIG_MACH_FREESCALE_MX7_SABRESD) += imx7d-sdb.dtb.o
+lwl-$(CONFIG_MACH_KAMSTRUP_IMX7D_TQMA7D) += imx7d-flex-concentrator-mfg.dtb.o
 lwl-$(CONFIG_MACH_GK802) += imx6q-gk802.dtb.o
 lwl-$(CONFIG_MACH_GLOBALSCALE_GURUPLUG) +=
kirkwood-guruplug-server-plus-bb.dtb.o
 lwl-$(CONFIG_MACH_GLOBALSCALE_MIRABOX) += armada-370-mirabox-bb.dtb.o
diff --git a/arch/arm/dts/imx7d-flex-concentrator-mfg.dts
b/arch/arm/dts/imx7d-flex-concentrator-mfg.dts
new file mode 100644
index 000000000000..746e36a70f4c
--- /dev/null
+++ b/arch/arm/dts/imx7d-flex-concentrator-mfg.dts
@@ -0,0 +1,11 @@
+/*
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+#include <arm/imx7d-flex-concentrator-mfg.dts>
+
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index 6dd5cb2aca15..d0a9332c7a24 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -492,6 +492,11 @@ config MACH_ZII_IMX7D_DEV
     select ARCH_IMX7
     select ARM_USE_COMPRESSED_DTB

+config MACH_KAMSTRUP_IMX7D_TQMA7D
+    bool "Kamstrup TQMa7D based devices"
+    select ARCH_IMX7
+    select ARM_USE_COMPRESSED_DTB
+
 config MACH_PHYTEC_PHYCORE_IMX7
     bool "Phytec phyCORE i.MX7"
     select ARCH_IMX7
diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
index 1ce057180a01..b0bdc48399e3 100644
--- a/drivers/regulator/Kconfig
+++ b/drivers/regulator/Kconfig
@@ -19,7 +19,7 @@ config REGULATOR_BCM283X
 config REGULATOR_PFUZE
     bool "Freescale PFUZE100/200/3000 regulator driver"
     depends on I2C
-    depends on ARCH_IMX6 || ARCH_IMX8MQ
+    depends on ARCH_IMX6 || ARCH_IMX7 || ARCH_IMX8MQ

 config REGULATOR_STM32_PWR
     bool "STMicroelectronics STM32 PWR"
diff --git a/dts/src/arm/imx7d-flex-concentrator-mfg.dts
b/dts/src/arm/imx7d-flex-concentrator-mfg.dts
new file mode 100644
index 000000000000..789f0837058f
--- /dev/null
+++ b/dts/src/arm/imx7d-flex-concentrator-mfg.dts
@@ -0,0 +1,25 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Device Tree Source for Kamstrup OMNIA Flex Concentrator in
+ * manufacturing/debugging mode.
+ *
+ * Copyright (C) 2020 Kamstrup A/S
+ * Author: Bruno Thomsen <bruno.thomsen@gmail.com>
+ */
+
+/dts-v1/;
+
+#include "imx7d-flex-concentrator.dts"
+
+/ {
+    model = "Kamstrup OMNIA Flex Concentrator - Manufacturing";
+    compatible = "kam,imx7d-flex-concentrator-mfg",
"kam,imx7d-flex-concentrator", "fsl,imx7d";
+
+    chosen {
+        stdout-path = &uart4;
+    };
+};
+
+&uart4 {
+    status = "okay";
+};
diff --git a/dts/src/arm/imx7d-flex-concentrator.dts
b/dts/src/arm/imx7d-flex-concentrator.dts
new file mode 100644
index 000000000000..43b331222a47
--- /dev/null
+++ b/dts/src/arm/imx7d-flex-concentrator.dts
@@ -0,0 +1,313 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Device Tree Source for Kamstrup OMNIA Flex Concentrator.
+ *
+ * Copyright (C) 2020 Kamstrup A/S
+ * Author: Bruno Thomsen <bruno.thomsen@gmail.com>
+ */
+
+/dts-v1/;
+
+#include "imx7d-tqma7.dtsi"
+
+/* Some I2C devices on TQMa7 SoM are not mounted */
+/delete-node/ &m24c64;
+/delete-node/ &ds1339;
+
+/ {
+    model = "Kamstrup OMNIA Flex Concentrator";
+    compatible = "kam,imx7d-flex-concentrator", "fsl,imx7d";
+
+    memory@80000000 {
+        device_type = "memory";
+        /* 1024 MB - TQMa7D board configuration */
+        reg = <0x80000000 0x40000000>;
+    };
+
+    reg_usb_otg2_vbus: regulator-usb-otg2-vbus {
+        compatible = "regulator-fixed";
+        regulator-name = "VBUS_USBOTG2";
+        regulator-min-microvolt = <5000000>;
+        regulator-max-microvolt = <5000000>;
+        gpio = <&gpio1 7 GPIO_ACTIVE_HIGH>;
+        enable-active-high;
+    };
+
+    reg_vref_1v8: regulator-vref-1v8 {
+        compatible = "regulator-fixed";
+        regulator-name = "VCC1V8_REF";
+        regulator-min-microvolt = <1800000>;
+        regulator-max-microvolt = <1800000>;
+        regulator-always-on;
+        vin-supply = <&sw2_reg>;
+    };
+
+    /*
+     * Human Machine Interface consists of 4 dual red/green LEDs.
+     * hmi-a-green is controlled directly by the switch-mode power supply.
+     * hmi-a-red is not used.
+     */
+    gpio-leds {
+        compatible = "gpio-leds";
+        pinctrl-names = "default";
+        pinctrl-0 = <&pinctrl_leds>;
+
+        hmi-b-red {
+            label = "hmi-b:red:provisioning";
+            gpios = <&gpio3 6 GPIO_ACTIVE_HIGH>;
+            default-state = "off";
+        };
+
+        hmi-b-green {
+            label = "hmi-b:green:operation";
+            gpios = <&gpio2 28 GPIO_ACTIVE_HIGH>;
+            default-state = "off";
+        };
+
+        hmi-c-red {
+            label = "hmi-c:red:mesh-error";
+            gpios = <&gpio2 29 GPIO_ACTIVE_HIGH>;
+            default-state = "off";
+        };
+
+        hmi-c-green {
+            label = "hmi-c:green:mesh-activity";
+            gpios = <&gpio2 30 GPIO_ACTIVE_HIGH>;
+            default-state = "off";
+        };
+
+        hmi-d-red {
+            label = "hmi-d:red:wan-down";
+            gpios = <&gpio2 31 GPIO_ACTIVE_HIGH>;
+            default-state = "off";
+        };
+
+        hmi-d-green {
+            label = "hmi-d:green:ipsec-up";
+            gpios = <&gpio4 3 GPIO_ACTIVE_HIGH>;
+            default-state = "off";
+        };
+    };
+
+    /*
+     * Errata e10574 board restart workaround.
+     */
+    gpio-restart {
+        pinctrl-names = "default";
+        pinctrl-0 = <&pinctrl_restart>;
+        compatible = "gpio-restart";
+        gpios = <&gpio7 12 GPIO_ACTIVE_LOW>;
+        priority = <200>;
+    };
+};
+
+/*
+ * Analog signals
+ * ADC1_IN0: SMPS - 5V output monitor (voltage divider: 1/0.2806)
+ */
+&adc1 {
+    vref-supply = <&reg_vref_1v8>;
+    status = "okay";
+};
+
+&ecspi2 {
+    pinctrl-names = "default";
+    pinctrl-0 = <&pinctrl_ecspi2>;
+    num-chipselects = <1>;
+    cs-gpios = <&gpio4 23 GPIO_ACTIVE_LOW>;
+    status = "okay";
+
+    pcf2127: rtc@0 {
+        compatible = "nxp,pcf2127";
+        reg = <0>;
+        spi-max-frequency = <2000000>;
+    };
+};
+
+&ecspi4 {
+    pinctrl-names = "default";
+    pinctrl-0 = <&pinctrl_ecspi4>;
+    num-chipselects = <1>;
+    cs-gpios = <&gpio3 3 GPIO_ACTIVE_LOW>;
+    status = "okay";
+
+    /*
+     * ST chip maximum SPI clock frequency is 33 MHz.
+     *
+     * TCG specification - Section 6.4.1 Clocking:
+     * TPM shall support a SPI clock frequency range of 10-24 MHz.
+     */
+    st33htph: tpm-tis@0 {
+        compatible = "st,st33htpm-spi", "tcg,tpm_tis-spi";
+        reg = <0>;
+        spi-max-frequency = <24000000>;
+    };
+};
+
+&fec1 {
+    pinctrl-names = "default";
+    pinctrl-0 = <&pinctrl_enet1>;
+    phy-mode = "rmii";
+    phy-handle = <&ethphy>;
+    status = "okay";
+
+    mdio {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        /* Micrel KSZ8081RNB */
+        ethphy: ethernet-phy@1 {
+            compatible = "ethernet-phy-id0022.1560",
"ethernet-phy-ieee802.3-c22";
+            reg = <1>;
+            max-speed = <100>;
+            interrupt-parent = <&gpio1>;
+            interrupts = <9 IRQ_TYPE_LEVEL_LOW>;
+            reset-assert-us = <100000>;
+            reset-deassert-us = <1000000>;
+            reset-gpios = <&gpio7 15 GPIO_ACTIVE_LOW>;
+        };
+    };
+};
+
+/*
+ * Detection signals for internal USB modules.
+ * Used for robust USB plug and play handling such as USB downstream port
+ * power-cycle and USB hub reset in case of misbehaving or crashed modules.
+ *
+ * SMPS - AC input monitor based on zero crossing.
+ * Used for last gasp notification.
+ */
+&gpio3 {
+    gpio-line-names = "", "", "", "", "", "", "", "",
+    "", "", "", "", "smps-ac-monitor", "", "usb-hub-reset", "",
+    "", "", "", "", "", "", "", "",
+    "", "module-b-detection", "", "module-a-detection", "", "", "", "";
+};
+
+/*
+ * Tamper IRQ trigger timestamp reading.
+ * Used for sealed cover opened/closed notification.
+ */
+&gpio5 {
+    gpio-line-names = "", "", "", "", "", "", "", "",
+    "", "", "", "", "rtc-tamper-irq", "", "", "",
+    "", "", "", "", "", "", "", "",
+    "", "", "", "", "", "", "", "";
+};
+
+&iomuxc {
+    pinctrl-names = "default";
+    pinctrl-0 = <&pinctrl_misc>;
+
+    pinctrl_ecspi2: ecspi2grp {
+        fsl,pins = <
+            MX7D_PAD_ECSPI2_MISO__ECSPI2_MISO        0x7c /* X2-15 */
+            MX7D_PAD_ECSPI2_MOSI__ECSPI2_MOSI        0x74 /* X2-18 */
+            MX7D_PAD_ECSPI2_SCLK__ECSPI2_SCLK        0x74 /* X2-13 */
+            MX7D_PAD_ECSPI2_SS0__GPIO4_IO23            0x74 /* X2-20 */
+            /* RTC - Tamper IRQ */
+            MX7D_PAD_SD2_CLK__GPIO5_IO12            0x3c /* X1-92 */
+        >;
+    };
+
+    pinctrl_ecspi4: ecspi4grp {
+        fsl,pins = <
+            MX7D_PAD_LCD_CLK__ECSPI4_MISO            0x7c /* X2-72 */
+            MX7D_PAD_LCD_ENABLE__ECSPI4_MOSI        0x74 /* X2-68 */
+            MX7D_PAD_LCD_HSYNC__ECSPI4_SCLK            0x74 /* X2-76 */
+            MX7D_PAD_LCD_VSYNC__GPIO3_IO3            0x74 /* X2-78 */
+        >;
+    };
+
+    pinctrl_enet1: enet1grp {
+        fsl,pins = <
+            MX7D_PAD_GPIO1_IO10__ENET1_MDIO            0x02 /* X2-48 */
+            MX7D_PAD_GPIO1_IO11__ENET1_MDC            0x00 /* X2-46 */
+            MX7D_PAD_ENET1_RGMII_TD0__ENET1_RGMII_TD0    0x71 /* X2-53 */
+            MX7D_PAD_ENET1_RGMII_TD1__ENET1_RGMII_TD1    0x71 /* X2-55 */
+            MX7D_PAD_ENET1_RGMII_TX_CTL__ENET1_RGMII_TX_CTL    0x71 /* X2-61 */
+            MX7D_PAD_ENET1_RGMII_RD0__ENET1_RGMII_RD0    0x79 /* X2-56 */
+            MX7D_PAD_ENET1_RGMII_RD1__ENET1_RGMII_RD1    0x79 /* X2-58 */
+            MX7D_PAD_ENET1_RGMII_RX_CTL__ENET1_RGMII_RX_CTL    0x79 /* X2-64 */
+            MX7D_PAD_ENET1_RGMII_RXC__ENET1_RX_ER        0x73 /* X2-52 */
+            /* PHY reset: SION, 100kPU, SRE_FAST, DSE_X1 */
+            MX7D_PAD_ENET1_COL__GPIO7_IO15        0x40000070 /* X1-96 */
+            /* Clock from PHY to MAC */
+            MX7D_PAD_GPIO1_IO12__CCM_ENET_REF_CLK1    0x40000073 /* X3-4 */
+            /* PHY interrupt: SION, 100kPU, HYS, SRE_FAST, DSE_X1 */
+            MX7D_PAD_GPIO1_IO09__GPIO1_IO9        0x40000078 /* X1-80 */
+        >;
+    };
+
+    pinctrl_leds: ledsgrp {
+        fsl,pins = <
+            MX7D_PAD_LCD_DATA01__GPIO3_IO6            0x14 /* X2-82 */
+            MX7D_PAD_EPDC_BDR0__GPIO2_IO28            0x14 /* X1-82 */
+            MX7D_PAD_EPDC_BDR1__GPIO2_IO29            0x14 /* X1-84 */
+            MX7D_PAD_EPDC_PWR_COM__GPIO2_IO30        0x14 /* X1-86 */
+            MX7D_PAD_EPDC_PWR_STAT__GPIO2_IO31        0x14 /* X1-88 */
+            MX7D_PAD_UART2_TX_DATA__GPIO4_IO3        0x14 /* X1-90 */
+        >;
+    };
+
+    pinctrl_misc: miscgrp {
+        fsl,pins = <
+            /* Module A detection (low = present) */
+            MX7D_PAD_LCD_DATA22__GPIO3_IO27            0x7c /* X2-105 */
+            /* Module B detection (low = present) */
+            MX7D_PAD_LCD_DATA20__GPIO3_IO25            0x7c /* X2-103 */
+            /* SMPS - AC input monitor (high = failure) */
+            MX7D_PAD_LCD_DATA07__GPIO3_IO12            0x7c /* X2-88 */
+            /* USB - Hub reset */
+            MX7D_PAD_LCD_DATA09__GPIO3_IO14            0x74 /* X2-92 */
+        >;
+    };
+
+    pinctrl_restart: restartgrp {
+        fsl,pins = <
+            MX7D_PAD_ENET1_TX_CLK__GPIO7_IO12    0x74 /* X1-94 */
+        >;
+    };
+
+    pinctrl_uart4: uart4grp {
+        fsl,pins = <
+            MX7D_PAD_SAI2_TX_SYNC__UART4_DCE_RX    0x7e /* X3-14 */
+            MX7D_PAD_SAI2_TX_BCLK__UART4_DCE_TX    0x76 /* X3-16 */
+        >;
+    };
+};
+
+&iomuxc_lpsr {
+    pinctrl_usbotg2: usbotg2grp {
+        fsl,pins = <
+            MX7D_PAD_LPSR_GPIO1_IO06__USB_OTG2_OC    0x5c /* X3-11 */
+            MX7D_PAD_LPSR_GPIO1_IO07__GPIO1_IO7    0x59 /* X3-9 */
+        >;
+    };
+
+};
+
+&uart4 {
+    pinctrl-names = "default";
+    pinctrl-0 = <&pinctrl_uart4>;
+    assigned-clocks = <&clks IMX7D_UART4_ROOT_SRC>;
+    assigned-clock-parents = <&clks IMX7D_OSC_24M_CLK>;
+};
+
+&usbotg2 {
+    pinctrl-names = "default";
+    pinctrl-0 = <&pinctrl_usbotg2>;
+    vbus-supply = <&reg_usb_otg2_vbus>;
+    srp-disable;
+    hnp-disable;
+    adp-disable;
+    dr_mode = "host";
+    status = "okay";
+};
+
+/*
+ * External watchdog feature provided by pcf2127.
+ */
+&wdog1 {
+    status = "disabled";
+};
diff --git a/images/Makefile.imx b/images/Makefile.imx
index 765702f26deb..cbbefd5c085b 100644
--- a/images/Makefile.imx
+++ b/images/Makefile.imx
@@ -364,6 +364,11 @@ CFG_start_zii_imx7d_dev.pblb.imximg =
$(board)/zii-imx7d-dev/flash-header-zii-im
 FILE_barebox-zii-imx7d-dev.img = start_zii_imx7d_dev.pblb.imximg
 image-$(CONFIG_MACH_ZII_IMX7D_DEV) += barebox-zii-imx7d-dev.img

+pblb-$(CONFIG_MACH_KAMSTRUP_IMX7D_TQMA7D) += start_kamstrup_imx7d_tqma7d
+CFG_start_kamstrup_imx7d_tqma7d.pblb.imximg =
$(board)/kamstrup-imx7d-tqma7d/flash-header-kamstrup-imx7d-tqma7d.imxcfg
+FILE_barebox-kamstrup-imx7d-tqma7d.img =
start_kamstrup_imx7d_tqma7d.pblb.imximg
+image-$(CONFIG_MACH_KAMSTRUP_IMX7D_TQMA7D) += barebox-kamstrup-imx7d-tqma7d.img
+
 # ----------------------- i.MX8mm based boards --------------------------
 pblb-$(CONFIG_MACH_NXP_IMX8MM_EVK) += start_nxp_imx8mm_evk
 CFG_start_nxp_imx8mm_evk.pblb.imximg =
$(board)/nxp-imx8mm-evk/flash-header-imx8mm-evk.imxcfg

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Getting serial console output on new imx7d tqma7 board UART4
  2020-07-29 16:52 Getting serial console output on new imx7d tqma7 board UART4 Lars Pedersen
@ 2020-07-29 17:22 ` Ahmad Fatoum
  2020-07-30  6:58   ` Lars Pedersen
  2020-08-03 10:10 ` Ahmad Fatoum
  1 sibling, 1 reply; 20+ messages in thread
From: Ahmad Fatoum @ 2020-07-29 17:22 UTC (permalink / raw)
  To: Lars Pedersen, barebox

Hello Lars,

On 7/29/20 6:52 PM, Lars Pedersen wrote:
> I have spent the last couple of days trying to port our bootloader
> from u-boot to barebox 2020.07 but have yet to get any console output.
> Our product is based on tqma7d i.MX7 dual core cpu and uses UART4 for
> serial console and boots from internal eMMC.
> 
> I created a new board inspired from "NXP i.MX7 SabreSD board" and
> tried to only add the basic in the first step to get a console output
> working. The image is built using ptxdist and the imx_v7_defconfig
> where the new board is selected. The image is flashed with "dd
> if=barebox-image of=/dev/mmcblk0 bs=1024 skip=1 seek=1 conv=fsync".
> The device works using u-boot 2020.07 with the same device trees but
> we thought it was time to try out barebox since u-boot felt a little
> bloated :)
> 
> So can anyone be of assistance and tell me what I'm missing?
> 
> /Lars Pedersen
> 
> From: Lars Pedersen <laa@kamstrup.com>
> Date: Tue, 28 Jul 2020 08:57:57 +0000
> Subject: [PATCH] Add kamstrup imx7d dev board
> 
> ---
>  arch/arm/boards/Makefile                           |   1 +
>  arch/arm/boards/kamstrup-imx7d-tqma7d/Makefile     |   2 +
>  arch/arm/boards/kamstrup-imx7d-tqma7d/board.c      |  19 ++
>  .../flash-header-kamstrup-imx7d-tqma7d.imxcfg      |  79 ++++++
>  arch/arm/boards/kamstrup-imx7d-tqma7d/lowlevel.c   |  35 +++
>  arch/arm/dts/Makefile                              |   1 +
>  arch/arm/dts/imx7d-flex-concentrator-mfg.dts       |  11 +
>  arch/arm/mach-imx/Kconfig                          |   5 +
>  drivers/regulator/Kconfig                          |   2 +-
>  dts/src/arm/imx7d-flex-concentrator-mfg.dts        |  25 ++
>  dts/src/arm/imx7d-flex-concentrator.dts            | 313 +++++++++++++++++++++
>  images/Makefile.imx                                |   5 +
>  12 files changed, 497 insertions(+), 1 deletion(-)
>  create mode 100644 arch/arm/boards/kamstrup-imx7d-tqma7d/Makefile
>  create mode 100644 arch/arm/boards/kamstrup-imx7d-tqma7d/board.c
>  create mode 100644
> arch/arm/boards/kamstrup-imx7d-tqma7d/flash-header-kamstrup-imx7d-tqma7d.imxcfg
>  create mode 100644 arch/arm/boards/kamstrup-imx7d-tqma7d/lowlevel.c
>  create mode 100644 arch/arm/dts/imx7d-flex-concentrator-mfg.dts
>  create mode 100644 dts/src/arm/imx7d-flex-concentrator-mfg.dts
>  create mode 100644 dts/src/arm/imx7d-flex-concentrator.dts
> 
> diff --git a/arch/arm/boards/Makefile b/arch/arm/boards/Makefile
> index e9e9163d589b..58bb4cf2adab 100644
> --- a/arch/arm/boards/Makefile
> +++ b/arch/arm/boards/Makefile
> @@ -64,6 +64,7 @@ obj-$(CONFIG_MACH_HIGHBANK)            += highbank/
>  obj-$(CONFIG_MACH_IMX21ADS)            += freescale-mx21-ads/
>  obj-$(CONFIG_MACH_IMX233_OLINUXINO)        += imx233-olinuxino/
>  obj-$(CONFIG_MACH_IMX27ADS)            += freescale-mx27-ads/
> +obj-$(CONFIG_MACH_KAMSTRUP_IMX7D_TQMA7D)    += kamstrup-imx7d-tqma7d/
>  obj-$(CONFIG_MACH_KINDLE3)            += kindle3/
>  obj-$(CONFIG_MACH_KONTRON_SAMX6I)        += kontron-samx6i/
>  obj-$(CONFIG_MACH_LENOVO_IX4_300D)        += lenovo-ix4-300d/
> diff --git a/arch/arm/boards/kamstrup-imx7d-tqma7d/Makefile
> b/arch/arm/boards/kamstrup-imx7d-tqma7d/Makefile
> new file mode 100644
> index 000000000000..01c7a259e9a5
> --- /dev/null
> +++ b/arch/arm/boards/kamstrup-imx7d-tqma7d/Makefile
> @@ -0,0 +1,2 @@
> +obj-y += board.o
> +lwl-y += lowlevel.o
> diff --git a/arch/arm/boards/kamstrup-imx7d-tqma7d/board.c
> b/arch/arm/boards/kamstrup-imx7d-tqma7d/board.c
> new file mode 100644
> index 000000000000..b3ffa851f3e6
> --- /dev/null
> +++ b/arch/arm/boards/kamstrup-imx7d-tqma7d/board.c
> @@ -0,0 +1,19 @@
> +// SPDX-License-Identifier: GPL-2.0-or-later
> +// SPDX-FileCopyrightText: 2020 Kamstrup A/S
> +
> +/* Author: Lars Pedersen <lapeddk@gmail.com> */
> +
> +#include <common.h>
> +#include <init.h>
> +#include <io.h>
> +#include <mach/imx7-regs.h>
> +#include <mfd/imx7-iomuxc-gpr.h>
> +
> +static int kamstrup_mx7_tqma7d_coredevices_init(void)
> +{
> +    if (!of_machine_is_compatible("kam,imx7d-flex-concentrator"))
> +        return 0;
> +
> +    return 0;
> +}
> +coredevice_initcall(kamstrup_mx7_tqma7d_coredevices_init);
> diff --git a/arch/arm/boards/kamstrup-imx7d-tqma7d/flash-header-kamstrup-imx7d-tqma7d.imxcfg
> b/arch/arm/boards/kamstrup-imx7d-tqma7d/flash-header-kamstrup-imx7d-tqma7d.imxcfg
> new file mode 100644
> index 000000000000..7656619c1b2e
> --- /dev/null
> +++ b/arch/arm/boards/kamstrup-imx7d-tqma7d/flash-header-kamstrup-imx7d-tqma7d.imxcfg
> @@ -0,0 +1,79 @@
> +soc imx7
> +loadaddr 0x80000000
> +dcdofs 0x400
> +
> +#include <mach/imx7-ddr-regs.h>
> +wm 32 0x30340004 0x4F400005 /* IOMUXC_GPR_GPR1 */
> +/* TODO this is copied from imx7sabresd */
> +/* Clear then set bit30 to ensure exit from DDR retention */
> +wm 32 0x30360388 0x40000000
> +wm 32 0x30360384 0x40000000
> +
> +/* TQMa7x DRAM Timing REV0100 */
> +/* DCD Code i.MX7D/S 528 MHz 1 GByte Samsung K4B4G1646D */
> +wm 32 0x30360070 0x0070302C     /*CCM_ANALOG_PLL_DDRx*/
> +wm 32  0x30360090 0x00000000    /*CCM_ANALOG_PLL_NUM*/
> +wm 32  0x30360070 0x0060302C    /*CCM_ANALOG_PLL_DDRx*/
> +check 32 until_any_bit_set 0x30360070 0x80000000
> +wm 32 0x30391000 0x00000002     /*SRC_DDRC_RCR*/
> +
> +wm 32 MX7_DDRC_MSTR 0x01040001   /*DDRC_MSTR*/
> +wm 32 MX7_DDRC_DFIUPD0 0x80400003   /*DDRC_DFIUPD0*/
> +wm 32 MX7_DDRC_DFIUPD1 0x00100020   /*DDRC_DFIUPD1*/
> +wm 32 MX7_DDRC_DFIUPD2 0x80100004   /*DDRC_DFIUPD2*/
> +wm 32 MX7_DDRC_RFSHTMG 0x00200045   /*DDRC_RFSHTMG*/
> +wm 32 MX7_DDRC_MP_PCTRL_0 0x00000001   /*DDRC_MP_PCTRL_0*/
> +wm 32 MX7_DDRC_INIT0 0x00020081   /*DDRC_INIT0*/
> +wm 32 MX7_DDRC_INIT1 0x00680000   /*DDRC_INIT1*/
> +wm 32 MX7_DDRC_INIT3 0x09300004   /*DDRC_INIT3*/
> +wm 32 MX7_DDRC_INIT4 0x00480000   /*DDRC_INIT4*/
> +wm 32 MX7_DDRC_INIT5 0x00100004   /*DDRC_INIT5*/
> +wm 32 MX7_DDRC_RANKCTL 0x0000033F   /*DDRC_RANKCTL*/
> +wm 32 MX7_DDRC_DRAMTMG0 0x090E0809   /*DDRC_DRAMTMG0*/
> +wm 32 MX7_DDRC_DRAMTMG1 0x0007020E   /*DDRC_DRAMTMG1*/
> +wm 32 MX7_DDRC_DRAMTMG2 0x03040407   /*DDRC_DRAMTMG2*/
> +wm 32 MX7_DDRC_DRAMTMG3 0x00002006   /*DDRC_DRAMTMG3*/
> +wm 32 MX7_DDRC_DRAMTMG4 0x04020304   /*DDRC_DRAMTMG4*/
> +wm 32 MX7_DDRC_DRAMTMG5 0x03030202   /*DDRC_DRAMTMG5*/
> +wm 32 MX7_DDRC_DRAMTMG8 0x00000803   /*DDRC_DRAMTMG8*/
> +wm 32 MX7_DDRC_ZQCTL0 0x00800020   /*DDRC_ZQCTL0*/
> +wm 32 MX7_DDRC_DFITMG0 0x02098204   /*DDRC_DFITMG0*/
> +wm 32 MX7_DDRC_DFITMG1 0x00030303   /*DDRC_DFITMG1*/
> +wm 32 MX7_DDRC_ADDRMAP0 0x00000016   /*DDRC_ADDRMAP0*/
> +wm 32 MX7_DDRC_ADDRMAP1 0x00171717   /*DDRC_ADDRMAP1*/
> +wm 32 MX7_DDRC_ADDRMAP4 0x00000F0F   /*DDRC_ADDRMAP4*/
> +wm 32 MX7_DDRC_ADDRMAP5 0x04040404   /*DDRC_ADDRMAP5*/
> +wm 32 MX7_DDRC_ADDRMAP6 0x0F040404   /*DDRC_ADDRMAP6*/
> +wm 32 MX7_DDRC_ODTCFG 0x06000604   /*DDRC_ODTCFG*/
> +wm 32 MX7_DDRC_ODTMAP 0x00000001   /*DDRC_ODTMAP*/
> +wm 32 0x30391000 0x00000000   /*SRC_DDRC_RCR*/
> +wm 32 MX7_DDR_PHY_PHY_CON0 0x17420F40   /*DDR_PHY_PHY_CON0*/
> +wm 32 MX7_DDR_PHY_PHY_CON1 0x10210100   /*DDR_PHY_PHY_CON1*/
> +wm 32 MX7_DDR_PHY_PHY_CON4 0x00060807   /*DDR_PHY_PHY_CON4*/
> +wm 32 MX7_DDR_PHY_MDLL_CON0 0x1010007E   /*DDR_PHY_MDLL_CON0*/
> +wm 32 MX7_DDR_PHY_DRVDS_CON0 0x00000924   /*DDR_PHY_DRVDS_CON0*/
> +/*DDR_PHY_CMD_DESKEW_CON0*/
> +/*DDR_PHY_CMD_DESKEW_CON1*/
> +/*DDR_PHY_CMD_DESKEW_CON2*/
> +/*DDR_PHY_CMD_DESKEW_CON3*/
> +/*DDR_PHY_LVL_CON0*/
> +wm 32 MX7_DDR_PHY_OFFSET_RD_CON0 0x0B0B0B0B   /*DDR_PHY_OFFSET_RD_CON0 */
> +wm 32 MX7_DDR_PHY_OFFSET_WR_CON0 0x06060606   /*DDR_PHY_OFFSET_WR_CON0 */
> +wm 32 MX7_DDR_PHY_CMD_SDLL_CON0 0x01000010   /*DDR_PHY_CMD_SDLL_CON0*/
> +wm 32 MX7_DDR_PHY_CMD_SDLL_CON0 0x00000010   /*DDR_PHY_CMD_SDLL_CON0*/
> +
> +wm 32 MX7_DDR_PHY_ZQ_CON0 0x0C407304   /*DDR_PHY_ZQ_CON0*/
> +wm 32 MX7_DDR_PHY_ZQ_CON0 0x0C447304   /*DDR_PHY_ZQ_CON0*/
> +wm 32 MX7_DDR_PHY_ZQ_CON0 0x0C447306   /*DDR_PHY_ZQ_CON0*/
> +check 32 until_any_bit_set MX7_DDR_PHY_ZQ_CON0 0x1 /*ZQ Calibration
> is finished*/
> +wm 32 MX7_DDR_PHY_ZQ_CON0 0x0C447304   /*DDR_PHY_ZQ_CON0*/
> +wm 32 MX7_DDR_PHY_ZQ_CON0 0x0C407304   /*DDR_PHY_ZQ_CON0*/
> +
> +wm 32 0x30384130 0x00000000 /* CCM_CCGRn */
> +wm 32 0x30340020 0x00000178 /* IOMUXC_GPR_GPR8 */
> +wm 32 0x30384130 0x00000002 /* CCM_CCGRn */
> +wm 32 0x30790018 0x0000000f /* DDR_PHY_LP_CON0 */
> +
> +/* DDRC_STAT */
> +check 32 until_any_bit_set 4 0x307a0004 0x1

You use the same exact DCD table under U-Boot as well?

> +
> diff --git a/arch/arm/boards/kamstrup-imx7d-tqma7d/lowlevel.c
> b/arch/arm/boards/kamstrup-imx7d-tqma7d/lowlevel.c
> new file mode 100644
> index 000000000000..d8c455701edc
> --- /dev/null
> +++ b/arch/arm/boards/kamstrup-imx7d-tqma7d/lowlevel.c
> @@ -0,0 +1,35 @@
> +#include <debug_ll.h>
> +#include <io.h>
> +#include <common.h>
> +#include <linux/sizes.h>
> +#include <mach/generic.h>
> +#include <asm/barebox-arm-head.h>
> +#include <asm/barebox-arm.h>
> +#include <mach/imx7-ccm-regs.h>
> +#include <mach/iomux-mx7.h>
> +#include <mach/debug_ll.h>
> +#include <asm/cache.h>
> +#include <mach/esdctl.h>
> +
> +extern char __dtb_imx7d_flex_concentrator_mfg_start[];

Unrelated to your issue, but you want __dtb_z_ here
(compressed device tree). Check CONFIG_ARM_COMPRESSED_DTB

> +
> +static inline void setup_uart(void)
> +{
> +    imx7_early_setup_uart_clock();
> +
> +    imx7_setup_pad(MX7D_PAD_SAI2_TX_BCLK__UART4_DCE_TX);
> +
> +    imx7_uart_setup_ll();
> +
> +    putc_ll('>');

You've CONFIG_DEBUG_LL=y and you choose the correct UART port
in the i.MX menuconfig option?

> +}
> +
> +ENTRY_FUNCTION(start_kamstrup_imx7d_tqma7d, r0, r1, r2)
> +{
> +    imx7_cpu_lowlevel_init();
> +
> +    if (IS_ENABLED(CONFIG_DEBUG_LL))
> +        setup_uart();
> +
> +    imx7d_barebox_entry(__dtb_imx7d_flex_concentrator_mfg_start +
> get_runtime_offset());
> +}
> diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
> index d61a052310ce..ec3d0f372786 100644
> --- a/arch/arm/dts/Makefile
> +++ b/arch/arm/dts/Makefile
> @@ -23,6 +23,7 @@ lwl-$(CONFIG_MACH_CCMX53) += imx53-ccxmx53.dtb.o
>  lwl-$(CONFIG_MACH_DIGI_CCIMX6ULSBCPRO) += imx6ul-ccimx6ulsbcpro.dtb.o
>  lwl-$(CONFIG_MACH_FREESCALE_MX53_VMX53) += imx53-voipac-bsb.dtb.o
>  lwl-$(CONFIG_MACH_FREESCALE_MX7_SABRESD) += imx7d-sdb.dtb.o
> +lwl-$(CONFIG_MACH_KAMSTRUP_IMX7D_TQMA7D) += imx7d-flex-concentrator-mfg.dtb.o
>  lwl-$(CONFIG_MACH_GK802) += imx6q-gk802.dtb.o
>  lwl-$(CONFIG_MACH_GLOBALSCALE_GURUPLUG) +=
> kirkwood-guruplug-server-plus-bb.dtb.o
>  lwl-$(CONFIG_MACH_GLOBALSCALE_MIRABOX) += armada-370-mirabox-bb.dtb.o
> diff --git a/arch/arm/dts/imx7d-flex-concentrator-mfg.dts
> b/arch/arm/dts/imx7d-flex-concentrator-mfg.dts
> new file mode 100644
> index 000000000000..746e36a70f4c
> --- /dev/null
> +++ b/arch/arm/dts/imx7d-flex-concentrator-mfg.dts
> @@ -0,0 +1,11 @@
> +/*
> + * The code contained herein is licensed under the GNU General Public
> + * License. You may obtain a copy of the GNU General Public License
> + * Version 2 or later at the following locations:
> + *
> + * http://www.opensource.org/licenses/gpl-license.html
> + * http://www.gnu.org/copyleft/gpl.html
> + */
> +
> +#include <arm/imx7d-flex-concentrator-mfg.dts>
> +
> diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
> index 6dd5cb2aca15..d0a9332c7a24 100644
> --- a/arch/arm/mach-imx/Kconfig
> +++ b/arch/arm/mach-imx/Kconfig
> @@ -492,6 +492,11 @@ config MACH_ZII_IMX7D_DEV
>      select ARCH_IMX7
>      select ARM_USE_COMPRESSED_DTB
> 
> +config MACH_KAMSTRUP_IMX7D_TQMA7D
> +    bool "Kamstrup TQMa7D based devices"
> +    select ARCH_IMX7
> +    select ARM_USE_COMPRESSED_DTB
> +
>  config MACH_PHYTEC_PHYCORE_IMX7
>      bool "Phytec phyCORE i.MX7"
>      select ARCH_IMX7
> diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
> index 1ce057180a01..b0bdc48399e3 100644
> --- a/drivers/regulator/Kconfig
> +++ b/drivers/regulator/Kconfig
> @@ -19,7 +19,7 @@ config REGULATOR_BCM283X
>  config REGULATOR_PFUZE
>      bool "Freescale PFUZE100/200/3000 regulator driver"
>      depends on I2C
> -    depends on ARCH_IMX6 || ARCH_IMX8MQ
> +    depends on ARCH_IMX6 || ARCH_IMX7 || ARCH_IMX8MQ
> 
>  config REGULATOR_STM32_PWR
>      bool "STMicroelectronics STM32 PWR"
> diff --git a/dts/src/arm/imx7d-flex-concentrator-mfg.dts
> b/dts/src/arm/imx7d-flex-concentrator-mfg.dts
> new file mode 100644
> index 000000000000..789f0837058f
> --- /dev/null
> +++ b/dts/src/arm/imx7d-flex-concentrator-mfg.dts
> @@ -0,0 +1,25 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Device Tree Source for Kamstrup OMNIA Flex Concentrator in
> + * manufacturing/debugging mode.
> + *
> + * Copyright (C) 2020 Kamstrup A/S
> + * Author: Bruno Thomsen <bruno.thomsen@gmail.com>
> + */
> +
> +/dts-v1/;
> +
> +#include "imx7d-flex-concentrator.dts"
> +
> +/ {
> +    model = "Kamstrup OMNIA Flex Concentrator - Manufacturing";
> +    compatible = "kam,imx7d-flex-concentrator-mfg",
> "kam,imx7d-flex-concentrator", "fsl,imx7d";
> +
> +    chosen {
> +        stdout-path = &uart4;
> +    };
> +};
> +
> +&uart4 {
> +    status = "okay";
> +};
> diff --git a/dts/src/arm/imx7d-flex-concentrator.dts
> b/dts/src/arm/imx7d-flex-concentrator.dts
> new file mode 100644
> index 000000000000..43b331222a47
> --- /dev/null
> +++ b/dts/src/arm/imx7d-flex-concentrator.dts
> @@ -0,0 +1,313 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Device Tree Source for Kamstrup OMNIA Flex Concentrator.
> + *
> + * Copyright (C) 2020 Kamstrup A/S
> + * Author: Bruno Thomsen <bruno.thomsen@gmail.com>
> + */
> +
> +/dts-v1/;
> +
> +#include "imx7d-tqma7.dtsi"
> +
> +/* Some I2C devices on TQMa7 SoM are not mounted */
> +/delete-node/ &m24c64;
> +/delete-node/ &ds1339;
> +
> +/ {
> +    model = "Kamstrup OMNIA Flex Concentrator";
> +    compatible = "kam,imx7d-flex-concentrator", "fsl,imx7d";
> +
> +    memory@80000000 {
> +        device_type = "memory";
> +        /* 1024 MB - TQMa7D board configuration */
> +        reg = <0x80000000 0x40000000>;
> +    };
> +
> +    reg_usb_otg2_vbus: regulator-usb-otg2-vbus {
> +        compatible = "regulator-fixed";
> +        regulator-name = "VBUS_USBOTG2";
> +        regulator-min-microvolt = <5000000>;
> +        regulator-max-microvolt = <5000000>;
> +        gpio = <&gpio1 7 GPIO_ACTIVE_HIGH>;
> +        enable-active-high;
> +    };
> +
> +    reg_vref_1v8: regulator-vref-1v8 {
> +        compatible = "regulator-fixed";
> +        regulator-name = "VCC1V8_REF";
> +        regulator-min-microvolt = <1800000>;
> +        regulator-max-microvolt = <1800000>;
> +        regulator-always-on;
> +        vin-supply = <&sw2_reg>;
> +    };
> +
> +    /*
> +     * Human Machine Interface consists of 4 dual red/green LEDs.
> +     * hmi-a-green is controlled directly by the switch-mode power supply.
> +     * hmi-a-red is not used.
> +     */
> +    gpio-leds {
> +        compatible = "gpio-leds";
> +        pinctrl-names = "default";
> +        pinctrl-0 = <&pinctrl_leds>;
> +
> +        hmi-b-red {
> +            label = "hmi-b:red:provisioning";
> +            gpios = <&gpio3 6 GPIO_ACTIVE_HIGH>;
> +            default-state = "off";
> +        };
> +
> +        hmi-b-green {
> +            label = "hmi-b:green:operation";
> +            gpios = <&gpio2 28 GPIO_ACTIVE_HIGH>;
> +            default-state = "off";
> +        };
> +
> +        hmi-c-red {
> +            label = "hmi-c:red:mesh-error";
> +            gpios = <&gpio2 29 GPIO_ACTIVE_HIGH>;
> +            default-state = "off";
> +        };
> +
> +        hmi-c-green {
> +            label = "hmi-c:green:mesh-activity";
> +            gpios = <&gpio2 30 GPIO_ACTIVE_HIGH>;
> +            default-state = "off";
> +        };
> +
> +        hmi-d-red {
> +            label = "hmi-d:red:wan-down";
> +            gpios = <&gpio2 31 GPIO_ACTIVE_HIGH>;
> +            default-state = "off";
> +        };
> +
> +        hmi-d-green {
> +            label = "hmi-d:green:ipsec-up";
> +            gpios = <&gpio4 3 GPIO_ACTIVE_HIGH>;
> +            default-state = "off";
> +        };
> +    };
> +
> +    /*
> +     * Errata e10574 board restart workaround.
> +     */
> +    gpio-restart {
> +        pinctrl-names = "default";
> +        pinctrl-0 = <&pinctrl_restart>;
> +        compatible = "gpio-restart";
> +        gpios = <&gpio7 12 GPIO_ACTIVE_LOW>;
> +        priority = <200>;
> +    };
> +};
> +
> +/*
> + * Analog signals
> + * ADC1_IN0: SMPS - 5V output monitor (voltage divider: 1/0.2806)
> + */
> +&adc1 {
> +    vref-supply = <&reg_vref_1v8>;
> +    status = "okay";
> +};
> +
> +&ecspi2 {
> +    pinctrl-names = "default";
> +    pinctrl-0 = <&pinctrl_ecspi2>;
> +    num-chipselects = <1>;
> +    cs-gpios = <&gpio4 23 GPIO_ACTIVE_LOW>;
> +    status = "okay";
> +
> +    pcf2127: rtc@0 {
> +        compatible = "nxp,pcf2127";
> +        reg = <0>;
> +        spi-max-frequency = <2000000>;
> +    };
> +};
> +
> +&ecspi4 {
> +    pinctrl-names = "default";
> +    pinctrl-0 = <&pinctrl_ecspi4>;
> +    num-chipselects = <1>;
> +    cs-gpios = <&gpio3 3 GPIO_ACTIVE_LOW>;
> +    status = "okay";
> +
> +    /*
> +     * ST chip maximum SPI clock frequency is 33 MHz.
> +     *
> +     * TCG specification - Section 6.4.1 Clocking:
> +     * TPM shall support a SPI clock frequency range of 10-24 MHz.
> +     */
> +    st33htph: tpm-tis@0 {
> +        compatible = "st,st33htpm-spi", "tcg,tpm_tis-spi";
> +        reg = <0>;
> +        spi-max-frequency = <24000000>;
> +    };
> +};
> +
> +&fec1 {
> +    pinctrl-names = "default";
> +    pinctrl-0 = <&pinctrl_enet1>;
> +    phy-mode = "rmii";
> +    phy-handle = <&ethphy>;
> +    status = "okay";
> +
> +    mdio {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        /* Micrel KSZ8081RNB */
> +        ethphy: ethernet-phy@1 {
> +            compatible = "ethernet-phy-id0022.1560",
> "ethernet-phy-ieee802.3-c22";
> +            reg = <1>;
> +            max-speed = <100>;
> +            interrupt-parent = <&gpio1>;
> +            interrupts = <9 IRQ_TYPE_LEVEL_LOW>;
> +            reset-assert-us = <100000>;
> +            reset-deassert-us = <1000000>;
> +            reset-gpios = <&gpio7 15 GPIO_ACTIVE_LOW>;
> +        };
> +    };
> +};
> +
> +/*
> + * Detection signals for internal USB modules.
> + * Used for robust USB plug and play handling such as USB downstream port
> + * power-cycle and USB hub reset in case of misbehaving or crashed modules.
> + *
> + * SMPS - AC input monitor based on zero crossing.
> + * Used for last gasp notification.
> + */
> +&gpio3 {
> +    gpio-line-names = "", "", "", "", "", "", "", "",
> +    "", "", "", "", "smps-ac-monitor", "", "usb-hub-reset", "",
> +    "", "", "", "", "", "", "", "",
> +    "", "module-b-detection", "", "module-a-detection", "", "", "", "";
> +};
> +
> +/*
> + * Tamper IRQ trigger timestamp reading.
> + * Used for sealed cover opened/closed notification.
> + */
> +&gpio5 {
> +    gpio-line-names = "", "", "", "", "", "", "", "",
> +    "", "", "", "", "rtc-tamper-irq", "", "", "",
> +    "", "", "", "", "", "", "", "",
> +    "", "", "", "", "", "", "", "";
> +};
> +
> +&iomuxc {
> +    pinctrl-names = "default";
> +    pinctrl-0 = <&pinctrl_misc>;
> +
> +    pinctrl_ecspi2: ecspi2grp {
> +        fsl,pins = <
> +            MX7D_PAD_ECSPI2_MISO__ECSPI2_MISO        0x7c /* X2-15 */
> +            MX7D_PAD_ECSPI2_MOSI__ECSPI2_MOSI        0x74 /* X2-18 */
> +            MX7D_PAD_ECSPI2_SCLK__ECSPI2_SCLK        0x74 /* X2-13 */
> +            MX7D_PAD_ECSPI2_SS0__GPIO4_IO23            0x74 /* X2-20 */
> +            /* RTC - Tamper IRQ */
> +            MX7D_PAD_SD2_CLK__GPIO5_IO12            0x3c /* X1-92 */
> +        >;
> +    };
> +
> +    pinctrl_ecspi4: ecspi4grp {
> +        fsl,pins = <
> +            MX7D_PAD_LCD_CLK__ECSPI4_MISO            0x7c /* X2-72 */
> +            MX7D_PAD_LCD_ENABLE__ECSPI4_MOSI        0x74 /* X2-68 */
> +            MX7D_PAD_LCD_HSYNC__ECSPI4_SCLK            0x74 /* X2-76 */
> +            MX7D_PAD_LCD_VSYNC__GPIO3_IO3            0x74 /* X2-78 */
> +        >;
> +    };
> +
> +    pinctrl_enet1: enet1grp {
> +        fsl,pins = <
> +            MX7D_PAD_GPIO1_IO10__ENET1_MDIO            0x02 /* X2-48 */
> +            MX7D_PAD_GPIO1_IO11__ENET1_MDC            0x00 /* X2-46 */
> +            MX7D_PAD_ENET1_RGMII_TD0__ENET1_RGMII_TD0    0x71 /* X2-53 */
> +            MX7D_PAD_ENET1_RGMII_TD1__ENET1_RGMII_TD1    0x71 /* X2-55 */
> +            MX7D_PAD_ENET1_RGMII_TX_CTL__ENET1_RGMII_TX_CTL    0x71 /* X2-61 */
> +            MX7D_PAD_ENET1_RGMII_RD0__ENET1_RGMII_RD0    0x79 /* X2-56 */
> +            MX7D_PAD_ENET1_RGMII_RD1__ENET1_RGMII_RD1    0x79 /* X2-58 */
> +            MX7D_PAD_ENET1_RGMII_RX_CTL__ENET1_RGMII_RX_CTL    0x79 /* X2-64 */
> +            MX7D_PAD_ENET1_RGMII_RXC__ENET1_RX_ER        0x73 /* X2-52 */
> +            /* PHY reset: SION, 100kPU, SRE_FAST, DSE_X1 */
> +            MX7D_PAD_ENET1_COL__GPIO7_IO15        0x40000070 /* X1-96 */
> +            /* Clock from PHY to MAC */
> +            MX7D_PAD_GPIO1_IO12__CCM_ENET_REF_CLK1    0x40000073 /* X3-4 */
> +            /* PHY interrupt: SION, 100kPU, HYS, SRE_FAST, DSE_X1 */
> +            MX7D_PAD_GPIO1_IO09__GPIO1_IO9        0x40000078 /* X1-80 */
> +        >;
> +    };
> +
> +    pinctrl_leds: ledsgrp {
> +        fsl,pins = <
> +            MX7D_PAD_LCD_DATA01__GPIO3_IO6            0x14 /* X2-82 */
> +            MX7D_PAD_EPDC_BDR0__GPIO2_IO28            0x14 /* X1-82 */
> +            MX7D_PAD_EPDC_BDR1__GPIO2_IO29            0x14 /* X1-84 */
> +            MX7D_PAD_EPDC_PWR_COM__GPIO2_IO30        0x14 /* X1-86 */
> +            MX7D_PAD_EPDC_PWR_STAT__GPIO2_IO31        0x14 /* X1-88 */
> +            MX7D_PAD_UART2_TX_DATA__GPIO4_IO3        0x14 /* X1-90 */
> +        >;
> +    };
> +
> +    pinctrl_misc: miscgrp {
> +        fsl,pins = <
> +            /* Module A detection (low = present) */
> +            MX7D_PAD_LCD_DATA22__GPIO3_IO27            0x7c /* X2-105 */
> +            /* Module B detection (low = present) */
> +            MX7D_PAD_LCD_DATA20__GPIO3_IO25            0x7c /* X2-103 */
> +            /* SMPS - AC input monitor (high = failure) */
> +            MX7D_PAD_LCD_DATA07__GPIO3_IO12            0x7c /* X2-88 */
> +            /* USB - Hub reset */
> +            MX7D_PAD_LCD_DATA09__GPIO3_IO14            0x74 /* X2-92 */
> +        >;
> +    };
> +
> +    pinctrl_restart: restartgrp {
> +        fsl,pins = <
> +            MX7D_PAD_ENET1_TX_CLK__GPIO7_IO12    0x74 /* X1-94 */
> +        >;
> +    };
> +
> +    pinctrl_uart4: uart4grp {
> +        fsl,pins = <
> +            MX7D_PAD_SAI2_TX_SYNC__UART4_DCE_RX    0x7e /* X3-14 */
> +            MX7D_PAD_SAI2_TX_BCLK__UART4_DCE_TX    0x76 /* X3-16 */
> +        >;
> +    };
> +};
> +
> +&iomuxc_lpsr {
> +    pinctrl_usbotg2: usbotg2grp {
> +        fsl,pins = <
> +            MX7D_PAD_LPSR_GPIO1_IO06__USB_OTG2_OC    0x5c /* X3-11 */
> +            MX7D_PAD_LPSR_GPIO1_IO07__GPIO1_IO7    0x59 /* X3-9 */
> +        >;
> +    };
> +
> +};
> +
> +&uart4 {
> +    pinctrl-names = "default";
> +    pinctrl-0 = <&pinctrl_uart4>;
> +    assigned-clocks = <&clks IMX7D_UART4_ROOT_SRC>;
> +    assigned-clock-parents = <&clks IMX7D_OSC_24M_CLK>;
> +};
> +
> +&usbotg2 {
> +    pinctrl-names = "default";
> +    pinctrl-0 = <&pinctrl_usbotg2>;
> +    vbus-supply = <&reg_usb_otg2_vbus>;
> +    srp-disable;
> +    hnp-disable;
> +    adp-disable;
> +    dr_mode = "host";
> +    status = "okay";
> +};
> +
> +/*
> + * External watchdog feature provided by pcf2127.
> + */
> +&wdog1 {
> +    status = "disabled";
> +};
> diff --git a/images/Makefile.imx b/images/Makefile.imx
> index 765702f26deb..cbbefd5c085b 100644
> --- a/images/Makefile.imx
> +++ b/images/Makefile.imx
> @@ -364,6 +364,11 @@ CFG_start_zii_imx7d_dev.pblb.imximg =
> $(board)/zii-imx7d-dev/flash-header-zii-im
>  FILE_barebox-zii-imx7d-dev.img = start_zii_imx7d_dev.pblb.imximg
>  image-$(CONFIG_MACH_ZII_IMX7D_DEV) += barebox-zii-imx7d-dev.img
> 
> +pblb-$(CONFIG_MACH_KAMSTRUP_IMX7D_TQMA7D) += start_kamstrup_imx7d_tqma7d
> +CFG_start_kamstrup_imx7d_tqma7d.pblb.imximg =
> $(board)/kamstrup-imx7d-tqma7d/flash-header-kamstrup-imx7d-tqma7d.imxcfg
> +FILE_barebox-kamstrup-imx7d-tqma7d.img =
> start_kamstrup_imx7d_tqma7d.pblb.imximg
> +image-$(CONFIG_MACH_KAMSTRUP_IMX7D_TQMA7D) += barebox-kamstrup-imx7d-tqma7d.img
> +
>  # ----------------------- i.MX8mm based boards --------------------------
>  pblb-$(CONFIG_MACH_NXP_IMX8MM_EVK) += start_nxp_imx8mm_evk
>  CFG_start_nxp_imx8mm_evk.pblb.imximg =
> $(board)/nxp-imx8mm-evk/flash-header-imx8mm-evk.imxcfg
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Getting serial console output on new imx7d tqma7 board UART4
  2020-07-29 17:22 ` Ahmad Fatoum
@ 2020-07-30  6:58   ` Lars Pedersen
  2020-07-30  7:25     ` Ahmad Fatoum
  0 siblings, 1 reply; 20+ messages in thread
From: Lars Pedersen @ 2020-07-30  6:58 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox

The DCD part now matches exactly for the top part (00000000 to
00000020)  of it which i guess is the IVT header, which shouldn't be
the same?

The following is xxd where barebox  (left side) has been shifted 0x400
to match u-boot part.

/usr/bin/diff -y <(xxd barebox_stripped) <(xxd uboot_stripped)
00000000: d100 2040 0010 0080 0000 0000 2c04 0080  .. @...... |
00000000: d100 2040 0000 c0bf 0000 0000 2cf4 bfbf  .. @......
00000010: 2004 0080 0004 0080 0000 0000 0000 0000   ......... |
00000010: 20f4 bfbf 00f4 bfbf 0000 0000 0000 0000   .........
00000020: 0000 0080 00e0 0500 0000 0000 d201 ec40  .......... |
00000020: 00f0 bfbf 00b0 0600 0000 0000 d201 ec40  ..........
00000030: cc00 3404 3034 0004 4f40 0005 3036 0388  ..4.04..O@
00000030: cc00 3404 3034 0004 4f40 0005 3036 0388  ..4.04..O@
00000040: 4000 0000 3036 0384 4000 0000 3036 0070  @...06..@.
00000040: 4000 0000 3036 0384 4000 0000 3036 0070  @...06..@.
00000050: 0070 302c 3036 0090 0000 0000 3036 0070  .p0,06....
00000050: 0070 302c 3036 0090 0000 0000 3036 0070  .p0,06....
00000060: 0060 302c cf00 0c14 3036 0070 8000 0000  .`0,....06
00000060: 0060 302c cf00 0c14 3036 0070 8000 0000  .`0,....06
00000070: cc01 5c04 3039 1000 0000 0002 307a 0000  ..\.09....
00000070: cc01 5c04 3039 1000 0000 0002 307a 0000  ..\.09....
00000080: 0104 0001 307a 01a0 8040 0003 307a 01a4  ....0z...@
00000080: 0104 0001 307a 01a0 8040 0003 307a 01a4  ....0z...@
00000090: 0010 0020 307a 01a8 8010 0004 307a 0064  ... 0z....
00000090: 0010 0020 307a 01a8 8010 0004 307a 0064  ... 0z....
000000a0: 0020 0045 307a 0490 0000 0001 307a 00d0  . .E0z....
000000a0: 0020 0045 307a 0490 0000 0001 307a 00d0  . .E0z....
000000b0: 0002 0081 307a 00d4 0068 0000 307a 00dc  ....0z...h
000000b0: 0002 0081 307a 00d4 0068 0000 307a 00dc  ....0z...h
000000c0: 0930 0004 307a 00e0 0048 0000 307a 00e4  .0..0z...H
000000c0: 0930 0004 307a 00e0 0048 0000 307a 00e4  .0..0z...H
000000d0: 0010 0004 307a 00f4 0000 033f 307a 0100  ....0z....
000000d0: 0010 0004 307a 00f4 0000 033f 307a 0100  ....0z....
000000e0: 090e 0809 307a 0104 0007 020e 307a 0108  ....0z....
000000e0: 090e 0809 307a 0104 0007 020e 307a 0108  ....0z....
000000f0: 0304 0407 307a 010c 0000 2006 307a 0110  ....0z....
000000f0: 0304 0407 307a 010c 0000 2006 307a 0110  ....0z....
00000100: 0402 0304 307a 0114 0303 0202 307a 0120  ....0z....
00000100: 0402 0304 307a 0114 0303 0202 307a 0120  ....0z....
00000110: 0000 0803 307a 0180 0080 0020 307a 0190  ....0z....
00000110: 0000 0803 307a 0180 0080 0020 307a 0190  ....0z....
00000120: 0209 8204 307a 0194 0003 0303 307a 0200  ....0z....
00000120: 0209 8204 307a 0194 0003 0303 307a 0200  ....0z....
00000130: 0000 0016 307a 0204 0017 1717 307a 0210  ....0z....
00000130: 0000 0016 307a 0204 0017 1717 307a 0210  ....0z....
00000140: 0000 0f0f 307a 0214 0404 0404 307a 0218  ....0z....
00000140: 0000 0f0f 307a 0214 0404 0404 307a 0218  ....0z....
00000150: 0f04 0404 307a 0240 0600 0604 307a 0244  ....0z.@..
00000150: 0f04 0404 307a 0240 0600 0604 307a 0244  ....0z.@..
00000160: 0000 0001 3039 1000 0000 0000 3079 0000  ....09....
00000160: 0000 0001 3039 1000 0000 0000 3079 0000  ....09....
00000170: 1742 0f40 3079 0004 1021 0100 3079 0010  .B.@0y...!
00000170: 1742 0f40 3079 0004 1021 0100 3079 0010  .B.@0y...!
00000180: 0006 0807 3079 00b0 1010 007e 3079 009c  ....0y....
00000180: 0006 0807 3079 00b0 1010 007e 3079 009c  ....0y....
00000190: 0000 0924 3079 0020 0b0b 0b0b 3079 0030  ...$0y. ..
00000190: 0000 0924 3079 0020 0b0b 0b0b 3079 0030  ...$0y. ..
000001a0: 0606 0606 3079 0050 0100 0010 3079 0050  ....0y.P..
000001a0: 0606 0606 3079 0050 0100 0010 3079 0050  ....0y.P..
000001b0: 0000 0010 3079 00c0 0c40 7304 3079 00c0  ....0y...@
000001b0: 0000 0010 3079 00c0 0c40 7304 3079 00c0  ....0y...@
000001c0: 0c44 7304 3079 00c0 0c44 7306 cf00 0c14  .Ds.0y...D
000001c0: 0c44 7304 3079 00c0 0c44 7306 cf00 0c14  .Ds.0y...D
000001d0: 3079 00c4 0000 0001 cc00 3404 3079 00c0  0y........
000001d0: 3079 00c4 0000 0001 cc00 3404 3079 00c0  0y........
000001e0: 0c44 7304 3079 00c0 0c40 7304 3038 4130  .Ds.0y...@
000001e0: 0c44 7304 3079 00c0 0c40 7304 3038 4130  .Ds.0y...@
000001f0: 0000 0000 3034 0020 0000 0178 3038 4130  ....04. ..
000001f0: 0000 0000 3034 0020 0000 0178 3038 4130  ....04. ..
00000200: 0000 0002 3079 0018 0000 000f cf00 0c14  ....0y....
00000200: 0000 0002 3079 0018 0000 000f cf00 0c14  ....0y....
00000210: 307a 0004 0000 0001 0000 0000 0000 0000  0z........
00000210: 307a 0004 0000 0001 0000 0000 0000 0000  0z........

So I guess that the DCD table part now should be correct. So the
question is if this is and lowlevel.c/board.c boilerplate issue or
maybe I need something in the Kconfig menu.

/Lars Pedersen

On Wed, 29 Jul 2020 at 19:22, Ahmad Fatoum <a.fatoum@pengutronix.de> wrote:
>
> Hello Lars,
>
> On 7/29/20 6:52 PM, Lars Pedersen wrote:
> > I have spent the last couple of days trying to port our bootloader
> > from u-boot to barebox 2020.07 but have yet to get any console output.
> > Our product is based on tqma7d i.MX7 dual core cpu and uses UART4 for
> > serial console and boots from internal eMMC.
> >
> > I created a new board inspired from "NXP i.MX7 SabreSD board" and
> > tried to only add the basic in the first step to get a console output
> > working. The image is built using ptxdist and the imx_v7_defconfig
> > where the new board is selected. The image is flashed with "dd
> > if=barebox-image of=/dev/mmcblk0 bs=1024 skip=1 seek=1 conv=fsync".
> > The device works using u-boot 2020.07 with the same device trees but
> > we thought it was time to try out barebox since u-boot felt a little
> > bloated :)
> >
> > So can anyone be of assistance and tell me what I'm missing?
> >
> > /Lars Pedersen
> >
> > From: Lars Pedersen <laa@kamstrup.com>
> > Date: Tue, 28 Jul 2020 08:57:57 +0000
> > Subject: [PATCH] Add kamstrup imx7d dev board
> >
> > ---
> >  arch/arm/boards/Makefile                           |   1 +
> >  arch/arm/boards/kamstrup-imx7d-tqma7d/Makefile     |   2 +
> >  arch/arm/boards/kamstrup-imx7d-tqma7d/board.c      |  19 ++
> >  .../flash-header-kamstrup-imx7d-tqma7d.imxcfg      |  79 ++++++
> >  arch/arm/boards/kamstrup-imx7d-tqma7d/lowlevel.c   |  35 +++
> >  arch/arm/dts/Makefile                              |   1 +
> >  arch/arm/dts/imx7d-flex-concentrator-mfg.dts       |  11 +
> >  arch/arm/mach-imx/Kconfig                          |   5 +
> >  drivers/regulator/Kconfig                          |   2 +-
> >  dts/src/arm/imx7d-flex-concentrator-mfg.dts        |  25 ++
> >  dts/src/arm/imx7d-flex-concentrator.dts            | 313 +++++++++++++++++++++
> >  images/Makefile.imx                                |   5 +
> >  12 files changed, 497 insertions(+), 1 deletion(-)
> >  create mode 100644 arch/arm/boards/kamstrup-imx7d-tqma7d/Makefile
> >  create mode 100644 arch/arm/boards/kamstrup-imx7d-tqma7d/board.c
> >  create mode 100644
> > arch/arm/boards/kamstrup-imx7d-tqma7d/flash-header-kamstrup-imx7d-tqma7d.imxcfg
> >  create mode 100644 arch/arm/boards/kamstrup-imx7d-tqma7d/lowlevel.c
> >  create mode 100644 arch/arm/dts/imx7d-flex-concentrator-mfg.dts
> >  create mode 100644 dts/src/arm/imx7d-flex-concentrator-mfg.dts
> >  create mode 100644 dts/src/arm/imx7d-flex-concentrator.dts
> >
> > diff --git a/arch/arm/boards/Makefile b/arch/arm/boards/Makefile
> > index e9e9163d589b..58bb4cf2adab 100644
> > --- a/arch/arm/boards/Makefile
> > +++ b/arch/arm/boards/Makefile
> > @@ -64,6 +64,7 @@ obj-$(CONFIG_MACH_HIGHBANK)            += highbank/
> >  obj-$(CONFIG_MACH_IMX21ADS)            += freescale-mx21-ads/
> >  obj-$(CONFIG_MACH_IMX233_OLINUXINO)        += imx233-olinuxino/
> >  obj-$(CONFIG_MACH_IMX27ADS)            += freescale-mx27-ads/
> > +obj-$(CONFIG_MACH_KAMSTRUP_IMX7D_TQMA7D)    += kamstrup-imx7d-tqma7d/
> >  obj-$(CONFIG_MACH_KINDLE3)            += kindle3/
> >  obj-$(CONFIG_MACH_KONTRON_SAMX6I)        += kontron-samx6i/
> >  obj-$(CONFIG_MACH_LENOVO_IX4_300D)        += lenovo-ix4-300d/
> > diff --git a/arch/arm/boards/kamstrup-imx7d-tqma7d/Makefile
> > b/arch/arm/boards/kamstrup-imx7d-tqma7d/Makefile
> > new file mode 100644
> > index 000000000000..01c7a259e9a5
> > --- /dev/null
> > +++ b/arch/arm/boards/kamstrup-imx7d-tqma7d/Makefile
> > @@ -0,0 +1,2 @@
> > +obj-y += board.o
> > +lwl-y += lowlevel.o
> > diff --git a/arch/arm/boards/kamstrup-imx7d-tqma7d/board.c
> > b/arch/arm/boards/kamstrup-imx7d-tqma7d/board.c
> > new file mode 100644
> > index 000000000000..b3ffa851f3e6
> > --- /dev/null
> > +++ b/arch/arm/boards/kamstrup-imx7d-tqma7d/board.c
> > @@ -0,0 +1,19 @@
> > +// SPDX-License-Identifier: GPL-2.0-or-later
> > +// SPDX-FileCopyrightText: 2020 Kamstrup A/S
> > +
> > +/* Author: Lars Pedersen <lapeddk@gmail.com> */
> > +
> > +#include <common.h>
> > +#include <init.h>
> > +#include <io.h>
> > +#include <mach/imx7-regs.h>
> > +#include <mfd/imx7-iomuxc-gpr.h>
> > +
> > +static int kamstrup_mx7_tqma7d_coredevices_init(void)
> > +{
> > +    if (!of_machine_is_compatible("kam,imx7d-flex-concentrator"))
> > +        return 0;
> > +
> > +    return 0;
> > +}
> > +coredevice_initcall(kamstrup_mx7_tqma7d_coredevices_init);
> > diff --git a/arch/arm/boards/kamstrup-imx7d-tqma7d/flash-header-kamstrup-imx7d-tqma7d.imxcfg
> > b/arch/arm/boards/kamstrup-imx7d-tqma7d/flash-header-kamstrup-imx7d-tqma7d.imxcfg
> > new file mode 100644
> > index 000000000000..7656619c1b2e
> > --- /dev/null
> > +++ b/arch/arm/boards/kamstrup-imx7d-tqma7d/flash-header-kamstrup-imx7d-tqma7d.imxcfg
> > @@ -0,0 +1,79 @@
> > +soc imx7
> > +loadaddr 0x80000000
> > +dcdofs 0x400
> > +
> > +#include <mach/imx7-ddr-regs.h>
> > +wm 32 0x30340004 0x4F400005 /* IOMUXC_GPR_GPR1 */
> > +/* TODO this is copied from imx7sabresd */
> > +/* Clear then set bit30 to ensure exit from DDR retention */
> > +wm 32 0x30360388 0x40000000
> > +wm 32 0x30360384 0x40000000
> > +
> > +/* TQMa7x DRAM Timing REV0100 */
> > +/* DCD Code i.MX7D/S 528 MHz 1 GByte Samsung K4B4G1646D */
> > +wm 32 0x30360070 0x0070302C     /*CCM_ANALOG_PLL_DDRx*/
> > +wm 32  0x30360090 0x00000000    /*CCM_ANALOG_PLL_NUM*/
> > +wm 32  0x30360070 0x0060302C    /*CCM_ANALOG_PLL_DDRx*/
> > +check 32 until_any_bit_set 0x30360070 0x80000000
> > +wm 32 0x30391000 0x00000002     /*SRC_DDRC_RCR*/
> > +
> > +wm 32 MX7_DDRC_MSTR 0x01040001   /*DDRC_MSTR*/
> > +wm 32 MX7_DDRC_DFIUPD0 0x80400003   /*DDRC_DFIUPD0*/
> > +wm 32 MX7_DDRC_DFIUPD1 0x00100020   /*DDRC_DFIUPD1*/
> > +wm 32 MX7_DDRC_DFIUPD2 0x80100004   /*DDRC_DFIUPD2*/
> > +wm 32 MX7_DDRC_RFSHTMG 0x00200045   /*DDRC_RFSHTMG*/
> > +wm 32 MX7_DDRC_MP_PCTRL_0 0x00000001   /*DDRC_MP_PCTRL_0*/
> > +wm 32 MX7_DDRC_INIT0 0x00020081   /*DDRC_INIT0*/
> > +wm 32 MX7_DDRC_INIT1 0x00680000   /*DDRC_INIT1*/
> > +wm 32 MX7_DDRC_INIT3 0x09300004   /*DDRC_INIT3*/
> > +wm 32 MX7_DDRC_INIT4 0x00480000   /*DDRC_INIT4*/
> > +wm 32 MX7_DDRC_INIT5 0x00100004   /*DDRC_INIT5*/
> > +wm 32 MX7_DDRC_RANKCTL 0x0000033F   /*DDRC_RANKCTL*/
> > +wm 32 MX7_DDRC_DRAMTMG0 0x090E0809   /*DDRC_DRAMTMG0*/
> > +wm 32 MX7_DDRC_DRAMTMG1 0x0007020E   /*DDRC_DRAMTMG1*/
> > +wm 32 MX7_DDRC_DRAMTMG2 0x03040407   /*DDRC_DRAMTMG2*/
> > +wm 32 MX7_DDRC_DRAMTMG3 0x00002006   /*DDRC_DRAMTMG3*/
> > +wm 32 MX7_DDRC_DRAMTMG4 0x04020304   /*DDRC_DRAMTMG4*/
> > +wm 32 MX7_DDRC_DRAMTMG5 0x03030202   /*DDRC_DRAMTMG5*/
> > +wm 32 MX7_DDRC_DRAMTMG8 0x00000803   /*DDRC_DRAMTMG8*/
> > +wm 32 MX7_DDRC_ZQCTL0 0x00800020   /*DDRC_ZQCTL0*/
> > +wm 32 MX7_DDRC_DFITMG0 0x02098204   /*DDRC_DFITMG0*/
> > +wm 32 MX7_DDRC_DFITMG1 0x00030303   /*DDRC_DFITMG1*/
> > +wm 32 MX7_DDRC_ADDRMAP0 0x00000016   /*DDRC_ADDRMAP0*/
> > +wm 32 MX7_DDRC_ADDRMAP1 0x00171717   /*DDRC_ADDRMAP1*/
> > +wm 32 MX7_DDRC_ADDRMAP4 0x00000F0F   /*DDRC_ADDRMAP4*/
> > +wm 32 MX7_DDRC_ADDRMAP5 0x04040404   /*DDRC_ADDRMAP5*/
> > +wm 32 MX7_DDRC_ADDRMAP6 0x0F040404   /*DDRC_ADDRMAP6*/
> > +wm 32 MX7_DDRC_ODTCFG 0x06000604   /*DDRC_ODTCFG*/
> > +wm 32 MX7_DDRC_ODTMAP 0x00000001   /*DDRC_ODTMAP*/
> > +wm 32 0x30391000 0x00000000   /*SRC_DDRC_RCR*/
> > +wm 32 MX7_DDR_PHY_PHY_CON0 0x17420F40   /*DDR_PHY_PHY_CON0*/
> > +wm 32 MX7_DDR_PHY_PHY_CON1 0x10210100   /*DDR_PHY_PHY_CON1*/
> > +wm 32 MX7_DDR_PHY_PHY_CON4 0x00060807   /*DDR_PHY_PHY_CON4*/
> > +wm 32 MX7_DDR_PHY_MDLL_CON0 0x1010007E   /*DDR_PHY_MDLL_CON0*/
> > +wm 32 MX7_DDR_PHY_DRVDS_CON0 0x00000924   /*DDR_PHY_DRVDS_CON0*/
> > +/*DDR_PHY_CMD_DESKEW_CON0*/
> > +/*DDR_PHY_CMD_DESKEW_CON1*/
> > +/*DDR_PHY_CMD_DESKEW_CON2*/
> > +/*DDR_PHY_CMD_DESKEW_CON3*/
> > +/*DDR_PHY_LVL_CON0*/
> > +wm 32 MX7_DDR_PHY_OFFSET_RD_CON0 0x0B0B0B0B   /*DDR_PHY_OFFSET_RD_CON0 */
> > +wm 32 MX7_DDR_PHY_OFFSET_WR_CON0 0x06060606   /*DDR_PHY_OFFSET_WR_CON0 */
> > +wm 32 MX7_DDR_PHY_CMD_SDLL_CON0 0x01000010   /*DDR_PHY_CMD_SDLL_CON0*/
> > +wm 32 MX7_DDR_PHY_CMD_SDLL_CON0 0x00000010   /*DDR_PHY_CMD_SDLL_CON0*/
> > +
> > +wm 32 MX7_DDR_PHY_ZQ_CON0 0x0C407304   /*DDR_PHY_ZQ_CON0*/
> > +wm 32 MX7_DDR_PHY_ZQ_CON0 0x0C447304   /*DDR_PHY_ZQ_CON0*/
> > +wm 32 MX7_DDR_PHY_ZQ_CON0 0x0C447306   /*DDR_PHY_ZQ_CON0*/
> > +check 32 until_any_bit_set MX7_DDR_PHY_ZQ_CON0 0x1 /*ZQ Calibration
> > is finished*/
> > +wm 32 MX7_DDR_PHY_ZQ_CON0 0x0C447304   /*DDR_PHY_ZQ_CON0*/
> > +wm 32 MX7_DDR_PHY_ZQ_CON0 0x0C407304   /*DDR_PHY_ZQ_CON0*/
> > +
> > +wm 32 0x30384130 0x00000000 /* CCM_CCGRn */
> > +wm 32 0x30340020 0x00000178 /* IOMUXC_GPR_GPR8 */
> > +wm 32 0x30384130 0x00000002 /* CCM_CCGRn */
> > +wm 32 0x30790018 0x0000000f /* DDR_PHY_LP_CON0 */
> > +
> > +/* DDRC_STAT */
> > +check 32 until_any_bit_set 4 0x307a0004 0x1
>
> You use the same exact DCD table under U-Boot as well?
>
> > +
> > diff --git a/arch/arm/boards/kamstrup-imx7d-tqma7d/lowlevel.c
> > b/arch/arm/boards/kamstrup-imx7d-tqma7d/lowlevel.c
> > new file mode 100644
> > index 000000000000..d8c455701edc
> > --- /dev/null
> > +++ b/arch/arm/boards/kamstrup-imx7d-tqma7d/lowlevel.c
> > @@ -0,0 +1,35 @@
> > +#include <debug_ll.h>
> > +#include <io.h>
> > +#include <common.h>
> > +#include <linux/sizes.h>
> > +#include <mach/generic.h>
> > +#include <asm/barebox-arm-head.h>
> > +#include <asm/barebox-arm.h>
> > +#include <mach/imx7-ccm-regs.h>
> > +#include <mach/iomux-mx7.h>
> > +#include <mach/debug_ll.h>
> > +#include <asm/cache.h>
> > +#include <mach/esdctl.h>
> > +
> > +extern char __dtb_imx7d_flex_concentrator_mfg_start[];
>
> Unrelated to your issue, but you want __dtb_z_ here
> (compressed device tree). Check CONFIG_ARM_COMPRESSED_DTB
>
> > +
> > +static inline void setup_uart(void)
> > +{
> > +    imx7_early_setup_uart_clock();
> > +
> > +    imx7_setup_pad(MX7D_PAD_SAI2_TX_BCLK__UART4_DCE_TX);
> > +
> > +    imx7_uart_setup_ll();
> > +
> > +    putc_ll('>');
>
> You've CONFIG_DEBUG_LL=y and you choose the correct UART port
> in the i.MX menuconfig option?
>
> > +}
> > +
> > +ENTRY_FUNCTION(start_kamstrup_imx7d_tqma7d, r0, r1, r2)
> > +{
> > +    imx7_cpu_lowlevel_init();
> > +
> > +    if (IS_ENABLED(CONFIG_DEBUG_LL))
> > +        setup_uart();
> > +
> > +    imx7d_barebox_entry(__dtb_imx7d_flex_concentrator_mfg_start +
> > get_runtime_offset());
> > +}
> > diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
> > index d61a052310ce..ec3d0f372786 100644
> > --- a/arch/arm/dts/Makefile
> > +++ b/arch/arm/dts/Makefile
> > @@ -23,6 +23,7 @@ lwl-$(CONFIG_MACH_CCMX53) += imx53-ccxmx53.dtb.o
> >  lwl-$(CONFIG_MACH_DIGI_CCIMX6ULSBCPRO) += imx6ul-ccimx6ulsbcpro.dtb.o
> >  lwl-$(CONFIG_MACH_FREESCALE_MX53_VMX53) += imx53-voipac-bsb.dtb.o
> >  lwl-$(CONFIG_MACH_FREESCALE_MX7_SABRESD) += imx7d-sdb.dtb.o
> > +lwl-$(CONFIG_MACH_KAMSTRUP_IMX7D_TQMA7D) += imx7d-flex-concentrator-mfg.dtb.o
> >  lwl-$(CONFIG_MACH_GK802) += imx6q-gk802.dtb.o
> >  lwl-$(CONFIG_MACH_GLOBALSCALE_GURUPLUG) +=
> > kirkwood-guruplug-server-plus-bb.dtb.o
> >  lwl-$(CONFIG_MACH_GLOBALSCALE_MIRABOX) += armada-370-mirabox-bb.dtb.o
> > diff --git a/arch/arm/dts/imx7d-flex-concentrator-mfg.dts
> > b/arch/arm/dts/imx7d-flex-concentrator-mfg.dts
> > new file mode 100644
> > index 000000000000..746e36a70f4c
> > --- /dev/null
> > +++ b/arch/arm/dts/imx7d-flex-concentrator-mfg.dts
> > @@ -0,0 +1,11 @@
> > +/*
> > + * The code contained herein is licensed under the GNU General Public
> > + * License. You may obtain a copy of the GNU General Public License
> > + * Version 2 or later at the following locations:
> > + *
> > + * http://www.opensource.org/licenses/gpl-license.html
> > + * http://www.gnu.org/copyleft/gpl.html
> > + */
> > +
> > +#include <arm/imx7d-flex-concentrator-mfg.dts>
> > +
> > diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
> > index 6dd5cb2aca15..d0a9332c7a24 100644
> > --- a/arch/arm/mach-imx/Kconfig
> > +++ b/arch/arm/mach-imx/Kconfig
> > @@ -492,6 +492,11 @@ config MACH_ZII_IMX7D_DEV
> >      select ARCH_IMX7
> >      select ARM_USE_COMPRESSED_DTB
> >
> > +config MACH_KAMSTRUP_IMX7D_TQMA7D
> > +    bool "Kamstrup TQMa7D based devices"
> > +    select ARCH_IMX7
> > +    select ARM_USE_COMPRESSED_DTB
> > +
> >  config MACH_PHYTEC_PHYCORE_IMX7
> >      bool "Phytec phyCORE i.MX7"
> >      select ARCH_IMX7
> > diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
> > index 1ce057180a01..b0bdc48399e3 100644
> > --- a/drivers/regulator/Kconfig
> > +++ b/drivers/regulator/Kconfig
> > @@ -19,7 +19,7 @@ config REGULATOR_BCM283X
> >  config REGULATOR_PFUZE
> >      bool "Freescale PFUZE100/200/3000 regulator driver"
> >      depends on I2C
> > -    depends on ARCH_IMX6 || ARCH_IMX8MQ
> > +    depends on ARCH_IMX6 || ARCH_IMX7 || ARCH_IMX8MQ
> >
> >  config REGULATOR_STM32_PWR
> >      bool "STMicroelectronics STM32 PWR"
> > diff --git a/dts/src/arm/imx7d-flex-concentrator-mfg.dts
> > b/dts/src/arm/imx7d-flex-concentrator-mfg.dts
> > new file mode 100644
> > index 000000000000..789f0837058f
> > --- /dev/null
> > +++ b/dts/src/arm/imx7d-flex-concentrator-mfg.dts
> > @@ -0,0 +1,25 @@
> > +// SPDX-License-Identifier: GPL-2.0
> > +/*
> > + * Device Tree Source for Kamstrup OMNIA Flex Concentrator in
> > + * manufacturing/debugging mode.
> > + *
> > + * Copyright (C) 2020 Kamstrup A/S
> > + * Author: Bruno Thomsen <bruno.thomsen@gmail.com>
> > + */
> > +
> > +/dts-v1/;
> > +
> > +#include "imx7d-flex-concentrator.dts"
> > +
> > +/ {
> > +    model = "Kamstrup OMNIA Flex Concentrator - Manufacturing";
> > +    compatible = "kam,imx7d-flex-concentrator-mfg",
> > "kam,imx7d-flex-concentrator", "fsl,imx7d";
> > +
> > +    chosen {
> > +        stdout-path = &uart4;
> > +    };
> > +};
> > +
> > +&uart4 {
> > +    status = "okay";
> > +};
> > diff --git a/dts/src/arm/imx7d-flex-concentrator.dts
> > b/dts/src/arm/imx7d-flex-concentrator.dts
> > new file mode 100644
> > index 000000000000..43b331222a47
> > --- /dev/null
> > +++ b/dts/src/arm/imx7d-flex-concentrator.dts
> > @@ -0,0 +1,313 @@
> > +// SPDX-License-Identifier: GPL-2.0
> > +/*
> > + * Device Tree Source for Kamstrup OMNIA Flex Concentrator.
> > + *
> > + * Copyright (C) 2020 Kamstrup A/S
> > + * Author: Bruno Thomsen <bruno.thomsen@gmail.com>
> > + */
> > +
> > +/dts-v1/;
> > +
> > +#include "imx7d-tqma7.dtsi"
> > +
> > +/* Some I2C devices on TQMa7 SoM are not mounted */
> > +/delete-node/ &m24c64;
> > +/delete-node/ &ds1339;
> > +
> > +/ {
> > +    model = "Kamstrup OMNIA Flex Concentrator";
> > +    compatible = "kam,imx7d-flex-concentrator", "fsl,imx7d";
> > +
> > +    memory@80000000 {
> > +        device_type = "memory";
> > +        /* 1024 MB - TQMa7D board configuration */
> > +        reg = <0x80000000 0x40000000>;
> > +    };
> > +
> > +    reg_usb_otg2_vbus: regulator-usb-otg2-vbus {
> > +        compatible = "regulator-fixed";
> > +        regulator-name = "VBUS_USBOTG2";
> > +        regulator-min-microvolt = <5000000>;
> > +        regulator-max-microvolt = <5000000>;
> > +        gpio = <&gpio1 7 GPIO_ACTIVE_HIGH>;
> > +        enable-active-high;
> > +    };
> > +
> > +    reg_vref_1v8: regulator-vref-1v8 {
> > +        compatible = "regulator-fixed";
> > +        regulator-name = "VCC1V8_REF";
> > +        regulator-min-microvolt = <1800000>;
> > +        regulator-max-microvolt = <1800000>;
> > +        regulator-always-on;
> > +        vin-supply = <&sw2_reg>;
> > +    };
> > +
> > +    /*
> > +     * Human Machine Interface consists of 4 dual red/green LEDs.
> > +     * hmi-a-green is controlled directly by the switch-mode power supply.
> > +     * hmi-a-red is not used.
> > +     */
> > +    gpio-leds {
> > +        compatible = "gpio-leds";
> > +        pinctrl-names = "default";
> > +        pinctrl-0 = <&pinctrl_leds>;
> > +
> > +        hmi-b-red {
> > +            label = "hmi-b:red:provisioning";
> > +            gpios = <&gpio3 6 GPIO_ACTIVE_HIGH>;
> > +            default-state = "off";
> > +        };
> > +
> > +        hmi-b-green {
> > +            label = "hmi-b:green:operation";
> > +            gpios = <&gpio2 28 GPIO_ACTIVE_HIGH>;
> > +            default-state = "off";
> > +        };
> > +
> > +        hmi-c-red {
> > +            label = "hmi-c:red:mesh-error";
> > +            gpios = <&gpio2 29 GPIO_ACTIVE_HIGH>;
> > +            default-state = "off";
> > +        };
> > +
> > +        hmi-c-green {
> > +            label = "hmi-c:green:mesh-activity";
> > +            gpios = <&gpio2 30 GPIO_ACTIVE_HIGH>;
> > +            default-state = "off";
> > +        };
> > +
> > +        hmi-d-red {
> > +            label = "hmi-d:red:wan-down";
> > +            gpios = <&gpio2 31 GPIO_ACTIVE_HIGH>;
> > +            default-state = "off";
> > +        };
> > +
> > +        hmi-d-green {
> > +            label = "hmi-d:green:ipsec-up";
> > +            gpios = <&gpio4 3 GPIO_ACTIVE_HIGH>;
> > +            default-state = "off";
> > +        };
> > +    };
> > +
> > +    /*
> > +     * Errata e10574 board restart workaround.
> > +     */
> > +    gpio-restart {
> > +        pinctrl-names = "default";
> > +        pinctrl-0 = <&pinctrl_restart>;
> > +        compatible = "gpio-restart";
> > +        gpios = <&gpio7 12 GPIO_ACTIVE_LOW>;
> > +        priority = <200>;
> > +    };
> > +};
> > +
> > +/*
> > + * Analog signals
> > + * ADC1_IN0: SMPS - 5V output monitor (voltage divider: 1/0.2806)
> > + */
> > +&adc1 {
> > +    vref-supply = <&reg_vref_1v8>;
> > +    status = "okay";
> > +};
> > +
> > +&ecspi2 {
> > +    pinctrl-names = "default";
> > +    pinctrl-0 = <&pinctrl_ecspi2>;
> > +    num-chipselects = <1>;
> > +    cs-gpios = <&gpio4 23 GPIO_ACTIVE_LOW>;
> > +    status = "okay";
> > +
> > +    pcf2127: rtc@0 {
> > +        compatible = "nxp,pcf2127";
> > +        reg = <0>;
> > +        spi-max-frequency = <2000000>;
> > +    };
> > +};
> > +
> > +&ecspi4 {
> > +    pinctrl-names = "default";
> > +    pinctrl-0 = <&pinctrl_ecspi4>;
> > +    num-chipselects = <1>;
> > +    cs-gpios = <&gpio3 3 GPIO_ACTIVE_LOW>;
> > +    status = "okay";
> > +
> > +    /*
> > +     * ST chip maximum SPI clock frequency is 33 MHz.
> > +     *
> > +     * TCG specification - Section 6.4.1 Clocking:
> > +     * TPM shall support a SPI clock frequency range of 10-24 MHz.
> > +     */
> > +    st33htph: tpm-tis@0 {
> > +        compatible = "st,st33htpm-spi", "tcg,tpm_tis-spi";
> > +        reg = <0>;
> > +        spi-max-frequency = <24000000>;
> > +    };
> > +};
> > +
> > +&fec1 {
> > +    pinctrl-names = "default";
> > +    pinctrl-0 = <&pinctrl_enet1>;
> > +    phy-mode = "rmii";
> > +    phy-handle = <&ethphy>;
> > +    status = "okay";
> > +
> > +    mdio {
> > +        #address-cells = <1>;
> > +        #size-cells = <0>;
> > +
> > +        /* Micrel KSZ8081RNB */
> > +        ethphy: ethernet-phy@1 {
> > +            compatible = "ethernet-phy-id0022.1560",
> > "ethernet-phy-ieee802.3-c22";
> > +            reg = <1>;
> > +            max-speed = <100>;
> > +            interrupt-parent = <&gpio1>;
> > +            interrupts = <9 IRQ_TYPE_LEVEL_LOW>;
> > +            reset-assert-us = <100000>;
> > +            reset-deassert-us = <1000000>;
> > +            reset-gpios = <&gpio7 15 GPIO_ACTIVE_LOW>;
> > +        };
> > +    };
> > +};
> > +
> > +/*
> > + * Detection signals for internal USB modules.
> > + * Used for robust USB plug and play handling such as USB downstream port
> > + * power-cycle and USB hub reset in case of misbehaving or crashed modules.
> > + *
> > + * SMPS - AC input monitor based on zero crossing.
> > + * Used for last gasp notification.
> > + */
> > +&gpio3 {
> > +    gpio-line-names = "", "", "", "", "", "", "", "",
> > +    "", "", "", "", "smps-ac-monitor", "", "usb-hub-reset", "",
> > +    "", "", "", "", "", "", "", "",
> > +    "", "module-b-detection", "", "module-a-detection", "", "", "", "";
> > +};
> > +
> > +/*
> > + * Tamper IRQ trigger timestamp reading.
> > + * Used for sealed cover opened/closed notification.
> > + */
> > +&gpio5 {
> > +    gpio-line-names = "", "", "", "", "", "", "", "",
> > +    "", "", "", "", "rtc-tamper-irq", "", "", "",
> > +    "", "", "", "", "", "", "", "",
> > +    "", "", "", "", "", "", "", "";
> > +};
> > +
> > +&iomuxc {
> > +    pinctrl-names = "default";
> > +    pinctrl-0 = <&pinctrl_misc>;
> > +
> > +    pinctrl_ecspi2: ecspi2grp {
> > +        fsl,pins = <
> > +            MX7D_PAD_ECSPI2_MISO__ECSPI2_MISO        0x7c /* X2-15 */
> > +            MX7D_PAD_ECSPI2_MOSI__ECSPI2_MOSI        0x74 /* X2-18 */
> > +            MX7D_PAD_ECSPI2_SCLK__ECSPI2_SCLK        0x74 /* X2-13 */
> > +            MX7D_PAD_ECSPI2_SS0__GPIO4_IO23            0x74 /* X2-20 */
> > +            /* RTC - Tamper IRQ */
> > +            MX7D_PAD_SD2_CLK__GPIO5_IO12            0x3c /* X1-92 */
> > +        >;
> > +    };
> > +
> > +    pinctrl_ecspi4: ecspi4grp {
> > +        fsl,pins = <
> > +            MX7D_PAD_LCD_CLK__ECSPI4_MISO            0x7c /* X2-72 */
> > +            MX7D_PAD_LCD_ENABLE__ECSPI4_MOSI        0x74 /* X2-68 */
> > +            MX7D_PAD_LCD_HSYNC__ECSPI4_SCLK            0x74 /* X2-76 */
> > +            MX7D_PAD_LCD_VSYNC__GPIO3_IO3            0x74 /* X2-78 */
> > +        >;
> > +    };
> > +
> > +    pinctrl_enet1: enet1grp {
> > +        fsl,pins = <
> > +            MX7D_PAD_GPIO1_IO10__ENET1_MDIO            0x02 /* X2-48 */
> > +            MX7D_PAD_GPIO1_IO11__ENET1_MDC            0x00 /* X2-46 */
> > +            MX7D_PAD_ENET1_RGMII_TD0__ENET1_RGMII_TD0    0x71 /* X2-53 */
> > +            MX7D_PAD_ENET1_RGMII_TD1__ENET1_RGMII_TD1    0x71 /* X2-55 */
> > +            MX7D_PAD_ENET1_RGMII_TX_CTL__ENET1_RGMII_TX_CTL    0x71 /* X2-61 */
> > +            MX7D_PAD_ENET1_RGMII_RD0__ENET1_RGMII_RD0    0x79 /* X2-56 */
> > +            MX7D_PAD_ENET1_RGMII_RD1__ENET1_RGMII_RD1    0x79 /* X2-58 */
> > +            MX7D_PAD_ENET1_RGMII_RX_CTL__ENET1_RGMII_RX_CTL    0x79 /* X2-64 */
> > +            MX7D_PAD_ENET1_RGMII_RXC__ENET1_RX_ER        0x73 /* X2-52 */
> > +            /* PHY reset: SION, 100kPU, SRE_FAST, DSE_X1 */
> > +            MX7D_PAD_ENET1_COL__GPIO7_IO15        0x40000070 /* X1-96 */
> > +            /* Clock from PHY to MAC */
> > +            MX7D_PAD_GPIO1_IO12__CCM_ENET_REF_CLK1    0x40000073 /* X3-4 */
> > +            /* PHY interrupt: SION, 100kPU, HYS, SRE_FAST, DSE_X1 */
> > +            MX7D_PAD_GPIO1_IO09__GPIO1_IO9        0x40000078 /* X1-80 */
> > +        >;
> > +    };
> > +
> > +    pinctrl_leds: ledsgrp {
> > +        fsl,pins = <
> > +            MX7D_PAD_LCD_DATA01__GPIO3_IO6            0x14 /* X2-82 */
> > +            MX7D_PAD_EPDC_BDR0__GPIO2_IO28            0x14 /* X1-82 */
> > +            MX7D_PAD_EPDC_BDR1__GPIO2_IO29            0x14 /* X1-84 */
> > +            MX7D_PAD_EPDC_PWR_COM__GPIO2_IO30        0x14 /* X1-86 */
> > +            MX7D_PAD_EPDC_PWR_STAT__GPIO2_IO31        0x14 /* X1-88 */
> > +            MX7D_PAD_UART2_TX_DATA__GPIO4_IO3        0x14 /* X1-90 */
> > +        >;
> > +    };
> > +
> > +    pinctrl_misc: miscgrp {
> > +        fsl,pins = <
> > +            /* Module A detection (low = present) */
> > +            MX7D_PAD_LCD_DATA22__GPIO3_IO27            0x7c /* X2-105 */
> > +            /* Module B detection (low = present) */
> > +            MX7D_PAD_LCD_DATA20__GPIO3_IO25            0x7c /* X2-103 */
> > +            /* SMPS - AC input monitor (high = failure) */
> > +            MX7D_PAD_LCD_DATA07__GPIO3_IO12            0x7c /* X2-88 */
> > +            /* USB - Hub reset */
> > +            MX7D_PAD_LCD_DATA09__GPIO3_IO14            0x74 /* X2-92 */
> > +        >;
> > +    };
> > +
> > +    pinctrl_restart: restartgrp {
> > +        fsl,pins = <
> > +            MX7D_PAD_ENET1_TX_CLK__GPIO7_IO12    0x74 /* X1-94 */
> > +        >;
> > +    };
> > +
> > +    pinctrl_uart4: uart4grp {
> > +        fsl,pins = <
> > +            MX7D_PAD_SAI2_TX_SYNC__UART4_DCE_RX    0x7e /* X3-14 */
> > +            MX7D_PAD_SAI2_TX_BCLK__UART4_DCE_TX    0x76 /* X3-16 */
> > +        >;
> > +    };
> > +};
> > +
> > +&iomuxc_lpsr {
> > +    pinctrl_usbotg2: usbotg2grp {
> > +        fsl,pins = <
> > +            MX7D_PAD_LPSR_GPIO1_IO06__USB_OTG2_OC    0x5c /* X3-11 */
> > +            MX7D_PAD_LPSR_GPIO1_IO07__GPIO1_IO7    0x59 /* X3-9 */
> > +        >;
> > +    };
> > +
> > +};
> > +
> > +&uart4 {
> > +    pinctrl-names = "default";
> > +    pinctrl-0 = <&pinctrl_uart4>;
> > +    assigned-clocks = <&clks IMX7D_UART4_ROOT_SRC>;
> > +    assigned-clock-parents = <&clks IMX7D_OSC_24M_CLK>;
> > +};
> > +
> > +&usbotg2 {
> > +    pinctrl-names = "default";
> > +    pinctrl-0 = <&pinctrl_usbotg2>;
> > +    vbus-supply = <&reg_usb_otg2_vbus>;
> > +    srp-disable;
> > +    hnp-disable;
> > +    adp-disable;
> > +    dr_mode = "host";
> > +    status = "okay";
> > +};
> > +
> > +/*
> > + * External watchdog feature provided by pcf2127.
> > + */
> > +&wdog1 {
> > +    status = "disabled";
> > +};
> > diff --git a/images/Makefile.imx b/images/Makefile.imx
> > index 765702f26deb..cbbefd5c085b 100644
> > --- a/images/Makefile.imx
> > +++ b/images/Makefile.imx
> > @@ -364,6 +364,11 @@ CFG_start_zii_imx7d_dev.pblb.imximg =
> > $(board)/zii-imx7d-dev/flash-header-zii-im
> >  FILE_barebox-zii-imx7d-dev.img = start_zii_imx7d_dev.pblb.imximg
> >  image-$(CONFIG_MACH_ZII_IMX7D_DEV) += barebox-zii-imx7d-dev.img
> >
> > +pblb-$(CONFIG_MACH_KAMSTRUP_IMX7D_TQMA7D) += start_kamstrup_imx7d_tqma7d
> > +CFG_start_kamstrup_imx7d_tqma7d.pblb.imximg =
> > $(board)/kamstrup-imx7d-tqma7d/flash-header-kamstrup-imx7d-tqma7d.imxcfg
> > +FILE_barebox-kamstrup-imx7d-tqma7d.img =
> > start_kamstrup_imx7d_tqma7d.pblb.imximg
> > +image-$(CONFIG_MACH_KAMSTRUP_IMX7D_TQMA7D) += barebox-kamstrup-imx7d-tqma7d.img
> > +
> >  # ----------------------- i.MX8mm based boards --------------------------
> >  pblb-$(CONFIG_MACH_NXP_IMX8MM_EVK) += start_nxp_imx8mm_evk
> >  CFG_start_nxp_imx8mm_evk.pblb.imximg =
> > $(board)/nxp-imx8mm-evk/flash-header-imx8mm-evk.imxcfg
> >
> > _______________________________________________
> > barebox mailing list
> > barebox@lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/barebox
> >
>
> --
> Pengutronix e.K.                           |                             |
> Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
> 31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Getting serial console output on new imx7d tqma7 board UART4
  2020-07-30  6:58   ` Lars Pedersen
@ 2020-07-30  7:25     ` Ahmad Fatoum
  2020-07-30 10:16       ` Lars Pedersen
  0 siblings, 1 reply; 20+ messages in thread
From: Ahmad Fatoum @ 2020-07-30  7:25 UTC (permalink / raw)
  To: Lars Pedersen; +Cc: barebox



On 7/30/20 8:58 AM, Lars Pedersen wrote:
> The DCD part now matches exactly for the top part (00000000 to
> 00000020)  of it which i guess is the IVT header, which shouldn't be
> the same?

I mean the memory calibration and such. Not that your U-Boot port
does something in C code, which you are missing in your barebox
DCD.

> 
> The following is xxd where barebox  (left side) has been shifted 0x400
> to match u-boot part.
> 
> /usr/bin/diff -y <(xxd barebox_stripped) <(xxd uboot_stripped)

I don't understand how to read this diff.

> So I guess that the DCD table part now should be correct. So the
> question is if this is and lowlevel.c/board.c boilerplate issue or
> maybe I need something in the Kconfig menu.

Enable CONFIG_DEBUG_LL and see how far barebox comes.
See the inline comment from my last mail.

>>> +
>>> +static inline void setup_uart(void)
>>> +{
>>> +    imx7_early_setup_uart_clock();
>>> +
>>> +    imx7_setup_pad(MX7D_PAD_SAI2_TX_BCLK__UART4_DCE_TX);
>>> +
>>> +    imx7_uart_setup_ll();
>>> +
>>> +    putc_ll('>');
>>
>> You've CONFIG_DEBUG_LL=y and you choose the correct UART port
>> in the i.MX menuconfig option?
-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Getting serial console output on new imx7d tqma7 board UART4
  2020-07-30  7:25     ` Ahmad Fatoum
@ 2020-07-30 10:16       ` Lars Pedersen
  2020-07-30 13:55         ` Ahmad Fatoum
  2020-08-03 21:51         ` Sascha Hauer
  0 siblings, 2 replies; 20+ messages in thread
From: Lars Pedersen @ 2020-07-30 10:16 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox

Thanks for the quick response :) I have made some inline comments

Additionally I have fixed the __dtb_z_ unrelated issue, but still
troubles to get some output. Could you maybe send me a barebox binary
for an mx6 or mx7 board? I'm still unsure if it has the correct binary
format.

My current Kconfig values look like this. Maybe you can see something
missing.I have patched drivers/regulator/Kconfig (ARCH_IMX7) so that I
can enable REGULATOR_PFUZE, which is used on the tqma7d board. From
what I can see the NXP i.MX7 SabreSD board uses a PF3000 PMIC too so
iam unsure why it can work without this fix.

CONFIG_ARM=y
CONFIG_ARM_LINUX=y
CONFIG_ARM_USE_COMPRESSED_DTB=y
CONFIG_TEXT_BASE=0x0
CONFIG_ARCH_IMX=y
CONFIG_CPU_32=y
CONFIG_CPU_V7=y
CONFIG_CPU_32v7=y
CONFIG_BAREBOX_MAX_IMAGE_SIZE=0xffffffff
CONFIG_ARCH_IMX_IMXIMAGE=y
CONFIG_ARCH_IMX7=y
CONFIG_IMX_MULTI_BOARDS=y
CONFIG_MACH_KAMSTRUP_IMX7D_TQMA7D=y
CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y
CONFIG_ARM_SMCCC=y
CONFIG_ARM_SECURE_MONITOR=y
CONFIG_ARM_PSCI_OF=y
CONFIG_ARM_PSCI=y
CONFIG_ARM_PSCI_DEBUG=y
CONFIG_GREGORIAN_CALENDER=y
CONFIG_HAS_KALLSYMS=y
CONFIG_HAS_MODULES=y
CONFIG_HAS_CACHE=y
CONFIG_HAS_DMA=y
CONFIG_GENERIC_GPIO=y
CONFIG_BLOCK=y
CONFIG_BLOCK_WRITE=y
CONFIG_FILETYPE=y
CONFIG_BINFMT=y
CONFIG_UIMAGE=y
CONFIG_LOGBUF=y
CONFIG_STDDEV=y
CONFIG_MENUTREE=y
CONFIG_UBIFORMAT=y
CONFIG_BOOT=y
CONFIG_LOCALVERSION=""
CONFIG_LOCALVERSION_AUTO=y
CONFIG_BANNER=y
CONFIG_MEMINFO=y
CONFIG_ENVIRONMENT_VARIABLES=y
CONFIG_GLOBALVAR=y
CONFIG_NVVAR=y
CONFIG_HAVE_PBL_IMAGE=y
CONFIG_HAVE_PBL_MULTI_IMAGES=y
CONFIG_HAVE_IMAGE_COMPRESSION=y
CONFIG_PBL_IMAGE=y
CONFIG_PBL_MULTI_IMAGES=y
CONFIG_PBL_RELOCATABLE=y
CONFIG_IMAGE_COMPRESSION=y
CONFIG_IMAGE_COMPRESSION_LZO=y
CONFIG_MMU=y
CONFIG_MMU_EARLY=y
CONFIG_HAVE_CONFIGURABLE_TEXT_BASE=y
CONFIG_BAREBOX_MAX_PBL_SIZE=0xffffffff
CONFIG_BAREBOX_MAX_BARE_INIT_SIZE=0xffffffff
CONFIG_STACK_SIZE=0x8000
CONFIG_MALLOC_SIZE=0x0
CONFIG_MALLOC_TLSF=y
CONFIG_HAVE_MOD_ARCH_SPECIFIC=y
CONFIG_KALLSYMS=y
CONFIG_PROMPT="barebox:"
CONFIG_BAUDRATE=115200
CONFIG_CBSIZE=1024
CONFIG_SHELL_HUSH=y
CONFIG_GLOB=y
CONFIG_GLOB_SORT=y
CONFIG_PROMPT_HUSH_PS2="> "
CONFIG_HUSH_FANCY_PROMPT=y
CONFIG_CMDLINE_EDITING=y
CONFIG_AUTO_COMPLETE=y
CONFIG_MENU=y
CONFIG_DYNAMIC_CRC_TABLE=y
CONFIG_ERRNO_MESSAGES=y
CONFIG_TIMESTAMP=y
CONFIG_BOOTM=y
CONFIG_BOOTM_SHOW_TYPE=y
CONFIG_BOOTM_VERBOSE=y
CONFIG_BOOTM_INITRD=y
CONFIG_BOOTM_OFTREE=y
CONFIG_BOOTM_OFTREE_UIMAGE=y
CONFIG_FLEXIBLE_BOOTARGS=y
CONFIG_BAREBOX_UPDATE=y
CONFIG_IMD=y
CONFIG_CONSOLE_FULL=y
CONFIG_CONSOLE_ACTIVATE_ALL=y
CONFIG_PBL_CONSOLE=y
CONFIG_PARTITION=y
CONFIG_PARTITION_DISK=y
CONFIG_PARTITION_DISK_DOS=y
CONFIG_PARTITION_DISK_EFI=y
CONFIG_PARTITION_DISK_EFI_GPT_NO_FORCE=y
CONFIG_PARTITION_DISK_EFI_GPT_COMPARE=y
CONFIG_ENV_HANDLING=y
CONFIG_DEFAULT_ENVIRONMENT=y
CONFIG_DEFAULT_COMPRESSION_NONE=y
CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW=y
CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW_MENU=y
CONFIG_DEFAULT_ENVIRONMENT_PATH=""
CONFIG_POLLER=y
CONFIG_STATE=y
CONFIG_BOOTCHOOSER=y
CONFIG_RESET_SOURCE=y
CONFIG_COMPILE_LOGLEVEL=6
CONFIG_DEFAULT_LOGLEVEL=7
CONFIG_DEBUG_IMX_UART_PORT=1
CONFIG_HAS_DEBUG_LL=y
CONFIG_COMMAND_SUPPORT=y
CONFIG_COMPILE_HASH=y
CONFIG_CMD_ARM_CPUINFO=y
CONFIG_CMD_DEVINFO=y
CONFIG_CMD_DMESG=y
CONFIG_CMD_DRVINFO=y
CONFIG_CMD_HELP=y
CONFIG_LONGHELP=y
CONFIG_CMD_IOMEM=y
CONFIG_CMD_IMD=y
CONFIG_CMD_MEMINFO=y
CONFIG_CMD_ARM_MMUINFO=y
CONFIG_CMD_REGULATOR=y
CONFIG_CMD_VERSION=y
CONFIG_CMD_MMC_EXTCSD=y
CONFIG_CMD_BOOT=y
CONFIG_CMD_BOOTM=y
CONFIG_CMD_GO=y
CONFIG_CMD_RESET=y
CONFIG_CMD_UIMAGE=y
CONFIG_CMD_PARTITION=y
CONFIG_CMD_AUTOMOUNT=y
CONFIG_CMD_MOUNT=y
CONFIG_CMD_UBI=y
CONFIG_CMD_UBIFORMAT=y
CONFIG_CMD_UMOUNT=y
CONFIG_CMD_NV=y
CONFIG_CMD_EXPORT=y
CONFIG_CMD_GLOBAL=y
CONFIG_CMD_LOADENV=y
CONFIG_CMD_PRINTENV=y
CONFIG_CMD_MAGICVAR=y
CONFIG_CMD_MAGICVAR_HELP=y
CONFIG_CMD_SAVEENV=y
CONFIG_CMD_BASENAME=y
CONFIG_CMD_CAT=y
CONFIG_CMD_CD=y
CONFIG_CMD_CP=y
CONFIG_CMD_DIGEST=y
CONFIG_CMD_DIRNAME=y
CONFIG_CMD_FILETYPE=y
CONFIG_CMD_LN=y
CONFIG_CMD_LS=y
CONFIG_CMD_MD5SUM=y
CONFIG_CMD_MKDIR=y
CONFIG_CMD_PWD=y
CONFIG_CMD_READLINK=y
CONFIG_CMD_RM=y
CONFIG_CMD_RMDIR=y
CONFIG_CMD_UNCOMPRESS=y
CONFIG_CMD_FALSE=y
CONFIG_CMD_GETOPT=y
CONFIG_CMD_LET=y
CONFIG_CMD_MSLEEP=y
CONFIG_CMD_READF=y
CONFIG_CMD_SLEEP=y
CONFIG_CMD_TEST=y
CONFIG_CMD_TRUE=y
CONFIG_CMD_CLEAR=y
CONFIG_CMD_ECHO=y
CONFIG_CMD_ECHO_E=y
CONFIG_CMD_EDIT=y
CONFIG_CMD_MENU=y
CONFIG_CMD_MENU_MANAGEMENT=y
CONFIG_CMD_MENUTREE=y
CONFIG_CMD_READLINE=y
CONFIG_CMD_TIMEOUT=y
CONFIG_CMD_CRC=y
CONFIG_CMD_CRC_CMP=y
CONFIG_CMD_MD=y
CONFIG_CMD_MEMCMP=y
CONFIG_CMD_MEMCPY=y
CONFIG_CMD_MEMSET=y
CONFIG_CMD_MEMTEST=y
CONFIG_CMD_MM=y
CONFIG_CMD_MW=y
CONFIG_CMD_CLK=y
CONFIG_CMD_DETECT=y
CONFIG_CMD_FLASH=y
CONFIG_CMD_GPIO=y
CONFIG_CMD_I2C=y
CONFIG_CMD_NAND=y
CONFIG_CMD_NANDTEST=y
CONFIG_CMD_SPI=y
CONFIG_CMD_WD=y
CONFIG_CMD_WD_DEFAULT_TIMOUT=0
CONFIG_CMD_BAREBOX_UPDATE=y
CONFIG_CMD_OF_DUMP=y
CONFIG_CMD_OF_NODE=y
CONFIG_CMD_OF_PROPERTY=y
CONFIG_CMD_OFTREE=y
CONFIG_CMD_TIME=y
CONFIG_CMD_STATE=y
CONFIG_CMD_BOOTCHOOSER=y
CONFIG_PM_GENERIC_DOMAINS=y
CONFIG_OFTREE=y
CONFIG_OFTREE_MEM_GENERIC=y
CONFIG_DTC=y
CONFIG_OFDEVICE=y
CONFIG_OF_GPIO=y
CONFIG_OF_BAREBOX_DRIVERS=y
CONFIG_DRIVER_SERIAL_IMX=y
CONFIG_ARCH_HAS_FEC_IMX=y
CONFIG_SPI=y
CONFIG_SPI_MEM=y
CONFIG_DRIVER_SPI_IMX_2_3=y
CONFIG_I2C=y
CONFIG_I2C_IMX=y
CONFIG_MTD=y
CONFIG_MTD_WRITE=y
CONFIG_MTD_OOB_DEVICE=y
CONFIG_MTD_RAW_DEVICE=y
CONFIG_MTD_DATAFLASH=y
CONFIG_MTD_M25P80=y
CONFIG_MTD_SST25L=y
CONFIG_NAND=y
CONFIG_NAND_ECC_SOFT=y
CONFIG_NAND_ECC_HW=y
CONFIG_NAND_ECC_HW_SYNDROME=y
CONFIG_NAND_ECC_HW_NONE=y
CONFIG_NAND_INFO=y
CONFIG_NAND_READ_OOB=y
CONFIG_NAND_BBT=y
CONFIG_NAND_ALLOW_ERASE_BAD=y
CONFIG_NAND_IMX=y
CONFIG_MTD_NAND_IDS=y
CONFIG_MTD_SPI_NOR=y
CONFIG_MTD_UBI=y
CONFIG_MTD_UBI_BEB_LIMIT=20
CONFIG_MTD_UBI_FASTMAP=y
CONFIG_DISK=y
CONFIG_DISK_IDE_SFF=y
CONFIG_DISK_WRITE=y
CONFIG_DISK_ATA=y
CONFIG_DISK_AHCI=y
CONFIG_DISK_AHCI_IMX=y
CONFIG_DISK_INTF_PLATFORM_IDE=y
CONFIG_DISK_PATA_IMX=y
CONFIG_MCI_SDHCI=y
CONFIG_MCI=y
CONFIG_MCI_INFO=y
CONFIG_MCI_WRITE=y
CONFIG_MCI_MMC_BOOT_PARTITIONS=y
CONFIG_MCI_IMX_ESDHC=y
CONFIG_HAVE_CLK=y
CONFIG_CLKDEV_LOOKUP=y
CONFIG_COMMON_CLK=y
CONFIG_COMMON_CLK_OF_PROVIDER=y
CONFIG_ARCH_HAS_IMX_GPT=y
CONFIG_CLOCKSOURCE_DUMMY_RATE=1000
CONFIG_CLOCKSOURCE_ARM_ARCHITECTED_TIMER=y
CONFIG_CLOCKSOURCE_IMX_GPT=y
CONFIG_MFD_DA9063=y
CONFIG_MFD_MC34704=y
CONFIG_MFD_MC9SDZ60=y
CONFIG_MFD_STMPE=y
CONFIG_STATE_DRV=y
CONFIG_DEV_MEM=y
CONFIG_EEPROM_AT25=y
CONFIG_EEPROM_AT24=y
CONFIG_INPUT=y
CONFIG_KEYBOARD_GPIO=y
CONFIG_WATCHDOG_IMX_RESET_SOURCE=y
CONFIG_WATCHDOG=y
CONFIG_WATCHDOG_IMX=y
CONFIG_PWM=y
CONFIG_PWM_IMX=y
CONFIG_GPIOLIB=y
CONFIG_GPIO_IMX=y
CONFIG_GPIO_STMPE=y
CONFIG_PINCTRL=y
CONFIG_PINCTRL_IMX_IOMUX_V3=y
CONFIG_NVMEM=y
CONFIG_REGULATOR=y
CONFIG_REGULATOR_PFUZE=y
CONFIG_HW_HAS_PCI=y
CONFIG_IMX_GPCV2_PM_DOMAINS=y
CONFIG_FS=y
CONFIG_FS_LEGACY=y
CONFIG_FS_AUTOMOUNT=y
CONFIG_FS_EXT4=y
CONFIG_FS_RAMFS=y
CONFIG_FS_DEVFS=y
CONFIG_FS_FAT=y
CONFIG_FS_FAT_WRITE=y
CONFIG_FS_FAT_LFN=y
CONFIG_FS_UBIFS=y
CONFIG_FS_UBIFS_COMPRESSION_LZO=y
CONFIG_PARAMETER=y
CONFIG_UNCOMPRESS=y
CONFIG_ZLIB=y
CONFIG_PROCESS_ESCAPE_SEQUENCE=y
CONFIG_LZO_DECOMPRESS=y
CONFIG_FNMATCH=y
CONFIG_QSORT=y
CONFIG_LIBSCAN=y
CONFIG_LIBUBIGEN=y
CONFIG_PRINTF_UUID=y
CONFIG_CRC32=y
CONFIG_DIGEST=y
CONFIG_MD5=y
CONFIG_DIGEST_MD5_GENERIC=y
CONFIG_EXTRA_FIRMWARE_DIR="firmware"

/Lars Pedersen.

On Thu, 30 Jul 2020 at 09:25, Ahmad Fatoum <a.fatoum@pengutronix.de> wrote:
>
>
>
> On 7/30/20 8:58 AM, Lars Pedersen wrote:
> > The DCD part now matches exactly for the top part (00000000 to
> > 00000020)  of it which i guess is the IVT header, which shouldn't be
> > the same?
>
> I mean the memory calibration and such. Not that your U-Boot port
> does something in C code, which you are missing in your barebox
> DCD.

I don't think u-boot does something extra in c code, but i'll check
again. The board config in u-boot is stripped down so that it only
probes info through the device tree.

And the DCD table is exactly the same in the compiled output.

>
> >
> > The following is xxd where barebox  (left side) has been shifted 0x400
> > to match u-boot part.
> >
> > /usr/bin/diff -y <(xxd barebox_stripped) <(xxd uboot_stripped)
>
> I don't understand how to read this diff.

I'm sorry it somehow got mangled when sent :/

>
> > So I guess that the DCD table part now should be correct. So the
> > question is if this is and lowlevel.c/board.c boilerplate issue or
> > maybe I need something in the Kconfig menu.
>
> Enable CONFIG_DEBUG_LL and see how far barebox comes.
> See the inline comment from my last mail.

I missed some of the last comments but I have already enabled
CONFIG_DEBUG_LL and can't get any console output to appear. UART4 has
been selected in the menu for this.

>
> >>> +
> >>> +static inline void setup_uart(void)
> >>> +{
> >>> +    imx7_early_setup_uart_clock();
> >>> +
> >>> +    imx7_setup_pad(MX7D_PAD_SAI2_TX_BCLK__UART4_DCE_TX);
> >>> +
> >>> +    imx7_uart_setup_ll();
> >>> +
> >>> +    putc_ll('>');
> >>
> >> You've CONFIG_DEBUG_LL=y and you choose the correct UART port
> >> in the i.MX menuconfig option?
> --
> Pengutronix e.K.                           |                             |
> Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
> 31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Getting serial console output on new imx7d tqma7 board UART4
  2020-07-30 10:16       ` Lars Pedersen
@ 2020-07-30 13:55         ` Ahmad Fatoum
  2020-08-03  7:56           ` Lars Pedersen
  2020-08-03 21:51         ` Sascha Hauer
  1 sibling, 1 reply; 20+ messages in thread
From: Ahmad Fatoum @ 2020-07-30 13:55 UTC (permalink / raw)
  To: Lars Pedersen; +Cc: barebox

Hi,

On 7/30/20 12:16 PM, Lars Pedersen wrote:
> Thanks for the quick response :) I have made some inline comments
> 
> Additionally I have fixed the __dtb_z_ unrelated issue, but still
> troubles to get some output. Could you maybe send me a barebox binary
> for an mx6 or mx7 board? I'm still unsure if it has the correct binary
> format.

Can you not compile a i.MX7-EVK barebox and run it on the EVK?
If this doesn't work, this is a different issue.


> My current Kconfig values look like this. Maybe you can see something
> missing.I have patched drivers/regulator/Kconfig (ARCH_IMX7) so that I
> can enable REGULATOR_PFUZE, which is used on the tqma7d board. From
> what I can see the NXP i.MX7 SabreSD board uses a PF3000 PMIC too so
> iam unsure why it can work without this fix.

DEBUG_LL lets barebox print a > symbol first thing it boots. This should
work for you regardless of any PMIC configuration.

>>> So I guess that the DCD table part now should be correct. So the
>>> question is if this is and lowlevel.c/board.c boilerplate issue or
>>> maybe I need something in the Kconfig menu.
>>
>> Enable CONFIG_DEBUG_LL and see how far barebox comes.
>> See the inline comment from my last mail.
> 
> I missed some of the last comments but I have already enabled
> CONFIG_DEBUG_LL and can't get any console output to appear. UART4 has
> been selected in the menu for this.

Then that's what you need to focus on. Prior to that '>', not much
code has run. If you don't come that far, chances are you set up your serial port
wrong (looks correct to me though) or your DCD table is wrong...

Cheers,
Ahmad

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Getting serial console output on new imx7d tqma7 board UART4
  2020-07-30 13:55         ` Ahmad Fatoum
@ 2020-08-03  7:56           ` Lars Pedersen
  0 siblings, 0 replies; 20+ messages in thread
From: Lars Pedersen @ 2020-08-03  7:56 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox

Thanks for the feedback.

I will order an i.MX7 EVK board and try to get it working. I guess
that we were a little too confident that the TQma7d board would work
out of the box with only minor tweaks.

/Lars Pedersen

On Thu, 30 Jul 2020 at 15:55, Ahmad Fatoum <a.fatoum@pengutronix.de> wrote:
>
> Hi,
>
> On 7/30/20 12:16 PM, Lars Pedersen wrote:
> > Thanks for the quick response :) I have made some inline comments
> >
> > Additionally I have fixed the __dtb_z_ unrelated issue, but still
> > troubles to get some output. Could you maybe send me a barebox binary
> > for an mx6 or mx7 board? I'm still unsure if it has the correct binary
> > format.
>
> Can you not compile a i.MX7-EVK barebox and run it on the EVK?
> If this doesn't work, this is a different issue.
>
>
> > My current Kconfig values look like this. Maybe you can see something
> > missing.I have patched drivers/regulator/Kconfig (ARCH_IMX7) so that I
> > can enable REGULATOR_PFUZE, which is used on the tqma7d board. From
> > what I can see the NXP i.MX7 SabreSD board uses a PF3000 PMIC too so
> > iam unsure why it can work without this fix.
>
> DEBUG_LL lets barebox print a > symbol first thing it boots. This should
> work for you regardless of any PMIC configuration.
>
> >>> So I guess that the DCD table part now should be correct. So the
> >>> question is if this is and lowlevel.c/board.c boilerplate issue or
> >>> maybe I need something in the Kconfig menu.
> >>
> >> Enable CONFIG_DEBUG_LL and see how far barebox comes.
> >> See the inline comment from my last mail.
> >
> > I missed some of the last comments but I have already enabled
> > CONFIG_DEBUG_LL and can't get any console output to appear. UART4 has
> > been selected in the menu for this.
>
> Then that's what you need to focus on. Prior to that '>', not much
> code has run. If you don't come that far, chances are you set up your serial port
> wrong (looks correct to me though) or your DCD table is wrong...
>
> Cheers,
> Ahmad
>
> --
> Pengutronix e.K.                           |                             |
> Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
> 31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Getting serial console output on new imx7d tqma7 board UART4
  2020-07-29 16:52 Getting serial console output on new imx7d tqma7 board UART4 Lars Pedersen
  2020-07-29 17:22 ` Ahmad Fatoum
@ 2020-08-03 10:10 ` Ahmad Fatoum
  2020-08-04 13:07   ` Lars Pedersen
  1 sibling, 1 reply; 20+ messages in thread
From: Ahmad Fatoum @ 2020-08-03 10:10 UTC (permalink / raw)
  To: Lars Pedersen, barebox

Hi,

On 7/29/20 6:52 PM, Lars Pedersen wrote:
> I have spent the last couple of days trying to port our bootloader
> from u-boot to barebox 2020.07 but have yet to get any console output.
> Our product is based on tqma7d i.MX7 dual core cpu and uses UART4 for
> serial console and boots from internal eMMC.
> 
> I created a new board inspired from "NXP i.MX7 SabreSD board" and
> tried to only add the basic in the first step to get a console output
> working. The image is built using ptxdist and the imx_v7_defconfig
> where the new board is selected. The image is flashed with "dd
> if=barebox-image of=/dev/mmcblk0 bs=1024 skip=1 seek=1 conv=fsync".
> The device works using u-boot 2020.07 with the same device trees but
> we thought it was time to try out barebox since u-boot felt a little
> bloated :)
> 
> So can anyone be of assistance and tell me what I'm missing?

When I looked through your patch the first time, I just looked
for stuff that would cause it to not boot. Some more comments
inline that are unrelated to your boot problems.

> 
> /Lars Pedersen
> 
> From: Lars Pedersen <laa@kamstrup.com>
> Date: Tue, 28 Jul 2020 08:57:57 +0000
> Subject: [PATCH] Add kamstrup imx7d dev board
> 
> ---
>  arch/arm/boards/Makefile                           |   1 +
>  arch/arm/boards/kamstrup-imx7d-tqma7d/Makefile     |   2 +
>  arch/arm/boards/kamstrup-imx7d-tqma7d/board.c      |  19 ++
>  .../flash-header-kamstrup-imx7d-tqma7d.imxcfg      |  79 ++++++
>  arch/arm/boards/kamstrup-imx7d-tqma7d/lowlevel.c   |  35 +++
>  arch/arm/dts/Makefile                              |   1 +
>  arch/arm/dts/imx7d-flex-concentrator-mfg.dts       |  11 +
>  arch/arm/mach-imx/Kconfig                          |   5 +
>  drivers/regulator/Kconfig                          |   2 +-
>  dts/src/arm/imx7d-flex-concentrator-mfg.dts        |  25 ++
>  dts/src/arm/imx7d-flex-concentrator.dts            | 313 +++++++++++++++++++++
>  images/Makefile.imx                                |   5 +
>  12 files changed, 497 insertions(+), 1 deletion(-)
>  create mode 100644 arch/arm/boards/kamstrup-imx7d-tqma7d/Makefile
>  create mode 100644 arch/arm/boards/kamstrup-imx7d-tqma7d/board.c
>  create mode 100644
> arch/arm/boards/kamstrup-imx7d-tqma7d/flash-header-kamstrup-imx7d-tqma7d.imxcfg
>  create mode 100644 arch/arm/boards/kamstrup-imx7d-tqma7d/lowlevel.c
>  create mode 100644 arch/arm/dts/imx7d-flex-concentrator-mfg.dts
>  create mode 100644 dts/src/arm/imx7d-flex-concentrator-mfg.dts
>  create mode 100644 dts/src/arm/imx7d-flex-concentrator.dts
> 
> diff --git a/arch/arm/boards/Makefile b/arch/arm/boards/Makefile
> index e9e9163d589b..58bb4cf2adab 100644
> --- a/arch/arm/boards/Makefile
> +++ b/arch/arm/boards/Makefile
> @@ -64,6 +64,7 @@ obj-$(CONFIG_MACH_HIGHBANK)            += highbank/
>  obj-$(CONFIG_MACH_IMX21ADS)            += freescale-mx21-ads/
>  obj-$(CONFIG_MACH_IMX233_OLINUXINO)        += imx233-olinuxino/
>  obj-$(CONFIG_MACH_IMX27ADS)            += freescale-mx27-ads/
> +obj-$(CONFIG_MACH_KAMSTRUP_IMX7D_TQMA7D)    += kamstrup-imx7d-tqma7d/
>  obj-$(CONFIG_MACH_KINDLE3)            += kindle3/
>  obj-$(CONFIG_MACH_KONTRON_SAMX6I)        += kontron-samx6i/
>  obj-$(CONFIG_MACH_LENOVO_IX4_300D)        += lenovo-ix4-300d/
> diff --git a/arch/arm/boards/kamstrup-imx7d-tqma7d/Makefile
> b/arch/arm/boards/kamstrup-imx7d-tqma7d/Makefile
> new file mode 100644
> index 000000000000..01c7a259e9a5
> --- /dev/null
> +++ b/arch/arm/boards/kamstrup-imx7d-tqma7d/Makefile
> @@ -0,0 +1,2 @@
> +obj-y += board.o
> +lwl-y += lowlevel.o
> diff --git a/arch/arm/boards/kamstrup-imx7d-tqma7d/board.c
> b/arch/arm/boards/kamstrup-imx7d-tqma7d/board.c
> new file mode 100644
> index 000000000000..b3ffa851f3e6
> --- /dev/null
> +++ b/arch/arm/boards/kamstrup-imx7d-tqma7d/board.c
> @@ -0,0 +1,19 @@
> +// SPDX-License-Identifier: GPL-2.0-or-later
> +// SPDX-FileCopyrightText: 2020 Kamstrup A/S
> +
> +/* Author: Lars Pedersen <lapeddk@gmail.com> */
> +
> +#include <common.h>
> +#include <init.h>
> +#include <io.h>
> +#include <mach/imx7-regs.h>
> +#include <mfd/imx7-iomuxc-gpr.h>
> +
> +static int kamstrup_mx7_tqma7d_coredevices_init(void)
> +{
> +    if (!of_machine_is_compatible("kam,imx7d-flex-concentrator"))
> +        return 0;
> +
> +    return 0;
> +}

Function serves no purpose. If you don't have baord code, drop it altogether.

> +coredevice_initcall(kamstrup_mx7_tqma7d_coredevices_init);
> diff --git a/arch/arm/boards/kamstrup-imx7d-tqma7d/flash-header-kamstrup-imx7d-tqma7d.imxcfg
> b/arch/arm/boards/kamstrup-imx7d-tqma7d/flash-header-kamstrup-imx7d-tqma7d.imxcfg
> new file mode 100644
> index 000000000000..7656619c1b2e
> --- /dev/null
> +++ b/arch/arm/boards/kamstrup-imx7d-tqma7d/flash-header-kamstrup-imx7d-tqma7d.imxcfg
> @@ -0,0 +1,79 @@
> +soc imx7
> +loadaddr 0x80000000
> +dcdofs 0x400

Called ivtofs now in barebox next branch now.

> +
> +#include <mach/imx7-ddr-regs.h>
> +wm 32 0x30340004 0x4F400005 /* IOMUXC_GPR_GPR1 */
> +/* TODO this is copied from imx7sabresd */
> +/* Clear then set bit30 to ensure exit from DDR retention */
> +wm 32 0x30360388 0x40000000
> +wm 32 0x30360384 0x40000000
> +
> +/* TQMa7x DRAM Timing REV0100 */
> +/* DCD Code i.MX7D/S 528 MHz 1 GByte Samsung K4B4G1646D */
> +wm 32 0x30360070 0x0070302C     /*CCM_ANALOG_PLL_DDRx*/
> +wm 32  0x30360090 0x00000000    /*CCM_ANALOG_PLL_NUM*/
> +wm 32  0x30360070 0x0060302C    /*CCM_ANALOG_PLL_DDRx*/
> +check 32 until_any_bit_set 0x30360070 0x80000000
> +wm 32 0x30391000 0x00000002     /*SRC_DDRC_RCR*/
> +
> +wm 32 MX7_DDRC_MSTR 0x01040001   /*DDRC_MSTR*/
> +wm 32 MX7_DDRC_DFIUPD0 0x80400003   /*DDRC_DFIUPD0*/
> +wm 32 MX7_DDRC_DFIUPD1 0x00100020   /*DDRC_DFIUPD1*/
> +wm 32 MX7_DDRC_DFIUPD2 0x80100004   /*DDRC_DFIUPD2*/
> +wm 32 MX7_DDRC_RFSHTMG 0x00200045   /*DDRC_RFSHTMG*/
> +wm 32 MX7_DDRC_MP_PCTRL_0 0x00000001   /*DDRC_MP_PCTRL_0*/
> +wm 32 MX7_DDRC_INIT0 0x00020081   /*DDRC_INIT0*/
> +wm 32 MX7_DDRC_INIT1 0x00680000   /*DDRC_INIT1*/
> +wm 32 MX7_DDRC_INIT3 0x09300004   /*DDRC_INIT3*/
> +wm 32 MX7_DDRC_INIT4 0x00480000   /*DDRC_INIT4*/
> +wm 32 MX7_DDRC_INIT5 0x00100004   /*DDRC_INIT5*/
> +wm 32 MX7_DDRC_RANKCTL 0x0000033F   /*DDRC_RANKCTL*/
> +wm 32 MX7_DDRC_DRAMTMG0 0x090E0809   /*DDRC_DRAMTMG0*/
> +wm 32 MX7_DDRC_DRAMTMG1 0x0007020E   /*DDRC_DRAMTMG1*/
> +wm 32 MX7_DDRC_DRAMTMG2 0x03040407   /*DDRC_DRAMTMG2*/
> +wm 32 MX7_DDRC_DRAMTMG3 0x00002006   /*DDRC_DRAMTMG3*/
> +wm 32 MX7_DDRC_DRAMTMG4 0x04020304   /*DDRC_DRAMTMG4*/
> +wm 32 MX7_DDRC_DRAMTMG5 0x03030202   /*DDRC_DRAMTMG5*/
> +wm 32 MX7_DDRC_DRAMTMG8 0x00000803   /*DDRC_DRAMTMG8*/
> +wm 32 MX7_DDRC_ZQCTL0 0x00800020   /*DDRC_ZQCTL0*/
> +wm 32 MX7_DDRC_DFITMG0 0x02098204   /*DDRC_DFITMG0*/
> +wm 32 MX7_DDRC_DFITMG1 0x00030303   /*DDRC_DFITMG1*/
> +wm 32 MX7_DDRC_ADDRMAP0 0x00000016   /*DDRC_ADDRMAP0*/
> +wm 32 MX7_DDRC_ADDRMAP1 0x00171717   /*DDRC_ADDRMAP1*/
> +wm 32 MX7_DDRC_ADDRMAP4 0x00000F0F   /*DDRC_ADDRMAP4*/
> +wm 32 MX7_DDRC_ADDRMAP5 0x04040404   /*DDRC_ADDRMAP5*/
> +wm 32 MX7_DDRC_ADDRMAP6 0x0F040404   /*DDRC_ADDRMAP6*/
> +wm 32 MX7_DDRC_ODTCFG 0x06000604   /*DDRC_ODTCFG*/
> +wm 32 MX7_DDRC_ODTMAP 0x00000001   /*DDRC_ODTMAP*/
> +wm 32 0x30391000 0x00000000   /*SRC_DDRC_RCR*/
> +wm 32 MX7_DDR_PHY_PHY_CON0 0x17420F40   /*DDR_PHY_PHY_CON0*/
> +wm 32 MX7_DDR_PHY_PHY_CON1 0x10210100   /*DDR_PHY_PHY_CON1*/
> +wm 32 MX7_DDR_PHY_PHY_CON4 0x00060807   /*DDR_PHY_PHY_CON4*/
> +wm 32 MX7_DDR_PHY_MDLL_CON0 0x1010007E   /*DDR_PHY_MDLL_CON0*/
> +wm 32 MX7_DDR_PHY_DRVDS_CON0 0x00000924   /*DDR_PHY_DRVDS_CON0*/
> +/*DDR_PHY_CMD_DESKEW_CON0*/
> +/*DDR_PHY_CMD_DESKEW_CON1*/
> +/*DDR_PHY_CMD_DESKEW_CON2*/
> +/*DDR_PHY_CMD_DESKEW_CON3*/
> +/*DDR_PHY_LVL_CON0*/
> +wm 32 MX7_DDR_PHY_OFFSET_RD_CON0 0x0B0B0B0B   /*DDR_PHY_OFFSET_RD_CON0 */
> +wm 32 MX7_DDR_PHY_OFFSET_WR_CON0 0x06060606   /*DDR_PHY_OFFSET_WR_CON0 */
> +wm 32 MX7_DDR_PHY_CMD_SDLL_CON0 0x01000010   /*DDR_PHY_CMD_SDLL_CON0*/
> +wm 32 MX7_DDR_PHY_CMD_SDLL_CON0 0x00000010   /*DDR_PHY_CMD_SDLL_CON0*/
> +
> +wm 32 MX7_DDR_PHY_ZQ_CON0 0x0C407304   /*DDR_PHY_ZQ_CON0*/
> +wm 32 MX7_DDR_PHY_ZQ_CON0 0x0C447304   /*DDR_PHY_ZQ_CON0*/
> +wm 32 MX7_DDR_PHY_ZQ_CON0 0x0C447306   /*DDR_PHY_ZQ_CON0*/
> +check 32 until_any_bit_set MX7_DDR_PHY_ZQ_CON0 0x1 /*ZQ Calibration
> is finished*/
> +wm 32 MX7_DDR_PHY_ZQ_CON0 0x0C447304   /*DDR_PHY_ZQ_CON0*/
> +wm 32 MX7_DDR_PHY_ZQ_CON0 0x0C407304   /*DDR_PHY_ZQ_CON0*/
> +
> +wm 32 0x30384130 0x00000000 /* CCM_CCGRn */
> +wm 32 0x30340020 0x00000178 /* IOMUXC_GPR_GPR8 */
> +wm 32 0x30384130 0x00000002 /* CCM_CCGRn */
> +wm 32 0x30790018 0x0000000f /* DDR_PHY_LP_CON0 */
> +
> +/* DDRC_STAT */
> +check 32 until_any_bit_set 4 0x307a0004 0x1
> +
> diff --git a/arch/arm/boards/kamstrup-imx7d-tqma7d/lowlevel.c
> b/arch/arm/boards/kamstrup-imx7d-tqma7d/lowlevel.c
> new file mode 100644
> index 000000000000..d8c455701edc
> --- /dev/null
> +++ b/arch/arm/boards/kamstrup-imx7d-tqma7d/lowlevel.c
> @@ -0,0 +1,35 @@
> +#include <debug_ll.h>
> +#include <io.h>
> +#include <common.h>
> +#include <linux/sizes.h>
> +#include <mach/generic.h>
> +#include <asm/barebox-arm-head.h>
> +#include <asm/barebox-arm.h>
> +#include <mach/imx7-ccm-regs.h>
> +#include <mach/iomux-mx7.h>
> +#include <mach/debug_ll.h>
> +#include <asm/cache.h>
> +#include <mach/esdctl.h>
> +
> +extern char __dtb_imx7d_flex_concentrator_mfg_start[];
> +
> +static inline void setup_uart(void)
> +{
> +    imx7_early_setup_uart_clock();
> +
> +    imx7_setup_pad(MX7D_PAD_SAI2_TX_BCLK__UART4_DCE_TX);
> +
> +    imx7_uart_setup_ll();
> +
> +    putc_ll('>');
> +}
> +
> +ENTRY_FUNCTION(start_kamstrup_imx7d_tqma7d, r0, r1, r2)
> +{
> +    imx7_cpu_lowlevel_init();
> +
> +    if (IS_ENABLED(CONFIG_DEBUG_LL))
> +        setup_uart();
> +
> +    imx7d_barebox_entry(__dtb_imx7d_flex_concentrator_mfg_start +
> get_runtime_offset());
> +}
> diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
> index d61a052310ce..ec3d0f372786 100644
> --- a/arch/arm/dts/Makefile
> +++ b/arch/arm/dts/Makefile
> @@ -23,6 +23,7 @@ lwl-$(CONFIG_MACH_CCMX53) += imx53-ccxmx53.dtb.o
>  lwl-$(CONFIG_MACH_DIGI_CCIMX6ULSBCPRO) += imx6ul-ccimx6ulsbcpro.dtb.o
>  lwl-$(CONFIG_MACH_FREESCALE_MX53_VMX53) += imx53-voipac-bsb.dtb.o
>  lwl-$(CONFIG_MACH_FREESCALE_MX7_SABRESD) += imx7d-sdb.dtb.o
> +lwl-$(CONFIG_MACH_KAMSTRUP_IMX7D_TQMA7D) += imx7d-flex-concentrator-mfg.dtb.o
>  lwl-$(CONFIG_MACH_GK802) += imx6q-gk802.dtb.o
>  lwl-$(CONFIG_MACH_GLOBALSCALE_GURUPLUG) +=
> kirkwood-guruplug-server-plus-bb.dtb.o
>  lwl-$(CONFIG_MACH_GLOBALSCALE_MIRABOX) += armada-370-mirabox-bb.dtb.o
> diff --git a/arch/arm/dts/imx7d-flex-concentrator-mfg.dts
> b/arch/arm/dts/imx7d-flex-concentrator-mfg.dts
> new file mode 100644
> index 000000000000..746e36a70f4c
> --- /dev/null
> +++ b/arch/arm/dts/imx7d-flex-concentrator-mfg.dts
> @@ -0,0 +1,11 @@
> +/*
> + * The code contained herein is licensed under the GNU General Public
> + * License. You may obtain a copy of the GNU General Public License
> + * Version 2 or later at the following locations:
> + *
> + * http://www.opensource.org/licenses/gpl-license.html
> + * http://www.gnu.org/copyleft/gpl.html
> + */
> +
> +#include <arm/imx7d-flex-concentrator-mfg.dts>
> +
> diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
> index 6dd5cb2aca15..d0a9332c7a24 100644
> --- a/arch/arm/mach-imx/Kconfig
> +++ b/arch/arm/mach-imx/Kconfig
> @@ -492,6 +492,11 @@ config MACH_ZII_IMX7D_DEV
>      select ARCH_IMX7
>      select ARM_USE_COMPRESSED_DTB
> 
> +config MACH_KAMSTRUP_IMX7D_TQMA7D
> +    bool "Kamstrup TQMa7D based devices"
> +    select ARCH_IMX7
> +    select ARM_USE_COMPRESSED_DTB
> +
>  config MACH_PHYTEC_PHYCORE_IMX7
>      bool "Phytec phyCORE i.MX7"
>      select ARCH_IMX7
> diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
> index 1ce057180a01..b0bdc48399e3 100644
> --- a/drivers/regulator/Kconfig
> +++ b/drivers/regulator/Kconfig
> @@ -19,7 +19,7 @@ config REGULATOR_BCM283X
>  config REGULATOR_PFUZE
>      bool "Freescale PFUZE100/200/3000 regulator driver"
>      depends on I2C
> -    depends on ARCH_IMX6 || ARCH_IMX8MQ
> +    depends on ARCH_IMX6 || ARCH_IMX7 || ARCH_IMX8MQ
> 
>  config REGULATOR_STM32_PWR
>      bool "STMicroelectronics STM32 PWR"
> diff --git a/dts/src/arm/imx7d-flex-concentrator-mfg.dts
> b/dts/src/arm/imx7d-flex-concentrator-mfg.dts
> new file mode 100644
> index 000000000000..789f0837058f
> --- /dev/null
> +++ b/dts/src/arm/imx7d-flex-concentrator-mfg.dts

Perfectly fine for your patch stack in BSP, but if you want to upstream
it, you need to either:

1) upstream your device tree to Linux. dts/ is a sync with Linux and
   shortly after, it will be imported into barebox
2) put your device tree in arch/arm/dts

> @@ -0,0 +1,25 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Device Tree Source for Kamstrup OMNIA Flex Concentrator in
> + * manufacturing/debugging mode.
> + *
> + * Copyright (C) 2020 Kamstrup A/S
> + * Author: Bruno Thomsen <bruno.thomsen@gmail.com>
> + */
> +
> +/dts-v1/;
> +
> +#include "imx7d-flex-concentrator.dts"
> +
> +/ {
> +    model = "Kamstrup OMNIA Flex Concentrator - Manufacturing";
> +    compatible = "kam,imx7d-flex-concentrator-mfg",
> "kam,imx7d-flex-concentrator", "fsl,imx7d";
> +
> +    chosen {
> +        stdout-path = &uart4;
> +    };
> +};
> +
> +&uart4 {
> +    status = "okay";
> +};
> diff --git a/dts/src/arm/imx7d-flex-concentrator.dts
> b/dts/src/arm/imx7d-flex-concentrator.dts
> new file mode 100644
> index 000000000000..43b331222a47
> --- /dev/null
> +++ b/dts/src/arm/imx7d-flex-concentrator.dts
> @@ -0,0 +1,313 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Device Tree Source for Kamstrup OMNIA Flex Concentrator.
> + *
> + * Copyright (C) 2020 Kamstrup A/S
> + * Author: Bruno Thomsen <bruno.thomsen@gmail.com>
> + */
> +
> +/dts-v1/;
> +
> +#include "imx7d-tqma7.dtsi"
> +
> +/* Some I2C devices on TQMa7 SoM are not mounted */
> +/delete-node/ &m24c64;
> +/delete-node/ &ds1339;
> +
> +/ {
> +    model = "Kamstrup OMNIA Flex Concentrator";
> +    compatible = "kam,imx7d-flex-concentrator", "fsl,imx7d";
> +
> +    memory@80000000 {
> +        device_type = "memory";
> +        /* 1024 MB - TQMa7D board configuration */
> +        reg = <0x80000000 0x40000000>;
> +    };
> +
> +    reg_usb_otg2_vbus: regulator-usb-otg2-vbus {
> +        compatible = "regulator-fixed";
> +        regulator-name = "VBUS_USBOTG2";
> +        regulator-min-microvolt = <5000000>;
> +        regulator-max-microvolt = <5000000>;
> +        gpio = <&gpio1 7 GPIO_ACTIVE_HIGH>;
> +        enable-active-high;
> +    };
> +
> +    reg_vref_1v8: regulator-vref-1v8 {
> +        compatible = "regulator-fixed";
> +        regulator-name = "VCC1V8_REF";
> +        regulator-min-microvolt = <1800000>;
> +        regulator-max-microvolt = <1800000>;
> +        regulator-always-on;
> +        vin-supply = <&sw2_reg>;
> +    };
> +
> +    /*
> +     * Human Machine Interface consists of 4 dual red/green LEDs.
> +     * hmi-a-green is controlled directly by the switch-mode power supply.
> +     * hmi-a-red is not used.
> +     */
> +    gpio-leds {
> +        compatible = "gpio-leds";
> +        pinctrl-names = "default";
> +        pinctrl-0 = <&pinctrl_leds>;
> +
> +        hmi-b-red {
> +            label = "hmi-b:red:provisioning";
> +            gpios = <&gpio3 6 GPIO_ACTIVE_HIGH>;
> +            default-state = "off";
> +        };
> +
> +        hmi-b-green {
> +            label = "hmi-b:green:operation";
> +            gpios = <&gpio2 28 GPIO_ACTIVE_HIGH>;
> +            default-state = "off";
> +        };
> +
> +        hmi-c-red {
> +            label = "hmi-c:red:mesh-error";
> +            gpios = <&gpio2 29 GPIO_ACTIVE_HIGH>;
> +            default-state = "off";
> +        };
> +
> +        hmi-c-green {
> +            label = "hmi-c:green:mesh-activity";
> +            gpios = <&gpio2 30 GPIO_ACTIVE_HIGH>;
> +            default-state = "off";
> +        };
> +
> +        hmi-d-red {
> +            label = "hmi-d:red:wan-down";
> +            gpios = <&gpio2 31 GPIO_ACTIVE_HIGH>;
> +            default-state = "off";
> +        };
> +
> +        hmi-d-green {
> +            label = "hmi-d:green:ipsec-up";
> +            gpios = <&gpio4 3 GPIO_ACTIVE_HIGH>;
> +            default-state = "off";
> +        };
> +    };
> +
> +    /*
> +     * Errata e10574 board restart workaround.
> +     */
> +    gpio-restart {
> +        pinctrl-names = "default";
> +        pinctrl-0 = <&pinctrl_restart>;
> +        compatible = "gpio-restart";
> +        gpios = <&gpio7 12 GPIO_ACTIVE_LOW>;
> +        priority = <200>;
> +    };
> +};
> +
> +/*
> + * Analog signals
> + * ADC1_IN0: SMPS - 5V output monitor (voltage divider: 1/0.2806)
> + */
> +&adc1 {
> +    vref-supply = <&reg_vref_1v8>;
> +    status = "okay";
> +};
> +
> +&ecspi2 {
> +    pinctrl-names = "default";
> +    pinctrl-0 = <&pinctrl_ecspi2>;
> +    num-chipselects = <1>;
> +    cs-gpios = <&gpio4 23 GPIO_ACTIVE_LOW>;
> +    status = "okay";
> +
> +    pcf2127: rtc@0 {
> +        compatible = "nxp,pcf2127";
> +        reg = <0>;
> +        spi-max-frequency = <2000000>;
> +    };
> +};
> +
> +&ecspi4 {
> +    pinctrl-names = "default";
> +    pinctrl-0 = <&pinctrl_ecspi4>;
> +    num-chipselects = <1>;
> +    cs-gpios = <&gpio3 3 GPIO_ACTIVE_LOW>;
> +    status = "okay";
> +
> +    /*
> +     * ST chip maximum SPI clock frequency is 33 MHz.
> +     *
> +     * TCG specification - Section 6.4.1 Clocking:
> +     * TPM shall support a SPI clock frequency range of 10-24 MHz.
> +     */
> +    st33htph: tpm-tis@0 {
> +        compatible = "st,st33htpm-spi", "tcg,tpm_tis-spi";
> +        reg = <0>;
> +        spi-max-frequency = <24000000>;
> +    };
> +};
> +
> +&fec1 {
> +    pinctrl-names = "default";
> +    pinctrl-0 = <&pinctrl_enet1>;
> +    phy-mode = "rmii";
> +    phy-handle = <&ethphy>;
> +    status = "okay";
> +
> +    mdio {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        /* Micrel KSZ8081RNB */
> +        ethphy: ethernet-phy@1 {
> +            compatible = "ethernet-phy-id0022.1560",
> "ethernet-phy-ieee802.3-c22";
> +            reg = <1>;
> +            max-speed = <100>;
> +            interrupt-parent = <&gpio1>;
> +            interrupts = <9 IRQ_TYPE_LEVEL_LOW>;
> +            reset-assert-us = <100000>;
> +            reset-deassert-us = <1000000>;
> +            reset-gpios = <&gpio7 15 GPIO_ACTIVE_LOW>;
> +        };
> +    };
> +};
> +
> +/*
> + * Detection signals for internal USB modules.
> + * Used for robust USB plug and play handling such as USB downstream port
> + * power-cycle and USB hub reset in case of misbehaving or crashed modules.
> + *
> + * SMPS - AC input monitor based on zero crossing.
> + * Used for last gasp notification.
> + */
> +&gpio3 {
> +    gpio-line-names = "", "", "", "", "", "", "", "",
> +    "", "", "", "", "smps-ac-monitor", "", "usb-hub-reset", "",
> +    "", "", "", "", "", "", "", "",
> +    "", "module-b-detection", "", "module-a-detection", "", "", "", "";
> +};
> +
> +/*
> + * Tamper IRQ trigger timestamp reading.
> + * Used for sealed cover opened/closed notification.
> + */
> +&gpio5 {
> +    gpio-line-names = "", "", "", "", "", "", "", "",
> +    "", "", "", "", "rtc-tamper-irq", "", "", "",
> +    "", "", "", "", "", "", "", "",
> +    "", "", "", "", "", "", "", "";
> +};
> +
> +&iomuxc {
> +    pinctrl-names = "default";
> +    pinctrl-0 = <&pinctrl_misc>;
> +
> +    pinctrl_ecspi2: ecspi2grp {
> +        fsl,pins = <
> +            MX7D_PAD_ECSPI2_MISO__ECSPI2_MISO        0x7c /* X2-15 */
> +            MX7D_PAD_ECSPI2_MOSI__ECSPI2_MOSI        0x74 /* X2-18 */
> +            MX7D_PAD_ECSPI2_SCLK__ECSPI2_SCLK        0x74 /* X2-13 */
> +            MX7D_PAD_ECSPI2_SS0__GPIO4_IO23            0x74 /* X2-20 */
> +            /* RTC - Tamper IRQ */
> +            MX7D_PAD_SD2_CLK__GPIO5_IO12            0x3c /* X1-92 */
> +        >;
> +    };
> +
> +    pinctrl_ecspi4: ecspi4grp {
> +        fsl,pins = <
> +            MX7D_PAD_LCD_CLK__ECSPI4_MISO            0x7c /* X2-72 */
> +            MX7D_PAD_LCD_ENABLE__ECSPI4_MOSI        0x74 /* X2-68 */
> +            MX7D_PAD_LCD_HSYNC__ECSPI4_SCLK            0x74 /* X2-76 */
> +            MX7D_PAD_LCD_VSYNC__GPIO3_IO3            0x74 /* X2-78 */
> +        >;
> +    };
> +
> +    pinctrl_enet1: enet1grp {
> +        fsl,pins = <
> +            MX7D_PAD_GPIO1_IO10__ENET1_MDIO            0x02 /* X2-48 */
> +            MX7D_PAD_GPIO1_IO11__ENET1_MDC            0x00 /* X2-46 */
> +            MX7D_PAD_ENET1_RGMII_TD0__ENET1_RGMII_TD0    0x71 /* X2-53 */
> +            MX7D_PAD_ENET1_RGMII_TD1__ENET1_RGMII_TD1    0x71 /* X2-55 */
> +            MX7D_PAD_ENET1_RGMII_TX_CTL__ENET1_RGMII_TX_CTL    0x71 /* X2-61 */
> +            MX7D_PAD_ENET1_RGMII_RD0__ENET1_RGMII_RD0    0x79 /* X2-56 */
> +            MX7D_PAD_ENET1_RGMII_RD1__ENET1_RGMII_RD1    0x79 /* X2-58 */
> +            MX7D_PAD_ENET1_RGMII_RX_CTL__ENET1_RGMII_RX_CTL    0x79 /* X2-64 */
> +            MX7D_PAD_ENET1_RGMII_RXC__ENET1_RX_ER        0x73 /* X2-52 */
> +            /* PHY reset: SION, 100kPU, SRE_FAST, DSE_X1 */
> +            MX7D_PAD_ENET1_COL__GPIO7_IO15        0x40000070 /* X1-96 */
> +            /* Clock from PHY to MAC */
> +            MX7D_PAD_GPIO1_IO12__CCM_ENET_REF_CLK1    0x40000073 /* X3-4 */
> +            /* PHY interrupt: SION, 100kPU, HYS, SRE_FAST, DSE_X1 */
> +            MX7D_PAD_GPIO1_IO09__GPIO1_IO9        0x40000078 /* X1-80 */
> +        >;
> +    };
> +
> +    pinctrl_leds: ledsgrp {
> +        fsl,pins = <
> +            MX7D_PAD_LCD_DATA01__GPIO3_IO6            0x14 /* X2-82 */
> +            MX7D_PAD_EPDC_BDR0__GPIO2_IO28            0x14 /* X1-82 */
> +            MX7D_PAD_EPDC_BDR1__GPIO2_IO29            0x14 /* X1-84 */
> +            MX7D_PAD_EPDC_PWR_COM__GPIO2_IO30        0x14 /* X1-86 */
> +            MX7D_PAD_EPDC_PWR_STAT__GPIO2_IO31        0x14 /* X1-88 */
> +            MX7D_PAD_UART2_TX_DATA__GPIO4_IO3        0x14 /* X1-90 */
> +        >;
> +    };
> +
> +    pinctrl_misc: miscgrp {
> +        fsl,pins = <
> +            /* Module A detection (low = present) */
> +            MX7D_PAD_LCD_DATA22__GPIO3_IO27            0x7c /* X2-105 */
> +            /* Module B detection (low = present) */
> +            MX7D_PAD_LCD_DATA20__GPIO3_IO25            0x7c /* X2-103 */
> +            /* SMPS - AC input monitor (high = failure) */
> +            MX7D_PAD_LCD_DATA07__GPIO3_IO12            0x7c /* X2-88 */
> +            /* USB - Hub reset */
> +            MX7D_PAD_LCD_DATA09__GPIO3_IO14            0x74 /* X2-92 */
> +        >;
> +    };
> +
> +    pinctrl_restart: restartgrp {
> +        fsl,pins = <
> +            MX7D_PAD_ENET1_TX_CLK__GPIO7_IO12    0x74 /* X1-94 */
> +        >;
> +    };
> +
> +    pinctrl_uart4: uart4grp {
> +        fsl,pins = <
> +            MX7D_PAD_SAI2_TX_SYNC__UART4_DCE_RX    0x7e /* X3-14 */
> +            MX7D_PAD_SAI2_TX_BCLK__UART4_DCE_TX    0x76 /* X3-16 */
> +        >;
> +    };
> +};
> +
> +&iomuxc_lpsr {
> +    pinctrl_usbotg2: usbotg2grp {
> +        fsl,pins = <
> +            MX7D_PAD_LPSR_GPIO1_IO06__USB_OTG2_OC    0x5c /* X3-11 */
> +            MX7D_PAD_LPSR_GPIO1_IO07__GPIO1_IO7    0x59 /* X3-9 */
> +        >;
> +    };
> +
> +};
> +
> +&uart4 {
> +    pinctrl-names = "default";
> +    pinctrl-0 = <&pinctrl_uart4>;
> +    assigned-clocks = <&clks IMX7D_UART4_ROOT_SRC>;
> +    assigned-clock-parents = <&clks IMX7D_OSC_24M_CLK>;
> +};
> +
> +&usbotg2 {
> +    pinctrl-names = "default";
> +    pinctrl-0 = <&pinctrl_usbotg2>;
> +    vbus-supply = <&reg_usb_otg2_vbus>;
> +    srp-disable;
> +    hnp-disable;
> +    adp-disable;
> +    dr_mode = "host";
> +    status = "okay";
> +};
> +
> +/*
> + * External watchdog feature provided by pcf2127.
> + */
> +&wdog1 {
> +    status = "disabled";
> +};
> diff --git a/images/Makefile.imx b/images/Makefile.imx
> index 765702f26deb..cbbefd5c085b 100644
> --- a/images/Makefile.imx
> +++ b/images/Makefile.imx
> @@ -364,6 +364,11 @@ CFG_start_zii_imx7d_dev.pblb.imximg =
> $(board)/zii-imx7d-dev/flash-header-zii-im
>  FILE_barebox-zii-imx7d-dev.img = start_zii_imx7d_dev.pblb.imximg
>  image-$(CONFIG_MACH_ZII_IMX7D_DEV) += barebox-zii-imx7d-dev.img
> 
> +pblb-$(CONFIG_MACH_KAMSTRUP_IMX7D_TQMA7D) += start_kamstrup_imx7d_tqma7d
> +CFG_start_kamstrup_imx7d_tqma7d.pblb.imximg =
> $(board)/kamstrup-imx7d-tqma7d/flash-header-kamstrup-imx7d-tqma7d.imxcfg
> +FILE_barebox-kamstrup-imx7d-tqma7d.img =
> start_kamstrup_imx7d_tqma7d.pblb.imximg
> +image-$(CONFIG_MACH_KAMSTRUP_IMX7D_TQMA7D) += barebox-kamstrup-imx7d-tqma7d.img
> +
>  # ----------------------- i.MX8mm based boards --------------------------
>  pblb-$(CONFIG_MACH_NXP_IMX8MM_EVK) += start_nxp_imx8mm_evk
>  CFG_start_nxp_imx8mm_evk.pblb.imximg =
> $(board)/nxp-imx8mm-evk/flash-header-imx8mm-evk.imxcfg
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Getting serial console output on new imx7d tqma7 board UART4
  2020-07-30 10:16       ` Lars Pedersen
  2020-07-30 13:55         ` Ahmad Fatoum
@ 2020-08-03 21:51         ` Sascha Hauer
  2020-08-04 12:53           ` Lars Pedersen
  1 sibling, 1 reply; 20+ messages in thread
From: Sascha Hauer @ 2020-08-03 21:51 UTC (permalink / raw)
  To: Lars Pedersen; +Cc: barebox, Ahmad Fatoum

Hi Lars,

On Thu, Jul 30, 2020 at 12:16:14PM +0200, Lars Pedersen wrote:

> CONFIG_DEBUG_IMX_UART_PORT=1
> CONFIG_HAS_DEBUG_LL=y

This config still has CONFIG_DEBUG_IMX_UART_PORT=1. You probably sent
this before you changed it to '4', right? Otherwise this might be the
issue.

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Getting serial console output on new imx7d tqma7 board UART4
  2020-08-03 21:51         ` Sascha Hauer
@ 2020-08-04 12:53           ` Lars Pedersen
  0 siblings, 0 replies; 20+ messages in thread
From: Lars Pedersen @ 2020-08-04 12:53 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox, Ahmad Fatoum

Hi Sascha thx for the reply.

/Lars Pedersen

On Mon, 3 Aug 2020 at 23:51, Sascha Hauer <s.hauer@pengutronix.de> wrote:
>
> Hi Lars,
>
> On Thu, Jul 30, 2020 at 12:16:14PM +0200, Lars Pedersen wrote:
>
> > CONFIG_DEBUG_IMX_UART_PORT=1
> > CONFIG_HAS_DEBUG_LL=y
>
> This config still has CONFIG_DEBUG_IMX_UART_PORT=1. You probably sent
> this before you changed it to '4', right? Otherwise this might be the
> issue.

Yes, it has been changed to 4.

>
> Sascha
>
> --
> Pengutronix e.K.                           |                             |
> Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
> 31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Getting serial console output on new imx7d tqma7 board UART4
  2020-08-03 10:10 ` Ahmad Fatoum
@ 2020-08-04 13:07   ` Lars Pedersen
  2020-08-04 16:15     ` Ahmad Fatoum
  0 siblings, 1 reply; 20+ messages in thread
From: Lars Pedersen @ 2020-08-04 13:07 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox

Hi.

I just go an MCIMX7SABRE board and it now trying to start barebox from
the external SD card, which I guess should be possible right?

I have taken barebox 2020.07.0 and copied the imx_v7_defconfig and
deselected all boards except the "NXP i.MX7 SabreSD board"

After compilation i copy the image using:

sudo dd if=barebox-freescale-mx7-sabresd.img of=/dev/sdb bs=1024 skip=1 seek=1
sync

But still no boot screen for that either. :/

Shouldn't this work out of the box??

/Lars Pedersen

On Mon, 3 Aug 2020 at 12:10, Ahmad Fatoum <a.fatoum@pengutronix.de> wrote:
>
> Hi,
>
> On 7/29/20 6:52 PM, Lars Pedersen wrote:
> > I have spent the last couple of days trying to port our bootloader
> > from u-boot to barebox 2020.07 but have yet to get any console output.
> > Our product is based on tqma7d i.MX7 dual core cpu and uses UART4 for
> > serial console and boots from internal eMMC.
> >
> > I created a new board inspired from "NXP i.MX7 SabreSD board" and
> > tried to only add the basic in the first step to get a console output
> > working. The image is built using ptxdist and the imx_v7_defconfig
> > where the new board is selected. The image is flashed with "dd
> > if=barebox-image of=/dev/mmcblk0 bs=1024 skip=1 seek=1 conv=fsync".
> > The device works using u-boot 2020.07 with the same device trees but
> > we thought it was time to try out barebox since u-boot felt a little
> > bloated :)
> >
> > So can anyone be of assistance and tell me what I'm missing?
>
> When I looked through your patch the first time, I just looked
> for stuff that would cause it to not boot. Some more comments
> inline that are unrelated to your boot problems.
>
> >
> > /Lars Pedersen
> >
> > From: Lars Pedersen <laa@kamstrup.com>
> > Date: Tue, 28 Jul 2020 08:57:57 +0000
> > Subject: [PATCH] Add kamstrup imx7d dev board
> >
> > ---
> >  arch/arm/boards/Makefile                           |   1 +
> >  arch/arm/boards/kamstrup-imx7d-tqma7d/Makefile     |   2 +
> >  arch/arm/boards/kamstrup-imx7d-tqma7d/board.c      |  19 ++
> >  .../flash-header-kamstrup-imx7d-tqma7d.imxcfg      |  79 ++++++
> >  arch/arm/boards/kamstrup-imx7d-tqma7d/lowlevel.c   |  35 +++
> >  arch/arm/dts/Makefile                              |   1 +
> >  arch/arm/dts/imx7d-flex-concentrator-mfg.dts       |  11 +
> >  arch/arm/mach-imx/Kconfig                          |   5 +
> >  drivers/regulator/Kconfig                          |   2 +-
> >  dts/src/arm/imx7d-flex-concentrator-mfg.dts        |  25 ++
> >  dts/src/arm/imx7d-flex-concentrator.dts            | 313 +++++++++++++++++++++
> >  images/Makefile.imx                                |   5 +
> >  12 files changed, 497 insertions(+), 1 deletion(-)
> >  create mode 100644 arch/arm/boards/kamstrup-imx7d-tqma7d/Makefile
> >  create mode 100644 arch/arm/boards/kamstrup-imx7d-tqma7d/board.c
> >  create mode 100644
> > arch/arm/boards/kamstrup-imx7d-tqma7d/flash-header-kamstrup-imx7d-tqma7d.imxcfg
> >  create mode 100644 arch/arm/boards/kamstrup-imx7d-tqma7d/lowlevel.c
> >  create mode 100644 arch/arm/dts/imx7d-flex-concentrator-mfg.dts
> >  create mode 100644 dts/src/arm/imx7d-flex-concentrator-mfg.dts
> >  create mode 100644 dts/src/arm/imx7d-flex-concentrator.dts
> >
> > diff --git a/arch/arm/boards/Makefile b/arch/arm/boards/Makefile
> > index e9e9163d589b..58bb4cf2adab 100644
> > --- a/arch/arm/boards/Makefile
> > +++ b/arch/arm/boards/Makefile
> > @@ -64,6 +64,7 @@ obj-$(CONFIG_MACH_HIGHBANK)            += highbank/
> >  obj-$(CONFIG_MACH_IMX21ADS)            += freescale-mx21-ads/
> >  obj-$(CONFIG_MACH_IMX233_OLINUXINO)        += imx233-olinuxino/
> >  obj-$(CONFIG_MACH_IMX27ADS)            += freescale-mx27-ads/
> > +obj-$(CONFIG_MACH_KAMSTRUP_IMX7D_TQMA7D)    += kamstrup-imx7d-tqma7d/
> >  obj-$(CONFIG_MACH_KINDLE3)            += kindle3/
> >  obj-$(CONFIG_MACH_KONTRON_SAMX6I)        += kontron-samx6i/
> >  obj-$(CONFIG_MACH_LENOVO_IX4_300D)        += lenovo-ix4-300d/
> > diff --git a/arch/arm/boards/kamstrup-imx7d-tqma7d/Makefile
> > b/arch/arm/boards/kamstrup-imx7d-tqma7d/Makefile
> > new file mode 100644
> > index 000000000000..01c7a259e9a5
> > --- /dev/null
> > +++ b/arch/arm/boards/kamstrup-imx7d-tqma7d/Makefile
> > @@ -0,0 +1,2 @@
> > +obj-y += board.o
> > +lwl-y += lowlevel.o
> > diff --git a/arch/arm/boards/kamstrup-imx7d-tqma7d/board.c
> > b/arch/arm/boards/kamstrup-imx7d-tqma7d/board.c
> > new file mode 100644
> > index 000000000000..b3ffa851f3e6
> > --- /dev/null
> > +++ b/arch/arm/boards/kamstrup-imx7d-tqma7d/board.c
> > @@ -0,0 +1,19 @@
> > +// SPDX-License-Identifier: GPL-2.0-or-later
> > +// SPDX-FileCopyrightText: 2020 Kamstrup A/S
> > +
> > +/* Author: Lars Pedersen <lapeddk@gmail.com> */
> > +
> > +#include <common.h>
> > +#include <init.h>
> > +#include <io.h>
> > +#include <mach/imx7-regs.h>
> > +#include <mfd/imx7-iomuxc-gpr.h>
> > +
> > +static int kamstrup_mx7_tqma7d_coredevices_init(void)
> > +{
> > +    if (!of_machine_is_compatible("kam,imx7d-flex-concentrator"))
> > +        return 0;
> > +
> > +    return 0;
> > +}
>
> Function serves no purpose. If you don't have baord code, drop it altogether.
>

I'll do a cleanup when I have it working :D

> > +coredevice_initcall(kamstrup_mx7_tqma7d_coredevices_init);
> > diff --git a/arch/arm/boards/kamstrup-imx7d-tqma7d/flash-header-kamstrup-imx7d-tqma7d.imxcfg
> > b/arch/arm/boards/kamstrup-imx7d-tqma7d/flash-header-kamstrup-imx7d-tqma7d.imxcfg
> > new file mode 100644
> > index 000000000000..7656619c1b2e
> > --- /dev/null
> > +++ b/arch/arm/boards/kamstrup-imx7d-tqma7d/flash-header-kamstrup-imx7d-tqma7d.imxcfg
> > @@ -0,0 +1,79 @@
> > +soc imx7
> > +loadaddr 0x80000000
> > +dcdofs 0x400
>
> Called ivtofs now in barebox next branch now.
>

Okay thanks.

> > diff --git a/arch/arm/dts/imx7d-flex-concentrator-mfg.dts
> > b/arch/arm/dts/imx7d-flex-concentrator-mfg.dts
> > new file mode 100644
> > index 000000000000..746e36a70f4c
> > --- /dev/null
> > +++ b/arch/arm/dts/imx7d-flex-concentrator-mfg.dts
> > @@ -0,0 +1,11 @@
> > +/*
> > + * The code contained herein is licensed under the GNU General Public
> > + * License. You may obtain a copy of the GNU General Public License
> > + * Version 2 or later at the following locations:
> > + *
> > + * http://www.opensource.org/licenses/gpl-license.html
> > + * http://www.gnu.org/copyleft/gpl.html
> > + */
> > +
> > +#include <arm/imx7d-flex-concentrator-mfg.dts>
> > +
> > diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
> > index 6dd5cb2aca15..d0a9332c7a24 100644
> > --- a/arch/arm/mach-imx/Kconfig
> > +++ b/arch/arm/mach-imx/Kconfig
> > @@ -492,6 +492,11 @@ config MACH_ZII_IMX7D_DEV
> >      select ARCH_IMX7
> >      select ARM_USE_COMPRESSED_DTB
> >
> > +config MACH_KAMSTRUP_IMX7D_TQMA7D
> > +    bool "Kamstrup TQMa7D based devices"
> > +    select ARCH_IMX7
> > +    select ARM_USE_COMPRESSED_DTB
> > +
> >  config MACH_PHYTEC_PHYCORE_IMX7
> >      bool "Phytec phyCORE i.MX7"
> >      select ARCH_IMX7
> > diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
> > index 1ce057180a01..b0bdc48399e3 100644
> > --- a/drivers/regulator/Kconfig
> > +++ b/drivers/regulator/Kconfig
> > @@ -19,7 +19,7 @@ config REGULATOR_BCM283X
> >  config REGULATOR_PFUZE
> >      bool "Freescale PFUZE100/200/3000 regulator driver"
> >      depends on I2C
> > -    depends on ARCH_IMX6 || ARCH_IMX8MQ
> > +    depends on ARCH_IMX6 || ARCH_IMX7 || ARCH_IMX8MQ
> >
> >  config REGULATOR_STM32_PWR
> >      bool "STMicroelectronics STM32 PWR"
> > diff --git a/dts/src/arm/imx7d-flex-concentrator-mfg.dts
> > b/dts/src/arm/imx7d-flex-concentrator-mfg.dts
> > new file mode 100644
> > index 000000000000..789f0837058f
> > --- /dev/null
> > +++ b/dts/src/arm/imx7d-flex-concentrator-mfg.dts
>
> Perfectly fine for your patch stack in BSP, but if you want to upstream
> it, you need to either:
>
> 1) upstream your device tree to Linux. dts/ is a sync with Linux and
>    shortly after, it will be imported into barebox
> 2) put your device tree in arch/arm/dts
>
The dts will upstreamed soon. Hopefully :D

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Getting serial console output on new imx7d tqma7 board UART4
  2020-08-04 13:07   ` Lars Pedersen
@ 2020-08-04 16:15     ` Ahmad Fatoum
  2020-08-04 19:21       ` Lars Pedersen
  0 siblings, 1 reply; 20+ messages in thread
From: Ahmad Fatoum @ 2020-08-04 16:15 UTC (permalink / raw)
  To: Lars Pedersen; +Cc: barebox

Hello Lars,

On 8/4/20 3:07 PM, Lars Pedersen wrote:
> I just go an MCIMX7SABRE board and it now trying to start barebox from
> the external SD card, which I guess should be possible right?
> 
> I have taken barebox 2020.07.0 and copied the imx_v7_defconfig and
> deselected all boards except the "NXP i.MX7 SabreSD board"
> 
> After compilation i copy the image using:
> 
> sudo dd if=barebox-freescale-mx7-sabresd.img of=/dev/sdb bs=1024 skip=1 seek=1
> sync> 
> But still no boot screen for that either. :/
> 
> Shouldn't this work out of the box??

Works for me.

imx_v7_defconfig
OSELAS.Toolchain-2019.09.1
Image written to SD card (offset 0) and booted from.

Can you try with same toolchain? If that works, it
might be a compiler issue? What are you using?

> 
> /Lars Pedersen
> 
> On Mon, 3 Aug 2020 at 12:10, Ahmad Fatoum <a.fatoum@pengutronix.de> wrote:
>>
>> Hi,
>>
>> On 7/29/20 6:52 PM, Lars Pedersen wrote:
>>> I have spent the last couple of days trying to port our bootloader
>>> from u-boot to barebox 2020.07 but have yet to get any console output.
>>> Our product is based on tqma7d i.MX7 dual core cpu and uses UART4 for
>>> serial console and boots from internal eMMC.
>>>
>>> I created a new board inspired from "NXP i.MX7 SabreSD board" and
>>> tried to only add the basic in the first step to get a console output
>>> working. The image is built using ptxdist and the imx_v7_defconfig
>>> where the new board is selected. The image is flashed with "dd
>>> if=barebox-image of=/dev/mmcblk0 bs=1024 skip=1 seek=1 conv=fsync".
>>> The device works using u-boot 2020.07 with the same device trees but
>>> we thought it was time to try out barebox since u-boot felt a little
>>> bloated :)
>>>
>>> So can anyone be of assistance and tell me what I'm missing?
>>
>> When I looked through your patch the first time, I just looked
>> for stuff that would cause it to not boot. Some more comments
>> inline that are unrelated to your boot problems.
>>
>>>
>>> /Lars Pedersen
>>>
>>> From: Lars Pedersen <laa@kamstrup.com>
>>> Date: Tue, 28 Jul 2020 08:57:57 +0000
>>> Subject: [PATCH] Add kamstrup imx7d dev board
>>>
>>> ---
>>>  arch/arm/boards/Makefile                           |   1 +
>>>  arch/arm/boards/kamstrup-imx7d-tqma7d/Makefile     |   2 +
>>>  arch/arm/boards/kamstrup-imx7d-tqma7d/board.c      |  19 ++
>>>  .../flash-header-kamstrup-imx7d-tqma7d.imxcfg      |  79 ++++++
>>>  arch/arm/boards/kamstrup-imx7d-tqma7d/lowlevel.c   |  35 +++
>>>  arch/arm/dts/Makefile                              |   1 +
>>>  arch/arm/dts/imx7d-flex-concentrator-mfg.dts       |  11 +
>>>  arch/arm/mach-imx/Kconfig                          |   5 +
>>>  drivers/regulator/Kconfig                          |   2 +-
>>>  dts/src/arm/imx7d-flex-concentrator-mfg.dts        |  25 ++
>>>  dts/src/arm/imx7d-flex-concentrator.dts            | 313 +++++++++++++++++++++
>>>  images/Makefile.imx                                |   5 +
>>>  12 files changed, 497 insertions(+), 1 deletion(-)
>>>  create mode 100644 arch/arm/boards/kamstrup-imx7d-tqma7d/Makefile
>>>  create mode 100644 arch/arm/boards/kamstrup-imx7d-tqma7d/board.c
>>>  create mode 100644
>>> arch/arm/boards/kamstrup-imx7d-tqma7d/flash-header-kamstrup-imx7d-tqma7d.imxcfg
>>>  create mode 100644 arch/arm/boards/kamstrup-imx7d-tqma7d/lowlevel.c
>>>  create mode 100644 arch/arm/dts/imx7d-flex-concentrator-mfg.dts
>>>  create mode 100644 dts/src/arm/imx7d-flex-concentrator-mfg.dts
>>>  create mode 100644 dts/src/arm/imx7d-flex-concentrator.dts
>>>
>>> diff --git a/arch/arm/boards/Makefile b/arch/arm/boards/Makefile
>>> index e9e9163d589b..58bb4cf2adab 100644
>>> --- a/arch/arm/boards/Makefile
>>> +++ b/arch/arm/boards/Makefile
>>> @@ -64,6 +64,7 @@ obj-$(CONFIG_MACH_HIGHBANK)            += highbank/
>>>  obj-$(CONFIG_MACH_IMX21ADS)            += freescale-mx21-ads/
>>>  obj-$(CONFIG_MACH_IMX233_OLINUXINO)        += imx233-olinuxino/
>>>  obj-$(CONFIG_MACH_IMX27ADS)            += freescale-mx27-ads/
>>> +obj-$(CONFIG_MACH_KAMSTRUP_IMX7D_TQMA7D)    += kamstrup-imx7d-tqma7d/
>>>  obj-$(CONFIG_MACH_KINDLE3)            += kindle3/
>>>  obj-$(CONFIG_MACH_KONTRON_SAMX6I)        += kontron-samx6i/
>>>  obj-$(CONFIG_MACH_LENOVO_IX4_300D)        += lenovo-ix4-300d/
>>> diff --git a/arch/arm/boards/kamstrup-imx7d-tqma7d/Makefile
>>> b/arch/arm/boards/kamstrup-imx7d-tqma7d/Makefile
>>> new file mode 100644
>>> index 000000000000..01c7a259e9a5
>>> --- /dev/null
>>> +++ b/arch/arm/boards/kamstrup-imx7d-tqma7d/Makefile
>>> @@ -0,0 +1,2 @@
>>> +obj-y += board.o
>>> +lwl-y += lowlevel.o
>>> diff --git a/arch/arm/boards/kamstrup-imx7d-tqma7d/board.c
>>> b/arch/arm/boards/kamstrup-imx7d-tqma7d/board.c
>>> new file mode 100644
>>> index 000000000000..b3ffa851f3e6
>>> --- /dev/null
>>> +++ b/arch/arm/boards/kamstrup-imx7d-tqma7d/board.c
>>> @@ -0,0 +1,19 @@
>>> +// SPDX-License-Identifier: GPL-2.0-or-later
>>> +// SPDX-FileCopyrightText: 2020 Kamstrup A/S
>>> +
>>> +/* Author: Lars Pedersen <lapeddk@gmail.com> */
>>> +
>>> +#include <common.h>
>>> +#include <init.h>
>>> +#include <io.h>
>>> +#include <mach/imx7-regs.h>
>>> +#include <mfd/imx7-iomuxc-gpr.h>
>>> +
>>> +static int kamstrup_mx7_tqma7d_coredevices_init(void)
>>> +{
>>> +    if (!of_machine_is_compatible("kam,imx7d-flex-concentrator"))
>>> +        return 0;
>>> +
>>> +    return 0;
>>> +}
>>
>> Function serves no purpose. If you don't have baord code, drop it altogether.
>>
> 
> I'll do a cleanup when I have it working :D
> 
>>> +coredevice_initcall(kamstrup_mx7_tqma7d_coredevices_init);
>>> diff --git a/arch/arm/boards/kamstrup-imx7d-tqma7d/flash-header-kamstrup-imx7d-tqma7d.imxcfg
>>> b/arch/arm/boards/kamstrup-imx7d-tqma7d/flash-header-kamstrup-imx7d-tqma7d.imxcfg
>>> new file mode 100644
>>> index 000000000000..7656619c1b2e
>>> --- /dev/null
>>> +++ b/arch/arm/boards/kamstrup-imx7d-tqma7d/flash-header-kamstrup-imx7d-tqma7d.imxcfg
>>> @@ -0,0 +1,79 @@
>>> +soc imx7
>>> +loadaddr 0x80000000
>>> +dcdofs 0x400
>>
>> Called ivtofs now in barebox next branch now.
>>
> 
> Okay thanks.
> 
>>> diff --git a/arch/arm/dts/imx7d-flex-concentrator-mfg.dts
>>> b/arch/arm/dts/imx7d-flex-concentrator-mfg.dts
>>> new file mode 100644
>>> index 000000000000..746e36a70f4c
>>> --- /dev/null
>>> +++ b/arch/arm/dts/imx7d-flex-concentrator-mfg.dts
>>> @@ -0,0 +1,11 @@
>>> +/*
>>> + * The code contained herein is licensed under the GNU General Public
>>> + * License. You may obtain a copy of the GNU General Public License
>>> + * Version 2 or later at the following locations:
>>> + *
>>> + * http://www.opensource.org/licenses/gpl-license.html
>>> + * http://www.gnu.org/copyleft/gpl.html
>>> + */
>>> +
>>> +#include <arm/imx7d-flex-concentrator-mfg.dts>
>>> +
>>> diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
>>> index 6dd5cb2aca15..d0a9332c7a24 100644
>>> --- a/arch/arm/mach-imx/Kconfig
>>> +++ b/arch/arm/mach-imx/Kconfig
>>> @@ -492,6 +492,11 @@ config MACH_ZII_IMX7D_DEV
>>>      select ARCH_IMX7
>>>      select ARM_USE_COMPRESSED_DTB
>>>
>>> +config MACH_KAMSTRUP_IMX7D_TQMA7D
>>> +    bool "Kamstrup TQMa7D based devices"
>>> +    select ARCH_IMX7
>>> +    select ARM_USE_COMPRESSED_DTB
>>> +
>>>  config MACH_PHYTEC_PHYCORE_IMX7
>>>      bool "Phytec phyCORE i.MX7"
>>>      select ARCH_IMX7
>>> diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
>>> index 1ce057180a01..b0bdc48399e3 100644
>>> --- a/drivers/regulator/Kconfig
>>> +++ b/drivers/regulator/Kconfig
>>> @@ -19,7 +19,7 @@ config REGULATOR_BCM283X
>>>  config REGULATOR_PFUZE
>>>      bool "Freescale PFUZE100/200/3000 regulator driver"
>>>      depends on I2C
>>> -    depends on ARCH_IMX6 || ARCH_IMX8MQ
>>> +    depends on ARCH_IMX6 || ARCH_IMX7 || ARCH_IMX8MQ
>>>
>>>  config REGULATOR_STM32_PWR
>>>      bool "STMicroelectronics STM32 PWR"
>>> diff --git a/dts/src/arm/imx7d-flex-concentrator-mfg.dts
>>> b/dts/src/arm/imx7d-flex-concentrator-mfg.dts
>>> new file mode 100644
>>> index 000000000000..789f0837058f
>>> --- /dev/null
>>> +++ b/dts/src/arm/imx7d-flex-concentrator-mfg.dts
>>
>> Perfectly fine for your patch stack in BSP, but if you want to upstream
>> it, you need to either:
>>
>> 1) upstream your device tree to Linux. dts/ is a sync with Linux and
>>    shortly after, it will be imported into barebox
>> 2) put your device tree in arch/arm/dts
>>
> The dts will upstreamed soon. Hopefully :D
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Getting serial console output on new imx7d tqma7 board UART4
  2020-08-04 16:15     ` Ahmad Fatoum
@ 2020-08-04 19:21       ` Lars Pedersen
  2020-08-05  8:49         ` Ahmad Fatoum
  0 siblings, 1 reply; 20+ messages in thread
From: Lars Pedersen @ 2020-08-04 19:21 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox

On Tue, 4 Aug 2020 at 18:15, Ahmad Fatoum <a.fatoum@pengutronix.de> wrote:
>
> Hello Lars,
>
> On 8/4/20 3:07 PM, Lars Pedersen wrote:
> > I just go an MCIMX7SABRE board and it now trying to start barebox from
> > the external SD card, which I guess should be possible right?
> >
> > I have taken barebox 2020.07.0 and copied the imx_v7_defconfig and
> > deselected all boards except the "NXP i.MX7 SabreSD board"
> >
> > After compilation i copy the image using:
> >
> > sudo dd if=barebox-freescale-mx7-sabresd.img of=/dev/sdb bs=1024 skip=1 seek=1
> > sync>
> > But still no boot screen for that either. :/
> >
> > Shouldn't this work out of the box??
>
> Works for me.
>
> imx_v7_defconfig
> OSELAS.Toolchain-2019.09.1
> Image written to SD card (offset 0) and booted from.

I'm using 2019.09.1 toolchain too. When you are saying "offset 0" is
that the same as nuking the MBR on the sd card? Like the following?
sudo dd if=barebox-freescale-mx7-sabresd.img of=/dev/sdb bs=1024

Okay I think that I have found the issue:
If are buldiing all the boards selected by the imx_v7_defconfig I get
an much bigger image size:

All boards selected (657570 bytes)
[DOCKER][developer@25071f8c717f ptxdist]$ ll
platform-tqma7/images/barebox-freescale-mx7-sabresd.img
-rw-r--r--. 1 developer developer 657570 Aug  4 19:07
platform-tqma7/images/barebox-freescale-mx7-sabresd.img
[DOCKER][developer@25071f8c717f ptxdist]$ sha256sum
platform-tqma7/images/barebox-freescale-mx7-sabresd.img
e454525846e6fbfbd559c100106e43ef5b1f14112562aeb585ccb0b1d4b1bdfe
platform-tqma7/images/barebox-freescale-mx7-sabresd.img

Only the NXP i.MX7 SabreSD board selected (497548 bytes)
[DOCKER][developer@25071f8c717f ptxdist]$ ll platform-tqma7/images/barebox-*
-rw-r--r--. 1 developer developer     28 Aug  4 19:14
platform-tqma7/images/barebox-default-environment
-rw-r--r--. 1 developer developer 497548 Aug  4 19:14
platform-tqma7/images/barebox-freescale-mx7-sabresd.img
lrwxrwxrwx. 1 developer developer     33 Aug  4 19:14
platform-tqma7/images/barebox-image ->
barebox-freescale-mx7-sabresd.img

A lot of stuff gets deselected, since the board doesn't depend  on it.
Stuff like: CONFIG_MCI_IMX_ESDHC_PBL is suddenly not enabled, which I
think is vital. So I'll test the it tomorrow

/Lars Pedersen

--- barebox_full    2020-08-04 21:06:31.270363892 +0200
+++ barebox_one_board    2020-08-04 21:09:46.162669378 +0200
@@ -4,7 +4,6 @@
 #
 CONFIG_ARM=y
 CONFIG_ARM_LINUX=y
-CONFIG_ARM_USE_COMPRESSED_DTB=y
 CONFIG_TEXT_BASE=0x0

 #
@@ -49,80 +48,67 @@
 # processor features
 #
 # CONFIG_BOOT_ENDIANNESS_SWITCH is not set
-CONFIG_ARCH_HAS_L2X0=y
-# CONFIG_CACHE_L2X0 is not set
-CONFIG_ARCH_TEXT_BASE=0x97f00000
 CONFIG_BAREBOX_MAX_IMAGE_SIZE=0xffffffff
 CONFIG_ARCH_IMX_IMXIMAGE=y
-CONFIG_RESET_IMX_SRC=y
-CONFIG_MACH_FREESCALE_MX51_PDK_POWER=y

 #
 # Freescale i.MX System-on-Chip
 #
-CONFIG_ARCH_IMX50=y
-CONFIG_ARCH_IMX51=y
-CONFIG_ARCH_IMX53=y
-CONFIG_ARCH_IMX6=y
-CONFIG_ARCH_IMX6SX=y
-CONFIG_ARCH_IMX6UL=y
 CONFIG_ARCH_IMX7=y
-CONFIG_ARCH_VF610=y
 CONFIG_IMX_MULTI_BOARDS=y
 # CONFIG_MACH_SCB9328 is not set
 # CONFIG_MACH_TX25 is not set
 # CONFIG_MACH_PCA100 is not set
 # CONFIG_MACH_PCM038 is not set
-CONFIG_MACH_KINDLE_MX50=y
-CONFIG_MACH_CCMX51=y
-CONFIG_MACH_EFIKA_MX_SMARTBOOK=y
-CONFIG_MACH_EMBEDSKY_E9=y
-CONFIG_MACH_FREESCALE_MX51_PDK=y
-CONFIG_MACH_CCMX53=y
-CONFIG_MACH_FREESCALE_MX53_LOCO=y
-CONFIG_MACH_GUF_VINCELL=y
-CONFIG_MACH_TQMA53=y
-CONFIG_MACH_FREESCALE_MX53_VMX53=y
-CONFIG_MACH_TX53=y
-CONFIG_MACH_PHYTEC_SOM_IMX6=y
-CONFIG_MACH_KONTRON_SAMX6I=y
-CONFIG_MACH_DFI_FS700_M60=y
-CONFIG_MACH_GUF_SANTARO=y
-CONFIG_MACH_REALQ7=y
-CONFIG_MACH_GK802=y
-CONFIG_MACH_ELTEC_HIPERCAM=y
-CONFIG_MACH_TQMA6X=y
-CONFIG_MACH_TX6X=y
-CONFIG_MACH_SABRELITE=y
-CONFIG_MACH_SABRESD=y
-CONFIG_MACH_FREESCALE_IMX6SX_SABRESDB=y
-CONFIG_MACH_NITROGEN6=y
-CONFIG_MACH_SOLIDRUN_MICROSOM=y
-CONFIG_MACH_TECHNEXION_PICO_HOBBIT=y
-CONFIG_MACH_TECHNEXION_WANDBOARD=y
-CONFIG_MACH_EMBEST_MARSBOARD=y
-CONFIG_MACH_EMBEST_RIOTBOARD=y
-CONFIG_MACH_UDOO=y
+# CONFIG_MACH_KINDLE_MX50 is not set
+# CONFIG_MACH_CCMX51 is not set
+# CONFIG_MACH_EFIKA_MX_SMARTBOOK is not set
+# CONFIG_MACH_EMBEDSKY_E9 is not set
+# CONFIG_MACH_FREESCALE_MX51_PDK is not set
+# CONFIG_MACH_CCMX53 is not set
+# CONFIG_MACH_FREESCALE_MX53_LOCO is not set
+# CONFIG_MACH_GUF_VINCELL is not set
+# CONFIG_MACH_TQMA53 is not set
+# CONFIG_MACH_FREESCALE_MX53_VMX53 is not set
+# CONFIG_MACH_TX53 is not set
+# CONFIG_MACH_PHYTEC_SOM_IMX6 is not set
+# CONFIG_MACH_KONTRON_SAMX6I is not set
+# CONFIG_MACH_DFI_FS700_M60 is not set
+# CONFIG_MACH_GUF_SANTARO is not set
+# CONFIG_MACH_REALQ7 is not set
+# CONFIG_MACH_GK802 is not set
+# CONFIG_MACH_ELTEC_HIPERCAM is not set
+# CONFIG_MACH_TQMA6X is not set
+# CONFIG_MACH_TX6X is not set
+# CONFIG_MACH_SABRELITE is not set
+# CONFIG_MACH_SABRESD is not set
+# CONFIG_MACH_FREESCALE_IMX6SX_SABRESDB is not set
+# CONFIG_MACH_NITROGEN6 is not set
+# CONFIG_MACH_SOLIDRUN_MICROSOM is not set
+# CONFIG_MACH_TECHNEXION_PICO_HOBBIT is not set
+# CONFIG_MACH_TECHNEXION_WANDBOARD is not set
+# CONFIG_MACH_EMBEST_MARSBOARD is not set
+# CONFIG_MACH_EMBEST_RIOTBOARD is not set
+# CONFIG_MACH_UDOO is not set
 # CONFIG_MACH_UDOO_NEO is not set
-CONFIG_MACH_VARISCITE_MX6=y
-CONFIG_MACH_GW_VENTANA=y
-CONFIG_MACH_CM_FX6=y
-CONFIG_MACH_ADVANTECH_ROM_742X=y
-CONFIG_MACH_WARP7=y
-CONFIG_MACH_VF610_TWR=y
-CONFIG_MACH_ZII_COMMON=y
-CONFIG_MACH_ZII_RDU1=y
-CONFIG_MACH_ZII_RDU2=y
+# CONFIG_MACH_VARISCITE_MX6 is not set
+# CONFIG_MACH_GW_VENTANA is not set
+# CONFIG_MACH_CM_FX6 is not set
+# CONFIG_MACH_ADVANTECH_ROM_742X is not set
+# CONFIG_MACH_WARP7 is not set
+# CONFIG_MACH_VF610_TWR is not set
+# CONFIG_MACH_ZII_RDU1 is not set
+# CONFIG_MACH_ZII_RDU2 is not set
 # CONFIG_MACH_ZII_IMX8MQ_DEV is not set
-CONFIG_MACH_ZII_VF610_DEV=y
+# CONFIG_MACH_ZII_VF610_DEV is not set
 # CONFIG_MACH_ZII_IMX7D_DEV is not set
-CONFIG_MACH_PHYTEC_PHYCORE_IMX7=y
+# CONFIG_MACH_PHYTEC_PHYCORE_IMX7 is not set
 CONFIG_MACH_FREESCALE_MX7_SABRESD=y
-CONFIG_MACH_NXP_IMX6ULL_EVK=y
+# CONFIG_MACH_NXP_IMX6ULL_EVK is not set
 # CONFIG_MACH_NXP_IMX8MM_EVK is not set
 # CONFIG_MACH_NXP_IMX8MQ_EVK is not set
 # CONFIG_MACH_PHYTEC_SOM_IMX8MQ is not set
-CONFIG_MACH_GRINN_LITEBOARD=y
+# CONFIG_MACH_GRINN_LITEBOARD is not set
 # CONFIG_MACH_DIGI_CCIMX6ULSBCPRO is not set

 #
@@ -133,17 +119,14 @@
 #
 # i.MX specific settings
 #
-CONFIG_IMX_IIM=y
-CONFIG_IMX_IIM_FUSE_BLOW=y
-# CONFIG_HABV4 is not set
+# CONFIG_IMX_IIM is not set
 # end of i.MX specific settings

 # CONFIG_BOARD_ARM_GENERIC_DT is not set
 CONFIG_ARM_ASM_UNIFIED=y
 CONFIG_AEABI=y
 CONFIG_THUMB2_BAREBOX=y
-CONFIG_ARM_BOARD_APPEND_ATAG=y
-# CONFIG_ARM_BOARD_PREPEND_ATAG is not set
+# CONFIG_ARM_BOARD_APPEND_ATAG is not set
 # end of System Type

 #
@@ -176,7 +159,6 @@
 CONFIG_STDDEV=y
 CONFIG_MENUTREE=y
 CONFIG_FILE_LIST=y
-CONFIG_BAREBOX_UPDATE_IMX_NAND_FCB=y
 CONFIG_UBIFORMAT=y
 CONFIG_USBGADGET_START=y
 CONFIG_BOOT=y
@@ -210,6 +192,7 @@
 # CONFIG_IMAGE_COMPRESSION_NONE is not set
 CONFIG_MMU=y
 CONFIG_MMU_EARLY=y
+CONFIG_HAVE_CONFIGURABLE_TEXT_BASE=y
 CONFIG_BAREBOX_MAX_PBL_SIZE=0xffffffff
 CONFIG_BAREBOX_MAX_BARE_INIT_SIZE=0xffffffff
 CONFIG_STACK_SIZE=0x8000
@@ -220,7 +203,7 @@
 # CONFIG_MALLOC_DLMALLOC is not set
 CONFIG_MALLOC_TLSF=y
 CONFIG_KALLSYMS=y
-CONFIG_RELOCATABLE=y
+# CONFIG_RELOCATABLE is not set
 # CONFIG_PANIC_HANG is not set
 CONFIG_PROMPT="barebox:"
 CONFIG_BAUDRATE=115200
@@ -470,7 +453,6 @@
 CONFIG_CMD_DETECT=y
 CONFIG_CMD_FLASH=y
 CONFIG_CMD_GPIO=y
-CONFIG_CMD_I2C=y
 CONFIG_CMD_LED=y
 CONFIG_CMD_NAND=y
 CONFIG_CMD_NANDTEST=y
@@ -537,7 +519,6 @@
 CONFIG_DRIVER_SERIAL_IMX=y
 # CONFIG_DRIVER_SERIAL_NS16550 is not set
 # CONFIG_DRIVER_SERIAL_CADENCE is not set
-CONFIG_DRIVER_SERIAL_LPUART=y
 # end of serial drivers

 CONFIG_ARCH_HAS_FEC_IMX=y
@@ -597,25 +578,11 @@
 CONFIG_SPI_MEM=y
 # CONFIG_DRIVER_SPI_FSL_QUADSPI is not set
 CONFIG_DRIVER_SPI_GPIO=y
-CONFIG_DRIVER_SPI_IMX=y
-CONFIG_DRIVER_SPI_IMX_0_7=y
+# CONFIG_DRIVER_SPI_IMX is not set
 CONFIG_DRIVER_SPI_IMX_2_3=y
-CONFIG_DRIVER_SPI_DSPI=y
 # end of SPI drivers

-CONFIG_I2C=y
-
-#
-# I2C Hardware Bus support
-#
-# CONFIG_I2C_GPIO is not set
-CONFIG_I2C_IMX=y
-# CONFIG_I2C_DESIGNWARE is not set
-# CONFIG_I2C_MV64XXX is not set
-# CONFIG_I2C_STM32 is not set
-# end of I2C Hardware Bus support
-
-# CONFIG_I2C_MUX is not set
+# CONFIG_I2C is not set
 CONFIG_MTD=y
 CONFIG_MTD_WRITE=y
 CONFIG_MTD_OOB_DEVICE=y
@@ -651,7 +618,6 @@
 CONFIG_NAND_BBT=y
 CONFIG_NAND_ALLOW_ERASE_BAD=y
 CONFIG_NAND_IMX=y
-CONFIG_NAND_MXS=y
 # CONFIG_MTD_NAND_ECC_SMC is not set
 CONFIG_MTD_NAND_IDS=y
 # CONFIG_MTD_NAND_DENALI is not set
@@ -687,7 +653,6 @@
 CONFIG_USB_HOST=y
 CONFIG_USB_IMX_CHIPIDEA=y
 CONFIG_USB_IMX_CHIPIDEA_USBMISC=y
-CONFIG_USB_IMX_PHY=y
 # CONFIG_USB_DWC3 is not set
 CONFIG_USB_EHCI=y
 # CONFIG_USB_DWC2_HOST is not set
@@ -699,7 +664,6 @@
 #
 # USB Miscellaneous drivers
 #
-# CONFIG_USB_HUB_USB251XB is not set
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_DUALSPEED=y
 CONFIG_USB_GADGET_DRIVER_ARC=y
@@ -714,21 +678,16 @@
 # CONFIG_USB_MUSB is not set
 CONFIG_VIDEO=y
 # CONFIG_FRAMEBUFFER_CONSOLE is not set
-# CONFIG_DRIVER_VIDEO_FB_SSD1307 is not set
 CONFIG_VIDEO_VPL=y
 CONFIG_DRIVER_VIDEO_IMX_IPUV3=y
 CONFIG_DRIVER_VIDEO_IMX_IPUV3_LVDS=y
-CONFIG_DRIVER_VIDEO_IMX_IPUV3_HDMI=y
 # CONFIG_DRIVER_VIDEO_IMX_IPUV3_PARALLEL is not set
 CONFIG_DRIVER_VIDEO_SIMPLEFB=y
-CONFIG_DRIVER_VIDEO_EDID=y
 # CONFIG_DRIVER_VIDEO_BACKLIGHT is not set

 #
 # Video encoder chips
 #
-# CONFIG_DRIVER_VIDEO_MTL017 is not set
-# CONFIG_DRIVER_VIDEO_TC358767 is not set
 # CONFIG_DRIVER_VIDEO_SIMPLE_PANEL is not set
 CONFIG_MCI_SDHCI=y
 CONFIG_MCI=y
@@ -749,7 +708,6 @@
 # CONFIG_MCI_IMX_ESDHC_PIO is not set
 # CONFIG_MCI_ARASAN is not set
 # CONFIG_MCI_SPI is not set
-CONFIG_MCI_IMX_ESDHC_PBL=y
 CONFIG_HAVE_CLK=y
 CONFIG_CLKDEV_LOOKUP=y
 CONFIG_COMMON_CLK=y
@@ -761,7 +719,6 @@
 CONFIG_ARCH_HAS_IMX_GPT=y
 CONFIG_CLOCKSOURCE_DUMMY_RATE=1000
 CONFIG_CLOCKSOURCE_ARM_ARCHITECTED_TIMER=y
-CONFIG_CLOCKSOURCE_ARM_GLOBAL_TIMER=y
 CONFIG_CLOCKSOURCE_IMX_GPT=y
 # CONFIG_CLOCKSOURCE_DW_APB_TIMER is not set
 # end of Clocksource
@@ -769,18 +726,8 @@
 #
 # Multifunction device drivers
 #
-# CONFIG_MFD_ACT8846 is not set
-# CONFIG_MFD_DA9053 is not set
-CONFIG_MFD_DA9063=y
-# CONFIG_MFD_LP3972 is not set
-CONFIG_MFD_MC13XXX=y
-CONFIG_MFD_MC34704=y
-CONFIG_MFD_MC9SDZ60=y
-CONFIG_MFD_STMPE=y
-CONFIG_MFD_SYSCON=y
-# CONFIG_MFD_TWL4030 is not set
-# CONFIG_MFD_TWL6030 is not set
-# CONFIG_MFD_STPMIC1 is not set
+# CONFIG_MFD_MC13XXX is not set
+# CONFIG_MFD_SYSCON is not set
 # CONFIG_FINTEK_SUPERIO is not set
 # CONFIG_SMSC_SUPERIO is not set
 # end of Multifunction device drivers
@@ -801,13 +748,11 @@
 # CONFIG_LED_GPIO_RGB is not set
 # CONFIG_LED_GPIO_BICOLOR is not set
 CONFIG_LED_TRIGGERS=y
-# CONFIG_LED_PCA955X is not set

 #
 # EEPROM support
 #
 CONFIG_EEPROM_AT25=y
-CONFIG_EEPROM_AT24=y
 # end of EEPROM support

 #
@@ -816,7 +761,6 @@
 CONFIG_INPUT=y
 CONFIG_KEYBOARD_GPIO=y
 # CONFIG_KEYBOARD_IMX_KEYPAD is not set
-# CONFIG_KEYBOARD_QT1070 is not set
 # CONFIG_KEYBOARD_USB is not set
 # CONFIG_INPUT_SPECIALKEYS is not set
 # end of Input device support
@@ -833,7 +777,6 @@
 #
 # DMA support
 #
-CONFIG_MXS_APBH_DMA=y
 # end of DMA support

 CONFIG_GPIOLIB=y
@@ -844,12 +787,7 @@
 CONFIG_GPIO_74164=y
 # CONFIG_GPIO_GENERIC_PLATFORM is not set
 CONFIG_GPIO_IMX=y
-CONFIG_GPIO_VF610=y
-# CONFIG_GPIO_PCA953X is not set
-# CONFIG_GPIO_PCF857X is not set
-CONFIG_GPIO_STMPE=y
 # CONFIG_GPIO_DESIGNWARE is not set
-# CONFIG_GPIO_SX150X is not set
 # end of GPIO

 # CONFIG_W1 is not set
@@ -860,14 +798,9 @@
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX_IOMUX_V3=y
 # CONFIG_PINCTRL_SINGLE is not set
-CONFIG_PINCTRL_VF610=y
 # end of Pin controllers

-CONFIG_NVMEM=y
-# CONFIG_NVMEM_SNVS_LPGPR is not set
-CONFIG_IMX_OCOTP=y
-# CONFIG_IMX_OCOTP_WRITE is not set
-# CONFIG_EEPROM_93XX46 is not set
+# CONFIG_NVMEM is not set

 #
 # Bus devices
@@ -877,8 +810,6 @@

 CONFIG_REGULATOR=y
 CONFIG_REGULATOR_FIXED=y
-# CONFIG_REGULATOR_PFUZE is not set
-# CONFIG_REGULATOR_ANATOP is not set

 #
 # Remoteproc drivers
@@ -992,16 +923,14 @@
 # CONFIG_BASE64 is not set
 CONFIG_PROCESS_ESCAPE_SEQUENCE=y
 CONFIG_LZO_DECOMPRESS=y
-CONFIG_BCH=y
 CONFIG_FNMATCH=y
 CONFIG_QSORT=y
 CONFIG_LIBSCAN=y
 CONFIG_LIBUBIGEN=y
-CONFIG_STMP_DEVICE=y
 # CONFIG_RATP is not set
 # CONFIG_ALLOW_PRNG_FALLBACK is not set
 # CONFIG_CRC_CCITT is not set
-CONFIG_CRC8=y
+# CONFIG_CRC8 is not set




>
> Can you try with same toolchain? If that works, it
> might be a compiler issue? What are you using?
>
> >
> > /Lars Pedersen
> >
> > On Mon, 3 Aug 2020 at 12:10, Ahmad Fatoum <a.fatoum@pengutronix.de> wrote:
> >>
> >> Hi,
> >>
> >> On 7/29/20 6:52 PM, Lars Pedersen wrote:
> >>> I have spent the last couple of days trying to port our bootloader
> >>> from u-boot to barebox 2020.07 but have yet to get any console output.
> >>> Our product is based on tqma7d i.MX7 dual core cpu and uses UART4 for
> >>> serial console and boots from internal eMMC.
> >>>
> >>> I created a new board inspired from "NXP i.MX7 SabreSD board" and
> >>> tried to only add the basic in the first step to get a console output
> >>> working. The image is built using ptxdist and the imx_v7_defconfig
> >>> where the new board is selected. The image is flashed with "dd
> >>> if=barebox-image of=/dev/mmcblk0 bs=1024 skip=1 seek=1 conv=fsync".
> >>> The device works using u-boot 2020.07 with the same device trees but
> >>> we thought it was time to try out barebox since u-boot felt a little
> >>> bloated :)
> >>>
> >>> So can anyone be of assistance and tell me what I'm missing?
> >>
> >> When I looked through your patch the first time, I just looked
> >> for stuff that would cause it to not boot. Some more comments
> >> inline that are unrelated to your boot problems.
> >>
> >>>
> >>> /Lars Pedersen
> >>>
> >>> From: Lars Pedersen <laa@kamstrup.com>
> >>> Date: Tue, 28 Jul 2020 08:57:57 +0000
> >>> Subject: [PATCH] Add kamstrup imx7d dev board
> >>>
> >>> ---
> >>>  arch/arm/boards/Makefile                           |   1 +
> >>>  arch/arm/boards/kamstrup-imx7d-tqma7d/Makefile     |   2 +
> >>>  arch/arm/boards/kamstrup-imx7d-tqma7d/board.c      |  19 ++
> >>>  .../flash-header-kamstrup-imx7d-tqma7d.imxcfg      |  79 ++++++
> >>>  arch/arm/boards/kamstrup-imx7d-tqma7d/lowlevel.c   |  35 +++
> >>>  arch/arm/dts/Makefile                              |   1 +
> >>>  arch/arm/dts/imx7d-flex-concentrator-mfg.dts       |  11 +
> >>>  arch/arm/mach-imx/Kconfig                          |   5 +
> >>>  drivers/regulator/Kconfig                          |   2 +-
> >>>  dts/src/arm/imx7d-flex-concentrator-mfg.dts        |  25 ++
> >>>  dts/src/arm/imx7d-flex-concentrator.dts            | 313 +++++++++++++++++++++
> >>>  images/Makefile.imx                                |   5 +
> >>>  12 files changed, 497 insertions(+), 1 deletion(-)
> >>>  create mode 100644 arch/arm/boards/kamstrup-imx7d-tqma7d/Makefile
> >>>  create mode 100644 arch/arm/boards/kamstrup-imx7d-tqma7d/board.c
> >>>  create mode 100644
> >>> arch/arm/boards/kamstrup-imx7d-tqma7d/flash-header-kamstrup-imx7d-tqma7d.imxcfg
> >>>  create mode 100644 arch/arm/boards/kamstrup-imx7d-tqma7d/lowlevel.c
> >>>  create mode 100644 arch/arm/dts/imx7d-flex-concentrator-mfg.dts
> >>>  create mode 100644 dts/src/arm/imx7d-flex-concentrator-mfg.dts
> >>>  create mode 100644 dts/src/arm/imx7d-flex-concentrator.dts
> >>>
> >>> diff --git a/arch/arm/boards/Makefile b/arch/arm/boards/Makefile
> >>> index e9e9163d589b..58bb4cf2adab 100644
> >>> --- a/arch/arm/boards/Makefile
> >>> +++ b/arch/arm/boards/Makefile
> >>> @@ -64,6 +64,7 @@ obj-$(CONFIG_MACH_HIGHBANK)            += highbank/
> >>>  obj-$(CONFIG_MACH_IMX21ADS)            += freescale-mx21-ads/
> >>>  obj-$(CONFIG_MACH_IMX233_OLINUXINO)        += imx233-olinuxino/
> >>>  obj-$(CONFIG_MACH_IMX27ADS)            += freescale-mx27-ads/
> >>> +obj-$(CONFIG_MACH_KAMSTRUP_IMX7D_TQMA7D)    += kamstrup-imx7d-tqma7d/
> >>>  obj-$(CONFIG_MACH_KINDLE3)            += kindle3/
> >>>  obj-$(CONFIG_MACH_KONTRON_SAMX6I)        += kontron-samx6i/
> >>>  obj-$(CONFIG_MACH_LENOVO_IX4_300D)        += lenovo-ix4-300d/
> >>> diff --git a/arch/arm/boards/kamstrup-imx7d-tqma7d/Makefile
> >>> b/arch/arm/boards/kamstrup-imx7d-tqma7d/Makefile
> >>> new file mode 100644
> >>> index 000000000000..01c7a259e9a5
> >>> --- /dev/null
> >>> +++ b/arch/arm/boards/kamstrup-imx7d-tqma7d/Makefile
> >>> @@ -0,0 +1,2 @@
> >>> +obj-y += board.o
> >>> +lwl-y += lowlevel.o
> >>> diff --git a/arch/arm/boards/kamstrup-imx7d-tqma7d/board.c
> >>> b/arch/arm/boards/kamstrup-imx7d-tqma7d/board.c
> >>> new file mode 100644
> >>> index 000000000000..b3ffa851f3e6
> >>> --- /dev/null
> >>> +++ b/arch/arm/boards/kamstrup-imx7d-tqma7d/board.c
> >>> @@ -0,0 +1,19 @@
> >>> +// SPDX-License-Identifier: GPL-2.0-or-later
> >>> +// SPDX-FileCopyrightText: 2020 Kamstrup A/S
> >>> +
> >>> +/* Author: Lars Pedersen <lapeddk@gmail.com> */
> >>> +
> >>> +#include <common.h>
> >>> +#include <init.h>
> >>> +#include <io.h>
> >>> +#include <mach/imx7-regs.h>
> >>> +#include <mfd/imx7-iomuxc-gpr.h>
> >>> +
> >>> +static int kamstrup_mx7_tqma7d_coredevices_init(void)
> >>> +{
> >>> +    if (!of_machine_is_compatible("kam,imx7d-flex-concentrator"))
> >>> +        return 0;
> >>> +
> >>> +    return 0;
> >>> +}
> >>
> >> Function serves no purpose. If you don't have baord code, drop it altogether.
> >>
> >
> > I'll do a cleanup when I have it working :D
> >
> >>> +coredevice_initcall(kamstrup_mx7_tqma7d_coredevices_init);
> >>> diff --git a/arch/arm/boards/kamstrup-imx7d-tqma7d/flash-header-kamstrup-imx7d-tqma7d.imxcfg
> >>> b/arch/arm/boards/kamstrup-imx7d-tqma7d/flash-header-kamstrup-imx7d-tqma7d.imxcfg
> >>> new file mode 100644
> >>> index 000000000000..7656619c1b2e
> >>> --- /dev/null
> >>> +++ b/arch/arm/boards/kamstrup-imx7d-tqma7d/flash-header-kamstrup-imx7d-tqma7d.imxcfg
> >>> @@ -0,0 +1,79 @@
> >>> +soc imx7
> >>> +loadaddr 0x80000000
> >>> +dcdofs 0x400
> >>
> >> Called ivtofs now in barebox next branch now.
> >>
> >
> > Okay thanks.
> >
> >>> diff --git a/arch/arm/dts/imx7d-flex-concentrator-mfg.dts
> >>> b/arch/arm/dts/imx7d-flex-concentrator-mfg.dts
> >>> new file mode 100644
> >>> index 000000000000..746e36a70f4c
> >>> --- /dev/null
> >>> +++ b/arch/arm/dts/imx7d-flex-concentrator-mfg.dts
> >>> @@ -0,0 +1,11 @@
> >>> +/*
> >>> + * The code contained herein is licensed under the GNU General Public
> >>> + * License. You may obtain a copy of the GNU General Public License
> >>> + * Version 2 or later at the following locations:
> >>> + *
> >>> + * http://www.opensource.org/licenses/gpl-license.html
> >>> + * http://www.gnu.org/copyleft/gpl.html
> >>> + */
> >>> +
> >>> +#include <arm/imx7d-flex-concentrator-mfg.dts>
> >>> +
> >>> diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
> >>> index 6dd5cb2aca15..d0a9332c7a24 100644
> >>> --- a/arch/arm/mach-imx/Kconfig
> >>> +++ b/arch/arm/mach-imx/Kconfig
> >>> @@ -492,6 +492,11 @@ config MACH_ZII_IMX7D_DEV
> >>>      select ARCH_IMX7
> >>>      select ARM_USE_COMPRESSED_DTB
> >>>
> >>> +config MACH_KAMSTRUP_IMX7D_TQMA7D
> >>> +    bool "Kamstrup TQMa7D based devices"
> >>> +    select ARCH_IMX7
> >>> +    select ARM_USE_COMPRESSED_DTB
> >>> +
> >>>  config MACH_PHYTEC_PHYCORE_IMX7
> >>>      bool "Phytec phyCORE i.MX7"
> >>>      select ARCH_IMX7
> >>> diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
> >>> index 1ce057180a01..b0bdc48399e3 100644
> >>> --- a/drivers/regulator/Kconfig
> >>> +++ b/drivers/regulator/Kconfig
> >>> @@ -19,7 +19,7 @@ config REGULATOR_BCM283X
> >>>  config REGULATOR_PFUZE
> >>>      bool "Freescale PFUZE100/200/3000 regulator driver"
> >>>      depends on I2C
> >>> -    depends on ARCH_IMX6 || ARCH_IMX8MQ
> >>> +    depends on ARCH_IMX6 || ARCH_IMX7 || ARCH_IMX8MQ
> >>>
> >>>  config REGULATOR_STM32_PWR
> >>>      bool "STMicroelectronics STM32 PWR"
> >>> diff --git a/dts/src/arm/imx7d-flex-concentrator-mfg.dts
> >>> b/dts/src/arm/imx7d-flex-concentrator-mfg.dts
> >>> new file mode 100644
> >>> index 000000000000..789f0837058f
> >>> --- /dev/null
> >>> +++ b/dts/src/arm/imx7d-flex-concentrator-mfg.dts
> >>
> >> Perfectly fine for your patch stack in BSP, but if you want to upstream
> >> it, you need to either:
> >>
> >> 1) upstream your device tree to Linux. dts/ is a sync with Linux and
> >>    shortly after, it will be imported into barebox
> >> 2) put your device tree in arch/arm/dts
> >>
> > The dts will upstreamed soon. Hopefully :D
> >
>
> --
> Pengutronix e.K.                           |                             |
> Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
> 31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Getting serial console output on new imx7d tqma7 board UART4
  2020-08-04 19:21       ` Lars Pedersen
@ 2020-08-05  8:49         ` Ahmad Fatoum
  2020-08-05  9:37           ` Lars Pedersen
  0 siblings, 1 reply; 20+ messages in thread
From: Ahmad Fatoum @ 2020-08-05  8:49 UTC (permalink / raw)
  To: Lars Pedersen; +Cc: barebox

Hello Lars,

On 8/4/20 9:21 PM, Lars Pedersen wrote:
> On Tue, 4 Aug 2020 at 18:15, Ahmad Fatoum <a.fatoum@pengutronix.de> wrote:
>>
>> Hello Lars,
>>
>> On 8/4/20 3:07 PM, Lars Pedersen wrote:
>>> I just go an MCIMX7SABRE board and it now trying to start barebox from
>>> the external SD card, which I guess should be possible right?
>>>
>>> I have taken barebox 2020.07.0 and copied the imx_v7_defconfig and
>>> deselected all boards except the "NXP i.MX7 SabreSD board"
>>>
>>> After compilation i copy the image using:
>>>
>>> sudo dd if=barebox-freescale-mx7-sabresd.img of=/dev/sdb bs=1024 skip=1 seek=1
>>> sync>
>>> But still no boot screen for that either. :/
>>>
>>> Shouldn't this work out of the box??
>>
>> Works for me.
>>
>> imx_v7_defconfig
>> OSELAS.Toolchain-2019.09.1
>> Image written to SD card (offset 0) and booted from.
> 
> I'm using 2019.09.1 toolchain too. When you are saying "offset 0" is
> that the same as nuking the MBR on the sd card? Like the following?
> sudo dd if=barebox-freescale-mx7-sabresd.img of=/dev/sdb bs=1024

Yes, that's what I did (or rather labgrid write-image did for me)

> Okay I think that I have found the issue:
> If are buldiing all the boards selected by the imx_v7_defconfig I get
> an much bigger image size:

That's expected. multi-image means that barebox is built to support
multiple boards and multiple images are generated, one for each board.

These images share the same main barebox, but each have a different
pre-bootloader (and device tree). Only the board code and drivers
matching the device tree are executed. The rest should remain
unused by your board.

To make sure this does work as intended, I just built barebox with
only barebox-freescale-mx7-sabresd.img selected and it works fine for me:

  barebox 2020.07.0 #58 Wed Aug 5 10:46:00 CEST 2020

> 
> All boards selected (657570 bytes)
> [DOCKER][developer@25071f8c717f ptxdist]$ ll
> platform-tqma7/images/barebox-freescale-mx7-sabresd.img
> -rw-r--r--. 1 developer developer 657570 Aug  4 19:07
> platform-tqma7/images/barebox-freescale-mx7-sabresd.img
> [DOCKER][developer@25071f8c717f ptxdist]$ sha256sum
> platform-tqma7/images/barebox-freescale-mx7-sabresd.img
> e454525846e6fbfbd559c100106e43ef5b1f14112562aeb585ccb0b1d4b1bdfe
> platform-tqma7/images/barebox-freescale-mx7-sabresd.img
> 
> Only the NXP i.MX7 SabreSD board selected (497548 bytes)
> [DOCKER][developer@25071f8c717f ptxdist]$ ll platform-tqma7/images/barebox-*
> -rw-r--r--. 1 developer developer     28 Aug  4 19:14
> platform-tqma7/images/barebox-default-environment
> -rw-r--r--. 1 developer developer 497548 Aug  4 19:14
> platform-tqma7/images/barebox-freescale-mx7-sabresd.img
> lrwxrwxrwx. 1 developer developer     33 Aug  4 19:14
> platform-tqma7/images/barebox-image ->
> barebox-freescale-mx7-sabresd.img
> 
> A lot of stuff gets deselected, since the board doesn't depend  on it.
> Stuff like: CONFIG_MCI_IMX_ESDHC_PBL is suddenly not enabled, which I
> think is vital. So I'll test the it tomorrow

It's not. When you do your SDRAM setup in DCD, you can have the ROM code
load barebox directly into SDRAM, so there's no need to have a limited
eSDHC driver in pre-bootloader. CONFIG_MCI_IMX_ESDHC_PBL is unset then.

Are you sure the board is strapped correctly to boot from SD?

> 
> /Lars Pedersen
> 
> --- barebox_full    2020-08-04 21:06:31.270363892 +0200
> +++ barebox_one_board    2020-08-04 21:09:46.162669378 +0200
> @@ -4,7 +4,6 @@
>  #
>  CONFIG_ARM=y
>  CONFIG_ARM_LINUX=y
> -CONFIG_ARM_USE_COMPRESSED_DTB=y
>  CONFIG_TEXT_BASE=0x0
> 
>  #
> @@ -49,80 +48,67 @@
>  # processor features
>  #
>  # CONFIG_BOOT_ENDIANNESS_SWITCH is not set
> -CONFIG_ARCH_HAS_L2X0=y
> -# CONFIG_CACHE_L2X0 is not set
> -CONFIG_ARCH_TEXT_BASE=0x97f00000
>  CONFIG_BAREBOX_MAX_IMAGE_SIZE=0xffffffff
>  CONFIG_ARCH_IMX_IMXIMAGE=y
> -CONFIG_RESET_IMX_SRC=y
> -CONFIG_MACH_FREESCALE_MX51_PDK_POWER=y
> 
>  #
>  # Freescale i.MX System-on-Chip
>  #
> -CONFIG_ARCH_IMX50=y
> -CONFIG_ARCH_IMX51=y
> -CONFIG_ARCH_IMX53=y
> -CONFIG_ARCH_IMX6=y
> -CONFIG_ARCH_IMX6SX=y
> -CONFIG_ARCH_IMX6UL=y
>  CONFIG_ARCH_IMX7=y
> -CONFIG_ARCH_VF610=y
>  CONFIG_IMX_MULTI_BOARDS=y
>  # CONFIG_MACH_SCB9328 is not set
>  # CONFIG_MACH_TX25 is not set
>  # CONFIG_MACH_PCA100 is not set
>  # CONFIG_MACH_PCM038 is not set
> -CONFIG_MACH_KINDLE_MX50=y
> -CONFIG_MACH_CCMX51=y
> -CONFIG_MACH_EFIKA_MX_SMARTBOOK=y
> -CONFIG_MACH_EMBEDSKY_E9=y
> -CONFIG_MACH_FREESCALE_MX51_PDK=y
> -CONFIG_MACH_CCMX53=y
> -CONFIG_MACH_FREESCALE_MX53_LOCO=y
> -CONFIG_MACH_GUF_VINCELL=y
> -CONFIG_MACH_TQMA53=y
> -CONFIG_MACH_FREESCALE_MX53_VMX53=y
> -CONFIG_MACH_TX53=y
> -CONFIG_MACH_PHYTEC_SOM_IMX6=y
> -CONFIG_MACH_KONTRON_SAMX6I=y
> -CONFIG_MACH_DFI_FS700_M60=y
> -CONFIG_MACH_GUF_SANTARO=y
> -CONFIG_MACH_REALQ7=y
> -CONFIG_MACH_GK802=y
> -CONFIG_MACH_ELTEC_HIPERCAM=y
> -CONFIG_MACH_TQMA6X=y
> -CONFIG_MACH_TX6X=y
> -CONFIG_MACH_SABRELITE=y
> -CONFIG_MACH_SABRESD=y
> -CONFIG_MACH_FREESCALE_IMX6SX_SABRESDB=y
> -CONFIG_MACH_NITROGEN6=y
> -CONFIG_MACH_SOLIDRUN_MICROSOM=y
> -CONFIG_MACH_TECHNEXION_PICO_HOBBIT=y
> -CONFIG_MACH_TECHNEXION_WANDBOARD=y
> -CONFIG_MACH_EMBEST_MARSBOARD=y
> -CONFIG_MACH_EMBEST_RIOTBOARD=y
> -CONFIG_MACH_UDOO=y
> +# CONFIG_MACH_KINDLE_MX50 is not set
> +# CONFIG_MACH_CCMX51 is not set
> +# CONFIG_MACH_EFIKA_MX_SMARTBOOK is not set
> +# CONFIG_MACH_EMBEDSKY_E9 is not set
> +# CONFIG_MACH_FREESCALE_MX51_PDK is not set
> +# CONFIG_MACH_CCMX53 is not set
> +# CONFIG_MACH_FREESCALE_MX53_LOCO is not set
> +# CONFIG_MACH_GUF_VINCELL is not set
> +# CONFIG_MACH_TQMA53 is not set
> +# CONFIG_MACH_FREESCALE_MX53_VMX53 is not set
> +# CONFIG_MACH_TX53 is not set
> +# CONFIG_MACH_PHYTEC_SOM_IMX6 is not set
> +# CONFIG_MACH_KONTRON_SAMX6I is not set
> +# CONFIG_MACH_DFI_FS700_M60 is not set
> +# CONFIG_MACH_GUF_SANTARO is not set
> +# CONFIG_MACH_REALQ7 is not set
> +# CONFIG_MACH_GK802 is not set
> +# CONFIG_MACH_ELTEC_HIPERCAM is not set
> +# CONFIG_MACH_TQMA6X is not set
> +# CONFIG_MACH_TX6X is not set
> +# CONFIG_MACH_SABRELITE is not set
> +# CONFIG_MACH_SABRESD is not set
> +# CONFIG_MACH_FREESCALE_IMX6SX_SABRESDB is not set
> +# CONFIG_MACH_NITROGEN6 is not set
> +# CONFIG_MACH_SOLIDRUN_MICROSOM is not set
> +# CONFIG_MACH_TECHNEXION_PICO_HOBBIT is not set
> +# CONFIG_MACH_TECHNEXION_WANDBOARD is not set
> +# CONFIG_MACH_EMBEST_MARSBOARD is not set
> +# CONFIG_MACH_EMBEST_RIOTBOARD is not set
> +# CONFIG_MACH_UDOO is not set
>  # CONFIG_MACH_UDOO_NEO is not set
> -CONFIG_MACH_VARISCITE_MX6=y
> -CONFIG_MACH_GW_VENTANA=y
> -CONFIG_MACH_CM_FX6=y
> -CONFIG_MACH_ADVANTECH_ROM_742X=y
> -CONFIG_MACH_WARP7=y
> -CONFIG_MACH_VF610_TWR=y
> -CONFIG_MACH_ZII_COMMON=y
> -CONFIG_MACH_ZII_RDU1=y
> -CONFIG_MACH_ZII_RDU2=y
> +# CONFIG_MACH_VARISCITE_MX6 is not set
> +# CONFIG_MACH_GW_VENTANA is not set
> +# CONFIG_MACH_CM_FX6 is not set
> +# CONFIG_MACH_ADVANTECH_ROM_742X is not set
> +# CONFIG_MACH_WARP7 is not set
> +# CONFIG_MACH_VF610_TWR is not set
> +# CONFIG_MACH_ZII_RDU1 is not set
> +# CONFIG_MACH_ZII_RDU2 is not set
>  # CONFIG_MACH_ZII_IMX8MQ_DEV is not set
> -CONFIG_MACH_ZII_VF610_DEV=y
> +# CONFIG_MACH_ZII_VF610_DEV is not set
>  # CONFIG_MACH_ZII_IMX7D_DEV is not set
> -CONFIG_MACH_PHYTEC_PHYCORE_IMX7=y
> +# CONFIG_MACH_PHYTEC_PHYCORE_IMX7 is not set
>  CONFIG_MACH_FREESCALE_MX7_SABRESD=y
> -CONFIG_MACH_NXP_IMX6ULL_EVK=y
> +# CONFIG_MACH_NXP_IMX6ULL_EVK is not set
>  # CONFIG_MACH_NXP_IMX8MM_EVK is not set
>  # CONFIG_MACH_NXP_IMX8MQ_EVK is not set
>  # CONFIG_MACH_PHYTEC_SOM_IMX8MQ is not set
> -CONFIG_MACH_GRINN_LITEBOARD=y
> +# CONFIG_MACH_GRINN_LITEBOARD is not set
>  # CONFIG_MACH_DIGI_CCIMX6ULSBCPRO is not set
> 
>  #
> @@ -133,17 +119,14 @@
>  #
>  # i.MX specific settings
>  #
> -CONFIG_IMX_IIM=y
> -CONFIG_IMX_IIM_FUSE_BLOW=y
> -# CONFIG_HABV4 is not set
> +# CONFIG_IMX_IIM is not set
>  # end of i.MX specific settings
> 
>  # CONFIG_BOARD_ARM_GENERIC_DT is not set
>  CONFIG_ARM_ASM_UNIFIED=y
>  CONFIG_AEABI=y
>  CONFIG_THUMB2_BAREBOX=y
> -CONFIG_ARM_BOARD_APPEND_ATAG=y
> -# CONFIG_ARM_BOARD_PREPEND_ATAG is not set
> +# CONFIG_ARM_BOARD_APPEND_ATAG is not set
>  # end of System Type
> 
>  #
> @@ -176,7 +159,6 @@
>  CONFIG_STDDEV=y
>  CONFIG_MENUTREE=y
>  CONFIG_FILE_LIST=y
> -CONFIG_BAREBOX_UPDATE_IMX_NAND_FCB=y
>  CONFIG_UBIFORMAT=y
>  CONFIG_USBGADGET_START=y
>  CONFIG_BOOT=y
> @@ -210,6 +192,7 @@
>  # CONFIG_IMAGE_COMPRESSION_NONE is not set
>  CONFIG_MMU=y
>  CONFIG_MMU_EARLY=y
> +CONFIG_HAVE_CONFIGURABLE_TEXT_BASE=y
>  CONFIG_BAREBOX_MAX_PBL_SIZE=0xffffffff
>  CONFIG_BAREBOX_MAX_BARE_INIT_SIZE=0xffffffff
>  CONFIG_STACK_SIZE=0x8000
> @@ -220,7 +203,7 @@
>  # CONFIG_MALLOC_DLMALLOC is not set
>  CONFIG_MALLOC_TLSF=y
>  CONFIG_KALLSYMS=y
> -CONFIG_RELOCATABLE=y
> +# CONFIG_RELOCATABLE is not set
>  # CONFIG_PANIC_HANG is not set
>  CONFIG_PROMPT="barebox:"
>  CONFIG_BAUDRATE=115200
> @@ -470,7 +453,6 @@
>  CONFIG_CMD_DETECT=y
>  CONFIG_CMD_FLASH=y
>  CONFIG_CMD_GPIO=y
> -CONFIG_CMD_I2C=y
>  CONFIG_CMD_LED=y
>  CONFIG_CMD_NAND=y
>  CONFIG_CMD_NANDTEST=y
> @@ -537,7 +519,6 @@
>  CONFIG_DRIVER_SERIAL_IMX=y
>  # CONFIG_DRIVER_SERIAL_NS16550 is not set
>  # CONFIG_DRIVER_SERIAL_CADENCE is not set
> -CONFIG_DRIVER_SERIAL_LPUART=y
>  # end of serial drivers
> 
>  CONFIG_ARCH_HAS_FEC_IMX=y
> @@ -597,25 +578,11 @@
>  CONFIG_SPI_MEM=y
>  # CONFIG_DRIVER_SPI_FSL_QUADSPI is not set
>  CONFIG_DRIVER_SPI_GPIO=y
> -CONFIG_DRIVER_SPI_IMX=y
> -CONFIG_DRIVER_SPI_IMX_0_7=y
> +# CONFIG_DRIVER_SPI_IMX is not set
>  CONFIG_DRIVER_SPI_IMX_2_3=y
> -CONFIG_DRIVER_SPI_DSPI=y
>  # end of SPI drivers
> 
> -CONFIG_I2C=y
> -
> -#
> -# I2C Hardware Bus support
> -#
> -# CONFIG_I2C_GPIO is not set
> -CONFIG_I2C_IMX=y
> -# CONFIG_I2C_DESIGNWARE is not set
> -# CONFIG_I2C_MV64XXX is not set
> -# CONFIG_I2C_STM32 is not set
> -# end of I2C Hardware Bus support
> -
> -# CONFIG_I2C_MUX is not set
> +# CONFIG_I2C is not set
>  CONFIG_MTD=y
>  CONFIG_MTD_WRITE=y
>  CONFIG_MTD_OOB_DEVICE=y
> @@ -651,7 +618,6 @@
>  CONFIG_NAND_BBT=y
>  CONFIG_NAND_ALLOW_ERASE_BAD=y
>  CONFIG_NAND_IMX=y
> -CONFIG_NAND_MXS=y
>  # CONFIG_MTD_NAND_ECC_SMC is not set
>  CONFIG_MTD_NAND_IDS=y
>  # CONFIG_MTD_NAND_DENALI is not set
> @@ -687,7 +653,6 @@
>  CONFIG_USB_HOST=y
>  CONFIG_USB_IMX_CHIPIDEA=y
>  CONFIG_USB_IMX_CHIPIDEA_USBMISC=y
> -CONFIG_USB_IMX_PHY=y
>  # CONFIG_USB_DWC3 is not set
>  CONFIG_USB_EHCI=y
>  # CONFIG_USB_DWC2_HOST is not set
> @@ -699,7 +664,6 @@
>  #
>  # USB Miscellaneous drivers
>  #
> -# CONFIG_USB_HUB_USB251XB is not set
>  CONFIG_USB_GADGET=y
>  CONFIG_USB_GADGET_DUALSPEED=y
>  CONFIG_USB_GADGET_DRIVER_ARC=y
> @@ -714,21 +678,16 @@
>  # CONFIG_USB_MUSB is not set
>  CONFIG_VIDEO=y
>  # CONFIG_FRAMEBUFFER_CONSOLE is not set
> -# CONFIG_DRIVER_VIDEO_FB_SSD1307 is not set
>  CONFIG_VIDEO_VPL=y
>  CONFIG_DRIVER_VIDEO_IMX_IPUV3=y
>  CONFIG_DRIVER_VIDEO_IMX_IPUV3_LVDS=y
> -CONFIG_DRIVER_VIDEO_IMX_IPUV3_HDMI=y
>  # CONFIG_DRIVER_VIDEO_IMX_IPUV3_PARALLEL is not set
>  CONFIG_DRIVER_VIDEO_SIMPLEFB=y
> -CONFIG_DRIVER_VIDEO_EDID=y
>  # CONFIG_DRIVER_VIDEO_BACKLIGHT is not set
> 
>  #
>  # Video encoder chips
>  #
> -# CONFIG_DRIVER_VIDEO_MTL017 is not set
> -# CONFIG_DRIVER_VIDEO_TC358767 is not set
>  # CONFIG_DRIVER_VIDEO_SIMPLE_PANEL is not set
>  CONFIG_MCI_SDHCI=y
>  CONFIG_MCI=y
> @@ -749,7 +708,6 @@
>  # CONFIG_MCI_IMX_ESDHC_PIO is not set
>  # CONFIG_MCI_ARASAN is not set
>  # CONFIG_MCI_SPI is not set
> -CONFIG_MCI_IMX_ESDHC_PBL=y
>  CONFIG_HAVE_CLK=y
>  CONFIG_CLKDEV_LOOKUP=y
>  CONFIG_COMMON_CLK=y
> @@ -761,7 +719,6 @@
>  CONFIG_ARCH_HAS_IMX_GPT=y
>  CONFIG_CLOCKSOURCE_DUMMY_RATE=1000
>  CONFIG_CLOCKSOURCE_ARM_ARCHITECTED_TIMER=y
> -CONFIG_CLOCKSOURCE_ARM_GLOBAL_TIMER=y
>  CONFIG_CLOCKSOURCE_IMX_GPT=y
>  # CONFIG_CLOCKSOURCE_DW_APB_TIMER is not set
>  # end of Clocksource
> @@ -769,18 +726,8 @@
>  #
>  # Multifunction device drivers
>  #
> -# CONFIG_MFD_ACT8846 is not set
> -# CONFIG_MFD_DA9053 is not set
> -CONFIG_MFD_DA9063=y
> -# CONFIG_MFD_LP3972 is not set
> -CONFIG_MFD_MC13XXX=y
> -CONFIG_MFD_MC34704=y
> -CONFIG_MFD_MC9SDZ60=y
> -CONFIG_MFD_STMPE=y
> -CONFIG_MFD_SYSCON=y
> -# CONFIG_MFD_TWL4030 is not set
> -# CONFIG_MFD_TWL6030 is not set
> -# CONFIG_MFD_STPMIC1 is not set
> +# CONFIG_MFD_MC13XXX is not set
> +# CONFIG_MFD_SYSCON is not set
>  # CONFIG_FINTEK_SUPERIO is not set
>  # CONFIG_SMSC_SUPERIO is not set
>  # end of Multifunction device drivers
> @@ -801,13 +748,11 @@
>  # CONFIG_LED_GPIO_RGB is not set
>  # CONFIG_LED_GPIO_BICOLOR is not set
>  CONFIG_LED_TRIGGERS=y
> -# CONFIG_LED_PCA955X is not set
> 
>  #
>  # EEPROM support
>  #
>  CONFIG_EEPROM_AT25=y
> -CONFIG_EEPROM_AT24=y
>  # end of EEPROM support
> 
>  #
> @@ -816,7 +761,6 @@
>  CONFIG_INPUT=y
>  CONFIG_KEYBOARD_GPIO=y
>  # CONFIG_KEYBOARD_IMX_KEYPAD is not set
> -# CONFIG_KEYBOARD_QT1070 is not set
>  # CONFIG_KEYBOARD_USB is not set
>  # CONFIG_INPUT_SPECIALKEYS is not set
>  # end of Input device support
> @@ -833,7 +777,6 @@
>  #
>  # DMA support
>  #
> -CONFIG_MXS_APBH_DMA=y
>  # end of DMA support
> 
>  CONFIG_GPIOLIB=y
> @@ -844,12 +787,7 @@
>  CONFIG_GPIO_74164=y
>  # CONFIG_GPIO_GENERIC_PLATFORM is not set
>  CONFIG_GPIO_IMX=y
> -CONFIG_GPIO_VF610=y
> -# CONFIG_GPIO_PCA953X is not set
> -# CONFIG_GPIO_PCF857X is not set
> -CONFIG_GPIO_STMPE=y
>  # CONFIG_GPIO_DESIGNWARE is not set
> -# CONFIG_GPIO_SX150X is not set
>  # end of GPIO
> 
>  # CONFIG_W1 is not set
> @@ -860,14 +798,9 @@
>  CONFIG_PINCTRL=y
>  CONFIG_PINCTRL_IMX_IOMUX_V3=y
>  # CONFIG_PINCTRL_SINGLE is not set
> -CONFIG_PINCTRL_VF610=y
>  # end of Pin controllers
> 
> -CONFIG_NVMEM=y
> -# CONFIG_NVMEM_SNVS_LPGPR is not set
> -CONFIG_IMX_OCOTP=y
> -# CONFIG_IMX_OCOTP_WRITE is not set
> -# CONFIG_EEPROM_93XX46 is not set
> +# CONFIG_NVMEM is not set
> 
>  #
>  # Bus devices
> @@ -877,8 +810,6 @@
> 
>  CONFIG_REGULATOR=y
>  CONFIG_REGULATOR_FIXED=y
> -# CONFIG_REGULATOR_PFUZE is not set
> -# CONFIG_REGULATOR_ANATOP is not set
> 
>  #
>  # Remoteproc drivers
> @@ -992,16 +923,14 @@
>  # CONFIG_BASE64 is not set
>  CONFIG_PROCESS_ESCAPE_SEQUENCE=y
>  CONFIG_LZO_DECOMPRESS=y
> -CONFIG_BCH=y
>  CONFIG_FNMATCH=y
>  CONFIG_QSORT=y
>  CONFIG_LIBSCAN=y
>  CONFIG_LIBUBIGEN=y
> -CONFIG_STMP_DEVICE=y
>  # CONFIG_RATP is not set
>  # CONFIG_ALLOW_PRNG_FALLBACK is not set
>  # CONFIG_CRC_CCITT is not set
> -CONFIG_CRC8=y
> +# CONFIG_CRC8 is not set
> 
> 
> 
> 
>>
>> Can you try with same toolchain? If that works, it
>> might be a compiler issue? What are you using?
>>
>>>
>>> /Lars Pedersen
>>>
>>> On Mon, 3 Aug 2020 at 12:10, Ahmad Fatoum <a.fatoum@pengutronix.de> wrote:
>>>>
>>>> Hi,
>>>>
>>>> On 7/29/20 6:52 PM, Lars Pedersen wrote:
>>>>> I have spent the last couple of days trying to port our bootloader
>>>>> from u-boot to barebox 2020.07 but have yet to get any console output.
>>>>> Our product is based on tqma7d i.MX7 dual core cpu and uses UART4 for
>>>>> serial console and boots from internal eMMC.
>>>>>
>>>>> I created a new board inspired from "NXP i.MX7 SabreSD board" and
>>>>> tried to only add the basic in the first step to get a console output
>>>>> working. The image is built using ptxdist and the imx_v7_defconfig
>>>>> where the new board is selected. The image is flashed with "dd
>>>>> if=barebox-image of=/dev/mmcblk0 bs=1024 skip=1 seek=1 conv=fsync".
>>>>> The device works using u-boot 2020.07 with the same device trees but
>>>>> we thought it was time to try out barebox since u-boot felt a little
>>>>> bloated :)
>>>>>
>>>>> So can anyone be of assistance and tell me what I'm missing?
>>>>
>>>> When I looked through your patch the first time, I just looked
>>>> for stuff that would cause it to not boot. Some more comments
>>>> inline that are unrelated to your boot problems.
>>>>
>>>>>
>>>>> /Lars Pedersen
>>>>>
>>>>> From: Lars Pedersen <laa@kamstrup.com>
>>>>> Date: Tue, 28 Jul 2020 08:57:57 +0000
>>>>> Subject: [PATCH] Add kamstrup imx7d dev board
>>>>>
>>>>> ---
>>>>>  arch/arm/boards/Makefile                           |   1 +
>>>>>  arch/arm/boards/kamstrup-imx7d-tqma7d/Makefile     |   2 +
>>>>>  arch/arm/boards/kamstrup-imx7d-tqma7d/board.c      |  19 ++
>>>>>  .../flash-header-kamstrup-imx7d-tqma7d.imxcfg      |  79 ++++++
>>>>>  arch/arm/boards/kamstrup-imx7d-tqma7d/lowlevel.c   |  35 +++
>>>>>  arch/arm/dts/Makefile                              |   1 +
>>>>>  arch/arm/dts/imx7d-flex-concentrator-mfg.dts       |  11 +
>>>>>  arch/arm/mach-imx/Kconfig                          |   5 +
>>>>>  drivers/regulator/Kconfig                          |   2 +-
>>>>>  dts/src/arm/imx7d-flex-concentrator-mfg.dts        |  25 ++
>>>>>  dts/src/arm/imx7d-flex-concentrator.dts            | 313 +++++++++++++++++++++
>>>>>  images/Makefile.imx                                |   5 +
>>>>>  12 files changed, 497 insertions(+), 1 deletion(-)
>>>>>  create mode 100644 arch/arm/boards/kamstrup-imx7d-tqma7d/Makefile
>>>>>  create mode 100644 arch/arm/boards/kamstrup-imx7d-tqma7d/board.c
>>>>>  create mode 100644
>>>>> arch/arm/boards/kamstrup-imx7d-tqma7d/flash-header-kamstrup-imx7d-tqma7d.imxcfg
>>>>>  create mode 100644 arch/arm/boards/kamstrup-imx7d-tqma7d/lowlevel.c
>>>>>  create mode 100644 arch/arm/dts/imx7d-flex-concentrator-mfg.dts
>>>>>  create mode 100644 dts/src/arm/imx7d-flex-concentrator-mfg.dts
>>>>>  create mode 100644 dts/src/arm/imx7d-flex-concentrator.dts
>>>>>
>>>>> diff --git a/arch/arm/boards/Makefile b/arch/arm/boards/Makefile
>>>>> index e9e9163d589b..58bb4cf2adab 100644
>>>>> --- a/arch/arm/boards/Makefile
>>>>> +++ b/arch/arm/boards/Makefile
>>>>> @@ -64,6 +64,7 @@ obj-$(CONFIG_MACH_HIGHBANK)            += highbank/
>>>>>  obj-$(CONFIG_MACH_IMX21ADS)            += freescale-mx21-ads/
>>>>>  obj-$(CONFIG_MACH_IMX233_OLINUXINO)        += imx233-olinuxino/
>>>>>  obj-$(CONFIG_MACH_IMX27ADS)            += freescale-mx27-ads/
>>>>> +obj-$(CONFIG_MACH_KAMSTRUP_IMX7D_TQMA7D)    += kamstrup-imx7d-tqma7d/
>>>>>  obj-$(CONFIG_MACH_KINDLE3)            += kindle3/
>>>>>  obj-$(CONFIG_MACH_KONTRON_SAMX6I)        += kontron-samx6i/
>>>>>  obj-$(CONFIG_MACH_LENOVO_IX4_300D)        += lenovo-ix4-300d/
>>>>> diff --git a/arch/arm/boards/kamstrup-imx7d-tqma7d/Makefile
>>>>> b/arch/arm/boards/kamstrup-imx7d-tqma7d/Makefile
>>>>> new file mode 100644
>>>>> index 000000000000..01c7a259e9a5
>>>>> --- /dev/null
>>>>> +++ b/arch/arm/boards/kamstrup-imx7d-tqma7d/Makefile
>>>>> @@ -0,0 +1,2 @@
>>>>> +obj-y += board.o
>>>>> +lwl-y += lowlevel.o
>>>>> diff --git a/arch/arm/boards/kamstrup-imx7d-tqma7d/board.c
>>>>> b/arch/arm/boards/kamstrup-imx7d-tqma7d/board.c
>>>>> new file mode 100644
>>>>> index 000000000000..b3ffa851f3e6
>>>>> --- /dev/null
>>>>> +++ b/arch/arm/boards/kamstrup-imx7d-tqma7d/board.c
>>>>> @@ -0,0 +1,19 @@
>>>>> +// SPDX-License-Identifier: GPL-2.0-or-later
>>>>> +// SPDX-FileCopyrightText: 2020 Kamstrup A/S
>>>>> +
>>>>> +/* Author: Lars Pedersen <lapeddk@gmail.com> */
>>>>> +
>>>>> +#include <common.h>
>>>>> +#include <init.h>
>>>>> +#include <io.h>
>>>>> +#include <mach/imx7-regs.h>
>>>>> +#include <mfd/imx7-iomuxc-gpr.h>
>>>>> +
>>>>> +static int kamstrup_mx7_tqma7d_coredevices_init(void)
>>>>> +{
>>>>> +    if (!of_machine_is_compatible("kam,imx7d-flex-concentrator"))
>>>>> +        return 0;
>>>>> +
>>>>> +    return 0;
>>>>> +}
>>>>
>>>> Function serves no purpose. If you don't have baord code, drop it altogether.
>>>>
>>>
>>> I'll do a cleanup when I have it working :D
>>>
>>>>> +coredevice_initcall(kamstrup_mx7_tqma7d_coredevices_init);
>>>>> diff --git a/arch/arm/boards/kamstrup-imx7d-tqma7d/flash-header-kamstrup-imx7d-tqma7d.imxcfg
>>>>> b/arch/arm/boards/kamstrup-imx7d-tqma7d/flash-header-kamstrup-imx7d-tqma7d.imxcfg
>>>>> new file mode 100644
>>>>> index 000000000000..7656619c1b2e
>>>>> --- /dev/null
>>>>> +++ b/arch/arm/boards/kamstrup-imx7d-tqma7d/flash-header-kamstrup-imx7d-tqma7d.imxcfg
>>>>> @@ -0,0 +1,79 @@
>>>>> +soc imx7
>>>>> +loadaddr 0x80000000
>>>>> +dcdofs 0x400
>>>>
>>>> Called ivtofs now in barebox next branch now.
>>>>
>>>
>>> Okay thanks.
>>>
>>>>> diff --git a/arch/arm/dts/imx7d-flex-concentrator-mfg.dts
>>>>> b/arch/arm/dts/imx7d-flex-concentrator-mfg.dts
>>>>> new file mode 100644
>>>>> index 000000000000..746e36a70f4c
>>>>> --- /dev/null
>>>>> +++ b/arch/arm/dts/imx7d-flex-concentrator-mfg.dts
>>>>> @@ -0,0 +1,11 @@
>>>>> +/*
>>>>> + * The code contained herein is licensed under the GNU General Public
>>>>> + * License. You may obtain a copy of the GNU General Public License
>>>>> + * Version 2 or later at the following locations:
>>>>> + *
>>>>> + * http://www.opensource.org/licenses/gpl-license.html
>>>>> + * http://www.gnu.org/copyleft/gpl.html
>>>>> + */
>>>>> +
>>>>> +#include <arm/imx7d-flex-concentrator-mfg.dts>
>>>>> +
>>>>> diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
>>>>> index 6dd5cb2aca15..d0a9332c7a24 100644
>>>>> --- a/arch/arm/mach-imx/Kconfig
>>>>> +++ b/arch/arm/mach-imx/Kconfig
>>>>> @@ -492,6 +492,11 @@ config MACH_ZII_IMX7D_DEV
>>>>>      select ARCH_IMX7
>>>>>      select ARM_USE_COMPRESSED_DTB
>>>>>
>>>>> +config MACH_KAMSTRUP_IMX7D_TQMA7D
>>>>> +    bool "Kamstrup TQMa7D based devices"
>>>>> +    select ARCH_IMX7
>>>>> +    select ARM_USE_COMPRESSED_DTB
>>>>> +
>>>>>  config MACH_PHYTEC_PHYCORE_IMX7
>>>>>      bool "Phytec phyCORE i.MX7"
>>>>>      select ARCH_IMX7
>>>>> diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
>>>>> index 1ce057180a01..b0bdc48399e3 100644
>>>>> --- a/drivers/regulator/Kconfig
>>>>> +++ b/drivers/regulator/Kconfig
>>>>> @@ -19,7 +19,7 @@ config REGULATOR_BCM283X
>>>>>  config REGULATOR_PFUZE
>>>>>      bool "Freescale PFUZE100/200/3000 regulator driver"
>>>>>      depends on I2C
>>>>> -    depends on ARCH_IMX6 || ARCH_IMX8MQ
>>>>> +    depends on ARCH_IMX6 || ARCH_IMX7 || ARCH_IMX8MQ
>>>>>
>>>>>  config REGULATOR_STM32_PWR
>>>>>      bool "STMicroelectronics STM32 PWR"
>>>>> diff --git a/dts/src/arm/imx7d-flex-concentrator-mfg.dts
>>>>> b/dts/src/arm/imx7d-flex-concentrator-mfg.dts
>>>>> new file mode 100644
>>>>> index 000000000000..789f0837058f
>>>>> --- /dev/null
>>>>> +++ b/dts/src/arm/imx7d-flex-concentrator-mfg.dts
>>>>
>>>> Perfectly fine for your patch stack in BSP, but if you want to upstream
>>>> it, you need to either:
>>>>
>>>> 1) upstream your device tree to Linux. dts/ is a sync with Linux and
>>>>    shortly after, it will be imported into barebox
>>>> 2) put your device tree in arch/arm/dts
>>>>
>>> The dts will upstreamed soon. Hopefully :D
>>>
>>
>> --
>> Pengutronix e.K.                           |                             |
>> Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
>> 31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
>> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Getting serial console output on new imx7d tqma7 board UART4
  2020-08-05  8:49         ` Ahmad Fatoum
@ 2020-08-05  9:37           ` Lars Pedersen
  2020-08-05  9:48             ` Ahmad Fatoum
  0 siblings, 1 reply; 20+ messages in thread
From: Lars Pedersen @ 2020-08-05  9:37 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox

Hi. I got both the EVK and our TQMa7d board working with using the
full imx_v7_defconfig! So that's progress :)

See my inline comments

/Lars Pedersen.

On Wed, 5 Aug 2020 at 10:49, Ahmad Fatoum <a.fatoum@pengutronix.de> wrote:
>
> Hello Lars,
>
> On 8/4/20 9:21 PM, Lars Pedersen wrote:
> > On Tue, 4 Aug 2020 at 18:15, Ahmad Fatoum <a.fatoum@pengutronix.de> wrote:
> >>
> >> Hello Lars,
> >>
> >> On 8/4/20 3:07 PM, Lars Pedersen wrote:
> >>> I just go an MCIMX7SABRE board and it now trying to start barebox from
> >>> the external SD card, which I guess should be possible right?
> >>>
> >>> I have taken barebox 2020.07.0 and copied the imx_v7_defconfig and
> >>> deselected all boards except the "NXP i.MX7 SabreSD board"
> >>>
> >>> After compilation i copy the image using:
> >>>
> >>> sudo dd if=barebox-freescale-mx7-sabresd.img of=/dev/sdb bs=1024 skip=1 seek=1
> >>> sync>
> >>> But still no boot screen for that either. :/
> >>>
> >>> Shouldn't this work out of the box??
> >>
> >> Works for me.
> >>
> >> imx_v7_defconfig
> >> OSELAS.Toolchain-2019.09.1
> >> Image written to SD card (offset 0) and booted from.
> >
> > I'm using 2019.09.1 toolchain too. When you are saying "offset 0" is
> > that the same as nuking the MBR on the sd card? Like the following?
> > sudo dd if=barebox-freescale-mx7-sabresd.img of=/dev/sdb bs=1024
>
> Yes, that's what I did (or rather labgrid write-image did for me)
>
> > Okay I think that I have found the issue:
> > If are buldiing all the boards selected by the imx_v7_defconfig I get
> > an much bigger image size:
>
> That's expected. multi-image means that barebox is built to support
> multiple boards and multiple images are generated, one for each board.
>
> These images share the same main barebox, but each have a different
> pre-bootloader (and device tree). Only the board code and drivers
> matching the device tree are executed. The rest should remain
> unused by your board.
>
> To make sure this does work as intended, I just built barebox with
> only barebox-freescale-mx7-sabresd.img selected and it works fine for me:
>

What's the size of that image? I just retested and I can't get it
working when only the sabresd board is selected for compilation.

>   barebox 2020.07.0 #58 Wed Aug 5 10:46:00 CEST 2020
>
> >
> > All boards selected (657570 bytes)
> > [DOCKER][developer@25071f8c717f ptxdist]$ ll
> > platform-tqma7/images/barebox-freescale-mx7-sabresd.img
> > -rw-r--r--. 1 developer developer 657570 Aug  4 19:07
> > platform-tqma7/images/barebox-freescale-mx7-sabresd.img
> > [DOCKER][developer@25071f8c717f ptxdist]$ sha256sum
> > platform-tqma7/images/barebox-freescale-mx7-sabresd.img
> > e454525846e6fbfbd559c100106e43ef5b1f14112562aeb585ccb0b1d4b1bdfe
> > platform-tqma7/images/barebox-freescale-mx7-sabresd.img
> >
> > Only the NXP i.MX7 SabreSD board selected (497548 bytes)
> > [DOCKER][developer@25071f8c717f ptxdist]$ ll platform-tqma7/images/barebox-*
> > -rw-r--r--. 1 developer developer     28 Aug  4 19:14
> > platform-tqma7/images/barebox-default-environment
> > -rw-r--r--. 1 developer developer 497548 Aug  4 19:14
> > platform-tqma7/images/barebox-freescale-mx7-sabresd.img
> > lrwxrwxrwx. 1 developer developer     33 Aug  4 19:14
> > platform-tqma7/images/barebox-image ->
> > barebox-freescale-mx7-sabresd.img
> >
> > A lot of stuff gets deselected, since the board doesn't depend  on it.
> > Stuff like: CONFIG_MCI_IMX_ESDHC_PBL is suddenly not enabled, which I
> > think is vital. So I'll test the it tomorrow
>
> It's not. When you do your SDRAM setup in DCD, you can have the ROM code
> load barebox directly into SDRAM, so there's no need to have a limited
> eSDHC driver in pre-bootloader. CONFIG_MCI_IMX_ESDHC_PBL is unset then.
>
> Are you sure the board is strapped correctly to boot from SD?

I got the board configuration as:

SW3 = 10
SW2 = 00100000

I have tried with:
cat barebox-freescale-mx7-sabresd.img > /dev/sdb
sync /dev/sdb
and
sudo dd if=barebox-freescale-mx7-sabresd.img of=/dev/sdb bs=1024

>
> >
> > /Lars Pedersen
> >
> > --- barebox_full    2020-08-04 21:06:31.270363892 +0200
> > +++ barebox_one_board    2020-08-04 21:09:46.162669378 +0200
> > @@ -4,7 +4,6 @@
> >  #
> >  CONFIG_ARM=y
> >  CONFIG_ARM_LINUX=y
> > -CONFIG_ARM_USE_COMPRESSED_DTB=y
> >  CONFIG_TEXT_BASE=0x0
> >
> >  #
> > @@ -49,80 +48,67 @@
> >  # processor features
> >  #
> >  # CONFIG_BOOT_ENDIANNESS_SWITCH is not set
> > -CONFIG_ARCH_HAS_L2X0=y
> > -# CONFIG_CACHE_L2X0 is not set
> > -CONFIG_ARCH_TEXT_BASE=0x97f00000
> >  CONFIG_BAREBOX_MAX_IMAGE_SIZE=0xffffffff
> >  CONFIG_ARCH_IMX_IMXIMAGE=y
> > -CONFIG_RESET_IMX_SRC=y
> > -CONFIG_MACH_FREESCALE_MX51_PDK_POWER=y
> >
> >  #
> >  # Freescale i.MX System-on-Chip
> >  #
> > -CONFIG_ARCH_IMX50=y
> > -CONFIG_ARCH_IMX51=y
> > -CONFIG_ARCH_IMX53=y
> > -CONFIG_ARCH_IMX6=y
> > -CONFIG_ARCH_IMX6SX=y
> > -CONFIG_ARCH_IMX6UL=y
> >  CONFIG_ARCH_IMX7=y
> > -CONFIG_ARCH_VF610=y
> >  CONFIG_IMX_MULTI_BOARDS=y
> >  # CONFIG_MACH_SCB9328 is not set
> >  # CONFIG_MACH_TX25 is not set
> >  # CONFIG_MACH_PCA100 is not set
> >  # CONFIG_MACH_PCM038 is not set
> > -CONFIG_MACH_KINDLE_MX50=y
> > -CONFIG_MACH_CCMX51=y
> > -CONFIG_MACH_EFIKA_MX_SMARTBOOK=y
> > -CONFIG_MACH_EMBEDSKY_E9=y
> > -CONFIG_MACH_FREESCALE_MX51_PDK=y
> > -CONFIG_MACH_CCMX53=y
> > -CONFIG_MACH_FREESCALE_MX53_LOCO=y
> > -CONFIG_MACH_GUF_VINCELL=y
> > -CONFIG_MACH_TQMA53=y
> > -CONFIG_MACH_FREESCALE_MX53_VMX53=y
> > -CONFIG_MACH_TX53=y
> > -CONFIG_MACH_PHYTEC_SOM_IMX6=y
> > -CONFIG_MACH_KONTRON_SAMX6I=y
> > -CONFIG_MACH_DFI_FS700_M60=y
> > -CONFIG_MACH_GUF_SANTARO=y
> > -CONFIG_MACH_REALQ7=y
> > -CONFIG_MACH_GK802=y
> > -CONFIG_MACH_ELTEC_HIPERCAM=y
> > -CONFIG_MACH_TQMA6X=y
> > -CONFIG_MACH_TX6X=y
> > -CONFIG_MACH_SABRELITE=y
> > -CONFIG_MACH_SABRESD=y
> > -CONFIG_MACH_FREESCALE_IMX6SX_SABRESDB=y
> > -CONFIG_MACH_NITROGEN6=y
> > -CONFIG_MACH_SOLIDRUN_MICROSOM=y
> > -CONFIG_MACH_TECHNEXION_PICO_HOBBIT=y
> > -CONFIG_MACH_TECHNEXION_WANDBOARD=y
> > -CONFIG_MACH_EMBEST_MARSBOARD=y
> > -CONFIG_MACH_EMBEST_RIOTBOARD=y
> > -CONFIG_MACH_UDOO=y
> > +# CONFIG_MACH_KINDLE_MX50 is not set
> > +# CONFIG_MACH_CCMX51 is not set
> > +# CONFIG_MACH_EFIKA_MX_SMARTBOOK is not set
> > +# CONFIG_MACH_EMBEDSKY_E9 is not set
> > +# CONFIG_MACH_FREESCALE_MX51_PDK is not set
> > +# CONFIG_MACH_CCMX53 is not set
> > +# CONFIG_MACH_FREESCALE_MX53_LOCO is not set
> > +# CONFIG_MACH_GUF_VINCELL is not set
> > +# CONFIG_MACH_TQMA53 is not set
> > +# CONFIG_MACH_FREESCALE_MX53_VMX53 is not set
> > +# CONFIG_MACH_TX53 is not set
> > +# CONFIG_MACH_PHYTEC_SOM_IMX6 is not set
> > +# CONFIG_MACH_KONTRON_SAMX6I is not set
> > +# CONFIG_MACH_DFI_FS700_M60 is not set
> > +# CONFIG_MACH_GUF_SANTARO is not set
> > +# CONFIG_MACH_REALQ7 is not set
> > +# CONFIG_MACH_GK802 is not set
> > +# CONFIG_MACH_ELTEC_HIPERCAM is not set
> > +# CONFIG_MACH_TQMA6X is not set
> > +# CONFIG_MACH_TX6X is not set
> > +# CONFIG_MACH_SABRELITE is not set
> > +# CONFIG_MACH_SABRESD is not set
> > +# CONFIG_MACH_FREESCALE_IMX6SX_SABRESDB is not set
> > +# CONFIG_MACH_NITROGEN6 is not set
> > +# CONFIG_MACH_SOLIDRUN_MICROSOM is not set
> > +# CONFIG_MACH_TECHNEXION_PICO_HOBBIT is not set
> > +# CONFIG_MACH_TECHNEXION_WANDBOARD is not set
> > +# CONFIG_MACH_EMBEST_MARSBOARD is not set
> > +# CONFIG_MACH_EMBEST_RIOTBOARD is not set
> > +# CONFIG_MACH_UDOO is not set
> >  # CONFIG_MACH_UDOO_NEO is not set
> > -CONFIG_MACH_VARISCITE_MX6=y
> > -CONFIG_MACH_GW_VENTANA=y
> > -CONFIG_MACH_CM_FX6=y
> > -CONFIG_MACH_ADVANTECH_ROM_742X=y
> > -CONFIG_MACH_WARP7=y
> > -CONFIG_MACH_VF610_TWR=y
> > -CONFIG_MACH_ZII_COMMON=y
> > -CONFIG_MACH_ZII_RDU1=y
> > -CONFIG_MACH_ZII_RDU2=y
> > +# CONFIG_MACH_VARISCITE_MX6 is not set
> > +# CONFIG_MACH_GW_VENTANA is not set
> > +# CONFIG_MACH_CM_FX6 is not set
> > +# CONFIG_MACH_ADVANTECH_ROM_742X is not set
> > +# CONFIG_MACH_WARP7 is not set
> > +# CONFIG_MACH_VF610_TWR is not set
> > +# CONFIG_MACH_ZII_RDU1 is not set
> > +# CONFIG_MACH_ZII_RDU2 is not set
> >  # CONFIG_MACH_ZII_IMX8MQ_DEV is not set
> > -CONFIG_MACH_ZII_VF610_DEV=y
> > +# CONFIG_MACH_ZII_VF610_DEV is not set
> >  # CONFIG_MACH_ZII_IMX7D_DEV is not set
> > -CONFIG_MACH_PHYTEC_PHYCORE_IMX7=y
> > +# CONFIG_MACH_PHYTEC_PHYCORE_IMX7 is not set
> >  CONFIG_MACH_FREESCALE_MX7_SABRESD=y
> > -CONFIG_MACH_NXP_IMX6ULL_EVK=y
> > +# CONFIG_MACH_NXP_IMX6ULL_EVK is not set
> >  # CONFIG_MACH_NXP_IMX8MM_EVK is not set
> >  # CONFIG_MACH_NXP_IMX8MQ_EVK is not set
> >  # CONFIG_MACH_PHYTEC_SOM_IMX8MQ is not set
> > -CONFIG_MACH_GRINN_LITEBOARD=y
> > +# CONFIG_MACH_GRINN_LITEBOARD is not set
> >  # CONFIG_MACH_DIGI_CCIMX6ULSBCPRO is not set
> >
> >  #
> > @@ -133,17 +119,14 @@
> >  #
> >  # i.MX specific settings
> >  #
> > -CONFIG_IMX_IIM=y
> > -CONFIG_IMX_IIM_FUSE_BLOW=y
> > -# CONFIG_HABV4 is not set
> > +# CONFIG_IMX_IIM is not set
> >  # end of i.MX specific settings
> >
> >  # CONFIG_BOARD_ARM_GENERIC_DT is not set
> >  CONFIG_ARM_ASM_UNIFIED=y
> >  CONFIG_AEABI=y
> >  CONFIG_THUMB2_BAREBOX=y
> > -CONFIG_ARM_BOARD_APPEND_ATAG=y
> > -# CONFIG_ARM_BOARD_PREPEND_ATAG is not set
> > +# CONFIG_ARM_BOARD_APPEND_ATAG is not set
> >  # end of System Type
> >
> >  #
> > @@ -176,7 +159,6 @@
> >  CONFIG_STDDEV=y
> >  CONFIG_MENUTREE=y
> >  CONFIG_FILE_LIST=y
> > -CONFIG_BAREBOX_UPDATE_IMX_NAND_FCB=y
> >  CONFIG_UBIFORMAT=y
> >  CONFIG_USBGADGET_START=y
> >  CONFIG_BOOT=y
> > @@ -210,6 +192,7 @@
> >  # CONFIG_IMAGE_COMPRESSION_NONE is not set
> >  CONFIG_MMU=y
> >  CONFIG_MMU_EARLY=y
> > +CONFIG_HAVE_CONFIGURABLE_TEXT_BASE=y
> >  CONFIG_BAREBOX_MAX_PBL_SIZE=0xffffffff
> >  CONFIG_BAREBOX_MAX_BARE_INIT_SIZE=0xffffffff
> >  CONFIG_STACK_SIZE=0x8000
> > @@ -220,7 +203,7 @@
> >  # CONFIG_MALLOC_DLMALLOC is not set
> >  CONFIG_MALLOC_TLSF=y
> >  CONFIG_KALLSYMS=y
> > -CONFIG_RELOCATABLE=y
> > +# CONFIG_RELOCATABLE is not set
> >  # CONFIG_PANIC_HANG is not set
> >  CONFIG_PROMPT="barebox:"
> >  CONFIG_BAUDRATE=115200
> > @@ -470,7 +453,6 @@
> >  CONFIG_CMD_DETECT=y
> >  CONFIG_CMD_FLASH=y
> >  CONFIG_CMD_GPIO=y
> > -CONFIG_CMD_I2C=y
> >  CONFIG_CMD_LED=y
> >  CONFIG_CMD_NAND=y
> >  CONFIG_CMD_NANDTEST=y
> > @@ -537,7 +519,6 @@
> >  CONFIG_DRIVER_SERIAL_IMX=y
> >  # CONFIG_DRIVER_SERIAL_NS16550 is not set
> >  # CONFIG_DRIVER_SERIAL_CADENCE is not set
> > -CONFIG_DRIVER_SERIAL_LPUART=y
> >  # end of serial drivers
> >
> >  CONFIG_ARCH_HAS_FEC_IMX=y
> > @@ -597,25 +578,11 @@
> >  CONFIG_SPI_MEM=y
> >  # CONFIG_DRIVER_SPI_FSL_QUADSPI is not set
> >  CONFIG_DRIVER_SPI_GPIO=y
> > -CONFIG_DRIVER_SPI_IMX=y
> > -CONFIG_DRIVER_SPI_IMX_0_7=y
> > +# CONFIG_DRIVER_SPI_IMX is not set
> >  CONFIG_DRIVER_SPI_IMX_2_3=y
> > -CONFIG_DRIVER_SPI_DSPI=y
> >  # end of SPI drivers
> >
> > -CONFIG_I2C=y
> > -
> > -#
> > -# I2C Hardware Bus support
> > -#
> > -# CONFIG_I2C_GPIO is not set
> > -CONFIG_I2C_IMX=y
> > -# CONFIG_I2C_DESIGNWARE is not set
> > -# CONFIG_I2C_MV64XXX is not set
> > -# CONFIG_I2C_STM32 is not set
> > -# end of I2C Hardware Bus support
> > -
> > -# CONFIG_I2C_MUX is not set
> > +# CONFIG_I2C is not set
> >  CONFIG_MTD=y
> >  CONFIG_MTD_WRITE=y
> >  CONFIG_MTD_OOB_DEVICE=y
> > @@ -651,7 +618,6 @@
> >  CONFIG_NAND_BBT=y
> >  CONFIG_NAND_ALLOW_ERASE_BAD=y
> >  CONFIG_NAND_IMX=y
> > -CONFIG_NAND_MXS=y
> >  # CONFIG_MTD_NAND_ECC_SMC is not set
> >  CONFIG_MTD_NAND_IDS=y
> >  # CONFIG_MTD_NAND_DENALI is not set
> > @@ -687,7 +653,6 @@
> >  CONFIG_USB_HOST=y
> >  CONFIG_USB_IMX_CHIPIDEA=y
> >  CONFIG_USB_IMX_CHIPIDEA_USBMISC=y
> > -CONFIG_USB_IMX_PHY=y
> >  # CONFIG_USB_DWC3 is not set
> >  CONFIG_USB_EHCI=y
> >  # CONFIG_USB_DWC2_HOST is not set
> > @@ -699,7 +664,6 @@
> >  #
> >  # USB Miscellaneous drivers
> >  #
> > -# CONFIG_USB_HUB_USB251XB is not set
> >  CONFIG_USB_GADGET=y
> >  CONFIG_USB_GADGET_DUALSPEED=y
> >  CONFIG_USB_GADGET_DRIVER_ARC=y
> > @@ -714,21 +678,16 @@
> >  # CONFIG_USB_MUSB is not set
> >  CONFIG_VIDEO=y
> >  # CONFIG_FRAMEBUFFER_CONSOLE is not set
> > -# CONFIG_DRIVER_VIDEO_FB_SSD1307 is not set
> >  CONFIG_VIDEO_VPL=y
> >  CONFIG_DRIVER_VIDEO_IMX_IPUV3=y
> >  CONFIG_DRIVER_VIDEO_IMX_IPUV3_LVDS=y
> > -CONFIG_DRIVER_VIDEO_IMX_IPUV3_HDMI=y
> >  # CONFIG_DRIVER_VIDEO_IMX_IPUV3_PARALLEL is not set
> >  CONFIG_DRIVER_VIDEO_SIMPLEFB=y
> > -CONFIG_DRIVER_VIDEO_EDID=y
> >  # CONFIG_DRIVER_VIDEO_BACKLIGHT is not set
> >
> >  #
> >  # Video encoder chips
> >  #
> > -# CONFIG_DRIVER_VIDEO_MTL017 is not set
> > -# CONFIG_DRIVER_VIDEO_TC358767 is not set
> >  # CONFIG_DRIVER_VIDEO_SIMPLE_PANEL is not set
> >  CONFIG_MCI_SDHCI=y
> >  CONFIG_MCI=y
> > @@ -749,7 +708,6 @@
> >  # CONFIG_MCI_IMX_ESDHC_PIO is not set
> >  # CONFIG_MCI_ARASAN is not set
> >  # CONFIG_MCI_SPI is not set
> > -CONFIG_MCI_IMX_ESDHC_PBL=y
> >  CONFIG_HAVE_CLK=y
> >  CONFIG_CLKDEV_LOOKUP=y
> >  CONFIG_COMMON_CLK=y
> > @@ -761,7 +719,6 @@
> >  CONFIG_ARCH_HAS_IMX_GPT=y
> >  CONFIG_CLOCKSOURCE_DUMMY_RATE=1000
> >  CONFIG_CLOCKSOURCE_ARM_ARCHITECTED_TIMER=y
> > -CONFIG_CLOCKSOURCE_ARM_GLOBAL_TIMER=y
> >  CONFIG_CLOCKSOURCE_IMX_GPT=y
> >  # CONFIG_CLOCKSOURCE_DW_APB_TIMER is not set
> >  # end of Clocksource
> > @@ -769,18 +726,8 @@
> >  #
> >  # Multifunction device drivers
> >  #
> > -# CONFIG_MFD_ACT8846 is not set
> > -# CONFIG_MFD_DA9053 is not set
> > -CONFIG_MFD_DA9063=y
> > -# CONFIG_MFD_LP3972 is not set
> > -CONFIG_MFD_MC13XXX=y
> > -CONFIG_MFD_MC34704=y
> > -CONFIG_MFD_MC9SDZ60=y
> > -CONFIG_MFD_STMPE=y
> > -CONFIG_MFD_SYSCON=y
> > -# CONFIG_MFD_TWL4030 is not set
> > -# CONFIG_MFD_TWL6030 is not set
> > -# CONFIG_MFD_STPMIC1 is not set
> > +# CONFIG_MFD_MC13XXX is not set
> > +# CONFIG_MFD_SYSCON is not set
> >  # CONFIG_FINTEK_SUPERIO is not set
> >  # CONFIG_SMSC_SUPERIO is not set
> >  # end of Multifunction device drivers
> > @@ -801,13 +748,11 @@
> >  # CONFIG_LED_GPIO_RGB is not set
> >  # CONFIG_LED_GPIO_BICOLOR is not set
> >  CONFIG_LED_TRIGGERS=y
> > -# CONFIG_LED_PCA955X is not set
> >
> >  #
> >  # EEPROM support
> >  #
> >  CONFIG_EEPROM_AT25=y
> > -CONFIG_EEPROM_AT24=y
> >  # end of EEPROM support
> >
> >  #
> > @@ -816,7 +761,6 @@
> >  CONFIG_INPUT=y
> >  CONFIG_KEYBOARD_GPIO=y
> >  # CONFIG_KEYBOARD_IMX_KEYPAD is not set
> > -# CONFIG_KEYBOARD_QT1070 is not set
> >  # CONFIG_KEYBOARD_USB is not set
> >  # CONFIG_INPUT_SPECIALKEYS is not set
> >  # end of Input device support
> > @@ -833,7 +777,6 @@
> >  #
> >  # DMA support
> >  #
> > -CONFIG_MXS_APBH_DMA=y
> >  # end of DMA support
> >
> >  CONFIG_GPIOLIB=y
> > @@ -844,12 +787,7 @@
> >  CONFIG_GPIO_74164=y
> >  # CONFIG_GPIO_GENERIC_PLATFORM is not set
> >  CONFIG_GPIO_IMX=y
> > -CONFIG_GPIO_VF610=y
> > -# CONFIG_GPIO_PCA953X is not set
> > -# CONFIG_GPIO_PCF857X is not set
> > -CONFIG_GPIO_STMPE=y
> >  # CONFIG_GPIO_DESIGNWARE is not set
> > -# CONFIG_GPIO_SX150X is not set
> >  # end of GPIO
> >
> >  # CONFIG_W1 is not set
> > @@ -860,14 +798,9 @@
> >  CONFIG_PINCTRL=y
> >  CONFIG_PINCTRL_IMX_IOMUX_V3=y
> >  # CONFIG_PINCTRL_SINGLE is not set
> > -CONFIG_PINCTRL_VF610=y
> >  # end of Pin controllers
> >
> > -CONFIG_NVMEM=y
> > -# CONFIG_NVMEM_SNVS_LPGPR is not set
> > -CONFIG_IMX_OCOTP=y
> > -# CONFIG_IMX_OCOTP_WRITE is not set
> > -# CONFIG_EEPROM_93XX46 is not set
> > +# CONFIG_NVMEM is not set
> >
> >  #
> >  # Bus devices
> > @@ -877,8 +810,6 @@
> >
> >  CONFIG_REGULATOR=y
> >  CONFIG_REGULATOR_FIXED=y
> > -# CONFIG_REGULATOR_PFUZE is not set
> > -# CONFIG_REGULATOR_ANATOP is not set
> >
> >  #
> >  # Remoteproc drivers
> > @@ -992,16 +923,14 @@
> >  # CONFIG_BASE64 is not set
> >  CONFIG_PROCESS_ESCAPE_SEQUENCE=y
> >  CONFIG_LZO_DECOMPRESS=y
> > -CONFIG_BCH=y
> >  CONFIG_FNMATCH=y
> >  CONFIG_QSORT=y
> >  CONFIG_LIBSCAN=y
> >  CONFIG_LIBUBIGEN=y
> > -CONFIG_STMP_DEVICE=y
> >  # CONFIG_RATP is not set
> >  # CONFIG_ALLOW_PRNG_FALLBACK is not set
> >  # CONFIG_CRC_CCITT is not set
> > -CONFIG_CRC8=y
> > +# CONFIG_CRC8 is not set
> >
> >
> >
> >
> >>
> >> Can you try with same toolchain? If that works, it
> >> might be a compiler issue? What are you using?
> >>
> >>>
> >>> /Lars Pedersen
> >>>
> >>> On Mon, 3 Aug 2020 at 12:10, Ahmad Fatoum <a.fatoum@pengutronix.de> wrote:
> >>>>
> >>>> Hi,
> >>>>
> >>>> On 7/29/20 6:52 PM, Lars Pedersen wrote:
> >>>>> I have spent the last couple of days trying to port our bootloader
> >>>>> from u-boot to barebox 2020.07 but have yet to get any console output.
> >>>>> Our product is based on tqma7d i.MX7 dual core cpu and uses UART4 for
> >>>>> serial console and boots from internal eMMC.
> >>>>>
> >>>>> I created a new board inspired from "NXP i.MX7 SabreSD board" and
> >>>>> tried to only add the basic in the first step to get a console output
> >>>>> working. The image is built using ptxdist and the imx_v7_defconfig
> >>>>> where the new board is selected. The image is flashed with "dd
> >>>>> if=barebox-image of=/dev/mmcblk0 bs=1024 skip=1 seek=1 conv=fsync".
> >>>>> The device works using u-boot 2020.07 with the same device trees but
> >>>>> we thought it was time to try out barebox since u-boot felt a little
> >>>>> bloated :)
> >>>>>
> >>>>> So can anyone be of assistance and tell me what I'm missing?
> >>>>
> >>>> When I looked through your patch the first time, I just looked
> >>>> for stuff that would cause it to not boot. Some more comments
> >>>> inline that are unrelated to your boot problems.
> >>>>
> >>>>>
> >>>>> /Lars Pedersen
> >>>>>
> >>>>> From: Lars Pedersen <laa@kamstrup.com>
> >>>>> Date: Tue, 28 Jul 2020 08:57:57 +0000
> >>>>> Subject: [PATCH] Add kamstrup imx7d dev board
> >>>>>
> >>>>> ---
> >>>>>  arch/arm/boards/Makefile                           |   1 +
> >>>>>  arch/arm/boards/kamstrup-imx7d-tqma7d/Makefile     |   2 +
> >>>>>  arch/arm/boards/kamstrup-imx7d-tqma7d/board.c      |  19 ++
> >>>>>  .../flash-header-kamstrup-imx7d-tqma7d.imxcfg      |  79 ++++++
> >>>>>  arch/arm/boards/kamstrup-imx7d-tqma7d/lowlevel.c   |  35 +++
> >>>>>  arch/arm/dts/Makefile                              |   1 +
> >>>>>  arch/arm/dts/imx7d-flex-concentrator-mfg.dts       |  11 +
> >>>>>  arch/arm/mach-imx/Kconfig                          |   5 +
> >>>>>  drivers/regulator/Kconfig                          |   2 +-
> >>>>>  dts/src/arm/imx7d-flex-concentrator-mfg.dts        |  25 ++
> >>>>>  dts/src/arm/imx7d-flex-concentrator.dts            | 313 +++++++++++++++++++++
> >>>>>  images/Makefile.imx                                |   5 +
> >>>>>  12 files changed, 497 insertions(+), 1 deletion(-)
> >>>>>  create mode 100644 arch/arm/boards/kamstrup-imx7d-tqma7d/Makefile
> >>>>>  create mode 100644 arch/arm/boards/kamstrup-imx7d-tqma7d/board.c
> >>>>>  create mode 100644
> >>>>> arch/arm/boards/kamstrup-imx7d-tqma7d/flash-header-kamstrup-imx7d-tqma7d.imxcfg
> >>>>>  create mode 100644 arch/arm/boards/kamstrup-imx7d-tqma7d/lowlevel.c
> >>>>>  create mode 100644 arch/arm/dts/imx7d-flex-concentrator-mfg.dts
> >>>>>  create mode 100644 dts/src/arm/imx7d-flex-concentrator-mfg.dts
> >>>>>  create mode 100644 dts/src/arm/imx7d-flex-concentrator.dts
> >>>>>
> >>>>> diff --git a/arch/arm/boards/Makefile b/arch/arm/boards/Makefile
> >>>>> index e9e9163d589b..58bb4cf2adab 100644
> >>>>> --- a/arch/arm/boards/Makefile
> >>>>> +++ b/arch/arm/boards/Makefile
> >>>>> @@ -64,6 +64,7 @@ obj-$(CONFIG_MACH_HIGHBANK)            += highbank/
> >>>>>  obj-$(CONFIG_MACH_IMX21ADS)            += freescale-mx21-ads/
> >>>>>  obj-$(CONFIG_MACH_IMX233_OLINUXINO)        += imx233-olinuxino/
> >>>>>  obj-$(CONFIG_MACH_IMX27ADS)            += freescale-mx27-ads/
> >>>>> +obj-$(CONFIG_MACH_KAMSTRUP_IMX7D_TQMA7D)    += kamstrup-imx7d-tqma7d/
> >>>>>  obj-$(CONFIG_MACH_KINDLE3)            += kindle3/
> >>>>>  obj-$(CONFIG_MACH_KONTRON_SAMX6I)        += kontron-samx6i/
> >>>>>  obj-$(CONFIG_MACH_LENOVO_IX4_300D)        += lenovo-ix4-300d/
> >>>>> diff --git a/arch/arm/boards/kamstrup-imx7d-tqma7d/Makefile
> >>>>> b/arch/arm/boards/kamstrup-imx7d-tqma7d/Makefile
> >>>>> new file mode 100644
> >>>>> index 000000000000..01c7a259e9a5
> >>>>> --- /dev/null
> >>>>> +++ b/arch/arm/boards/kamstrup-imx7d-tqma7d/Makefile
> >>>>> @@ -0,0 +1,2 @@
> >>>>> +obj-y += board.o
> >>>>> +lwl-y += lowlevel.o
> >>>>> diff --git a/arch/arm/boards/kamstrup-imx7d-tqma7d/board.c
> >>>>> b/arch/arm/boards/kamstrup-imx7d-tqma7d/board.c
> >>>>> new file mode 100644
> >>>>> index 000000000000..b3ffa851f3e6
> >>>>> --- /dev/null
> >>>>> +++ b/arch/arm/boards/kamstrup-imx7d-tqma7d/board.c
> >>>>> @@ -0,0 +1,19 @@
> >>>>> +// SPDX-License-Identifier: GPL-2.0-or-later
> >>>>> +// SPDX-FileCopyrightText: 2020 Kamstrup A/S
> >>>>> +
> >>>>> +/* Author: Lars Pedersen <lapeddk@gmail.com> */
> >>>>> +
> >>>>> +#include <common.h>
> >>>>> +#include <init.h>
> >>>>> +#include <io.h>
> >>>>> +#include <mach/imx7-regs.h>
> >>>>> +#include <mfd/imx7-iomuxc-gpr.h>
> >>>>> +
> >>>>> +static int kamstrup_mx7_tqma7d_coredevices_init(void)
> >>>>> +{
> >>>>> +    if (!of_machine_is_compatible("kam,imx7d-flex-concentrator"))
> >>>>> +        return 0;
> >>>>> +
> >>>>> +    return 0;
> >>>>> +}
> >>>>
> >>>> Function serves no purpose. If you don't have baord code, drop it altogether.
> >>>>
> >>>
> >>> I'll do a cleanup when I have it working :D
> >>>
> >>>>> +coredevice_initcall(kamstrup_mx7_tqma7d_coredevices_init);
> >>>>> diff --git a/arch/arm/boards/kamstrup-imx7d-tqma7d/flash-header-kamstrup-imx7d-tqma7d.imxcfg
> >>>>> b/arch/arm/boards/kamstrup-imx7d-tqma7d/flash-header-kamstrup-imx7d-tqma7d.imxcfg
> >>>>> new file mode 100644
> >>>>> index 000000000000..7656619c1b2e
> >>>>> --- /dev/null
> >>>>> +++ b/arch/arm/boards/kamstrup-imx7d-tqma7d/flash-header-kamstrup-imx7d-tqma7d.imxcfg
> >>>>> @@ -0,0 +1,79 @@
> >>>>> +soc imx7
> >>>>> +loadaddr 0x80000000
> >>>>> +dcdofs 0x400
> >>>>
> >>>> Called ivtofs now in barebox next branch now.
> >>>>
> >>>
> >>> Okay thanks.
> >>>
> >>>>> diff --git a/arch/arm/dts/imx7d-flex-concentrator-mfg.dts
> >>>>> b/arch/arm/dts/imx7d-flex-concentrator-mfg.dts
> >>>>> new file mode 100644
> >>>>> index 000000000000..746e36a70f4c
> >>>>> --- /dev/null
> >>>>> +++ b/arch/arm/dts/imx7d-flex-concentrator-mfg.dts
> >>>>> @@ -0,0 +1,11 @@
> >>>>> +/*
> >>>>> + * The code contained herein is licensed under the GNU General Public
> >>>>> + * License. You may obtain a copy of the GNU General Public License
> >>>>> + * Version 2 or later at the following locations:
> >>>>> + *
> >>>>> + * http://www.opensource.org/licenses/gpl-license.html
> >>>>> + * http://www.gnu.org/copyleft/gpl.html
> >>>>> + */
> >>>>> +
> >>>>> +#include <arm/imx7d-flex-concentrator-mfg.dts>
> >>>>> +
> >>>>> diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
> >>>>> index 6dd5cb2aca15..d0a9332c7a24 100644
> >>>>> --- a/arch/arm/mach-imx/Kconfig
> >>>>> +++ b/arch/arm/mach-imx/Kconfig
> >>>>> @@ -492,6 +492,11 @@ config MACH_ZII_IMX7D_DEV
> >>>>>      select ARCH_IMX7
> >>>>>      select ARM_USE_COMPRESSED_DTB
> >>>>>
> >>>>> +config MACH_KAMSTRUP_IMX7D_TQMA7D
> >>>>> +    bool "Kamstrup TQMa7D based devices"
> >>>>> +    select ARCH_IMX7
> >>>>> +    select ARM_USE_COMPRESSED_DTB
> >>>>> +
> >>>>>  config MACH_PHYTEC_PHYCORE_IMX7
> >>>>>      bool "Phytec phyCORE i.MX7"
> >>>>>      select ARCH_IMX7
> >>>>> diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
> >>>>> index 1ce057180a01..b0bdc48399e3 100644
> >>>>> --- a/drivers/regulator/Kconfig
> >>>>> +++ b/drivers/regulator/Kconfig
> >>>>> @@ -19,7 +19,7 @@ config REGULATOR_BCM283X
> >>>>>  config REGULATOR_PFUZE
> >>>>>      bool "Freescale PFUZE100/200/3000 regulator driver"
> >>>>>      depends on I2C
> >>>>> -    depends on ARCH_IMX6 || ARCH_IMX8MQ
> >>>>> +    depends on ARCH_IMX6 || ARCH_IMX7 || ARCH_IMX8MQ
> >>>>>
> >>>>>  config REGULATOR_STM32_PWR
> >>>>>      bool "STMicroelectronics STM32 PWR"
> >>>>> diff --git a/dts/src/arm/imx7d-flex-concentrator-mfg.dts
> >>>>> b/dts/src/arm/imx7d-flex-concentrator-mfg.dts
> >>>>> new file mode 100644
> >>>>> index 000000000000..789f0837058f
> >>>>> --- /dev/null
> >>>>> +++ b/dts/src/arm/imx7d-flex-concentrator-mfg.dts
> >>>>
> >>>> Perfectly fine for your patch stack in BSP, but if you want to upstream
> >>>> it, you need to either:
> >>>>
> >>>> 1) upstream your device tree to Linux. dts/ is a sync with Linux and
> >>>>    shortly after, it will be imported into barebox
> >>>> 2) put your device tree in arch/arm/dts
> >>>>
> >>> The dts will upstreamed soon. Hopefully :D
> >>>
> >>
> >> --
> >> Pengutronix e.K.                           |                             |
> >> Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
> >> 31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
> >> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
> >
>
> --
> Pengutronix e.K.                           |                             |
> Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
> 31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Getting serial console output on new imx7d tqma7 board UART4
  2020-08-05  9:37           ` Lars Pedersen
@ 2020-08-05  9:48             ` Ahmad Fatoum
  2020-08-05 11:12               ` Lars Pedersen
  0 siblings, 1 reply; 20+ messages in thread
From: Ahmad Fatoum @ 2020-08-05  9:48 UTC (permalink / raw)
  To: Lars Pedersen; +Cc: barebox

On 8/5/20 11:37 AM, Lars Pedersen wrote:
> Hi. I got both the EVK and our TQMa7d board working with using the
> full imx_v7_defconfig! So that's progress :)

Oh. Can you turn them off stepwise to see, which config option
is missing? (If my suspicion below isn't true)


> See my inline comments

>> To make sure this does work as intended, I just built barebox with
>> only barebox-freescale-mx7-sabresd.img selected and it works fine for me:
>>
> 
> What's the size of that image? I just retested and I can't get it
> working when only the sabresd board is selected for compilation.

532K.

>> Are you sure the board is strapped correctly to boot from SD?
> 
> I got the board configuration as:
> 
> SW3 = 10
> SW2 = 00100000

I skimmed through your config,
-CONFIG_RELOCATABLE=y
+# CONFIG_RELOCATABLE is not set
CONFIG_TEXT_BASE=0x0

Text base is ignored, when you are relocatable. If you aren't relocatable,
you need a valid address as your text base. Why did you turn it off?

Cheers,
Ahmad

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Getting serial console output on new imx7d tqma7 board UART4
  2020-08-05  9:48             ` Ahmad Fatoum
@ 2020-08-05 11:12               ` Lars Pedersen
  2020-08-05 12:30                 ` Ahmad Fatoum
  0 siblings, 1 reply; 20+ messages in thread
From: Lars Pedersen @ 2020-08-05 11:12 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox

Hi. I also got it working with a single board compilation now.

You are correct that it is the CONFIG_RELOCATABLE that is the issue.
If I select this it works.

/Lars Pedersen

On Wed, 5 Aug 2020 at 11:48, Ahmad Fatoum <a.fatoum@pengutronix.de> wrote:
>
> On 8/5/20 11:37 AM, Lars Pedersen wrote:
> > Hi. I got both the EVK and our TQMa7d board working with using the
> > full imx_v7_defconfig! So that's progress :)
>
> Oh. Can you turn them off stepwise to see, which config option
> is missing? (If my suspicion below isn't true)
>
>
> > See my inline comments
>
> >> To make sure this does work as intended, I just built barebox with
> >> only barebox-freescale-mx7-sabresd.img selected and it works fine for me:
> >>
> >
> > What's the size of that image? I just retested and I can't get it
> > working when only the sabresd board is selected for compilation.
>
> 532K.
>
> >> Are you sure the board is strapped correctly to boot from SD?
> >
> > I got the board configuration as:
> >
> > SW3 = 10
> > SW2 = 00100000
>
> I skimmed through your config,
> -CONFIG_RELOCATABLE=y
> +# CONFIG_RELOCATABLE is not set
> CONFIG_TEXT_BASE=0x0
>
> Text base is ignored, when you are relocatable. If you aren't relocatable,
> you need a valid address as your text base. Why did you turn it off?

I didn't turn it off. It isn't selected by MACH_FREESCALE_MX7_SABRESD
so it gets turned off if only this board is used. It is selected by 6
other boards, which is the reason it works when compiling for all
boards.

 Symbol: RELOCATABLE [=y]
 Type  : bool
 Defined at common/Kconfig:336
   Prompt: generate relocatable barebox binary
   Depends on: PPC || ARM [=y]
   Location:
 (2) -> General Settings
 Selected by [y]:
   - MACH_CCMX51 [=y] && ARCH_IMX [=y] && IMX_MULTI_BOARDS [=y]
 Selected by [n]:
   - ARCH_BCM283X [=n] && <choice>
   - ARCH_TEGRA [=n] && <choice>
   - ARCH_ZYNQMP [=n] && <choice>
   - MACH_VEXPRESS [=n] && <choice>
   - ARCH_ZYNQ7000 [=n] && ARCH_ZYNQ [=n]


>
> Cheers,
> Ahmad
>
> --
> Pengutronix e.K.                           |                             |
> Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
> 31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Getting serial console output on new imx7d tqma7 board UART4
  2020-08-05 11:12               ` Lars Pedersen
@ 2020-08-05 12:30                 ` Ahmad Fatoum
  2020-08-05 15:00                   ` Lars Pedersen
  0 siblings, 1 reply; 20+ messages in thread
From: Ahmad Fatoum @ 2020-08-05 12:30 UTC (permalink / raw)
  To: Lars Pedersen, Sascha Hauer; +Cc: barebox

Hello,

On 8/5/20 1:12 PM, Lars Pedersen wrote:
>> Text base is ignored, when you are relocatable. If you aren't relocatable,
>> you need a valid address as your text base. Why did you turn it off?
> 
> I didn't turn it off. It isn't selected by MACH_FREESCALE_MX7_SABRESD
> so it gets turned off if only this board is used. It is selected by 6
> other boards, which is the reason it works when compiling for all
> boards.

I don't think that's how it works. If it was =y and the select went
away because of CONFIG_MACH_CCMX51=n, it remains at =y. I just tested
it and that's the behavior I observed.


I am not sure what we could do better here. You can use barebox
as non-relocatable binary if you set CONFIG_TEXT_BASE to a sensible
value. You might want this if you are keen on reducing barebox size
further at cost of portability. So having a select here to ensure
it's always set won't work.

We can also not set a suitable CONFIG_TEXT_BASE at Kconfig level,
because, due to multi-image support, we may be building different
boards with different TEXT_BASEs...

We could have RELOCATABLE be default y as it's a more sensible default
though. Sascha, what do you think?

> 
>  Symbol: RELOCATABLE [=y]
>  Type  : bool
>  Defined at common/Kconfig:336
>    Prompt: generate relocatable barebox binary
>    Depends on: PPC || ARM [=y]
>    Location:
>  (2) -> General Settings
>  Selected by [y]:
>    - MACH_CCMX51 [=y] && ARCH_IMX [=y] && IMX_MULTI_BOARDS [=y]
>  Selected by [n]:
>    - ARCH_BCM283X [=n] && <choice>
>    - ARCH_TEGRA [=n] && <choice>
>    - ARCH_ZYNQMP [=n] && <choice>
>    - MACH_VEXPRESS [=n] && <choice>
>    - ARCH_ZYNQ7000 [=n] && ARCH_ZYNQ [=n]
> 
> 
>>
>> Cheers,
>> Ahmad
>>
>> --
>> Pengutronix e.K.                           |                             |
>> Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
>> 31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
>> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Getting serial console output on new imx7d tqma7 board UART4
  2020-08-05 12:30                 ` Ahmad Fatoum
@ 2020-08-05 15:00                   ` Lars Pedersen
  2020-08-10  8:00                     ` Sascha Hauer
  0 siblings, 1 reply; 20+ messages in thread
From: Lars Pedersen @ 2020-08-05 15:00 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox

Hi. Thanks for your patience :D

/Lars Pedersen

On Wed, 5 Aug 2020 at 14:30, Ahmad Fatoum <a.fatoum@pengutronix.de> wrote:
>
> Hello,
>
> On 8/5/20 1:12 PM, Lars Pedersen wrote:
> >> Text base is ignored, when you are relocatable. If you aren't relocatable,
> >> you need a valid address as your text base. Why did you turn it off?
> >
> > I didn't turn it off. It isn't selected by MACH_FREESCALE_MX7_SABRESD
> > so it gets turned off if only this board is used. It is selected by 6
> > other boards, which is the reason it works when compiling for all
> > boards.
>
> I don't think that's how it works. If it was =y and the select went
> away because of CONFIG_MACH_CCMX51=n, it remains at =y. I just tested
> it and that's the behavior I observed.

If I use the imx_v7_defconfig and go and deselect  "ConnectCore
i.MX51" (MACH_CCMX51), then RELOCATABLE will change from =y to =n

So in other words. Deselecting this one board (MACH_CCMX51) will set
RELOCATABLE=n and now all the boards rely on CONFIG_TEXT_BASE to be
set correct. And as you also mentioned later on, this will be an
issue.

>
>
> I am not sure what we could do better here. You can use barebox
> as non-relocatable binary if you set CONFIG_TEXT_BASE to a sensible
> value. You might want this if you are keen on reducing barebox size
> further at cost of portability. So having a select here to ensure
> it's always set won't work.
>
> We can also not set a suitable CONFIG_TEXT_BASE at Kconfig level,
> because, due to multi-image support, we may be building different
> boards with different TEXT_BASEs...
>
> We could have RELOCATABLE be default y as it's a more sensible default
> though. Sascha, what do you think?
>
> >
> >  Symbol: RELOCATABLE [=y]
> >  Type  : bool
> >  Defined at common/Kconfig:336
> >    Prompt: generate relocatable barebox binary
> >    Depends on: PPC || ARM [=y]
> >    Location:
> >  (2) -> General Settings
> >  Selected by [y]:
> >    - MACH_CCMX51 [=y] && ARCH_IMX [=y] && IMX_MULTI_BOARDS [=y]
> >  Selected by [n]:
> >    - ARCH_BCM283X [=n] && <choice>
> >    - ARCH_TEGRA [=n] && <choice>
> >    - ARCH_ZYNQMP [=n] && <choice>
> >    - MACH_VEXPRESS [=n] && <choice>
> >    - ARCH_ZYNQ7000 [=n] && ARCH_ZYNQ [=n]
> >
> >
> >>
> >> Cheers,
> >> Ahmad
> >>
> >> --
> >> Pengutronix e.K.                           |                             |
> >> Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
> >> 31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
> >> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
> >
>
> --
> Pengutronix e.K.                           |                             |
> Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
> 31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Getting serial console output on new imx7d tqma7 board UART4
  2020-08-05 15:00                   ` Lars Pedersen
@ 2020-08-10  8:00                     ` Sascha Hauer
  0 siblings, 0 replies; 20+ messages in thread
From: Sascha Hauer @ 2020-08-10  8:00 UTC (permalink / raw)
  To: Lars Pedersen; +Cc: barebox, Ahmad Fatoum

On Wed, Aug 05, 2020 at 05:00:06PM +0200, Lars Pedersen wrote:
> Hi. Thanks for your patience :D
> 
> /Lars Pedersen
> 
> On Wed, 5 Aug 2020 at 14:30, Ahmad Fatoum <a.fatoum@pengutronix.de> wrote:
> >
> > Hello,
> >
> > On 8/5/20 1:12 PM, Lars Pedersen wrote:
> > >> Text base is ignored, when you are relocatable. If you aren't relocatable,
> > >> you need a valid address as your text base. Why did you turn it off?
> > >
> > > I didn't turn it off. It isn't selected by MACH_FREESCALE_MX7_SABRESD
> > > so it gets turned off if only this board is used. It is selected by 6
> > > other boards, which is the reason it works when compiling for all
> > > boards.
> >
> > I don't think that's how it works. If it was =y and the select went
> > away because of CONFIG_MACH_CCMX51=n, it remains at =y. I just tested
> > it and that's the behavior I observed.
> 
> If I use the imx_v7_defconfig and go and deselect  "ConnectCore
> i.MX51" (MACH_CCMX51), then RELOCATABLE will change from =y to =n
> 
> So in other words. Deselecting this one board (MACH_CCMX51) will set
> RELOCATABLE=n and now all the boards rely on CONFIG_TEXT_BASE to be
> set correct. And as you also mentioned later on, this will be an
> issue.

That's strange. I can confirm what Ahmad said: starting from
imx_v7_defconfig and deselecting MACH_CCMX51 still leaves RELOCATABLE
enabled here. I have no idea why this is different for you.

Anyway, on i.MX a barebox binary with RELOCATABLE disabled only works in
very special cases and requires setting TEXT_BASE to a suitable value,
one that works on all boards selected. It would be nice to hide
RELOCATABLE from the user in most cases.

Sascha


-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2020-08-10  8:00 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-29 16:52 Getting serial console output on new imx7d tqma7 board UART4 Lars Pedersen
2020-07-29 17:22 ` Ahmad Fatoum
2020-07-30  6:58   ` Lars Pedersen
2020-07-30  7:25     ` Ahmad Fatoum
2020-07-30 10:16       ` Lars Pedersen
2020-07-30 13:55         ` Ahmad Fatoum
2020-08-03  7:56           ` Lars Pedersen
2020-08-03 21:51         ` Sascha Hauer
2020-08-04 12:53           ` Lars Pedersen
2020-08-03 10:10 ` Ahmad Fatoum
2020-08-04 13:07   ` Lars Pedersen
2020-08-04 16:15     ` Ahmad Fatoum
2020-08-04 19:21       ` Lars Pedersen
2020-08-05  8:49         ` Ahmad Fatoum
2020-08-05  9:37           ` Lars Pedersen
2020-08-05  9:48             ` Ahmad Fatoum
2020-08-05 11:12               ` Lars Pedersen
2020-08-05 12:30                 ` Ahmad Fatoum
2020-08-05 15:00                   ` Lars Pedersen
2020-08-10  8:00                     ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox