[PATCH] .gitignore: add files produced by b4

2022-06-07 Thread Andrey Zhizhikin
b4 utility [1] is introduced by Linux Kernel developers and used to
fetch patches and patch series from lore.kernel.org and is proven
to be useful for U-Boot development. Detailed usage of the tool can be
read under post from the original author [2].

This tool fetches files from the list and populates the source folder
with additional files (*.cover and *.mbx) which are not ignored by git
and shown as newly added files.

Add those file patterns into .gitignore file, so they can be safely
skipped during changes attestation.

Link: [1]: https://pypi.org/project/b4/
Link: [2]: 
https://people.kernel.org/monsieuricon/introducing-b4-and-patch-attestation
Signed-off-by: Andrey Zhizhikin 
---
 .gitignore | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/.gitignore b/.gitignore
index 28c439f09f..eb769f144c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,6 +10,7 @@
 *.asn1.[ch]
 *.bin
 *.cfgout
+*.cover
 *.dtb
 *.dtbo
 *.dtb.S
@@ -22,6 +23,7 @@
 *.lex.c
 *.lst
 *.mod.c
+*.mbx
 *.o
 *.o.*
 *.order

base-commit: 8f527342db4160a1f030de6fe4a1591787cce65a
-- 
2.25.1



[PATCH 2/2] clk: imx8mp: use usb_core_ref for usb_root_clk

2022-06-03 Thread Andrey Zhizhikin
Upstream commit 7a2c3be95a50 ("clk: imx8mp: Fill in DWC3 USB, USB PHY,
HSIOMIX clock") added usb_core_ref for USB Controller but never set it
to be used as a clock source, using rather "osc_32k" instead.

This produces following boot log message:
"clk_register: failed to get osc_32k device (parent of usb_root_clk)"

Fix the USB controller clock source by using usb_core_ref instead of
osc_32k.

Fixes: 7a2c3be95a50 ("clk: imx8mp: Fill in DWC3 USB, USB PHY, HSIOMIX clock")
Signed-off-by: Andrey Zhizhikin 
Cc: Fabio Estevam 
Cc: Peng Fan 
Cc: Stefano Babic 
---
 drivers/clk/imx/clk-imx8mp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/imx/clk-imx8mp.c b/drivers/clk/imx/clk-imx8mp.c
index cbed86a684..ffbc1d1ba9 100644
--- a/drivers/clk/imx/clk-imx8mp.c
+++ b/drivers/clk/imx/clk-imx8mp.c
@@ -300,7 +300,7 @@ static int imx8mp_clk_probe(struct udevice *dev)
clk_dm(IMX8MP_CLK_UART2_ROOT, imx_clk_gate4("uart2_root_clk", "uart2", 
base + 0x44a0, 0));
clk_dm(IMX8MP_CLK_UART3_ROOT, imx_clk_gate4("uart3_root_clk", "uart3", 
base + 0x44b0, 0));
clk_dm(IMX8MP_CLK_UART4_ROOT, imx_clk_gate4("uart4_root_clk", "uart4", 
base + 0x44c0, 0));
-   clk_dm(IMX8MP_CLK_USB_ROOT, imx_clk_gate4("usb_root_clk", "osc_32k", 
base + 0x44d0, 0));
+   clk_dm(IMX8MP_CLK_USB_ROOT, imx_clk_gate4("usb_root_clk", 
"usb_core_ref", base + 0x44d0, 0));
clk_dm(IMX8MP_CLK_USB_PHY_ROOT, imx_clk_gate4("usb_phy_root_clk", 
"usb_phy_ref", base + 0x44f0, 0));
clk_dm(IMX8MP_CLK_USDHC1_ROOT, imx_clk_gate4("usdhc1_root_clk", 
"usdhc1", base + 0x4510, 0));
clk_dm(IMX8MP_CLK_USDHC2_ROOT, imx_clk_gate4("usdhc2_root_clk", 
"usdhc2", base + 0x4520, 0));
-- 
2.25.1



[PATCH 1/2] clk: imx8mp: fix root clock names for ecspi

2022-06-03 Thread Andrey Zhizhikin
Root clock name contained underscore, which does not match to the actual
clock name.

Correct the name to match what is present in the FDT.

Fixes: 87f958810fcb ("clk: imx8mp: Add ECSPI clocks")
Signed-off-by: Andrey Zhizhikin 
Cc: Fabio Estevam 
Cc: Peng Fan 
Cc: Stefano Babic 
Cc: uboot-imx 
---
 drivers/clk/imx/clk-imx8mp.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/clk/imx/clk-imx8mp.c b/drivers/clk/imx/clk-imx8mp.c
index ac727b7e40..cbed86a684 100644
--- a/drivers/clk/imx/clk-imx8mp.c
+++ b/drivers/clk/imx/clk-imx8mp.c
@@ -122,15 +122,15 @@ static const char *imx8mp_gic_sels[] = {"clock-osc-24m", 
"sys_pll2_200m", "sys_p
"sys_pll2_100m", "sys_pll1_800m",
"sys_pll2_500m", "clk_ext4", 
"audio_pll2_out" };
 
-static const char *imx8mp_ecspi1_sels[] = {"clock-osc_24m", "sys_pll2_200m", 
"sys_pll1_40m",
+static const char *imx8mp_ecspi1_sels[] = {"clock-osc-24m", "sys_pll2_200m", 
"sys_pll1_40m",
  "sys_pll1_160m", 
"sys_pll1_800m", "sys_pll3_out",
  "sys_pll2_250m", 
"audio_pll2_out", };
 
-static const char *imx8mp_ecspi2_sels[] = {"clock-osc_24m", "sys_pll2_200m", 
"sys_pll1_40m",
+static const char *imx8mp_ecspi2_sels[] = {"clock-osc-24m", "sys_pll2_200m", 
"sys_pll1_40m",
  "sys_pll1_160m", 
"sys_pll1_800m", "sys_pll3_out",
  "sys_pll2_250m", 
"audio_pll2_out", };
 
-static const char *imx8mp_ecspi3_sels[] = {"clock-osc_24m", "sys_pll2_200m", 
"sys_pll1_40m",
+static const char *imx8mp_ecspi3_sels[] = {"clock-osc-24m", "sys_pll2_200m", 
"sys_pll1_40m",
  "sys_pll1_160m", 
"sys_pll1_800m", "sys_pll3_out",
  "sys_pll2_250m", 
"audio_pll2_out", };
 
-- 
2.25.1



[PATCH 0/2] clk: imx8mp: clock names and clock source fixes

2022-06-03 Thread Andrey Zhizhikin
This series addresses few fixes for clock sub-system for i.MX8MP SOC.

One is dealing with incorrect names used, while the second one addresses
root clock selection which has been apparently omitted during merge and
caused the warning to be reported during boot.

Andrey Zhizhikin (2):
  clk: imx8mp: fix root clock names for ecspi
  clk: imx8mp: use usb_core_ref for usb_root_clk

 drivers/clk/imx/clk-imx8mp.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)


base-commit: 3053b781465711fd05b88ab141b1f2b55a875516
-- 
2.25.1



[PATCH] env: do not fail on non-existing env.in file

2022-04-03 Thread Andrey Zhizhikin
If include/generated/env.in does not exist, which is a typical case for
clean build, quiet_cmd_gen_envp command tries to delete this file
unconditionally.

This produces following warning during the build:
  ENVPinclude/generated/env.in
rm: cannot remove 'include/generated/env.in': No such file or directory

Add '-f' option to the `rm` command to not complain if file does not
exist.

Fixes: f432eb6d8a9d ("env: Avoid using a leftover text-environment file")
Signed-off-by: Andrey Zhizhikin 
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 4672147318..868445bf33 100644
--- a/Makefile
+++ b/Makefile
@@ -1846,7 +1846,7 @@ quiet_cmd_gen_envp = ENVP$@
-I$(srctree)/arch/$(ARCH)/include \
$< -o $@; \
else \
-   rm $@; \
+   rm -f $@; \
touch $@ ; \
fi
 include/generated/env.in: include/generated/env.txt FORCE
-- 
2.25.1



[PATCH] imx8m: lock id_swap_bypass bit in tzc380 enable

2022-01-24 Thread Andrey Zhizhikin
According to TRM for i.MX8M Nano and Plus, GPR10 register contains lock
bit for TZASC_ID_SWAP_BYPASS bit. This bit is required to be set in
order to avoid AXI bus errors when GPU is enabled on the platform.
TZASC_ID_SWAP_BYPASS bit is alread set for all imx8m applicable
derivatives, but is missing a lock settings to be applied.

Set the TZASC_ID_SWAP_BYPASS_LOCK bit for those derivatives which have
it implemented.

Since we're here, provide also names to bits from TRM instead of using
BIT() macro in the code.

Fixes: deca6cfbf5d7 ("imx8mn: set BYPASS ID SWAP to avoid AXI bus errors")
Fixes: a07c7181296f ("imx8mp: set BYPASS ID SWAP to avoid AXI bus errors")
Signed-off-by: Andrey Zhizhikin 
Cc: Peng Fan 
---
 arch/arm/include/asm/arch-imx8m/imx-regs.h |  6 --
 arch/arm/mach-imx/imx8m/soc.c  | 15 ++-
 2 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/arch/arm/include/asm/arch-imx8m/imx-regs.h 
b/arch/arm/include/asm/arch-imx8m/imx-regs.h
index b800da13a1..45d95a7c19 100644
--- a/arch/arm/include/asm/arch-imx8m/imx-regs.h
+++ b/arch/arm/include/asm/arch-imx8m/imx-regs.h
@@ -80,8 +80,10 @@
 #include 
 #include 
 
-#define GPR_TZASC_EN   BIT(0)
-#define GPR_TZASC_EN_LOCK  BIT(16)
+#define GPR_TZASC_EN   BIT(0)
+#define GPR_TZASC_ID_SWAP_BYPASS   BIT(1)
+#define GPR_TZASC_EN_LOCK  BIT(16)
+#define GPR_TZASC_ID_SWAP_BYPASS_LOCK  BIT(17)
 
 #define SRC_SCR_M4_ENABLE_OFFSET   3
 #define SRC_SCR_M4_ENABLE_MASK BIT(3)
diff --git a/arch/arm/mach-imx/imx8m/soc.c b/arch/arm/mach-imx/imx8m/soc.c
index 863508776d..5f5175b4dd 100644
--- a/arch/arm/mach-imx/imx8m/soc.c
+++ b/arch/arm/mach-imx/imx8m/soc.c
@@ -66,8 +66,21 @@ void enable_tzc380(void)
/* Enable TZASC and lock setting */
setbits_le32(>gpr[10], GPR_TZASC_EN);
setbits_le32(>gpr[10], GPR_TZASC_EN_LOCK);
+
+   /*
+* According to TRM, TZASC_ID_SWAP_BYPASS should be set in
+* order to avoid AXI Bus errors when GPU is in use
+*/
if (is_imx8mm() || is_imx8mn() || is_imx8mp())
-   setbits_le32(>gpr[10], BIT(1));
+   setbits_le32(>gpr[10], GPR_TZASC_ID_SWAP_BYPASS);
+
+   /*
+* imx8mn and imx8mp implements the lock bit for
+* TZASC_ID_SWAP_BYPASS, enable it to lock settings
+*/
+   if (is_imx8mn() || is_imx8mp())
+   setbits_le32(>gpr[10], GPR_TZASC_ID_SWAP_BYPASS_LOCK);
+
/*
 * set Region 0 attribute to allow secure and non-secure
 * read/write permission. Found some masters like usb dwc3

base-commit: 21a1439d986a889cefbc2ed785c3f592fc9266de
-- 
2.25.1



[PATCH] imx8mn-ddr4-evk: generate single bootable image

2022-01-17 Thread Andrey Zhizhikin
As suggested in commit 028abfd9b157 ("imx8mm-evk: Generate a single
bootable flash.bin again") for imx8mm_evk, it is possible to produce
single bootable image via binman. This restores the original behavior in
distros, where only one boot container is used to create target image.

Perform similar adaptions in order to provide single bootable image for
imx8mn-ddr4-evk derivate.

Update documentation to drop additional step of copying u-boot.itb

Fixes: 353dfe4b4359 ("imx8mn-ddr4-evk: switch to use binman")
Signed-off-by: Andrey Zhizhikin 
---
 arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi  | 19 ++-
 .../imx8mn_evk/imximage-8mn-ddr4.cfg  |  2 +-
 doc/board/nxp/imx8mn_evk.rst  |  1 -
 3 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi 
b/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi
index 1d3844437d..2e39790766 100644
--- a/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi
+++ b/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi
@@ -157,7 +157,9 @@
};
 
 
-   flash {
+   spl {
+   filename = "spl.bin";
+
mkimage {
args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 
0x912000";
 
@@ -224,4 +226,19 @@
};
};
};
+
+   imx-boot {
+   filename = "flash.bin";
+   pad-byte = <0x00>;
+
+   spl: blob-ext@1 {
+   offset = <0x0>;
+   filename = "spl.bin";
+   };
+
+   uboot: blob-ext@2 {
+   offset = <0x58000>;
+   filename = "u-boot.itb";
+   };
+   };
 };
diff --git a/board/freescale/imx8mn_evk/imximage-8mn-ddr4.cfg 
b/board/freescale/imx8mn_evk/imximage-8mn-ddr4.cfg
index 22aec26da7..7286b26494 100644
--- a/board/freescale/imx8mn_evk/imximage-8mn-ddr4.cfg
+++ b/board/freescale/imx8mn_evk/imximage-8mn-ddr4.cfg
@@ -7,4 +7,4 @@
 
 ROM_VERSIONv2
 BOOT_FROM  sd
-LOADER mkimage.flash.mkimage   0x912000
+LOADER u-boot-spl-ddr.bin  0x912000
diff --git a/doc/board/nxp/imx8mn_evk.rst b/doc/board/nxp/imx8mn_evk.rst
index 9fbb947032..711545af89 100644
--- a/doc/board/nxp/imx8mn_evk.rst
+++ b/doc/board/nxp/imx8mn_evk.rst
@@ -50,7 +50,6 @@ Burn the flash.bin to MicroSD card offset 32KB:
 .. code-block:: bash
 
$sudo dd if=flash.bin of=/dev/sd[x] bs=1024 seek=32 conv=notrunc
-   $sudo dd if=u-boot.itb of=/dev/sd[x] bs=1024 seek=384 conv=notrunc
 
 Boot
 

base-commit: 4e81f3be340072ad2c0aac093677333702f14f22
-- 
2.25.1



[PATCH] imx: ventana: correct splashimage load address

2022-01-17 Thread Andrey Zhizhikin
Commit 72d81360aabd ("global: Convert CONFIG_LOADADDR to
CONFIG_SYS_LOADADDR") dropped the usage of LOADADDR and replaced it with
SYS_LOADADDR.

Use the correct macro in environment by replacing CONFIG_LOADADDR with
CONFIG_SYS_LOADADDR.

Fixes: d75ebf3482c3 ("imx: ventana: fix splash logo drawing")
Signed-off-by: Andrey Zhizhikin 
Cc: Tim Harvey 
---
 include/configs/gw_ventana.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/configs/gw_ventana.h b/include/configs/gw_ventana.h
index 513b2d4679..acd495f234 100644
--- a/include/configs/gw_ventana.h
+++ b/include/configs/gw_ventana.h
@@ -105,7 +105,7 @@
 
 #define CONFIG_EXTRA_ENV_SETTINGS_COMMON \
"splashpos=m,m\0" \
-   "splashimage=" __stringify(CONFIG_LOADADDR) "\0" \
+   "splashimage=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
"usb_pgood_delay=2000\0" \
"console=ttymxc1\0" \
"bootdevs=usb mmc sata flash\0" \

base-commit: d71dbe657c3c22f50ecb3df133e5cdd884daae7d
-- 
2.25.1



[PATCH v2] imx8mq_evk: configs: add/cleanup variables for distro boot

2022-01-16 Thread Andrey Zhizhikin
Add fdt_addr_r fdtfile which used by distro boot, and cleanup legacy
environment variables.

Signed-off-by: Andrey Zhizhikin 
---
Changes in V2:
- Correct config variable name, it should be SYS_LOAD_ADDR

 include/configs/imx8mq_evk.h | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/configs/imx8mq_evk.h b/include/configs/imx8mq_evk.h
index 6e1d387e2b..5f587f7336 100644
--- a/include/configs/imx8mq_evk.h
+++ b/include/configs/imx8mq_evk.h
@@ -61,13 +61,13 @@
 /* Initial environment variables */
 #define CONFIG_EXTRA_ENV_SETTINGS  \
BOOTENV \
-   "scriptaddr=0x4350\0" \
-   "kernel_addr_r=0x4088\0" \
+   "scriptaddr=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
+   "kernel_addr_r=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
"image=Image\0" \
"console=ttymxc0,115200\0" \
-   "fdt_addr=0x4300\0" \
+   "fdt_addr_r=0x4300\0"   \
"boot_fdt=try\0" \
-   "fdt_file=imx8mq-evk.dtb\0" \
+   "fdtfile=imx8mq-evk.dtb\0" \
"initrd_addr=0x4380\0"  \
"bootm_size=0x1000\0" \
"mmcpart=1\0" \

base-commit: d71dbe657c3c22f50ecb3df133e5cdd884daae7d
-- 
2.25.1



[PATCH v2] imx8mq_evk: configs: add/cleanup variables for distro boot

2022-01-11 Thread Andrey Zhizhikin
 Add fdt_addr_r fdtfile which used by distro boot, and cleanup legacy
 environment variables.

Signed-off-by: Andrey Zhizhikin 
---

Changes in V2:
- Rebased on latest master after 2022.01 release

 include/configs/imx8mq_evk.h | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/configs/imx8mq_evk.h b/include/configs/imx8mq_evk.h
index 6e1d387e2b..f15c49d2db 100644
--- a/include/configs/imx8mq_evk.h
+++ b/include/configs/imx8mq_evk.h
@@ -61,13 +61,13 @@
 /* Initial environment variables */
 #define CONFIG_EXTRA_ENV_SETTINGS  \
BOOTENV \
-   "scriptaddr=0x4350\0" \
-   "kernel_addr_r=0x4088\0" \
+   "scriptaddr=" __stringify(CONFIG_LOADADDR) "\0" \
+   "kernel_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \
"image=Image\0" \
"console=ttymxc0,115200\0" \
-   "fdt_addr=0x4300\0" \
+   "fdt_addr_r=0x4300\0"   \
"boot_fdt=try\0" \
-   "fdt_file=imx8mq-evk.dtb\0" \
+   "fdtfile=imx8mq-evk.dtb\0" \
"initrd_addr=0x4380\0"  \
"bootm_size=0x1000\0" \
"mmcpart=1\0" \

base-commit: fe04d885fb540b614a2f989e16e808b300ccb52e
-- 
2.25.1



[PATCH] imx8mq_evk: configs: add/cleanup variables for distro boot

2021-12-06 Thread Andrey Zhizhikin
 Add fdt_addr_r fdtfile which used by distro boot, and cleanup legacy
 environment variables.

Signed-off-by: Andrey Zhizhikin 
---
 include/configs/imx8mq_evk.h | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/configs/imx8mq_evk.h b/include/configs/imx8mq_evk.h
index 49a9526d96..63539c7649 100644
--- a/include/configs/imx8mq_evk.h
+++ b/include/configs/imx8mq_evk.h
@@ -63,13 +63,13 @@
 /* Initial environment variables */
 #define CONFIG_EXTRA_ENV_SETTINGS  \
BOOTENV \
-   "scriptaddr=0x4350\0" \
-   "kernel_addr_r=0x4088\0" \
+   "scriptaddr=" __stringify(CONFIG_LOADADDR) "\0" \
+   "kernel_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \
"image=Image\0" \
"console=ttymxc0,115200\0" \
-   "fdt_addr=0x4300\0" \
+   "fdt_addr_r=0x4300\0"   \
"boot_fdt=try\0" \
-   "fdt_file=imx8mq-evk.dtb\0" \
+   "fdtfile=imx8mq-evk.dtb\0" \
"initrd_addr=0x4380\0"  \
"bootm_size=0x1000\0" \
"mmcpart=" __stringify(CONFIG_SYS_MMC_IMG_LOAD_PART) "\0" \

base-commit: 558002a0f2230bedf6b38716f3ed86a92fc9010b
prerequisite-patch-id: 59faad9613725a42a9057aba206b92cf084dd1c1
-- 
2.25.1



[PATCH v2] imx8mq_evk: switch board to use binman for images

2021-12-03 Thread Andrey Zhizhikin
Currently i.MX8MQ EVK board still targeting the old image generation
approach for image generation, which relies on the FIT generator that
has been dropped from the tree.

Switch the board to use binman instead, which is a standard image
generator now.

Update board documentation to correct build command, and advise latest
firmware and TF-A versions to use.

NOTE: New image produced by binman does not have Signed HDMI FW support,
this has been left on the side and does not interfere with the general
boot flow.

Tested on: [i.MX8MQ rev2.0]

Signed-off-by: Andrey Zhizhikin 
---

Changes in V2:
- Modify binman and documentation to use single flash.bin file instead
  of flash.bin+u-boot.itb combination, suggested by Fabio Estevam.

 arch/arm/dts/imx8mq-evk-u-boot.dtsi   | 124 ++
 arch/arm/mach-imx/imx8m/Kconfig   |   1 +
 board/freescale/imx8mq_evk/Kconfig|   2 +-
 .../imx8mq_evk/imximage-8mq-lpddr4.cfg|   9 ++
 configs/imx8mq_evk_defconfig  |   2 +-
 doc/board/nxp/imx8mq_evk.rst  |  21 +--
 6 files changed, 148 insertions(+), 11 deletions(-)
 create mode 100644 board/freescale/imx8mq_evk/imximage-8mq-lpddr4.cfg

diff --git a/arch/arm/dts/imx8mq-evk-u-boot.dtsi 
b/arch/arm/dts/imx8mq-evk-u-boot.dtsi
index 2cfc12b7e0..e3f780ca75 100644
--- a/arch/arm/dts/imx8mq-evk-u-boot.dtsi
+++ b/arch/arm/dts/imx8mq-evk-u-boot.dtsi
@@ -1,5 +1,129 @@
 // SPDX-License-Identifier: (GPL-2.0 OR MIT)
 
+/ {
+   binman: binman {
+   multiple-images;
+   };
+};
+
+ {
+   u-boot-spl-ddr {
+   filename = "u-boot-spl-ddr.bin";
+   pad-byte = <0xff>;
+   align-size = <4>;
+   align = <4>;
+
+   u-boot-spl {
+   align-end = <4>;
+   };
+
+   blob_1: blob-ext@1 {
+   filename = "lpddr4_pmu_train_1d_imem.bin";
+   size = <0x8000>;
+   };
+
+   blob_2: blob-ext@2 {
+   filename = "lpddr4_pmu_train_1d_dmem.bin";
+   size = <0x4000>;
+   };
+
+   blob_3: blob-ext@3 {
+   filename = "lpddr4_pmu_train_2d_imem.bin";
+   size = <0x8000>;
+   };
+
+   blob_4: blob-ext@4 {
+   filename = "lpddr4_pmu_train_2d_dmem.bin";
+   size = <0x4000>;
+   };
+   };
+
+   spl {
+   filename = "spl.bin";
+
+   mkimage {
+   args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 
0x7e1000";
+
+   blob {
+   filename = "u-boot-spl-ddr.bin";
+   };
+   };
+   };
+
+   itb {
+   filename = "u-boot.itb";
+
+   fit {
+   description = "Configuration to load ATF before U-Boot";
+   #address-cells = <1>;
+   fit,external-offset = ;
+
+   images {
+   uboot {
+   description = "U-Boot (64-bit)";
+   type = "standalone";
+   arch = "arm64";
+   compression = "none";
+   load = ;
+
+   uboot_blob: blob-ext {
+   filename = "u-boot-nodtb.bin";
+   };
+   };
+
+   atf {
+   description = "ARM Trusted Firmware";
+   type = "firmware";
+   arch = "arm64";
+   compression = "none";
+   load = <0x91>;
+   entry = <0x91>;
+
+   atf_blob: blob-ext {
+   filename = "bl31.bin";
+   };
+   };
+
+   fdt {
+   description = "NAME";
+   type = "flat_dt";
+   compression = "none";
+
+   uboot_fdt_blob: blob-ext {
+   filename = "u-boot.dtb

[PATCH] imx8mq_evk: switch board to use binman for images

2021-12-03 Thread Andrey Zhizhikin
Currently i.MX8MQ EVK board still targeting the old image generation
approach for image generation, which relies on the FIT generator that
has been dropped from the tree.

Switch the board to use binman instead, which is a standard image
generator now.

Update board documentation to correct build command, and advise latest
firmware and TF-A versions to use.

NOTE: New image produced by binman does not have Signed HDMI FW support,
this has been left on the side and does not interfere with the general
boot flow.

Tested on: [i.MX8MQ rev2.0]

Signed-off-by: Andrey Zhizhikin 
---
 arch/arm/dts/imx8mq-evk-u-boot.dtsi   | 107 ++
 arch/arm/mach-imx/imx8m/Kconfig   |   1 +
 board/freescale/imx8mq_evk/Kconfig|   2 +-
 .../imx8mq_evk/imximage-8mq-lpddr4.cfg|   9 ++
 configs/imx8mq_evk_defconfig  |   2 +-
 doc/board/nxp/imx8mq_evk.rst  |  24 ++--
 6 files changed, 133 insertions(+), 12 deletions(-)
 create mode 100644 board/freescale/imx8mq_evk/imximage-8mq-lpddr4.cfg

diff --git a/arch/arm/dts/imx8mq-evk-u-boot.dtsi 
b/arch/arm/dts/imx8mq-evk-u-boot.dtsi
index 2cfc12b7e0..a602ae55eb 100644
--- a/arch/arm/dts/imx8mq-evk-u-boot.dtsi
+++ b/arch/arm/dts/imx8mq-evk-u-boot.dtsi
@@ -1,5 +1,112 @@
 // SPDX-License-Identifier: (GPL-2.0 OR MIT)
 
+/ {
+   binman: binman {
+   multiple-images;
+   };
+};
+
+ {
+   u-boot-spl-ddr {
+   filename = "u-boot-spl-ddr.bin";
+   pad-byte = <0xff>;
+   align-size = <4>;
+   align = <4>;
+
+   u-boot-spl {
+   align-end = <4>;
+   };
+
+   blob_1: blob-ext@1 {
+   filename = "lpddr4_pmu_train_1d_imem.bin";
+   size = <0x8000>;
+   };
+
+   blob_2: blob-ext@2 {
+   filename = "lpddr4_pmu_train_1d_dmem.bin";
+   size = <0x4000>;
+   };
+
+   blob_3: blob-ext@3 {
+   filename = "lpddr4_pmu_train_2d_imem.bin";
+   size = <0x8000>;
+   };
+
+   blob_4: blob-ext@4 {
+   filename = "lpddr4_pmu_train_2d_dmem.bin";
+   size = <0x4000>;
+   };
+   };
+
+   flash {
+   mkimage {
+   args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 
0x7e1000";
+
+   blob {
+   filename = "u-boot-spl-ddr.bin";
+   };
+   };
+   };
+
+   itb {
+   filename = "u-boot.itb";
+
+   fit {
+   description = "Configuration to load ATF before U-Boot";
+   #address-cells = <1>;
+   fit,external-offset = ;
+
+   images {
+   uboot {
+   description = "U-Boot (64-bit)";
+   type = "standalone";
+   arch = "arm64";
+   compression = "none";
+   load = ;
+
+   uboot_blob: blob-ext {
+   filename = "u-boot-nodtb.bin";
+   };
+   };
+
+   atf {
+   description = "ARM Trusted Firmware";
+   type = "firmware";
+   arch = "arm64";
+   compression = "none";
+   load = <0x91>;
+   entry = <0x91>;
+
+   atf_blob: blob-ext {
+   filename = "bl31.bin";
+   };
+   };
+
+   fdt {
+   description = "NAME";
+   type = "flat_dt";
+   compression = "none";
+
+   uboot_fdt_blob: blob-ext {
+   filename = "u-boot.dtb";
+   };
+   };
+   };
+
+   configurations {
+ 

[PATCH][RFC] tree: imx: remove old fit generator script

2021-08-24 Thread Andrey Zhizhikin
Since derivatives are moving to binman from usage of the FIT generator
script, and considering the warning introduced in f4a43d2925
("Makefile: Warn against using CONFIG_SPL_FIT_GENERATOR"), usage of FIT
generator is discouraged.

Current FIT generator also generates broken output, since commit
3f04db891a ("image: Check for unit addresses in FITs") prohibits using
'@' for unit addresses but the generator script still emits the old
sematics.

Remove the generator script and corresponding call in Makefile, all
derivatives should be migrated to binman in order to provide binary
images.

Signed-off-by: Andrey Zhizhikin 
---
 Makefile |   3 -
 arch/arm/mach-imx/mkimage_fit_atf.sh | 143 ---
 2 files changed, 146 deletions(-)
 delete mode 100755 arch/arm/mach-imx/mkimage_fit_atf.sh

diff --git a/Makefile b/Makefile
index 3c8437d21a..6760ddc826 100644
--- a/Makefile
+++ b/Makefile
@@ -1350,9 +1350,6 @@ $(U_BOOT_ITS): $(subst ",,$(CONFIG_SPL_FIT_SOURCE))
 else
 ifneq ($(CONFIG_USE_SPL_FIT_GENERATOR),)
 U_BOOT_ITS := u-boot.its
-ifeq ($(CONFIG_SPL_FIT_GENERATOR),"arch/arm/mach-imx/mkimage_fit_atf.sh")
-U_BOOT_ITS_DEPS += u-boot-nodtb.bin
-endif
 ifeq ($(CONFIG_SPL_FIT_GENERATOR),"arch/arm/mach-rockchip/make_fit_atf.py")
 U_BOOT_ITS_DEPS += u-boot
 endif
diff --git a/arch/arm/mach-imx/mkimage_fit_atf.sh 
b/arch/arm/mach-imx/mkimage_fit_atf.sh
deleted file mode 100755
index 2a17968794..00
--- a/arch/arm/mach-imx/mkimage_fit_atf.sh
+++ /dev/null
@@ -1,143 +0,0 @@
-#!/bin/sh
-# SPDX-License-Identifier: GPL-2.0+
-#
-# script to generate FIT image source for i.MX8MQ boards with
-# ARM Trusted Firmware and multiple device trees (given on the command line)
-#
-# usage: $0  [ [&2
-   exit 0
-else
-   echo "$BL31 size: " >&2
-   stat -c %s $BL31 >&2
-fi
-
-BL32="tee.bin"
-
-if [ ! -f $BL32 ]; then
-   BL32=/dev/null
-else
-   echo "Building with TEE support, make sure your $BL31 is compiled with 
spd. If you do not want tee, please delete $BL31" >&2
-   echo "$BL32 size: " >&2
-   stat -c %s $BL32 >&2
-fi
-
-BL33="u-boot-nodtb.bin"
-
-if [ ! -f $BL33 ]; then
-   echo "ERROR: $BL33 file NOT found" >&2
-   exit 0
-else
-   echo "u-boot-nodtb.bin size: " >&2
-   stat -c %s u-boot-nodtb.bin >&2
-fi
-
-for dtname in $*
-do
-   echo "$dtname size: " >&2
-   stat -c %s $dtname >&2
-done
-
-
-cat << __HEADER_EOF
-/dts-v1/;
-
-/ {
-   description = "Configuration to load ATF before U-Boot";
-
-   images {
-   uboot@1 {
-   description = "U-Boot (64-bit)";
-   os = "u-boot";
-   data = /incbin/("$BL33");
-   type = "standalone";
-   arch = "arm64";
-   compression = "none";
-   load = <$BL33_LOAD_ADDR>;
-   };
-__HEADER_EOF
-
-cnt=1
-for dtname in $*
-do
-   cat << __FDT_IMAGE_EOF
-   fdt@$cnt {
-   description = "$(basename $dtname .dtb)";
-   data = /incbin/("$dtname");
-   type = "flat_dt";
-   compression = "none";
-   };
-__FDT_IMAGE_EOF
-cnt=$((cnt+1))
-done
-
-cat << __HEADER_EOF
-   atf@1 {
-   description = "ARM Trusted Firmware";
-   os = "arm-trusted-firmware";
-   data = /incbin/("$BL31");
-   type = "firmware";
-   arch = "arm64";
-   compression = "none";
-   load = <$ATF_LOAD_ADDR>;
-   entry = <$ATF_LOAD_ADDR>;
-   };
-__HEADER_EOF
-
-if [ -f $BL32 ]; then
-cat << __HEADER_EOF
-   tee@1 {
-   description = "TEE firmware";
-   data = /incbin/("$BL32");
-   type = "firmware";
-   arch = "arm64";
-   compression = "none";
-   load = <$TEE_LOAD_ADDR>;
-   entry = <$TEE_LOAD_ADDR>;
-   };
-__HEADER_EOF
-fi
-
-cat << __CONF_HEADER_EOF
-   };
-   configurations {
-   default = "config@1";
-
-__CONF_HEADER_EOF
-
-cnt=1
-for dtname in $*
-do
-if [ -f $BL32 ]; then
-cat << __CONF_SECTION_EOF
-   config@$cnt {
-   description = "$(basename $dtname .dtb)&quo

[PATCH] arm: imx: imx8mm: clock: make debug output more descriptive

2021-05-03 Thread Andrey Zhizhikin
Clock initialization functionality has ambitious debug messages, which are
printed out when failures are triggered during execution:
- Separate frequency table lookup functions have the the same output that
  makes it impossible to understand which function failed and produced the
  output
- PLL decoding routine has a generic debug statement printed, which does
  not state the actual value failed to be found

Extend the output for both cases with prefixing table lookup functions
output with function name, and report the failed value in PLL decoding
routine.

Signed-off-by: Andrey Zhizhikin 
Cc: Stefano Babic 
Cc: Fabio Estevam 
Cc: "NXP i.MX U-Boot Team" 
Cc: Peng Fan 
Cc: Simon Glass 
Cc: Ye Li 
---
 arch/arm/mach-imx/imx8m/clock_imx8mm.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-imx/imx8m/clock_imx8mm.c 
b/arch/arm/mach-imx/imx8m/clock_imx8mm.c
index 7d0f564a24..8b0c19cec8 100644
--- a/arch/arm/mach-imx/imx8m/clock_imx8mm.c
+++ b/arch/arm/mach-imx/imx8m/clock_imx8mm.c
@@ -72,7 +72,7 @@ static int fracpll_configure(enum pll_clocks pll, u32 freq)
}
 
if (i == ARRAY_SIZE(imx8mm_fracpll_tbl)) {
-   printf("No matched freq table %u\n", freq);
+   printf("%s: No matched freq table %u\n", __func__, freq);
return -EINVAL;
}
 
@@ -148,7 +148,7 @@ void dram_enable_bypass(ulong clk_val)
}
 
if (i == ARRAY_SIZE(imx8mm_dram_bypass_tbl)) {
-   printf("No matched freq table %lu\n", clk_val);
+   printf("%s: No matched freq table %lu\n", __func__, clk_val);
return;
}
 
@@ -646,7 +646,7 @@ static u32 decode_fracpll(enum clk_root_src frac_pll)
pll_fdiv_ctl1 = readl(_pll->video_pll1_fdiv_ctl1);
break;
default:
-   printf("Not supported\n");
+   printf("Unsupported clk_root_src %d\n", frac_pll);
return 0;
}
 
-- 
2.25.1



[PATCH v2] arm: imx: imx8mm: correct unrecognized fracpll frequency

2021-05-03 Thread Andrey Zhizhikin
Frequency requested by ddrphy_init_set_dfi_clk from fracpll uses MHZ()
macro, which expands the value provided to the Hz range without taking into
account the precise Hz setting. This causes the frequency of 266 MHz not ot
be found in the imx8mm_fracpll_tbl, since it is entered there with a
precise Hz value. This in turn causes the boot hang in SPL, as proper DDR
fracpll frequency cannot be determined.

Correct the value in imx8mm_fracpll_tbl to match the one expanded by
MHZ(266) macro, rounding it down to MHz range only.

Signed-off-by: Andrey Zhizhikin 
Cc: Stefano Babic 
Cc: Fabio Estevam 
Cc: "NXP i.MX U-Boot Team" 
Cc: Peng Fan 
Cc: Simon Glass 
Cc: Ye Li 
Fixes: 825ab6b406 ("driver: ddr: Refine the ddr init driver on imx8m")
---

Changes in v2:
- Remove debug message clarifications, they are addressed in a separate
  patch

 arch/arm/mach-imx/imx8m/clock_imx8mm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-imx/imx8m/clock_imx8mm.c 
b/arch/arm/mach-imx/imx8m/clock_imx8mm.c
index 029d06f27f..7d0f564a24 100644
--- a/arch/arm/mach-imx/imx8m/clock_imx8mm.c
+++ b/arch/arm/mach-imx/imx8m/clock_imx8mm.c
@@ -54,7 +54,7 @@ static struct imx_int_pll_rate_table imx8mm_fracpll_tbl[] = {
PLL_1443X_RATE(6U, 300, 3, 2, 0),
PLL_1443X_RATE(59400U, 99, 1, 2, 0),
PLL_1443X_RATE(4U, 300, 9, 1, 0),
-   PLL_1443X_RATE(26667U, 400, 9, 2, 0),
+   PLL_1443X_RATE(26600U, 400, 9, 2, 0),
PLL_1443X_RATE(16700U, 334, 3, 4, 0),
PLL_1443X_RATE(1U, 300, 9, 3, 0),
 };
-- 
2.25.1



[PATCH v2] imx8mn: configs: add support for distro boot commands

2021-05-02 Thread Andrey Zhizhikin
Supported boot device types in iMX8MN: MMC, DHCP.

Add DISTRO_DEFAULTS config option and include the distro boot command
header file to enable full support of distro boot on i.MX8M Nano EVK (both
DDR and LPDDR derivatives).

Drop previous environment, which was targeting customized boot commands and
boot order.

Signed-off-by: Andrey Zhizhikin 
Cc: Peng Fan 
---
Changes in v2:
- Correct fdt parameters: "fdt_file" -> "fdtfile", "fdt_addr" -> "fdt_addr_r"
- Set "kernel_addr_r" and "scriptaddr" from config

 configs/imx8mn_ddr4_evk_defconfig |  1 +
 configs/imx8mn_evk_defconfig  |  1 +
 include/configs/imx8mn_evk.h  | 68 +++
 3 files changed, 16 insertions(+), 54 deletions(-)

diff --git a/configs/imx8mn_ddr4_evk_defconfig 
b/configs/imx8mn_ddr4_evk_defconfig
index b10cd13fc3..1686e1a851 100644
--- a/configs/imx8mn_ddr4_evk_defconfig
+++ b/configs/imx8mn_ddr4_evk_defconfig
@@ -19,6 +19,7 @@ CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
 CONFIG_SPL=y
 CONFIG_SPL_IMX_ROMAPI_LOADADDR=0x4800
 CONFIG_DEFAULT_DEVICE_TREE="imx8mn-ddr4-evk"
+CONFIG_DISTRO_DEFAULTS=y
 CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_SPL_LOAD_FIT=y
diff --git a/configs/imx8mn_evk_defconfig b/configs/imx8mn_evk_defconfig
index d0e5b58902..14db624e29 100644
--- a/configs/imx8mn_evk_defconfig
+++ b/configs/imx8mn_evk_defconfig
@@ -22,6 +22,7 @@ CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
 CONFIG_SPL=y
 CONFIG_SPL_IMX_ROMAPI_LOADADDR=0x4800
 CONFIG_DEFAULT_DEVICE_TREE="imx8mn-evk"
+CONFIG_DISTRO_DEFAULTS=y
 CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_SPL_LOAD_FIT=y
diff --git a/include/configs/imx8mn_evk.h b/include/configs/imx8mn_evk.h
index 596e255ca6..985bec803a 100644
--- a/include/configs/imx8mn_evk.h
+++ b/include/configs/imx8mn_evk.h
@@ -31,69 +31,29 @@
 
 #endif
 
+#ifndef CONFIG_SPL_BUILD
+#define BOOT_TARGET_DEVICES(func) \
+   func(MMC, mmc, 1) \
+   func(MMC, mmc, 2) \
+   func(DHCP, dhcp, na)
+
+#include 
+#endif
+
 /* Initial environment variables */
 #define CONFIG_EXTRA_ENV_SETTINGS  \
-   "script=boot.scr\0" \
"image=Image\0" \
+   BOOTENV \
+   "scriptaddr=" __stringify(CONFIG_LOADADDR) "\0" \
+   "kernel_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \
"console=ttymxc1,115200\0" \
-   "fdt_addr=0x4300\0" \
+   "fdt_addr_r=0x4300\0"   \
"boot_fit=no\0" \
-   "fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \
+   "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
"initrd_addr=0x4380\0"  \
"bootm_size=0x1000\0" \
-   "mmcdev="__stringify(CONFIG_SYS_MMC_ENV_DEV)"\0" \
"mmcpart=" __stringify(CONFIG_SYS_MMC_IMG_LOAD_PART) "\0" \
"mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \
-   "mmcautodetect=yes\0" \
-   "mmcargs=setenv bootargs console=${console} root=${mmcroot}\0 " \
-   "loadbootscript=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} 
${script};\0" \
-   "bootscript=echo Running bootscript from mmc ...; " \
-   "source\0" \
-   "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
-   "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
-   "mmcboot=echo Booting from mmc ...; " \
-   "run mmcargs; " \
-   "if test ${boot_fit} = yes || test ${boot_fit} = try; then " \
-   "bootm ${loadaddr}; " \
-   "else " \
-   "if run loadfdt; then " \
-   "booti ${loadaddr} - ${fdt_addr}; " \
-   "else " \
-   "echo WARN: Cannot load the DT; " \
-   "fi; " \
-   "fi;\0" \
-   "netargs=setenv bootargs console=${console} " \
-   "root=/dev/nfs " \
-   "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
-   "netboot=echo Booting from net ...; " \
-   "run netargs;  " \
-   "if test ${ip_dyn} = yes; then " \
-   "setenv get_cmd dhcp; " \
-   "else " \
-   "setenv get_cmd tftp; " \
-   "fi; " \
-   "${get_cmd} ${loadaddr} ${image}; " \
-   "if test ${boot_fit} = yes || test ${boot_fit} = try; then " \
-   "

[PATCH 3/3] imx8mn: configs: add support for distro boot commands

2021-05-01 Thread Andrey Zhizhikin
Supported boot device types in iMX8MN: MMC, DHCP.

Add DISTRO_DEFAULTS config option and include the distro boot command
header file to enable full support of distro boot on i.MX8M Nano EVK (both
DDR and LPDDR derivatives).

Drop previous environment, which was targeting customized boot commands and
boot order.

Signed-off-by: Andrey Zhizhikin 
Cc: Peng Fan 
---
 configs/imx8mn_ddr4_evk_defconfig |  1 +
 configs/imx8mn_evk_defconfig  |  1 +
 include/configs/imx8mn_evk.h  | 64 ++-
 3 files changed, 14 insertions(+), 52 deletions(-)

diff --git a/configs/imx8mn_ddr4_evk_defconfig 
b/configs/imx8mn_ddr4_evk_defconfig
index b10cd13fc3..1686e1a851 100644
--- a/configs/imx8mn_ddr4_evk_defconfig
+++ b/configs/imx8mn_ddr4_evk_defconfig
@@ -19,6 +19,7 @@ CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
 CONFIG_SPL=y
 CONFIG_SPL_IMX_ROMAPI_LOADADDR=0x4800
 CONFIG_DEFAULT_DEVICE_TREE="imx8mn-ddr4-evk"
+CONFIG_DISTRO_DEFAULTS=y
 CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_SPL_LOAD_FIT=y
diff --git a/configs/imx8mn_evk_defconfig b/configs/imx8mn_evk_defconfig
index 2b79c0a472..ed3bddac00 100644
--- a/configs/imx8mn_evk_defconfig
+++ b/configs/imx8mn_evk_defconfig
@@ -20,6 +20,7 @@ CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
 CONFIG_SPL=y
 CONFIG_SPL_IMX_ROMAPI_LOADADDR=0x4800
 CONFIG_DEFAULT_DEVICE_TREE="imx8mn-evk"
+CONFIG_DISTRO_DEFAULTS=y
 CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_SPL_LOAD_FIT=y
diff --git a/include/configs/imx8mn_evk.h b/include/configs/imx8mn_evk.h
index 596e255ca6..241bfdf1a2 100644
--- a/include/configs/imx8mn_evk.h
+++ b/include/configs/imx8mn_evk.h
@@ -31,69 +31,29 @@
 
 #endif
 
+#ifndef CONFIG_SPL_BUILD
+#define BOOT_TARGET_DEVICES(func) \
+   func(MMC, mmc, 1) \
+   func(MMC, mmc, 2) \
+   func(DHCP, dhcp, na)
+
+#include 
+#endif
+
 /* Initial environment variables */
 #define CONFIG_EXTRA_ENV_SETTINGS  \
-   "script=boot.scr\0" \
"image=Image\0" \
+   BOOTENV \
+   "scriptaddr=0x4350\0" \
+   "kernel_addr_r=0x4088\0" \
"console=ttymxc1,115200\0" \
"fdt_addr=0x4300\0" \
"boot_fit=no\0" \
"fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \
"initrd_addr=0x4380\0"  \
"bootm_size=0x1000\0" \
-   "mmcdev="__stringify(CONFIG_SYS_MMC_ENV_DEV)"\0" \
"mmcpart=" __stringify(CONFIG_SYS_MMC_IMG_LOAD_PART) "\0" \
"mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \
-   "mmcautodetect=yes\0" \
-   "mmcargs=setenv bootargs console=${console} root=${mmcroot}\0 " \
-   "loadbootscript=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} 
${script};\0" \
-   "bootscript=echo Running bootscript from mmc ...; " \
-   "source\0" \
-   "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
-   "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
-   "mmcboot=echo Booting from mmc ...; " \
-   "run mmcargs; " \
-   "if test ${boot_fit} = yes || test ${boot_fit} = try; then " \
-   "bootm ${loadaddr}; " \
-   "else " \
-   "if run loadfdt; then " \
-   "booti ${loadaddr} - ${fdt_addr}; " \
-   "else " \
-   "echo WARN: Cannot load the DT; " \
-   "fi; " \
-   "fi;\0" \
-   "netargs=setenv bootargs console=${console} " \
-   "root=/dev/nfs " \
-   "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
-   "netboot=echo Booting from net ...; " \
-   "run netargs;  " \
-   "if test ${ip_dyn} = yes; then " \
-   "setenv get_cmd dhcp; " \
-   "else " \
-   "setenv get_cmd tftp; " \
-   "fi; " \
-   "${get_cmd} ${loadaddr} ${image}; " \
-   "if test ${boot_fit} = yes || test ${boot_fit} = try; then " \
-   "bootm ${loadaddr}; " \
-   "else " \
-   "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
-   "booti ${loadaddr} - ${fdt_addr}; " \
-   "else " \
-   "echo WARN: Cannot load the DT; " \
-   "fi; " \
-   "fi;\0"
-
-#define CONFIG_BOOTCOMMAND \
-  "mmc dev ${mmcdev}; if mmc rescan; then " \
-  "if run loadbootscript; then " \
-  "run bootscript; " \
-  "else " \
-  "if run loadimage; then " \
-  "run mmcboot; " \
-  "else run netboot; " \
-  "fi; " \
-  "fi; " \
-  "fi;"
 
 /* Link Definitions */
 #define CONFIG_LOADADDR0x4048
-- 
2.25.1



[PATCH 0/3] Correct and extend distro boot support for imx8m

2021-05-01 Thread Andrey Zhizhikin
Distro boot support for imx8m family is not completed, with:
(a) imx8mm and imx8mp has facilities enabled to support only boot flow
based on the boot scripts;
(b) im8mn has no distro boot support enabled, and still adheres to the
customized boot flow using modified environment;

This patch series addresses above points by extending imx8mm and imx8mp
derivatives with full support for distro boot, including sysboot flow; and
adds a support for distro boot to imx8mn.

Andrey Zhizhikin (3):
  imx8mm: configs: enable distro default features
  imx8mp: configs: enable distro default features
  imx8mn: configs: add support for distro boot commands

 configs/imx8mm_evk_defconfig  |  3 +-
 configs/imx8mn_ddr4_evk_defconfig |  1 +
 configs/imx8mn_evk_defconfig  |  1 +
 configs/imx8mp_evk_defconfig  |  3 +-
 include/configs/imx8mn_evk.h  | 64 ++-
 5 files changed, 16 insertions(+), 56 deletions(-)

-- 
2.25.1



[PATCH 2/3] imx8mp: configs: enable distro default features

2021-05-01 Thread Andrey Zhizhikin
imx8mp ekv has been switched to use distro boot commands, but had no
correct options enabled to support sysboot.
According to the README.distro, sysboot is consindered to be a
recommended way of using distro boot commands, it required default distro
features to be enabled instead of only those that are relevant to the boot
script.

Replace the boot script specific options in the config to a default distro
option.

Signed-off-by: Andrey Zhizhikin 
Cc: Peng Fan 
Fixes: 9b162b1d1f ("imx8mp: configs: add support for distro boot commands")
---
 configs/imx8mp_evk_defconfig | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/configs/imx8mp_evk_defconfig b/configs/imx8mp_evk_defconfig
index 089ec26b3c..7818e19ead 100644
--- a/configs/imx8mp_evk_defconfig
+++ b/configs/imx8mp_evk_defconfig
@@ -19,6 +19,7 @@ CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
 CONFIG_SPL=y
 CONFIG_SPL_IMX_ROMAPI_LOADADDR=0x4800
 CONFIG_DEFAULT_DEVICE_TREE="imx8mp-evk"
+CONFIG_DISTRO_DEFAULTS=y
 CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_SPL_LOAD_FIT=y
@@ -45,7 +46,6 @@ CONFIG_CMD_FUSE=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_PART=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
@@ -55,7 +55,6 @@ CONFIG_CMD_EXT2=y
 CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
-CONFIG_CMD_FS_GENERIC=y
 CONFIG_OF_CONTROL=y
 CONFIG_SPL_OF_CONTROL=y
 CONFIG_ENV_OVERWRITE=y
-- 
2.25.1



[PATCH 1/3] imx8mm: configs: enable distro default features

2021-05-01 Thread Andrey Zhizhikin
imx8mm ekv has been switched to use distro boot commands, but had no
correct options enabled to support sysboot.
According to the README.distro, sysboot is consindered to be a
recommended way of using distro boot commands, it required default distro
features to be enabled instead of only those that are relevant to the boot
script.

Replace the boot script specific options in the config to a default distro
option.

Signed-off-by: Andrey Zhizhikin 
Cc: Peng Fan 
Fixes: 2df8930bf9 ("imx8mm: configs: add support for distro boot commands")
---
 configs/imx8mm_evk_defconfig | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/configs/imx8mm_evk_defconfig b/configs/imx8mm_evk_defconfig
index 23741a1c8a..6a3b15389b 100644
--- a/configs/imx8mm_evk_defconfig
+++ b/configs/imx8mm_evk_defconfig
@@ -18,6 +18,7 @@ CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
 CONFIG_SPL=y
 CONFIG_DEFAULT_DEVICE_TREE="imx8mm-evk"
+CONFIG_DISTRO_DEFAULTS=y
 CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_SPL_LOAD_FIT=y
@@ -40,7 +41,6 @@ CONFIG_CMD_FUSE=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_PART=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
@@ -50,7 +50,6 @@ CONFIG_CMD_EXT2=y
 CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
-CONFIG_CMD_FS_GENERIC=y
 CONFIG_OF_CONTROL=y
 CONFIG_SPL_OF_CONTROL=y
 CONFIG_ENV_OVERWRITE=y
-- 
2.25.1



[PATCH] arm: imx: imx8mm: correct unrecognized fracpll frequency

2021-05-01 Thread Andrey Zhizhikin
Frequency requested by ddrphy_init_set_dfi_clk from fracpll uses MHZ()
macro, which expands the value provided to the Hz range without taking into
account the precise Hz setting. This causes the frequency of 266 MHz not ot
be found in the imx8mm_fracpll_tbl, since it is entered there with a
precise Hz value. This in turn causes the boot hang in SPL, as proper DDR
fracpll frequency cannot be determined.

Correct the value in imx8mm_fracpll_tbl to match the one expanded by
MHZ(266) macro, rounding it down to MHz range only.

Signed-off-by: Andrey Zhizhikin 
Cc: Stefano Babic 
Cc: Fabio Estevam 
Cc: "NXP i.MX U-Boot Team" 
Cc: Peng Fan 
Cc: Simon Glass 
Cc: Ye Li 
Fixes: 825ab6b406 ("driver: ddr: Refine the ddr init driver on imx8m")
---
 arch/arm/mach-imx/imx8m/clock_imx8mm.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-imx/imx8m/clock_imx8mm.c 
b/arch/arm/mach-imx/imx8m/clock_imx8mm.c
index 029d06f27f..86ff2b9cc9 100644
--- a/arch/arm/mach-imx/imx8m/clock_imx8mm.c
+++ b/arch/arm/mach-imx/imx8m/clock_imx8mm.c
@@ -54,7 +54,7 @@ static struct imx_int_pll_rate_table imx8mm_fracpll_tbl[] = {
PLL_1443X_RATE(6U, 300, 3, 2, 0),
PLL_1443X_RATE(59400U, 99, 1, 2, 0),
PLL_1443X_RATE(4U, 300, 9, 1, 0),
-   PLL_1443X_RATE(26667U, 400, 9, 2, 0),
+   PLL_1443X_RATE(26600U, 400, 9, 2, 0),
PLL_1443X_RATE(16700U, 334, 3, 4, 0),
PLL_1443X_RATE(1U, 300, 9, 3, 0),
 };
@@ -72,7 +72,7 @@ static int fracpll_configure(enum pll_clocks pll, u32 freq)
}
 
if (i == ARRAY_SIZE(imx8mm_fracpll_tbl)) {
-   printf("No matched freq table %u\n", freq);
+   printf("%s: No matched freq table %u\n", __func__, freq);
return -EINVAL;
}
 
@@ -148,7 +148,7 @@ void dram_enable_bypass(ulong clk_val)
}
 
if (i == ARRAY_SIZE(imx8mm_dram_bypass_tbl)) {
-   printf("No matched freq table %lu\n", clk_val);
+   printf("%s: No matched freq table %lu\n", __func__, clk_val);
return;
}
 
-- 
2.25.1



[PATCH] Makefile: allow to override python3

2021-05-01 Thread Andrey Zhizhikin
Python3 taken from the PATH causes build issues when pylibfdt bindings are
generated with Yocto SDK.

Python3 provided as a part of SDK is not compatible with host Python3,
therefore binding build breaks with following errors:

scripts/dtc/pylibfdt/libfdt_wrap.c:154:11: fatal error: Python.h: No such file 
or directory
  154 | # include 
  |   ^~

Do not enforce the python3 from the PATH and make it conditionally-assigned
so it can be overridden from outside of build system. Keep the default
assignment to point to version that is taken from the PATH.

Similar fix has been introduced in b48bfc74ee ("tools: allow to override
python"), where conditional assignment is used for python executable to
address similar build errors.

Signed-off-by: Andrey Zhizhikin 
Cc: Simon Glass 
Fixes: e91610da7c ("kconfig: re-sync with Linux 4.17-rc4")
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 404977efa5..f033ab39f2 100644
--- a/Makefile
+++ b/Makefile
@@ -408,7 +408,7 @@ AWK = awk
 PERL   = perl
 PYTHON ?= python
 PYTHON2= python2
-PYTHON3= python3
+PYTHON3?= python3
 DTC?= $(objtree)/scripts/dtc/dtc
 CHECK  = sparse
 
-- 
2.25.1



Re: [PATCH] imx8mn_ddr4_evk: Allow booting the kernel by default

2021-03-04 Thread Andrey Zhizhikin
Hello Fabio,

On Thu, Mar 4, 2021 at 12:07 PM Fabio Estevam  wrote:
>
> Currently it is not possible to boot Linux from the SD card
> by default.
>
> Make the necessary adjustments to allow it.
>
> Reported-by: Peter Bergin 
> Signed-off-by: Fabio Estevam 

Tested-by: Andrey Zhizhikin  # imx8mn_ddr4_evk

> ---
>  configs/imx8mn_ddr4_evk_defconfig | 1 +
>  include/configs/imx8mn_evk.h  | 4 ++--
>  2 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/configs/imx8mn_ddr4_evk_defconfig 
> b/configs/imx8mn_ddr4_evk_defconfig
> index f7ea65886d51..2c12bdabe0a0 100644
> --- a/configs/imx8mn_ddr4_evk_defconfig
> +++ b/configs/imx8mn_ddr4_evk_defconfig
> @@ -54,6 +54,7 @@ CONFIG_SPL_OF_CONTROL=y
>  CONFIG_ENV_OVERWRITE=y
>  CONFIG_ENV_IS_IN_MMC=y
>  CONFIG_SYS_RELOC_GD_ENV_ADDR=y
> +CONFIG_SYS_MMC_ENV_DEV=1
>  CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
>  CONFIG_SPL_DM=y
>  CONFIG_SPL_CLK_COMPOSITE_CCF=y
> diff --git a/include/configs/imx8mn_evk.h b/include/configs/imx8mn_evk.h
> index 1e2825337e2d..596e255ca6de 100644
> --- a/include/configs/imx8mn_evk.h
> +++ b/include/configs/imx8mn_evk.h
> @@ -34,10 +34,10 @@
>  /* Initial environment variables */
>  #define CONFIG_EXTRA_ENV_SETTINGS  \
> "script=boot.scr\0" \
> -   "image=Image.itb\0" \
> +   "image=Image\0" \
> "console=ttymxc1,115200\0" \
> "fdt_addr=0x4300\0" \
> -   "boot_fit=try\0" \
> +   "boot_fit=no\0" \
> "fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \
> "initrd_addr=0x4380\0"  \
> "bootm_size=0x1000\0" \
> --
> 2.25.1
>


-- 
Regards,
Andrey.


Re: [meta-freescale] MTD UBI undefined reference failed to build OE gatesgarth branch

2021-01-15 Thread Andrey Zhizhikin
Hello Jupiter,

On Fri, Jan 15, 2021 at 8:32 PM JH  wrote:
>
> Hello,
>
> The mtd build was fine, what could be missing not to link mtd?
>
> $ ls 2020.04-r0/build/mx6ull_14x14_evk_nand_config/drivers/mtd

>From all the build logs you have, it look to me that you're trying to
build the U-Boot delivered by NXP as a part of their BSP release.

In this case, I suggest you'd rather contact NXP support in order to
address this failure, since it is a vendor BSP you're trying to
upgrade.

In addition, I do not think that all mailing lists you've cross-posted
your question to would be able to help you here:
- linux-mtd list is not really appropriate to solve U-Boot build issues;
- u-boot list is for upstream U-Boot patches and discussions, which is
way past over 2020.04 version (not even considering that you're
building U-Boot from NXP fork);
- oe-core is not a proper list to post questions specific to one SOC vendor;
- meta-freescale 'gatesgarth' branch does not have any U-Boot build
configuration for mx6ull_14x14_evk_nand_config, the only available
build config provided is for sd card;

Having all those points above, I'd suggest you contact NXP support at
first to see if they can solve those build errors for you.

If you would find a solution, you can send a PR to meta-freescale to
address it - this would be much appreciated.

>
> built-in.o  mtdcore.su  mtdpart.o   mtd_uboot.o   mtd-uclass.o   nand spi
> mtdcore.o   mtd.o   mtdpart.su  mtd_uboot.su  mtd-uclass.su  onenand  ubi
>
>
>
> On 1/15/21, Jupiter  wrote:
> > Hello,
> >
> > I was able to build MTD, UBI and u-boot on OE version Zeus branch, but
> > failed in gatesgarth branch. Here are errors, what could I be missing?
> >
> > u-boot-imx/2020.04-r0/git/cmd/ubi.c:478: undefined reference to
> > `mtd_probe_devices'
> > u-boot-imx/2020.04-r0/git/cmd/ubi.c:484: undefined reference to
> > `put_mtd_device'
> > u-boot-imx/2020.04-r0/git/drivers/mtd/ubi/build.c:1161: undefined
> > reference to `put_mtd_device'
> > u-boot-imx/2020.04-r0/git/drivers/mtd/ubi/build.c:1229: undefined
> > reference to `get_mtd_device_nm'
> > u-boot-imx/2020.04-r0/git/drivers/mtd/ubi/io.c:1407: undefined
> > reference to `mtd_read'
> > u-boot-imx/2020.04-r0/git/drivers/mtd/ubi/io.c:279: undefined
> > reference to `mtd_write'
> >
> > u-boot-imx/2020.04-r0/git/drivers/video/cfb_console.c:2025: undefined
> > reference to `video_hw_init'
> > u-boot-imx/2020.04-r0/git/drivers/gpio/74x164_gpio.c:51: undefined
> > reference to `dm_spi_claim_bus'
> > u-boot-imx/2020.04-r0/git/drivers/gpio/74x164_gpio.c:55: undefined
> > reference to `dm_spi_xfer'
> > u-boot-imx/2020.04-r0/git/drivers/gpio/74x164_gpio.c:58: undefined
> > reference to `dm_spi_release_bus'
> > u-boot-imx/2020.04-r0/git/Makefile:1701: recipe for target 'u-boot' failed
> > make[1]: *** [u-boot] Error 1
> > WARNING: exit code 1 from a shell command.
> >
> > There are a couple of warning messages I am not sure if they are
> > important or just nonsense, like CONFIG_DEFAULT_DEVICE_TREE has
> > already been defined but it complained:
> >
> > Device Tree Source is not correctly specified.
> > Please define 'CONFIG_DEFAULT_DEVICE_TREE'
> > or build with 'DEVICE_TREE=' argument
> >
> > u-boot-imx/2020.04-r0/git/drivers/gpio/74x164_gpio.c:51:8: warning:
> > implicit declaration of function 'dm_spi_claim_bus'; did you mean
> > 'spi_claim_bus'? [-Wimplicit-function-declaration]
> >51 |  ret = dm_spi_claim_bus(dev);
> >   |^~~~
> >   |spi_claim_bus
> > @
> > u-boot-imx/2020.04-r0/git/drivers/gpio/74x164_gpio.c:55:8: warning:
> > implicit declaration of function 'dm_spi_xfer'; did you mean
> > 'spi_xfer'? [-Wimplicit-function-declaration]
> >55 |  ret = dm_spi_xfer(dev, priv->nregs * 8, priv->buffer, NULL,
> >   |^~~
> >   |spi_xfer
> > u-boot-imx/2020.04-r0/git/drivers/gpio/74x164_gpio.c:58:2: warning:
> > implicit declaration of function 'dm_spi_release_bus'; did you mean
> > 'spi_release_bus'? [-Wimplicit-function-declaration]
> >58 |  dm_spi_release_bus(dev);
> >   |  ^~
> >   |  spi_release_bus
> >
> > Appreciate your advice.
> >
> > Thank you very much.
> >
> > Kind regards,
> >
> > - jupiter
> >
>
>
> --
> "A man can fail many times, but he isn't a failure until he begins to
> blame somebody else."
> -- John Burroughs
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#24489): 
> https://lists.yoctoproject.org/g/meta-freescale/message/24489
> Mute This Topic: https://lists.yoctoproject.org/mt/79697340/3617192
> Group Owner: meta-freescale+ow...@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/meta-freescale/unsub 
> [andre...@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>


-- 
Regards,
Andrey.


[PATCH] doc: board: freescale: advise to use newer atf and firmware

2020-12-13 Thread Andrey Zhizhikin
Update branch and version information of ATF and DDR firmware files to
point to latest releases provided by NXP.

This is especially critical for imx8mp evk, as the ATF support for that
SoC is only available in latest releases.

Align all SoCs from imx8m family to use identical revisions of ATF and
DDR firmware.

Signed-off-by: Andrey Zhizhikin 
---
 doc/board/freescale/imx8mm_evk.rst | 10 +-
 doc/board/freescale/imx8mn_evk.rst | 10 +-
 doc/board/freescale/imx8mp_evk.rst | 16 
 doc/board/freescale/imx8mq_evk.rst | 12 ++--
 4 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/doc/board/freescale/imx8mm_evk.rst 
b/doc/board/freescale/imx8mm_evk.rst
index f75190227c..a9ccdb7850 100644
--- a/doc/board/freescale/imx8mm_evk.rst
+++ b/doc/board/freescale/imx8mm_evk.rst
@@ -18,7 +18,7 @@ Get and Build the ARM Trusted firmware
 
 Note: builddir is U-Boot build directory (source directory for in-tree builds)
 Get ATF from: https://source.codeaurora.org/external/imx/imx-atf
-branch: imx_4.19.35_1.0.0
+branch: imx_5.4.47_2.2.0
 
 .. code-block:: bash
 
@@ -30,10 +30,10 @@ Get the ddr firmware
 
 .. code-block:: bash
 
-   $ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-imx-8.0.bin
-   $ chmod +x firmware-imx-8.0.bin
-   $ ./firmware-imx-8.0
-   $ cp firmware-imx-8.0/firmware/ddr/synopsys/lpddr4*.bin $(builddir)
+   $ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-imx-8.9.bin
+   $ chmod +x firmware-imx-8.9.bin
+   $ ./firmware-imx-8.9
+   $ cp firmware-imx-8.9/firmware/ddr/synopsys/lpddr4*.bin $(builddir)
 
 Build U-Boot
 
diff --git a/doc/board/freescale/imx8mn_evk.rst 
b/doc/board/freescale/imx8mn_evk.rst
index c3e92cecee..375e0bb761 100644
--- a/doc/board/freescale/imx8mn_evk.rst
+++ b/doc/board/freescale/imx8mn_evk.rst
@@ -18,7 +18,7 @@ Get and Build the ARM Trusted firmware
 
 Note: srctree is U-Boot source directory
 Get ATF from: https://source.codeaurora.org/external/imx/imx-atf
-branch: imx_4.19.35_1.1.0
+branch: imx_5.4.47_2.2.0
 
 .. code-block:: bash
 
@@ -30,10 +30,10 @@ Get the ddr firmware
 
 .. code-block:: bash
 
-   $ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-imx-8.5.bin
-   $ chmod +x firmware-imx-8.5.bin
-   $ ./firmware-imx-8.5
-   $ cp firmware-imx-8.5/firmware/ddr/synopsys/ddr4*.bin $(srctree)
+   $ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-imx-8.9.bin
+   $ chmod +x firmware-imx-8.9.bin
+   $ ./firmware-imx-8.9
+   $ cp firmware-imx-8.9/firmware/ddr/synopsys/ddr4*.bin $(srctree)
 
 Build U-Boot
 
diff --git a/doc/board/freescale/imx8mp_evk.rst 
b/doc/board/freescale/imx8mp_evk.rst
index 96df6d470f..ccffcf7257 100644
--- a/doc/board/freescale/imx8mp_evk.rst
+++ b/doc/board/freescale/imx8mp_evk.rst
@@ -18,7 +18,7 @@ Get and Build the ARM Trusted firmware
 
 Note: $(srctree) is the U-Boot source directory
 Get ATF from: https://source.codeaurora.org/external/imx/imx-atf
-branch: imx_5.4.3_2.0.0
+branch: imx_5.4.47_2.2.0
 
 .. code-block:: bash
 
@@ -30,13 +30,13 @@ Get the ddr firmware
 
 .. code-block:: bash
 
-   $ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-imx-8.7.bin
-   $ chmod +x firmware-imx-8.7.bin
-   $ ./firmware-imx-8.7.bin
-   $ cp 
firmware-imx-8.7/firmware/ddr/synopsys/lpddr4_pmu_train_1d_dmem_201904.bin 
$(srctree)/lpddr4_pmu_train_1d_dmem.bin
-   $ cp 
firmware-imx-8.7/firmware/ddr/synopsys/lpddr4_pmu_train_1d_imem_201904.bin 
$(srctree)/lpddr4_pmu_train_1d_imem.bin
-   $ cp 
firmware-imx-8.7/firmware/ddr/synopsys/lpddr4_pmu_train_2d_dmem_201904.bin 
$(srctree)/lpddr4_pmu_train_2d_dmem.bin
-   $ cp 
firmware-imx-8.7/firmware/ddr/synopsys/lpddr4_pmu_train_2d_imem_201904.bin 
$(srctree)/lpddr4_pmu_train_2d_imem.bin
+   $ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-imx-8.9.bin
+   $ chmod +x firmware-imx-8.9.bin
+   $ ./firmware-imx-8.9.bin
+   $ cp 
firmware-imx-8.9/firmware/ddr/synopsys/lpddr4_pmu_train_1d_dmem_201904.bin 
$(srctree)/lpddr4_pmu_train_1d_dmem.bin
+   $ cp 
firmware-imx-8.9/firmware/ddr/synopsys/lpddr4_pmu_train_1d_imem_201904.bin 
$(srctree)/lpddr4_pmu_train_1d_imem.bin
+   $ cp 
firmware-imx-8.9/firmware/ddr/synopsys/lpddr4_pmu_train_2d_dmem_201904.bin 
$(srctree)/lpddr4_pmu_train_2d_dmem.bin
+   $ cp 
firmware-imx-8.9/firmware/ddr/synopsys/lpddr4_pmu_train_2d_imem_201904.bin 
$(srctree)/lpddr4_pmu_train_2d_imem.bin
 
 Build U-Boot
 
diff --git a/doc/board/freescale/imx8mq_evk.rst 
b/doc/board/freescale/imx8mq_evk.rst
index 0a64ecc5ba..c269fdebe3 100644
--- a/doc/board/freescale/imx8mq_evk.rst
+++ b/doc/board/freescale/imx8mq_evk.rst
@@ -18,7 +18,7 @@ Get and Build the ARM Trusted firmware
 
 Note: srctree is U-Boot source directory
 Get ATF from: https://source.codeaurora.org/external/imx/imx-atf
-branch: imx_4.19.35_1.0.0
+branch: imx_5.4.47_2.2.0
 
 .. code-block:: bash
 
@@ -30,11 +30,11 @@ Get the ddr and hdmi firmware
 
 .. code-block:: bash
 
-   $ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO

[PATCH v3 3/3] configs: imx8m: enable eMMC HS400ES and SD UHS mode on EVK

2020-12-05 Thread Andrey Zhizhikin
i.MX8M series includes support for high speed modes in uSDHC controllers.
Turn on corresponding configuration options for EVK boards, which would
enable high speed modes to be included in U-Boot.

Signed-off-by: Andrey Zhizhikin 
---
 configs/imx8mm_evk_defconfig  | 4 
 configs/imx8mn_ddr4_evk_defconfig | 4 
 configs/imx8mp_evk_defconfig  | 3 +++
 3 files changed, 11 insertions(+)

diff --git a/configs/imx8mm_evk_defconfig b/configs/imx8mm_evk_defconfig
index 91d3bc3ac9..1aef1ab40d 100644
--- a/configs/imx8mm_evk_defconfig
+++ b/configs/imx8mm_evk_defconfig
@@ -66,6 +66,10 @@ CONFIG_DM_I2C=y
 CONFIG_SYS_I2C_MXC=y
 CONFIG_DM_MMC=y
 CONFIG_SUPPORT_EMMC_BOOT=y
+CONFIG_MMC_IO_VOLTAGE=y
+CONFIG_MMC_UHS_SUPPORT=y
+CONFIG_MMC_HS400_ES_SUPPORT=y
+CONFIG_MMC_HS400_SUPPORT=y
 CONFIG_FSL_ESDHC_IMX=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_ATHEROS=y
diff --git a/configs/imx8mn_ddr4_evk_defconfig 
b/configs/imx8mn_ddr4_evk_defconfig
index 22e5f5aeea..41889c4624 100644
--- a/configs/imx8mn_ddr4_evk_defconfig
+++ b/configs/imx8mn_ddr4_evk_defconfig
@@ -65,6 +65,10 @@ CONFIG_DM_I2C=y
 CONFIG_SYS_I2C_MXC=y
 CONFIG_DM_MMC=y
 CONFIG_SUPPORT_EMMC_BOOT=y
+CONFIG_MMC_IO_VOLTAGE=y
+CONFIG_MMC_UHS_SUPPORT=y
+CONFIG_MMC_HS400_ES_SUPPORT=y
+CONFIG_MMC_HS400_SUPPORT=y
 CONFIG_FSL_ESDHC_IMX=y
 CONFIG_PHYLIB=y
 CONFIG_DM_ETH=y
diff --git a/configs/imx8mp_evk_defconfig b/configs/imx8mp_evk_defconfig
index cd5724e811..f84696f030 100644
--- a/configs/imx8mp_evk_defconfig
+++ b/configs/imx8mp_evk_defconfig
@@ -70,6 +70,9 @@ CONFIG_LED_GPIO=y
 CONFIG_DM_MMC=y
 CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_MMC_IO_VOLTAGE=y
+CONFIG_MMC_UHS_SUPPORT=y
+CONFIG_MMC_HS400_ES_SUPPORT=y
+CONFIG_MMC_HS400_SUPPORT=y
 CONFIG_FSL_ESDHC_IMX=y
 CONFIG_PHYLIB=y
 CONFIG_DM_ETH=y
-- 
2.17.1



[PATCH v3 2/3] ARM: dts: imx8m: add UHS or HS400/HS400ES properties

2020-12-05 Thread Andrey Zhizhikin
i.MX8M series provide support for high speed grades in their
usdhc controllers, which has eMMC and SDHC connected to them.

Enable this support across the entire i.MX8M family by providing quirks
to usdhc controllers designated by storage media connected to them.

Signed-off-by: Andrey Zhizhikin 
Cc: Stefano Babic 
Cc: Ye Li 
---
Changes in v3:
- Fix binding names, which had incorrect 'u-boot,' prefix used

Changes in v2:
- Moved u-boot binding for imx8mq-evk and imx8mq-phanbell to separate
  autoincluded dtsi files 

 arch/arm/dts/fsl-imx8qm-mek-u-boot.dtsi  | 3 +++
 arch/arm/dts/fsl-imx8qxp-mek-u-boot.dtsi | 3 +++
 arch/arm/dts/imx8mm-evk-u-boot.dtsi  | 4 
 arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi | 4 
 arch/arm/dts/imx8mp-evk-u-boot.dtsi  | 4 
 arch/arm/dts/imx8mq-evk-u-boot.dtsi  | 9 +
 6 files changed, 27 insertions(+)

diff --git a/arch/arm/dts/fsl-imx8qm-mek-u-boot.dtsi 
b/arch/arm/dts/fsl-imx8qm-mek-u-boot.dtsi
index 80d6475b7c..9e0d264b71 100644
--- a/arch/arm/dts/fsl-imx8qm-mek-u-boot.dtsi
+++ b/arch/arm/dts/fsl-imx8qm-mek-u-boot.dtsi
@@ -118,8 +118,11 @@
 
  {
u-boot,dm-spl;
+   mmc-hs400-1_8v;
 };
 
  {
u-boot,dm-spl;
+   sd-uhs-sdr104;
+   sd-uhs-ddr50;
 };
diff --git a/arch/arm/dts/fsl-imx8qxp-mek-u-boot.dtsi 
b/arch/arm/dts/fsl-imx8qxp-mek-u-boot.dtsi
index 771ab635f1..701af4434d 100644
--- a/arch/arm/dts/fsl-imx8qxp-mek-u-boot.dtsi
+++ b/arch/arm/dts/fsl-imx8qxp-mek-u-boot.dtsi
@@ -118,8 +118,11 @@
 
  {
u-boot,dm-spl;
+   mmc-hs400-1_8v;
 };
 
  {
u-boot,dm-spl;
+   sd-uhs-sdr104;
+   sd-uhs-ddr50;
 };
diff --git a/arch/arm/dts/imx8mm-evk-u-boot.dtsi 
b/arch/arm/dts/imx8mm-evk-u-boot.dtsi
index 9f77d3c6ff..e843a5648e 100644
--- a/arch/arm/dts/imx8mm-evk-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-evk-u-boot.dtsi
@@ -100,10 +100,14 @@
 
  {
u-boot,dm-spl;
+   sd-uhs-sdr104;
+   sd-uhs-ddr50;
 };
 
  {
u-boot,dm-spl;
+   mmc-hs400-1_8v;
+   mmc-hs400-enhanced-strobe;
 };
 
  {
diff --git a/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi 
b/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi
index 98b0b9891b..025090fff4 100644
--- a/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi
+++ b/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi
@@ -97,10 +97,14 @@
 
  {
u-boot,dm-spl;
+   sd-uhs-sdr104;
+   sd-uhs-ddr50;
 };
 
  {
u-boot,dm-spl;
+   mmc-hs400-1_8v;
+   mmc-hs400-enhanced-strobe;
 };
 
  {
diff --git a/arch/arm/dts/imx8mp-evk-u-boot.dtsi 
b/arch/arm/dts/imx8mp-evk-u-boot.dtsi
index 2452e9175c..4f00b5a3a9 100644
--- a/arch/arm/dts/imx8mp-evk-u-boot.dtsi
+++ b/arch/arm/dts/imx8mp-evk-u-boot.dtsi
@@ -126,10 +126,14 @@
 
  {
u-boot,dm-spl;
+   sd-uhs-sdr104;
+   sd-uhs-ddr50;
 };
 
  {
u-boot,dm-spl;
+   mmc-hs400-1_8v;
+   mmc-hs400-enhanced-strobe;
 };
 
  {
diff --git a/arch/arm/dts/imx8mq-evk-u-boot.dtsi 
b/arch/arm/dts/imx8mq-evk-u-boot.dtsi
index 4712cf6a44..44af663727 100644
--- a/arch/arm/dts/imx8mq-evk-u-boot.dtsi
+++ b/arch/arm/dts/imx8mq-evk-u-boot.dtsi
@@ -3,3 +3,12 @@
 _usdhc2_vmmc {
u-boot,off-on-delay-us = <2>;
 };
+
+ {
+   mmc-hs400-1_8v;
+};
+
+ {
+   sd-uhs-sdr104;
+   sd-uhs-ddr50;
+};
-- 
2.17.1



[PATCH v3 1/3] ARM: dts: imx8m: increase off-on delay on the SD Vcc regulator

2020-12-05 Thread Andrey Zhizhikin
Some SD Card controller and power circuitry has increased capacitance,
which keeps the internal logic remains powered after regulator is switch
off. This is generally the case when card is switched to SD104 mode,
where a power cycle should be performed. In case if the card internal
logic remains powered, it causes a subsequent failure of mode
transition, effectively leading to failed enumeration.

Introduce a delay of 20 msec in order to provide a possibility for
internal card circuitry to drain voltages and perform a power cycle
correctly.

Similar fix is done in commit c49d0ac38a76 ("ARM: dts: rmobile: Increase
off-on delay on the SD Vcc regulator") targeted Renesas SOCs.

Signed-off-by: Andrey Zhizhikin 
Cc: Stefano Babic 
---
Changes in v3:
- No changes since v2

Changes in v2: 
- Moved u-boot binding for imx8mq-evk to separate autoincluded dtsi
  files

 arch/arm/dts/imx8mm-beacon-kit-u-boot.dtsi | 4 
 arch/arm/dts/imx8mm-evk-u-boot.dtsi| 4 
 arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi   | 4 
 arch/arm/dts/imx8mp-evk-u-boot.dtsi| 4 
 arch/arm/dts/imx8mq-evk-u-boot.dtsi| 5 +
 arch/arm/dts/imx8mq-phanbell-u-boot.dtsi   | 5 +
 6 files changed, 26 insertions(+)
 create mode 100644 arch/arm/dts/imx8mq-evk-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx8mq-phanbell-u-boot.dtsi

diff --git a/arch/arm/dts/imx8mm-beacon-kit-u-boot.dtsi 
b/arch/arm/dts/imx8mm-beacon-kit-u-boot.dtsi
index fc1aebb2fe..6d80a529ae 100644
--- a/arch/arm/dts/imx8mm-beacon-kit-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-beacon-kit-u-boot.dtsi
@@ -37,6 +37,10 @@
/delete-property/ assigned-clock-rates;
 };
 
+_usdhc2_vmmc {
+   u-boot,off-on-delay-us = <2>;
+};
+
  {
phy-reset-gpios = < 22 GPIO_ACTIVE_LOW>;
 };
diff --git a/arch/arm/dts/imx8mm-evk-u-boot.dtsi 
b/arch/arm/dts/imx8mm-evk-u-boot.dtsi
index b5c12105a9..9f77d3c6ff 100644
--- a/arch/arm/dts/imx8mm-evk-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-evk-u-boot.dtsi
@@ -46,6 +46,10 @@
u-boot,dm-spl;
 };
 
+_usdhc2_vmmc {
+   u-boot,off-on-delay-us = <2>;
+};
+
 _reg_usdhc2_vmmc {
u-boot,dm-spl;
 };
diff --git a/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi 
b/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi
index 4419679d4c..98b0b9891b 100644
--- a/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi
+++ b/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi
@@ -47,6 +47,10 @@
u-boot,dm-spl;
 };
 
+_usdhc2_vmmc {
+   u-boot,off-on-delay-us = <2>;
+};
+
 _uart2 {
u-boot,dm-spl;
 };
diff --git a/arch/arm/dts/imx8mp-evk-u-boot.dtsi 
b/arch/arm/dts/imx8mp-evk-u-boot.dtsi
index 24a93ac2d6..2452e9175c 100644
--- a/arch/arm/dts/imx8mp-evk-u-boot.dtsi
+++ b/arch/arm/dts/imx8mp-evk-u-boot.dtsi
@@ -48,6 +48,10 @@
u-boot,dm-spl;
 };
 
+_usdhc2_vmmc {
+   u-boot,off-on-delay-us = <2>;
+};
+
 _usdhc2_vmmc {
u-boot,dm-spl;
 };
diff --git a/arch/arm/dts/imx8mq-evk-u-boot.dtsi 
b/arch/arm/dts/imx8mq-evk-u-boot.dtsi
new file mode 100644
index 00..4712cf6a44
--- /dev/null
+++ b/arch/arm/dts/imx8mq-evk-u-boot.dtsi
@@ -0,0 +1,5 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+
+_usdhc2_vmmc {
+   u-boot,off-on-delay-us = <2>;
+};
diff --git a/arch/arm/dts/imx8mq-phanbell-u-boot.dtsi 
b/arch/arm/dts/imx8mq-phanbell-u-boot.dtsi
new file mode 100644
index 00..4712cf6a44
--- /dev/null
+++ b/arch/arm/dts/imx8mq-phanbell-u-boot.dtsi
@@ -0,0 +1,5 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+
+_usdhc2_vmmc {
+   u-boot,off-on-delay-us = <2>;
+};
-- 
2.17.1



[PATCH v3 0/3] imx8m: introduce high speed mode support in usdhc

2020-12-05 Thread Andrey Zhizhikin
This patch series is targeted to address issues that can be observed
with various sd cards connected to i.MX8M derivatives.

Current configuration of usdhc dts nodes for imx8m SOC derivatives does
experience issues with recognition and mode switch for various sd card
types from different manufacturers, sometimes leading to an abrupted
boot
process, either during attempt to load kernel image from attached media
or failure to recognize the sd card when switch to higher speed mode is
performed.

Modifications in patches introduced are aimed to resolve those issue by
introducing a short delay when mode switch in attempted, and enabling
high speed mode quirks for all imx8m derivatives.

--
Changes in v3:
- Fix binding names, which had incorrect 'u-boot,' prefix used.
- Introduce additional patch to turn on config options required to
  enable the support for high speed modes in eSDHC driver components.

Andrey Zhizhikin (3):
  ARM: dts: imx8m: increase off-on delay on the SD Vcc regulator
  ARM: dts: imx8m: add UHS or HS400/HS400ES properties
  configs: imx8m: enable eMMC HS400ES and SD UHS mode on EVK

 arch/arm/dts/fsl-imx8qm-mek-u-boot.dtsi|  3 +++
 arch/arm/dts/fsl-imx8qxp-mek-u-boot.dtsi   |  3 +++
 arch/arm/dts/imx8mm-beacon-kit-u-boot.dtsi |  4 
 arch/arm/dts/imx8mm-evk-u-boot.dtsi|  8 
 arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi   |  8 
 arch/arm/dts/imx8mp-evk-u-boot.dtsi|  8 
 arch/arm/dts/imx8mq-evk-u-boot.dtsi| 14 ++
 arch/arm/dts/imx8mq-phanbell-u-boot.dtsi   |  5 +
 configs/imx8mm_evk_defconfig   |  4 
 configs/imx8mn_ddr4_evk_defconfig  |  4 
 configs/imx8mp_evk_defconfig   |  3 +++
 11 files changed, 64 insertions(+)
 create mode 100644 arch/arm/dts/imx8mq-evk-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx8mq-phanbell-u-boot.dtsi


base-commit: ee1e04558ff8c8ed812b986939447f129bb0b0bb
-- 
2.17.1



[PATCH v2 2/2] ARM: dts: imx8m: add UHS or HS400/HS400ES properties

2020-12-02 Thread Andrey Zhizhikin
i.MX8M series provide support for high speed grades in their
usdhc controllers, which has eMMC and SDHC connected to them.

Enable this support across the entire i.MX8M family by providing quirks
to usdhc controllers designated by storage media connected to them.

Signed-off-by: Andrey Zhizhikin 
Cc: Stefano Babic 
Cc: Ye Li 
---
Changes in v2: 
- Moved u-boot binding for imx8mq-evk to separate autoincluded dtsi
  files

 arch/arm/dts/fsl-imx8qm-mek-u-boot.dtsi  | 3 +++
 arch/arm/dts/fsl-imx8qxp-mek-u-boot.dtsi | 3 +++
 arch/arm/dts/imx8mm-evk-u-boot.dtsi  | 4 
 arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi | 4 
 arch/arm/dts/imx8mp-evk-u-boot.dtsi  | 4 
 arch/arm/dts/imx8mq-evk-u-boot.dtsi  | 9 +
 6 files changed, 27 insertions(+)

diff --git a/arch/arm/dts/fsl-imx8qm-mek-u-boot.dtsi 
b/arch/arm/dts/fsl-imx8qm-mek-u-boot.dtsi
index 80d6475b7c..2f86fcce3e 100644
--- a/arch/arm/dts/fsl-imx8qm-mek-u-boot.dtsi
+++ b/arch/arm/dts/fsl-imx8qm-mek-u-boot.dtsi
@@ -118,8 +118,11 @@
 
  {
u-boot,dm-spl;
+   u-boot,mmc-hs400-1_8v;
 };
 
  {
u-boot,dm-spl;
+   u-boot,sd-uhs-sdr104;
+   u-boot,sd-uhs-ddr50;
 };
diff --git a/arch/arm/dts/fsl-imx8qxp-mek-u-boot.dtsi 
b/arch/arm/dts/fsl-imx8qxp-mek-u-boot.dtsi
index 771ab635f1..f4332edac5 100644
--- a/arch/arm/dts/fsl-imx8qxp-mek-u-boot.dtsi
+++ b/arch/arm/dts/fsl-imx8qxp-mek-u-boot.dtsi
@@ -118,8 +118,11 @@
 
  {
u-boot,dm-spl;
+   u-boot,mmc-hs400-1_8v;
 };
 
  {
u-boot,dm-spl;
+   u-boot,sd-uhs-sdr104;
+   u-boot,sd-uhs-ddr50;
 };
diff --git a/arch/arm/dts/imx8mm-evk-u-boot.dtsi 
b/arch/arm/dts/imx8mm-evk-u-boot.dtsi
index 9f77d3c6ff..67666a08ec 100644
--- a/arch/arm/dts/imx8mm-evk-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-evk-u-boot.dtsi
@@ -100,10 +100,14 @@
 
  {
u-boot,dm-spl;
+   u-boot,sd-uhs-sdr104;
+   u-boot,sd-uhs-ddr50;
 };
 
  {
u-boot,dm-spl;
+   u-boot,mmc-hs400-1_8v;
+   u-boot,mmc-hs400-enhanced-strobe;
 };
 
  {
diff --git a/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi 
b/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi
index 98b0b9891b..e03e635213 100644
--- a/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi
+++ b/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi
@@ -97,10 +97,14 @@
 
  {
u-boot,dm-spl;
+   u-boot,sd-uhs-sdr104;
+   u-boot,sd-uhs-ddr50;
 };
 
  {
u-boot,dm-spl;
+   u-boot,mmc-hs400-1_8v;
+   u-boot,mmc-hs400-enhanced-strobe;
 };
 
  {
diff --git a/arch/arm/dts/imx8mp-evk-u-boot.dtsi 
b/arch/arm/dts/imx8mp-evk-u-boot.dtsi
index 2452e9175c..0776b24a6e 100644
--- a/arch/arm/dts/imx8mp-evk-u-boot.dtsi
+++ b/arch/arm/dts/imx8mp-evk-u-boot.dtsi
@@ -126,10 +126,14 @@
 
  {
u-boot,dm-spl;
+   u-boot,sd-uhs-sdr104;
+   u-boot,sd-uhs-ddr50;
 };
 
  {
u-boot,dm-spl;
+   u-boot,mmc-hs400-1_8v;
+   u-boot,mmc-hs400-enhanced-strobe;
 };
 
  {
diff --git a/arch/arm/dts/imx8mq-evk-u-boot.dtsi 
b/arch/arm/dts/imx8mq-evk-u-boot.dtsi
index 4712cf6a44..d0fc64c433 100644
--- a/arch/arm/dts/imx8mq-evk-u-boot.dtsi
+++ b/arch/arm/dts/imx8mq-evk-u-boot.dtsi
@@ -3,3 +3,12 @@
 _usdhc2_vmmc {
u-boot,off-on-delay-us = <2>;
 };
+
+ {
+   u-boot,mmc-hs400-1_8v;
+};
+
+ {
+   u-boot,sd-uhs-sdr104;
+   u-boot,sd-uhs-ddr50;
+};
-- 
2.17.1



[PATCH v2 1/2] ARM: dts: imx8m: increase off-on delay on the SD Vcc regulator

2020-12-02 Thread Andrey Zhizhikin
Some SD Card controller and power circuitry has increased capacitance,
which keeps the internal logic remains powered after regulator is switch
off. This is generally the case when card is switched to SD104 mode,
where a power cycle should be performed. In case if the card internal
logic remains powered, it causes a subsequent failure of mode
transition, effectively leading to failed enumeration.

Introduce a delay of 20 msec in order to provide a possibility for
internal card circuitry to drain voltages and perform a power cycle
correctly.

Similar fix is done in commit c49d0ac38a76 ("ARM: dts: rmobile: Increase
off-on delay on the SD Vcc regulator") targeted Renesas SOCs.

Signed-off-by: Andrey Zhizhikin 
Cc: Stefano Babic 
---
Changes in v2:
- Moved u-boot binding for imx8mq-evk and imx8mq-phanbell to separate
  autoincluded dtsi files 

 arch/arm/dts/imx8mm-beacon-kit-u-boot.dtsi | 4 
 arch/arm/dts/imx8mm-evk-u-boot.dtsi| 4 
 arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi   | 4 
 arch/arm/dts/imx8mp-evk-u-boot.dtsi| 4 
 arch/arm/dts/imx8mq-evk-u-boot.dtsi| 5 +
 arch/arm/dts/imx8mq-phanbell-u-boot.dtsi   | 5 +
 6 files changed, 26 insertions(+)
 create mode 100644 arch/arm/dts/imx8mq-evk-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx8mq-phanbell-u-boot.dtsi

diff --git a/arch/arm/dts/imx8mm-beacon-kit-u-boot.dtsi 
b/arch/arm/dts/imx8mm-beacon-kit-u-boot.dtsi
index fc1aebb2fe..6d80a529ae 100644
--- a/arch/arm/dts/imx8mm-beacon-kit-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-beacon-kit-u-boot.dtsi
@@ -37,6 +37,10 @@
/delete-property/ assigned-clock-rates;
 };
 
+_usdhc2_vmmc {
+   u-boot,off-on-delay-us = <2>;
+};
+
  {
phy-reset-gpios = < 22 GPIO_ACTIVE_LOW>;
 };
diff --git a/arch/arm/dts/imx8mm-evk-u-boot.dtsi 
b/arch/arm/dts/imx8mm-evk-u-boot.dtsi
index b5c12105a9..9f77d3c6ff 100644
--- a/arch/arm/dts/imx8mm-evk-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-evk-u-boot.dtsi
@@ -46,6 +46,10 @@
u-boot,dm-spl;
 };
 
+_usdhc2_vmmc {
+   u-boot,off-on-delay-us = <2>;
+};
+
 _reg_usdhc2_vmmc {
u-boot,dm-spl;
 };
diff --git a/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi 
b/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi
index 4419679d4c..98b0b9891b 100644
--- a/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi
+++ b/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi
@@ -47,6 +47,10 @@
u-boot,dm-spl;
 };
 
+_usdhc2_vmmc {
+   u-boot,off-on-delay-us = <2>;
+};
+
 _uart2 {
u-boot,dm-spl;
 };
diff --git a/arch/arm/dts/imx8mp-evk-u-boot.dtsi 
b/arch/arm/dts/imx8mp-evk-u-boot.dtsi
index 24a93ac2d6..2452e9175c 100644
--- a/arch/arm/dts/imx8mp-evk-u-boot.dtsi
+++ b/arch/arm/dts/imx8mp-evk-u-boot.dtsi
@@ -48,6 +48,10 @@
u-boot,dm-spl;
 };
 
+_usdhc2_vmmc {
+   u-boot,off-on-delay-us = <2>;
+};
+
 _usdhc2_vmmc {
u-boot,dm-spl;
 };
diff --git a/arch/arm/dts/imx8mq-evk-u-boot.dtsi 
b/arch/arm/dts/imx8mq-evk-u-boot.dtsi
new file mode 100644
index 00..4712cf6a44
--- /dev/null
+++ b/arch/arm/dts/imx8mq-evk-u-boot.dtsi
@@ -0,0 +1,5 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+
+_usdhc2_vmmc {
+   u-boot,off-on-delay-us = <2>;
+};
diff --git a/arch/arm/dts/imx8mq-phanbell-u-boot.dtsi 
b/arch/arm/dts/imx8mq-phanbell-u-boot.dtsi
new file mode 100644
index 00..4712cf6a44
--- /dev/null
+++ b/arch/arm/dts/imx8mq-phanbell-u-boot.dtsi
@@ -0,0 +1,5 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+
+_usdhc2_vmmc {
+   u-boot,off-on-delay-us = <2>;
+};
-- 
2.17.1



[PATCH 2/2] ARM: dts: imx8m: add UHS or HS400/HS400ES properties

2020-12-01 Thread Andrey Zhizhikin
i.MX8M series provide support for high speed grades in their
usdhc controllers, which has eMMC and SDHC connected to them.

Enable this support across the entire i.MX8M family by providing quirks
to usdhc controllers designated by storage media connected to them.

Signed-off-by: Andrey Zhizhikin 
Cc: Stefano Babic 
Cc: Ye Li 
---
 arch/arm/dts/fsl-imx8qm-mek-u-boot.dtsi  | 3 +++
 arch/arm/dts/fsl-imx8qxp-mek-u-boot.dtsi | 3 +++
 arch/arm/dts/imx8mm-evk-u-boot.dtsi  | 4 
 arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi | 4 
 arch/arm/dts/imx8mp-evk-u-boot.dtsi  | 4 
 arch/arm/dts/imx8mq-evk.dts  | 3 +++
 6 files changed, 21 insertions(+)

diff --git a/arch/arm/dts/fsl-imx8qm-mek-u-boot.dtsi 
b/arch/arm/dts/fsl-imx8qm-mek-u-boot.dtsi
index 80d6475b7c..2f86fcce3e 100644
--- a/arch/arm/dts/fsl-imx8qm-mek-u-boot.dtsi
+++ b/arch/arm/dts/fsl-imx8qm-mek-u-boot.dtsi
@@ -118,8 +118,11 @@
 
  {
u-boot,dm-spl;
+   u-boot,mmc-hs400-1_8v;
 };
 
  {
u-boot,dm-spl;
+   u-boot,sd-uhs-sdr104;
+   u-boot,sd-uhs-ddr50;
 };
diff --git a/arch/arm/dts/fsl-imx8qxp-mek-u-boot.dtsi 
b/arch/arm/dts/fsl-imx8qxp-mek-u-boot.dtsi
index 771ab635f1..f4332edac5 100644
--- a/arch/arm/dts/fsl-imx8qxp-mek-u-boot.dtsi
+++ b/arch/arm/dts/fsl-imx8qxp-mek-u-boot.dtsi
@@ -118,8 +118,11 @@
 
  {
u-boot,dm-spl;
+   u-boot,mmc-hs400-1_8v;
 };
 
  {
u-boot,dm-spl;
+   u-boot,sd-uhs-sdr104;
+   u-boot,sd-uhs-ddr50;
 };
diff --git a/arch/arm/dts/imx8mm-evk-u-boot.dtsi 
b/arch/arm/dts/imx8mm-evk-u-boot.dtsi
index 9f77d3c6ff..67666a08ec 100644
--- a/arch/arm/dts/imx8mm-evk-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-evk-u-boot.dtsi
@@ -100,10 +100,14 @@
 
  {
u-boot,dm-spl;
+   u-boot,sd-uhs-sdr104;
+   u-boot,sd-uhs-ddr50;
 };
 
  {
u-boot,dm-spl;
+   u-boot,mmc-hs400-1_8v;
+   u-boot,mmc-hs400-enhanced-strobe;
 };
 
  {
diff --git a/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi 
b/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi
index 98b0b9891b..e03e635213 100644
--- a/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi
+++ b/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi
@@ -97,10 +97,14 @@
 
  {
u-boot,dm-spl;
+   u-boot,sd-uhs-sdr104;
+   u-boot,sd-uhs-ddr50;
 };
 
  {
u-boot,dm-spl;
+   u-boot,mmc-hs400-1_8v;
+   u-boot,mmc-hs400-enhanced-strobe;
 };
 
  {
diff --git a/arch/arm/dts/imx8mp-evk-u-boot.dtsi 
b/arch/arm/dts/imx8mp-evk-u-boot.dtsi
index 2452e9175c..0776b24a6e 100644
--- a/arch/arm/dts/imx8mp-evk-u-boot.dtsi
+++ b/arch/arm/dts/imx8mp-evk-u-boot.dtsi
@@ -126,10 +126,14 @@
 
  {
u-boot,dm-spl;
+   u-boot,sd-uhs-sdr104;
+   u-boot,sd-uhs-ddr50;
 };
 
  {
u-boot,dm-spl;
+   u-boot,mmc-hs400-1_8v;
+   u-boot,mmc-hs400-enhanced-strobe;
 };
 
  {
diff --git a/arch/arm/dts/imx8mq-evk.dts b/arch/arm/dts/imx8mq-evk.dts
index 9663683f69..985e7e7f8b 100644
--- a/arch/arm/dts/imx8mq-evk.dts
+++ b/arch/arm/dts/imx8mq-evk.dts
@@ -291,6 +291,7 @@
non-removable;
no-sd;
no-sdio;
+   u-boot,mmc-hs400-1_8v;
status = "okay";
 };
 
@@ -301,6 +302,8 @@
pinctrl-2 = <_usdhc2_200mhz>;
cd-gpios = < 12 GPIO_ACTIVE_LOW>;
vmmc-supply = <_usdhc2_vmmc>;
+   u-boot,sd-uhs-sdr104;
+   u-boot,sd-uhs-ddr50;
status = "okay";
 };
 
-- 
2.17.1



[PATCH 1/2] ARM: dts: imx8m: increase off-on delay on the SD Vcc regulator

2020-12-01 Thread Andrey Zhizhikin
Some SD Card controller and power circuitry has increased capacitance,
which keeps the internal logic remains powered after regulator is switch
off. This is generally the case when card is switched to SD104 mode,
where a power cycle should be performed. In case if the card internal
logic remains powered, it causes a subsequent failure of mode
transition, effectively leading to failed enumeration.

Introduce a delay of 20 msec in order to provide a possibility for
internal card circuitry to drain voltages and perform a power cycle
correctly.

Similar fix is done in commit c49d0ac38a76 ("ARM: dts: rmobile: Increase
off-on delay on the SD Vcc regulator") targeted Renesas SOCs.

Signed-off-by: Andrey Zhizhikin 
Cc: Stefano Babic 
---
 arch/arm/dts/imx8mm-beacon-kit-u-boot.dtsi | 4 
 arch/arm/dts/imx8mm-evk-u-boot.dtsi| 4 
 arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi   | 4 
 arch/arm/dts/imx8mp-evk-u-boot.dtsi| 4 
 arch/arm/dts/imx8mq-evk.dts| 1 +
 arch/arm/dts/imx8mq-phanbell.dts   | 1 +
 6 files changed, 18 insertions(+)

diff --git a/arch/arm/dts/imx8mm-beacon-kit-u-boot.dtsi 
b/arch/arm/dts/imx8mm-beacon-kit-u-boot.dtsi
index fc1aebb2fe..6d80a529ae 100644
--- a/arch/arm/dts/imx8mm-beacon-kit-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-beacon-kit-u-boot.dtsi
@@ -37,6 +37,10 @@
/delete-property/ assigned-clock-rates;
 };
 
+_usdhc2_vmmc {
+   u-boot,off-on-delay-us = <2>;
+};
+
  {
phy-reset-gpios = < 22 GPIO_ACTIVE_LOW>;
 };
diff --git a/arch/arm/dts/imx8mm-evk-u-boot.dtsi 
b/arch/arm/dts/imx8mm-evk-u-boot.dtsi
index b5c12105a9..9f77d3c6ff 100644
--- a/arch/arm/dts/imx8mm-evk-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-evk-u-boot.dtsi
@@ -46,6 +46,10 @@
u-boot,dm-spl;
 };
 
+_usdhc2_vmmc {
+   u-boot,off-on-delay-us = <2>;
+};
+
 _reg_usdhc2_vmmc {
u-boot,dm-spl;
 };
diff --git a/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi 
b/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi
index 4419679d4c..98b0b9891b 100644
--- a/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi
+++ b/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi
@@ -47,6 +47,10 @@
u-boot,dm-spl;
 };
 
+_usdhc2_vmmc {
+   u-boot,off-on-delay-us = <2>;
+};
+
 _uart2 {
u-boot,dm-spl;
 };
diff --git a/arch/arm/dts/imx8mp-evk-u-boot.dtsi 
b/arch/arm/dts/imx8mp-evk-u-boot.dtsi
index 24a93ac2d6..2452e9175c 100644
--- a/arch/arm/dts/imx8mp-evk-u-boot.dtsi
+++ b/arch/arm/dts/imx8mp-evk-u-boot.dtsi
@@ -48,6 +48,10 @@
u-boot,dm-spl;
 };
 
+_usdhc2_vmmc {
+   u-boot,off-on-delay-us = <2>;
+};
+
 _usdhc2_vmmc {
u-boot,dm-spl;
 };
diff --git a/arch/arm/dts/imx8mq-evk.dts b/arch/arm/dts/imx8mq-evk.dts
index 55294ba9c8..9663683f69 100644
--- a/arch/arm/dts/imx8mq-evk.dts
+++ b/arch/arm/dts/imx8mq-evk.dts
@@ -39,6 +39,7 @@
regulator-max-microvolt = <330>;
gpio = < 19 GPIO_ACTIVE_HIGH>;
enable-active-high;
+   u-boot,off-on-delay-us = <2>;
};
 
buck2_reg: regulator-buck2 {
diff --git a/arch/arm/dts/imx8mq-phanbell.dts b/arch/arm/dts/imx8mq-phanbell.dts
index 4892ad5ee1..bc6b2638ee 100644
--- a/arch/arm/dts/imx8mq-phanbell.dts
+++ b/arch/arm/dts/imx8mq-phanbell.dts
@@ -34,6 +34,7 @@
regulator-max-microvolt = <330>;
gpio = < 19 GPIO_ACTIVE_HIGH>;
enable-active-high;
+   u-boot,off-on-delay-us = <2>;
};
 };
 
-- 
2.17.1



[PATCH 0/2] imx8m: introduce high speed mode support in usdhc

2020-12-01 Thread Andrey Zhizhikin
This patch series is targeted to address issues that can be observed
with various sd cards connected to i.MX8M derivatives.

Current configuration of usdhc dts nodes for imx8m SOC derivatives does
experience issues with recognition and mode switch for various sd card
types from different manufacturers, sometimes leading to an abrupted boot
process, either during attempt to load kernel image from attached media
or failure to recognize the sd card when switch to higher speed mode is
performed.

Modifications in patches introduced are aimed to resolve those issue by
introducing a short delay when mode switch in attempted, and enabling
high speed mode quirks for all imx8m derivatives.

Andrey Zhizhikin (2):
  ARM: dts: imx8m: increase off-on delay on the SD Vcc regulator
  ARM: dts: imx8m: add UHS or HS400/HS400ES properties

 arch/arm/dts/fsl-imx8qm-mek-u-boot.dtsi| 3 +++
 arch/arm/dts/fsl-imx8qxp-mek-u-boot.dtsi   | 3 +++
 arch/arm/dts/imx8mm-beacon-kit-u-boot.dtsi | 4 
 arch/arm/dts/imx8mm-evk-u-boot.dtsi| 8 
 arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi   | 8 
 arch/arm/dts/imx8mp-evk-u-boot.dtsi| 8 
 arch/arm/dts/imx8mq-evk.dts| 4 
 arch/arm/dts/imx8mq-phanbell.dts   | 1 +
 8 files changed, 39 insertions(+)


base-commit: 0719bf42931033c3109ecc6357e8adb567cb637b
-- 
2.17.1



Re: [U-Boot] [PATCH] config: Enable part command for socfpga platform

2017-12-18 Thread Andrey Zhizhikin
Hello Marek,

On Mon, Dec 18, 2017 at 12:39 PM, Marek Vasut <ma...@denx.de> wrote:
> On 12/18/2017 12:10 PM, Andrey Zhizhikin wrote:
>> Enable CONFIG_CMD_PART item, as default environment requires it
>> and complains this command in unknown.
>
> Fine by me, but what about the other boards, don't they need this as well ?

I'd say this is applicable to other boards in socfpga family as well.
The only reason I didn't include them as well into this commit is I
don't have those boards on hands to perform verification. But I can
assume since a lot of people uses ENV files to overwrite defaults -
this should not affect anyone. Please let me know what you think, and
I can re-submit this patch to include part command in all socfpga
family configs.

>
> btw diffstat is missing and the tags are wrong (should be ARM:
> socfpga:). I can fix those up, but see my question above...
>

Thanks a lot for pointing this out! I quickly checked the log on those
files, and missed those points out... If you would agree on my
proposal below, then I get those resolved as well.

-- 
Regards,
Andrey.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH] ARM: socfpga: Enable part command for socfpga platform

2017-12-18 Thread Andrey Zhizhikin
Enable CONFIG_CMD_PART item, as default environment requires it
and complains this command in unknown.

Signed-off-by: Andrey Zhizhikin <andre...@gmail.com>
---
 configs/socfpga_arria10_defconfig  | 1 +
 configs/socfpga_arria5_defconfig   | 1 +
 configs/socfpga_cyclone5_defconfig | 1 +
 configs/socfpga_de0_nano_soc_defconfig | 1 +
 configs/socfpga_de10_nano_defconfig| 1 +
 configs/socfpga_de1_soc_defconfig  | 1 +
 configs/socfpga_is1_defconfig  | 1 +
 configs/socfpga_mcvevk_defconfig   | 1 +
 configs/socfpga_sockit_defconfig   | 1 +
 configs/socfpga_socrates_defconfig | 1 +
 configs/socfpga_sr1500_defconfig   | 1 +
 configs/socfpga_vining_fpga_defconfig  | 1 +
 12 files changed, 12 insertions(+)

diff --git a/configs/socfpga_arria10_defconfig 
b/configs/socfpga_arria10_defconfig
index f7bcce3..0b3ec11 100644
--- a/configs/socfpga_arria10_defconfig
+++ b/configs/socfpga_arria10_defconfig
@@ -20,6 +20,7 @@ CONFIG_CMD_PING=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
+CONFIG_CMD_PART=y
 CONFIG_MTDIDS_DEFAULT="nor0=ff705000.spi.0"
 CONFIG_DOS_PARTITION=y
 # CONFIG_SPL_DOS_PARTITION is not set
diff --git a/configs/socfpga_arria5_defconfig b/configs/socfpga_arria5_defconfig
index 8ed6169..2685881 100644
--- a/configs/socfpga_arria5_defconfig
+++ b/configs/socfpga_arria5_defconfig
@@ -35,6 +35,7 @@ CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
+CONFIG_CMD_PART=y
 CONFIG_MTDIDS_DEFAULT="nor0=ff705000.spi.0"
 
CONFIG_MTDPARTS_DEFAULT="mtdparts=ff705000.spi.0:1m(u-boot),256k(env1),256k(env2),14848k(boot),16m(rootfs),-@1536k(UBI)0"
 CONFIG_CMD_UBI=y
diff --git a/configs/socfpga_cyclone5_defconfig 
b/configs/socfpga_cyclone5_defconfig
index 54c3495..f49d0ab 100644
--- a/configs/socfpga_cyclone5_defconfig
+++ b/configs/socfpga_cyclone5_defconfig
@@ -35,6 +35,7 @@ CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
+CONFIG_CMD_PART=y
 CONFIG_MTDIDS_DEFAULT="nor0=ff705000.spi.0"
 
CONFIG_MTDPARTS_DEFAULT="mtdparts=ff705000.spi.0:1m(u-boot),256k(env1),256k(env2),14848k(boot),16m(rootfs),-@1536k(UBI)0"
 CONFIG_CMD_UBI=y
diff --git a/configs/socfpga_de0_nano_soc_defconfig 
b/configs/socfpga_de0_nano_soc_defconfig
index 2787b60..59b2dcf 100644
--- a/configs/socfpga_de0_nano_soc_defconfig
+++ b/configs/socfpga_de0_nano_soc_defconfig
@@ -37,6 +37,7 @@ CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
+CONFIG_CMD_PART=y
 CONFIG_MTDIDS_DEFAULT="nor0=ff705000.spi.0"
 
CONFIG_MTDPARTS_DEFAULT="mtdparts=ff705000.spi.0:1m(u-boot),256k(env1),256k(env2),14848k(boot),16m(rootfs),-@1536k(UBI)0"
 CONFIG_CMD_UBI=y
diff --git a/configs/socfpga_de10_nano_defconfig 
b/configs/socfpga_de10_nano_defconfig
index ecf6de3..17780af 100644
--- a/configs/socfpga_de10_nano_defconfig
+++ b/configs/socfpga_de10_nano_defconfig
@@ -34,6 +34,7 @@ CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
+CONFIG_CMD_PART=y
 CONFIG_MTDIDS_DEFAULT="nor0=ff705000.spi.0"
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SPL_DM=y
diff --git a/configs/socfpga_de1_soc_defconfig 
b/configs/socfpga_de1_soc_defconfig
index 97a6c5e..d4ceb92 100644
--- a/configs/socfpga_de1_soc_defconfig
+++ b/configs/socfpga_de1_soc_defconfig
@@ -36,6 +36,7 @@ CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
+CONFIG_CMD_PART=y
 CONFIG_MTDIDS_DEFAULT="nor0=ff705000.spi.0"
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SPL_DM=y
diff --git a/configs/socfpga_is1_defconfig b/configs/socfpga_is1_defconfig
index bba90d9..10f0c82 100644
--- a/configs/socfpga_is1_defconfig
+++ b/configs/socfpga_is1_defconfig
@@ -32,6 +32,7 @@ CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
+CONFIG_CMD_PART=y
 CONFIG_MTDIDS_DEFAULT="nor0=ff705000.spi.0"
 
CONFIG_MTDPARTS_DEFAULT="mtdparts=ff705000.spi.0:1m(u-boot),256k(env1),256k(env2),14848k(boot),16m(rootfs),-@1536k(UBI)0"
 CONFIG_CMD_UBI=y
diff --git a/configs/socfpga_mcvevk_defconfig b/configs/socfpga_mcvevk_defconfig
index 5bae037..ed057cf 100644
--- a/configs/socfpga_mcvevk_defconfig
+++ b/configs/socfpga_mcvevk_defconfig
@@ -36,6 +36,7 @@ CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
+CONFIG_CMD_PART=y
 CONFIG_MTDIDS_DEFAULT="nor0=ff705000.spi.0"
 
CONFIG_MTDPARTS_DEFAULT="mtdparts=ff705000.spi.0:1m(u-boot),256k(env1),256k(env2),14848k(boot),16m(rootfs),-@1536k(UBI)0"
 CONFIG_CMD_UBI=y
diff --git a/configs/socfpga_sockit_defconfig b/configs/socfpga_sockit_defconfig
index 079d465..857f2f7 100644
--- a/configs/socfpga_sockit_defconfig
+++ b/configs/socfpga_sockit_defconfig
@@ -35,6 +35,7 @@ CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
+CONFIG_CMD_PART=y
 CONFIG_MTDIDS_DEFAULT="nor0=ff705000.spi.0

[U-Boot] [PATCH] config: Enable part command for socfpga platform

2017-12-18 Thread Andrey Zhizhikin
Enable CONFIG_CMD_PART item, as default environment requires it
and complains this command in unknown.

Signed-off-by: Andrey Zhizhikin <andre...@gmail.com>

diff --git a/configs/socfpga_arria5_defconfig b/configs/socfpga_arria5_defconfig
index 8ed6169..2685881 100644
--- a/configs/socfpga_arria5_defconfig
+++ b/configs/socfpga_arria5_defconfig
@@ -35,6 +35,7 @@ CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
+CONFIG_CMD_PART=y
 CONFIG_MTDIDS_DEFAULT="nor0=ff705000.spi.0"
 
CONFIG_MTDPARTS_DEFAULT="mtdparts=ff705000.spi.0:1m(u-boot),256k(env1),256k(env2),14848k(boot),16m(rootfs),-@1536k(UBI)0"
 CONFIG_CMD_UBI=y
diff --git a/configs/socfpga_cyclone5_defconfig 
b/configs/socfpga_cyclone5_defconfig
index 54c3495..f49d0ab 100644
--- a/configs/socfpga_cyclone5_defconfig
+++ b/configs/socfpga_cyclone5_defconfig
@@ -35,6 +35,7 @@ CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
+CONFIG_CMD_PART=y
 CONFIG_MTDIDS_DEFAULT="nor0=ff705000.spi.0"
 
CONFIG_MTDPARTS_DEFAULT="mtdparts=ff705000.spi.0:1m(u-boot),256k(env1),256k(env2),14848k(boot),16m(rootfs),-@1536k(UBI)0"
 CONFIG_CMD_UBI=y
diff --git a/configs/socfpga_sockit_defconfig b/configs/socfpga_sockit_defconfig
index 079d465..857f2f7 100644
--- a/configs/socfpga_sockit_defconfig
+++ b/configs/socfpga_sockit_defconfig
@@ -35,6 +35,7 @@ CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
+CONFIG_CMD_PART=y
 CONFIG_MTDIDS_DEFAULT="nor0=ff705000.spi.0"
 
CONFIG_MTDPARTS_DEFAULT="mtdparts=ff705000.spi.0:1m(u-boot),256k(env1),256k(env2),14848k(boot),16m(rootfs),-@1536k(UBI)0"
 CONFIG_CMD_UBI=y
diff --git a/configs/socfpga_socrates_defconfig 
b/configs/socfpga_socrates_defconfig
index 35773e6..71bd8f1 100644
--- a/configs/socfpga_socrates_defconfig
+++ b/configs/socfpga_socrates_defconfig
@@ -36,6 +36,7 @@ CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
+CONFIG_CMD_PART=y
 CONFIG_MTDIDS_DEFAULT="nor0=ff705000.spi.0"
 
CONFIG_MTDPARTS_DEFAULT="mtdparts=ff705000.spi.0:1m(u-boot),256k(env1),256k(env2),14848k(boot),16m(rootfs),-@1536k(UBI)0"
 CONFIG_CMD_UBI=y
-- 
2.7.4

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot