[U-Boot] [PATCH 2/2] arm: mvebu: clearfog: fix boot from SD card

2019-11-03 Thread Baruch Siach
Enable gpio0 in SPL to allow the sdhci driver read the SD card-detect
signal.

Signed-off-by: Baruch Siach 
---
 arch/arm/dts/armada-388-clearfog-u-boot.dtsi | 4 
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/dts/armada-388-clearfog-u-boot.dtsi 
b/arch/arm/dts/armada-388-clearfog-u-boot.dtsi
index cf6c08881b18..38e4f3d99ac9 100644
--- a/arch/arm/dts/armada-388-clearfog-u-boot.dtsi
+++ b/arch/arm/dts/armada-388-clearfog-u-boot.dtsi
@@ -12,6 +12,10 @@
u-boot,dm-spl;
 };
 
+&gpio0 {
+   u-boot,dm-spl;
+};
+
 &ahci0 {
u-boot,dm-spl;
 };
-- 
2.24.0.rc1

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


[U-Boot] [PATCH 1/2] gpio: fix CONFIG_IS_ENABLED(DM_GPIO) for SPL

2019-11-03 Thread Baruch Siach
There is currently no CONFIG_SPL_DM_GPIO, so CONFIG_IS_ENABLED(DM_GPIO)
is always false. As a result the sdhci driver can not use the DM gpio
API to read the card-detect signal in SPL. This breaks boot from SD card
on the SolidRun Clearfog platform since commit da18c62b6e ("mmc: sdhci:
Implement SDHCI card detect") that added sdhci_get_cd().

Add a blind CONFIG_SPL_DM_GPIO symbol that is enabled iff CONFIG_DM_GPIO
is. That makes CONFIG_IS_ENABLED(DM_GPIO) correct for SPL code.

Signed-off-by: Baruch Siach 
---
 drivers/gpio/Kconfig | 5 +
 1 file changed, 5 insertions(+)

diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
index c1ad5d64a35c..9bac341c5ed5 100644
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -14,6 +14,11 @@ config DM_GPIO
  particular GPIOs that they provide. The uclass interface
  is defined in include/asm-generic/gpio.h.
 
+config SPL_DM_GPIO
+   bool
+   depends on DM_GPIO
+   default y
+
 config GPIO_HOG
bool "Enable GPIO hog support"
depends on DM_GPIO
-- 
2.24.0.rc1

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


[U-Boot] [PATCH] mmc: sdhci: make sdhci_get_cd static

2019-11-03 Thread Baruch Siach
sdhci_get_cd() is not referenced anywhere else. Limit its scope to
sdhci.c.

Signed-off-by: Baruch Siach 
---
 drivers/mmc/sdhci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
index fbc576fd726e..32e83db8e09b 100644
--- a/drivers/mmc/sdhci.c
+++ b/drivers/mmc/sdhci.c
@@ -660,7 +660,7 @@ int sdhci_probe(struct udevice *dev)
return sdhci_init(mmc);
 }
 
-int sdhci_get_cd(struct udevice *dev)
+static int sdhci_get_cd(struct udevice *dev)
 {
struct mmc *mmc = mmc_get_mmc_dev(dev);
struct sdhci_host *host = mmc->priv;
-- 
2.24.0.rc1

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


Re: [U-Boot] [PATCH] stm32mp1: configs: fix checking the presence of an environment

2019-11-03 Thread Bartosz Biłas
Hello Patrick,

sorry for the late answer but I'll try to explain you my issue.

On 10/29/19 9:38 AM, Patrick DELAUNAY wrote:

Hi Bartosz,

Please ad get maintainers or tools/patman to sent patch for stm32mp1 platform.

Ok, I'll remember about that.





From: U-Boot 
 On Behalf 
Of Bartosz Bilas
Sent: dimanche 27 octobre 2019 15:46
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] stm32mp1: configs: fix checking the presence of an
environment

Execute env check command within extra env settings section instead of bootcmd
whereby we are able to mount rootfs partition from sd card properly.

Signed-off-by: Bartosz Bilas 

---
 include/configs/stm32mp1.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/configs/stm32mp1.h b/include/configs/stm32mp1.h index
988992b336..cadc0358fd 100644
--- a/include/configs/stm32mp1.h
+++ b/include/configs/stm32mp1.h
@@ -115,7 +115,6 @@
"if test ${boot_device} = serial || test ${boot_device} = usb;" \
"then stm32prog ${boot_device} ${boot_instance}; " \
"else " \
-   "run env_check;" \
"if test ${boot_device} = mmc;" \
"then env set boot_targets \"mmc${boot_instance}\"; fi;" \
"if test ${boot_device} = nand;" \
@@ -160,6 +159,7 @@
"initrd_high=0x\0" \
"altbootcmd=run bootcmd\0" \
"env_default=1\0" \
+   "run env_check;" \



It is not a correct place, this define CONFIG_EXTRA_ENV_SETTINGS only the 
default environment (only set env variable).
Only "bootcmd"  or "preboot" is really executed, this command will be never 
executed here.



"env_check=if test $env_default -eq 1;"\
" then env set env_default 0;env save;fi\0" \
STM32MP_BOOTCMD \
--



Can you explain you issue and the board used.

The problem which I've encountered is that I'm not able to boot my rootfs 
partition properly using the latest U-Boot version (2019.10) using 
stm32mp157c-dk2 board (I've been getting kernel panic because it wasn't able to 
mount partition). On the previous version (2019.07) there is no any problems 
with that. I've used git bisect to check which commit causes the problem and it 
turned out that the problem is with commit 
22bed7ee4988aadfaef0c0da9746bf8541549ed4.



I think your patch only mask the issue, as environment is not saved, U-Boot 
never write in EXT4 file system.
You should have again the issue if you execute manually by the command "env 
save".

Hmm, it makes sense.



Today I have no issue on my side with environment in ext4 file system 
(generated by donwstrean yocto);
the requests done by U-Boot are acceptable if the ext4 file system is generated 
with only the features supported by U-Boot.

I use buildroot and if you wanna you can build and check that image yourself. 
Here is a link to guide 
https://github.com/buildroot/buildroot/tree/master/board/stmicroelectronics/stm32mp157c-dk2
 but remember to comment this line -> 
BR2_GLOBAL_PATCH_DIR="board/stmicroelectronics/stm32mp157c-dk2/patches" in 
stm32mp157c_dk2_defconfig file to disable my faulty patch.



But we solved issue with latest ext4 tools; since e2fsprogs 1.43 at least, we 
have ascendance incompatibility as new enable features are enable by default = 
metadata_csum and dir_index.

We remove them with the mkfs.ext4 option: -O ^metadata_csum,^dir_index

Example : mkfs.ext4 -L rootfs -O ^metadata_csum,^dir_index /dev/sdb4

I'll check that and let you know about the results.



For details of restriction, see commit 10a7a1b8 : update with hash tree 
directory of EXT4 not support by U-Boot (EXT4_INDEX_FL)

Thanks



Best regards

Patrick




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


Re: [U-Boot] [PATCH 4/4] mx6: Allow configuring the NoC registers on i.MX6QP

2019-11-03 Thread Stefano Babic
On 24/10/19 15:47, Fabio Estevam wrote:
> Hi Stefano,
> 
> On Fri, Jul 12, 2019 at 9:33 AM Fabio Estevam  wrote:
>>
>> The NoC registers on i.MX6QP needs to be configured, otherwise some
>> usecases in the kernel behave incorrectly, such as rotation and resize.
>>
>> Currently the NoC registers are not configured in the kernel, so
>> configure them in U-Boot like it is done in the NXP U-Boot tree.
>>
>> Signed-off-by: Fabio Estevam 
> 
> It seems that only the first patch of this series got applied.
> 
> Could you please consider applying patches 2-4 too?

Something went wrong, patches were already set to "Accepted" in
patchwork. I have picked up the rest of series, thanks for remind.

Regards,
Stefano


-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] stm32mp1: configs: fix checking the presence of an environment

2019-11-03 Thread Bartosz Biłas
Hello Patrick,

On 11/3/19 11:15 AM, Bartosz Biłas wrote:
> Hello Patrick,
>
> sorry for the late answer but I'll try to explain you my issue.
>
> On 10/29/19 9:38 AM, Patrick DELAUNAY wrote:
>
> Hi Bartosz,
>
> Please ad get maintainers or tools/patman to sent patch for stm32mp1 platform.
>
> Ok, I'll remember about that.
>
>
>
>
>
> From: U-Boot 
>  On Behalf 
> Of Bartosz Bilas
> Sent: dimanche 27 octobre 2019 15:46
> To: u-boot@lists.denx.de
> Subject: [U-Boot] [PATCH] stm32mp1: configs: fix checking the presence of an
> environment
>
> Execute env check command within extra env settings section instead of bootcmd
> whereby we are able to mount rootfs partition from sd card properly.
>
> Signed-off-by: Bartosz Bilas 
> 
> ---
>   include/configs/stm32mp1.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/configs/stm32mp1.h b/include/configs/stm32mp1.h index
> 988992b336..cadc0358fd 100644
> --- a/include/configs/stm32mp1.h
> +++ b/include/configs/stm32mp1.h
> @@ -115,7 +115,6 @@
>  "if test ${boot_device} = serial || test ${boot_device} = usb;" \
>  "then stm32prog ${boot_device} ${boot_instance}; " \
>  "else " \
> -   "run env_check;" \
>  "if test ${boot_device} = mmc;" \
>  "then env set boot_targets \"mmc${boot_instance}\"; fi;" \
>  "if test ${boot_device} = nand;" \
> @@ -160,6 +159,7 @@
>  "initrd_high=0x\0" \
>  "altbootcmd=run bootcmd\0" \
>  "env_default=1\0" \
> +   "run env_check;" \
>
>
>
> It is not a correct place, this define CONFIG_EXTRA_ENV_SETTINGS only the 
> default environment (only set env variable).
> Only "bootcmd"  or "preboot" is really executed, this command will be never 
> executed here.
>
>
>
>  "env_check=if test $env_default -eq 1;"\
>  " then env set env_default 0;env save;fi\0" \
>  STM32MP_BOOTCMD \
> --
>
>
>
> Can you explain you issue and the board used.
>
> The problem which I've encountered is that I'm not able to boot my rootfs 
> partition properly using the latest U-Boot version (2019.10) using 
> stm32mp157c-dk2 board (I've been getting kernel panic because it wasn't able 
> to mount partition). On the previous version (2019.07) there is no any 
> problems with that. I've used git bisect to check which commit causes the 
> problem and it turned out that the problem is with commit 
> 22bed7ee4988aadfaef0c0da9746bf8541549ed4.
>
>
>
> I think your patch only mask the issue, as environment is not saved, U-Boot 
> never write in EXT4 file system.
> You should have again the issue if you execute manually by the command "env 
> save".
>
> Hmm, it makes sense.
>
>
>
> Today I have no issue on my side with environment in ext4 file system 
> (generated by donwstrean yocto);
> the requests done by U-Boot are acceptable if the ext4 file system is 
> generated with only the features supported by U-Boot.
>
> I use buildroot and if you wanna you can build and check that image yourself. 
> Here is a link to guide 
> https://github.com/buildroot/buildroot/tree/master/board/stmicroelectronics/stm32mp157c-dk2
>  but remember to comment this line -> 
> BR2_GLOBAL_PATCH_DIR="board/stmicroelectronics/stm32mp157c-dk2/patches" in 
> stm32mp157c_dk2_defconfig file to disable my faulty patch.
>
>
>
> But we solved issue with latest ext4 tools; since e2fsprogs 1.43 at least, we 
> have ascendance incompatibility as new enable features are enable by default 
> = metadata_csum and dir_index.
>
> We remove them with the mkfs.ext4 option: -O ^metadata_csum,^dir_index
>
> Example : mkfs.ext4 -L rootfs -O ^metadata_csum,^dir_index /dev/sdb4
>
> I'll check that and let you know about the results.

I've prepared sd card with disabled those options and it works well. I 
think we can reject that patch then.


Best
Bartek
>
>
>
> For details of restriction, see commit 10a7a1b8 : update with hash tree 
> directory of EXT4 not support by U-Boot (EXT4_INDEX_FL)
>
> Thanks
>
>
>
> Best regards
>
> Patrick
>
>
>
>
> Best
> Bartek
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> https://lists.denx.de/listinfo/u-boot
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH] tbs2910: Disable Plan9/RTEMS bootm support

2019-11-03 Thread Tom Rini
We have once again reached a point where this board does not build in
some cases with supported toolchains due to reaching a size constraint.
To regain some space, disable support for Plan 9 / RTEMS images with the
bootm command.

Signed-off-by: Tom Rini 
---
 configs/tbs2910_defconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/configs/tbs2910_defconfig b/configs/tbs2910_defconfig
index 42e6f58eee19..ba29b7144d6e 100644
--- a/configs/tbs2910_defconfig
+++ b/configs/tbs2910_defconfig
@@ -17,6 +17,8 @@ CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="Matrix U-Boot> "
 CONFIG_CMD_BOOTZ=y
+# CONFIG_BOOTM_PLAN9 is not set
+# CONFIG_BOOTM_RTEMS is not set
 # CONFIG_CMD_FDT is not set
 CONFIG_CMD_MEMTEST=y
 # CONFIG_CMD_FLASH is not set
-- 
2.17.1

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


Re: [U-Boot] [PATCH v2 3/5] imx: nandbcb: add support for i.MX7

2019-11-03 Thread Stefano Babic
Hi Igor,

On 21/10/19 15:38, Igor Opaniuk wrote:
> From: Igor Opaniuk 
> 
> Add support for updating FCB/DBBT on i.MX7:
> - additional new fields in FCB structure
> - Leverage hardware BCH/randomizer for writing FCB
> 
> Signed-off-by: Igor Opaniuk 
> ---
> 

Patch conflicts with the one for i.MX6UL, that I have currently applied
(you see it on -next branch). Could you please rebase on it and resend ?
Thanks !

Regards,
Stefano

>  arch/arm/include/asm/mach-imx/imx-nandbcb.h |  12 ++
>  arch/arm/mach-imx/Kconfig   |   2 +-
>  arch/arm/mach-imx/cmd_nandbcb.c | 129 +---
>  3 files changed, 100 insertions(+), 43 deletions(-)
> 
> diff --git a/arch/arm/include/asm/mach-imx/imx-nandbcb.h 
> b/arch/arm/include/asm/mach-imx/imx-nandbcb.h
> index 033659a038..907e7ed8f9 100644
> --- a/arch/arm/include/asm/mach-imx/imx-nandbcb.h
> +++ b/arch/arm/include/asm/mach-imx/imx-nandbcb.h
> @@ -106,6 +106,18 @@ struct fcb_block {
>  
>   /* The swap position of main area in spare area */
>   u32 spare_offset;
> +
> + /* Actual for iMX7 only */
> + u32 onfi_sync_enable;
> + u32 onfi_sync_speed;
> + u32 onfi_sync_nand_data;
> + u32 reserved2[6];
> + u32 disbbm_search;
> + u32 disbbm_search_limit;
> + u32 reserved3[15];
> + u32 read_retry_enable;
> + u32 reserved4[1];
> + u32 fill_to_1024[183];
>  };
>  
>  #endif   /* _IMX_NAND_BCB_H_ */
> diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
> index b0b9d2c070..c22e8f51b4 100644
> --- a/arch/arm/mach-imx/Kconfig
> +++ b/arch/arm/mach-imx/Kconfig
> @@ -81,7 +81,7 @@ config CMD_HDMIDETECT
>  config CMD_NANDBCB
>   bool "i.MX6 NAND Boot Control Block(BCB) command"
>   depends on NAND && CMD_MTDPARTS
> - default y if ARCH_MX6 && NAND_MXS
> + default y if (ARCH_MX6 && NAND_MXS) || (ARCH_MX7 && NAND_MXS)
>   help
> Unlike normal 'nand write/erase' commands, this command update
> Boot Control Block(BCB) for i.MX6 platform NAND IP's.
> diff --git a/arch/arm/mach-imx/cmd_nandbcb.c b/arch/arm/mach-imx/cmd_nandbcb.c
> index 7811c61d22..aae2cc82f3 100644
> --- a/arch/arm/mach-imx/cmd_nandbcb.c
> +++ b/arch/arm/mach-imx/cmd_nandbcb.c
> @@ -16,6 +16,7 @@
>  #include 
>  #include 
>  
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -67,26 +68,36 @@ static void fill_fcb(struct fcb_block *fcb, struct 
> mtd_info *mtd)
>  {
>   struct nand_chip *chip = mtd_to_nand(mtd);
>   struct mxs_nand_info *nand_info = nand_get_controller_data(chip);
> + struct mxs_nand_layout l;
> +
> + mxs_nand_get_layout(mtd, &l);
>  
>   fcb->fingerprint = FCB_FINGERPRINT;
>   fcb->version = FCB_VERSION_1;
> +
>   fcb->pagesize = mtd->writesize;
>   fcb->oob_pagesize = mtd->writesize + mtd->oobsize;
>   fcb->sectors = mtd->erasesize / mtd->writesize;
>  
> - /* Divide ECC strength by two and save the value into FCB structure. */
> - fcb->ecc_level = nand_info->bch_geometry.ecc_strength >> 1;
> -
> - fcb->ecc_type = fcb->ecc_level;
> + fcb->meta_size = l.meta_size;
> + fcb->nr_blocks = l.nblocks;
> + fcb->ecc_nr = l.data0_size;
> + fcb->ecc_level = l.ecc0;
> + fcb->ecc_size = l.datan_size;
> + fcb->ecc_type = l.eccn;
>  
>   /* Also hardcoded in kobs-ng */
> - fcb->ecc_nr = 0x0200;
> - fcb->ecc_size = 0x0200;
> - fcb->datasetup = 80;
> - fcb->datahold = 60;
> - fcb->addr_setup = 25;
> - fcb->dsample_time = 6;
> - fcb->meta_size = 10;
> + if (is_mx6()) {
> + fcb->datasetup = 80;
> + fcb->datahold = 60;
> + fcb->addr_setup = 25;
> + fcb->dsample_time = 6;
> + } else if (is_mx7()) {
> + fcb->datasetup = 10;
> + fcb->datahold = 7;
> + fcb->addr_setup = 15;
> + fcb->dsample_time = 6;
> + }
>  
>   /* DBBT search area starts at second page on first block */
>   fcb->dbbt_start = 1;
> @@ -98,6 +109,9 @@ static void fill_fcb(struct fcb_block *fcb, struct 
> mtd_info *mtd)
>  
>   fcb->nr_blocks = mtd->writesize / fcb->ecc_nr - 1;
>  
> + fcb->disbbm = 0;
> + fcb->disbbm_search = 0;
> +
>   fcb->checksum = calc_chksum((void *)fcb + 4, sizeof(*fcb) - 4);
>  }
>  
> @@ -133,6 +147,7 @@ static int nandbcb_update(struct mtd_info *mtd, loff_t 
> off, size_t size,
>   size_t fwsize, dummy;
>   int i, ret;
>  
> + fcb_raw_page = 0;
>   /* erase */
>   memset(&opts, 0, sizeof(opts));
>   opts.offset = off;
> @@ -223,45 +238,74 @@ static int nandbcb_update(struct mtd_info *mtd, loff_t 
> off, size_t size,
>   else if (ret > 0)
>   dbbt->dbbtpages = 1;
>  
> - /* write fcb/dbbt */
> - fcb_raw_page = kzalloc(mtd->writesize + mtd->oobsize, GFP_KERNEL);
> - if (!fcb_raw_page) {
> - debug("failed to allocate fcb_raw_page\n");
> - ret = -ENOMEM;
> - goto dbbt_da

[U-Boot] [PATCH] ARM: imx6q_logic: Cleanup boot sequence check

2019-11-03 Thread Adam Ford
The board_boot_order() function currenly assumes that the boot source
is MMC/eMMC, but this isn't true for the NAND devices.

This patch cleans up board_boot_order() to check for NAND, SD, ESD,
MMC or EMMC.  Anything beyond these are not supported, so it will
default back to the serial downloader if any of those devices are not
available.

Fixes: 9fb50c68daa6 ("ARM: imx6q_logic: Fix MMC2 booting")

Signed-off-by: Adam Ford 

diff --git a/board/logicpd/imx6/imx6logic.c b/board/logicpd/imx6/imx6logic.c
index 3c1a3a9fa2..fc4ce34ce4 100644
--- a/board/logicpd/imx6/imx6logic.c
+++ b/board/logicpd/imx6/imx6logic.c
@@ -154,29 +154,49 @@ void board_boot_order(u32 *spl_boot_list)
 {
struct src *psrc = (struct src *)SRC_BASE_ADDR;
unsigned int reg = readl(&psrc->sbmr1) >> 11;
-   /*
-* Upon reading BOOT_CFG register the following map is done:
-* Bit 11 and 12 of BOOT_CFG register can determine the current
-* mmc port
-* 0x1  SD1-SOM
-* 0x2  SD2-Baseboard
-*/
-
-   reg &= 0x3; /* Only care about bottom 2 bits */
-   switch (reg) {
-   case 0:
-   spl_boot_list[0] = BOOT_DEVICE_MMC1;
+   u32 boot_mode = imx6_src_get_boot_mode() & IMX6_BMODE_MASK;
+   unsigned int bmode = readl(&src_base->sbmr2);
+
+   /* If bmode is serial or USB phy is active, return serial */
+   if (((bmode >> 24) & 0x03) == 0x01 || is_usbotg_phy_active()) {
+   spl_boot_list[0] = BOOT_DEVICE_BOARD;
+   return;
+   }
+
+   switch (boot_mode >> IMX6_BMODE_SHIFT) {
+   case IMX6_BMODE_NAND_MIN ... IMX6_BMODE_NAND_MAX:
+   spl_boot_list[0] = BOOT_DEVICE_NAND;
break;
-   case 1:
-   spl_boot_list[0] = BOOT_DEVICE_MMC2;
+   case IMX6_BMODE_SD:
+   case IMX6_BMODE_ESD:
+   case IMX6_BMODE_MMC:
+   case IMX6_BMODE_EMMC:
+   /*
+* Upon reading BOOT_CFG register the following map is done:
+* Bit 11 and 12 of BOOT_CFG register can determine the current
+* mmc port
+* 0x1  SD1-SOM
+* 0x2  SD2-Baseboard
+*/
+
+   reg &= 0x3; /* Only care about bottom 2 bits */
+   switch (reg) {
+   case 0:
+   spl_boot_list[0] = BOOT_DEVICE_MMC1;
+   break;
+   case 1:
+   spl_boot_list[0] = BOOT_DEVICE_MMC2;
+   break;
+   }
+   break;
+   default:
+   /* By default use USB downloader */
+   spl_boot_list[0] = BOOT_DEVICE_BOARD;
break;
}
 
-   /* If we cannot find a valid MMC/SD card, try NAND */
-   spl_boot_list[1] = BOOT_DEVICE_NAND;
-
/* As a last resort, use serial downloader */
-   spl_boot_list[2] = BOOT_DEVICE_BOARD;
+   spl_boot_list[1] = BOOT_DEVICE_BOARD;
 }
 
 static void ccgr_init(void)
-- 
2.20.1

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


Re: [U-Boot] [PATCH] tbs2910: Disable Plan9/RTEMS bootm support

2019-11-03 Thread Stefano Babic
On 03/11/19 13:41, Tom Rini wrote:
> We have once again reached a point where this board does not build in
> some cases with supported toolchains due to reaching a size constraint.
> To regain some space, disable support for Plan 9 / RTEMS images with the
> bootm command.
> 
> Signed-off-by: Tom Rini 
> ---
>  configs/tbs2910_defconfig | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/configs/tbs2910_defconfig b/configs/tbs2910_defconfig
> index 42e6f58eee19..ba29b7144d6e 100644
> --- a/configs/tbs2910_defconfig
> +++ b/configs/tbs2910_defconfig
> @@ -17,6 +17,8 @@ CONFIG_BOARD_EARLY_INIT_F=y
>  CONFIG_HUSH_PARSER=y
>  CONFIG_SYS_PROMPT="Matrix U-Boot> "
>  CONFIG_CMD_BOOTZ=y
> +# CONFIG_BOOTM_PLAN9 is not set
> +# CONFIG_BOOTM_RTEMS is not set
>  # CONFIG_CMD_FDT is not set
>  CONFIG_CMD_MEMTEST=y
>  # CONFIG_CMD_FLASH is not set
> 

Acked-by: Stefano Babic 

Best regards,
Stefano Babic


-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2 7/8] env: ti: boot: Boot Android with dynamic partitions

2019-11-03 Thread Tom Rini
On Wed, Oct 23, 2019 at 05:34:26PM +0300, Sam Protsenko wrote:

> Changes:
>   - use boot.img instead of boot_fit.img
>   - use .dtb from boot.img v2
>   - implement recovery boot
>   - always boot ramdisk from boot.img, we can't mount system as root
> now, as system is a logical partition inside of super partition
>   - don't add "skip_initramfs" to cmdline anymore
>   - to boot into recovery, use boot image from recovery partition
>   - prepare partition table:
> - A/B scheme
> - use 'super' partition instead of 'system' and 'vendor'
> - add dtbo partitions
> - introduce metadata partition
> 
> Not implemented: reading and applying dtbo files from dtbo partition.
> 
> Signed-off-by: Sam Protsenko 

This breaks at least "dra7xx_evm" building:
   arm:  +   dra7xx_evm
+(dra7xx_evm) In file included from include/configs/ti_omap5_common.h:57:0,
+(dra7xx_evm)  from include/configs/dra7xx_evm.h:62,
+(dra7xx_evm)  from include/config.h:5,
+(dra7xx_evm)  from include/common.h:23,
+(dra7xx_evm)  from env/common.c:10:
+(dra7xx_evm) include/environment/ti/boot.h:104:3: error: expected '}' before 
'AB_SELECT_SLOT'
+(dra7xx_evm)AB_SELECT_SLOT \
+(dra7xx_evm)^
+(dra7xx_evm) include/configs/ti_omap5_common.h:65:2: note: in expansion of 
macro 'DEFAULT_COMMON_BOOT_TI_ARGS'
+(dra7xx_evm)   DEFAULT_COMMON_BOOT_TI_ARGS \
+(dra7xx_evm)   ^~~
+(dra7xx_evm) include/env_default.h:111:2: note: in expansion of macro 
'CONFIG_EXTRA_ENV_SETTINGS'
+(dra7xx_evm)   CONFIG_EXTRA_ENV_SETTINGS
+(dra7xx_evm)   ^
+(dra7xx_evm) make[2]: *** [env/common.o] Error 1
+(dra7xx_evm) make[1]: *** [env] Error 2
+(dra7xx_evm) make[1]: *** wait: No child processes.  Stop.
+(dra7xx_evm) make: *** [sub-make] Error 2

-- 
Tom


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


Re: [U-Boot] [PATCH v3 013/108] x86: spi: Add helper functions for Intel Fast SPI

2019-11-03 Thread Simon Glass
Hi Bin,

On Sat, 2 Nov 2019 at 17:18, Bin Meng  wrote:
>
> Hi Simon,
>
> On Sun, Nov 3, 2019 at 5:04 AM Simon Glass  wrote:
> >
> > Hi Bin,
> >
> > On Fri, 1 Nov 2019 at 22:14, Bin Meng  wrote:
> > >
> > > On Mon, Oct 21, 2019 at 11:33 AM Simon Glass  wrote:
> > > >
> > > > Most x86 CPUs use a mechanism where the SPI flash is mapped into the 
> > > > very
> > > > top of 32-bit address space, so that it can be executed in place and 
> > > > read
> > > > simply by copying from memory. For an 8MB ROM the mapping starts at
> > > > 0xff80.
> > > >
> > > > However some recent Intel CPUs do not use a simple 1:1 memory map. 
> > > > Instead
> > > > the map starts at a different address and not all of the SPI flash is
> > > > accessible through the map. This 'Fast SPI' feature requires that U-Boot
> > > > check the location of the map. It is also possible (optionally) to read
> > > > from the SPI flash using a driver.
> > > >
> > > > Add support for booting from Fast SPI. The memory-mapped version is used
> > > > by both TPL and SPL on apollolake.
> > > >
> > > > In respect of a SPI flash driver, the actual SPI driver is ich.c - this
> > > > just adds a few helper functions and definitions.
> > > >
> > > > This is used by Apollolake.
> > > >
> > > > Signed-off-by: Simon Glass 
> > > > ---
> > > >
> > > > Changes in v3:
> > > > - Add support for of-platdata for TPL
> > > > - Add the missing header file
> > > > - Change Fast-SPI driver into a helper file used by ICH SPI
> > > > - Don't include write() and erase() in TPL
> > > > - Merge in patch "x86: Add support for booting from Fast SPI"
> > > > - Reorder file so that write() and erase() are together
> > > > - Use pci_get_devfn()
> > > >
> > > > Changes in v2: None
> > > >
> > > >  arch/x86/cpu/intel_common/Makefile   |  1 +
> > > >  arch/x86/cpu/intel_common/fast_spi.c | 73 
> > > >  arch/x86/include/asm/fast_spi.h  | 68 ++
> > > >  arch/x86/include/asm/spl.h   |  1 +
> > > >  4 files changed, 143 insertions(+)
> > > >  create mode 100644 arch/x86/cpu/intel_common/fast_spi.c
> > > >  create mode 100644 arch/x86/include/asm/fast_spi.h
> > [..]
> >
> > > > +/* Register offsets from the MMIO region base (PCI_BASE_ADDRESS_0) */
> > > > +struct fast_spi_regs {
> > > > +   u32 bfp;
> > > > +   u32 hsfsts_ctl;
> > > > +   u32 faddr;
> > > > +   u32 dlock;
> > > > +
> > > > +   u32 fdata[0x10];
> > > > +
> > > > +   u32 fracc;
> > > > +   u32 freg[12];
> > > > +   u32 fpr[5];
> > > > +   u32 gpr0;
> > > > +   u32 spare2;
> > > > +   u32 sts_ctl;
> > > > +   u16 preop;  /* a4 */
> > >
> > > I assume a4 is the offset of preop? Leaving it causes confusion and it
> > > can be dropped, I think.
> > >
> >
> > Will do.
> >
> > I'm rebasing on your applied patches and moving the code around to
> > address Andy's comments. I'll send a new version v4 by Monday.
>
> Or maybe you can wait until I looked at all v3 patches. I just wanted
> to send a PR for a collection of good patches so far, instead of
> giving Tom a huge list :)

OK that's fine with me.

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


Re: [U-Boot] [PATCH 1/1] ARM: i.MX6: TARGET_NITROGEN6X: add 'select MX6QDL'

2019-11-03 Thread Stefano Babic
On 26/09/19 18:18, Troy Kisky wrote:
> On 9/25/2019 5:30 PM, Troy Kisky wrote:
>> This fixes commit <91435cd40d30> "ARM: i.MX6: exclude the ARM errata
>>  from i.MX6 UP system"
>>
>> for nitrogen6x. The above commit removed the errata for the board
>> since MX6Q/MXDL/MX6S is selected via CONFIG_SYS_EXTRA_OPTIONS
>>
>> This restores the errata configs.
>>
>> Signed-off-by: Troy Kisky 
>>
>> ---
>> Note:
>> marsboard, mx6qarm2, seem to have same problem.
>> ---
>>  arch/arm/mach-imx/mx6/Kconfig | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/arch/arm/mach-imx/mx6/Kconfig b/arch/arm/mach-imx/mx6/Kconfig
>> index 01f0121beb..2c2edaa093 100644
>> --- a/arch/arm/mach-imx/mx6/Kconfig
>> +++ b/arch/arm/mach-imx/mx6/Kconfig
>> @@ -412,6 +412,7 @@ config TARGET_NITROGEN6X
>>  imply USB_ETHER_MCS7830
>>  imply USB_ETHER_SMSC95XX
>>  imply USB_HOST_ETHER
>> +select MX6QDL
>>  
>>  config TARGET_OPOS6ULDEV
>>  bool "Armadeus OPOS6ULDev board"
>>
> 
> 
> Maybe the more correct fix is to allow MX6Q/MX6DL/MX6S to be selected in the 
> defconfig (add a text
> string in the Kconfig). That way MX6S boards won't have unneeded errata 
> applied.

Not sure. This is really that cannot be configured. If a board has just
a i.MX6DL, well, it should not simply configured via menuconfig. It is
bound with the hardware.

By the way, this simple patch breaks all nitrogen boards, I have to
reject it.

Regards,
Stefano
> 
> Thoughts?
> 
> Troy
> 


-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH V4 5/6] net: fec_mxc: support i.MX8M with CLK_CCF

2019-11-03 Thread Stefano Babic
Hi Peng,

On 25/10/19 11:48, Peng Fan wrote:
> Add more clks for fec_mxc according to Linux Kernel 5.4.0-rc1
> drivers/net/ethernet/freescale/fec_main.c.
> 
> Since i.MX8MQ not support CLK_CCF, so add a check to restrict
> the code only effect when CONFIG_IMX8M and CONFIG_CLK_CCF both defined.
> 
> Reviewed-by: Frieder Schrempf 
> Signed-off-by: Peng Fan 
> ---
> 

This seems to break most of i.MX8 boards - does it build o your side ?

Regards,
Stefano

> V4:
>  Fix build warning
>  Add R-b
> 
> V3:
>  Drop unneeded else
>  correct ipg->ahb
>  Other patches keep V1
> 
> V2:
>  Use CONFIG_IS_ENABLED
> 
> 
>  drivers/net/fec_mxc.c | 79 
> +--
>  drivers/net/fec_mxc.h |  4 +++
>  2 files changed, 68 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
> index 080dbcf7db..131d1998a7 100644
> --- a/drivers/net/fec_mxc.c
> +++ b/drivers/net/fec_mxc.c
> @@ -123,30 +123,38 @@ static int fec_mdio_read(struct ethernet_regs *eth, 
> uint8_t phyaddr,
>   return val;
>  }
>  
> +#ifndef imx_get_fecclk
> +u32 __weak imx_get_fecclk(void)
> +{
> + return 0;
> +}
> +#endif
> +
>  static int fec_get_clk_rate(void *udev, int idx)
>  {
> -#if IS_ENABLED(CONFIG_IMX8)
>   struct fec_priv *fec;
>   struct udevice *dev;
>   int ret;
>  
> - dev = udev;
> - if (!dev) {
> - ret = uclass_get_device(UCLASS_ETH, idx, &dev);
> - if (ret < 0) {
> - debug("Can't get FEC udev: %d\n", ret);
> - return ret;
> + if (IS_ENABLED(CONFIG_IMX8) ||
> + CONFIG_IS_ENABLED(CLK_CCF)) {
> + dev = udev;
> + if (!dev) {
> + ret = uclass_get_device(UCLASS_ETH, idx, &dev);
> + if (ret < 0) {
> + debug("Can't get FEC udev: %d\n", ret);
> + return ret;
> + }
>   }
> - }
>  
> - fec = dev_get_priv(dev);
> - if (fec)
> - return fec->clk_rate;
> + fec = dev_get_priv(dev);
> + if (fec)
> + return fec->clk_rate;
>  
> - return -EINVAL;
> -#else
> - return imx_get_fecclk();
> -#endif
> + return -EINVAL;
> + } else {
> + return imx_get_fecclk();
> + }
>  }
>  
>  static void fec_mii_setspeed(struct ethernet_regs *eth)
> @@ -1335,6 +1343,47 @@ static int fecmxc_probe(struct udevice *dev)
>   return ret;
>   }
>  
> + priv->clk_rate = clk_get_rate(&priv->ipg_clk);
> + } else if (CONFIG_IS_ENABLED(CLK_CCF)) {
> + ret = clk_get_by_name(dev, "ipg", &priv->ipg_clk);
> + if (ret < 0) {
> + debug("Can't get FEC ipg clk: %d\n", ret);
> + return ret;
> + }
> + ret = clk_enable(&priv->ipg_clk);
> + if(ret)
> + return ret;
> +
> + ret = clk_get_by_name(dev, "ahb", &priv->ahb_clk);
> + if (ret < 0) {
> + debug("Can't get FEC ahb clk: %d\n", ret);
> + return ret;
> + }
> + ret = clk_enable(&priv->ahb_clk);
> + if (ret)
> + return ret;
> +
> + ret = clk_get_by_name(dev, "enet_out", &priv->clk_enet_out);
> + if (!ret) {
> + ret = clk_enable(&priv->clk_enet_out);
> + if (ret)
> + return ret;
> + }
> +
> + ret = clk_get_by_name(dev, "enet_clk_ref", &priv->clk_ref);
> + if (!ret) {
> + ret = clk_enable(&priv->clk_ref);
> + if (ret)
> + return ret;
> + }
> +
> + ret = clk_get_by_name(dev, "ptp", &priv->clk_ptp);
> + if (!ret) {
> + ret = clk_enable(&priv->clk_ptp);
> + if (ret)
> + return ret;
> + }
> +
>   priv->clk_rate = clk_get_rate(&priv->ipg_clk);
>   }
>  
> diff --git a/drivers/net/fec_mxc.h b/drivers/net/fec_mxc.h
> index e5f2dd75c5..723b06a651 100644
> --- a/drivers/net/fec_mxc.h
> +++ b/drivers/net/fec_mxc.h
> @@ -264,6 +264,10 @@ struct fec_priv {
>   u32 interface;
>  #endif
>   struct clk ipg_clk;
> + struct clk ahb_clk;
> + struct clk clk_enet_out;
> + struct clk clk_ref;
> + struct clk clk_ptp;
>   u32 clk_rate;
>  };
>  
> 


-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=
__

Re: [U-Boot] Pull request: u-boot-net.git master

2019-11-03 Thread Michael Walle

Am 2019-11-02 16:05, schrieb Tom Rini:
[snip]
But again, I've given up.  I say that the ABI meant that the wrong 
value
was supposed to work since that's what happened and a new version of 
the

binding needed to be used where the right value must be used.  Others
disagree.  I'm not holding U-Boot up on the new changes over this, I
just haven't put together the PR.  It's on my short list now.


I want to rebase my cleanup and device tree support for the Atheros PHY 
onto the patches by Vladimir. Although I do have some problems/questions 
now:


 - will the whole series [1] be pulled altogether?
 - there is a kconfig option to control the EEE option. Wouldn't it be 
better to put that into a device tree property option too?
 - there were some cleanups I'd do another way, for example the clock 
enumeration uses "BIT(0) | BIT(1)" instead of 3. I'd use a mask and the 
correct enumeration and FIELD_PREP(). So should I base my patch on 
Vladimirs patch? Should Vladimir post a new patch?


To be frank, I'd rather pull Vladimirs patches and change (or drop them 
if they are superseeded mine), if everyone is ok with that. I'd propose 
the following:

 - I rebase my patches onto Vladimirs patches
 - change some of Vladimirs patches
 - privately, mail the patch series to Vladimir, then he can review 
them, add SOB or other tags
 - If he is ok with the changes, I'll post another "atheros PHY cleanup 
and device tree support" series with patches from Vladimir and myself.


I don't really want to hijack any patches, but patching the patch seems 
to be not really good.


Does anybody know if the "disable smartEEE" should go into the linux phy 
driver too? As far as I understand it, linux configures the complete phy 
itself, (eg. it might even do a hardware reset).


--
-michael

[1] https://patchwork.ozlabs.org/cover/1031360/
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v5 0/2] Add board support for iMX8QXP AI_ML board

2019-11-03 Thread Stefano Babic
On 21/10/19 13:00, Manivannan Sadhasivam wrote:
> Hi,
> 
> On Thu, Aug 15, 2019 at 01:57:23PM +0530, Manivannan Sadhasivam wrote:
>> Hello,
>>
>> This patchset adds initial board support for iMX8QXP AI_ML board
>> from Einfochips. This board is one of the Consumer Edition and AI
>> boards of the 96Boards family.
>>
>> This initial supports contains following peripherals which are tested and
>> known to work:
>>
>> 1. Debug serial via UART2
>> 2. SD card
>> 3. Ethernet
>>
>> Below is the boot log from SPL to Linux kernel:
>> ===
>>
>> MMC:   FSL_SDHC: 0, FSL_SDHC: 1
>> Loading Environment from MMC... *** Warning - bad CRC, using default 
>> environment
>>
>> In:serial@5a08
>> Out:   serial@5a08
>> Err:   serial@5a08
>> Net:   
>> Warning: ethernet@5b04 (eth0) using random MAC address - 
>> d2:46:66:cf:f5:61
>> eth0: ethernet@5b04
>> Hit any key to stop autoboot:  0 
>> switch to partitions #0, OK
>> mmc1 is current device
>> Scanning mmc 1:1...
>> Found /extlinux/extlinux.conf
>> Retrieving file: /extlinux/extlinux.conf
>> 171 bytes read in 14 ms (11.7 KiB/s)
>> 1:  ai_ml-kernel
>> Retrieving file: /Image
>> 24689152 bytes read in 1055 ms (22.3 MiB/s)
>> append: earlycon console=ttyLP2,115200 rw root=/dev/mmcblk0p2 
>> rootfstype=ext4 init=/sbin/t
>> Retrieving file: /imx8qxp-ai_ml.dtb
>> 12529 bytes read in 13 ms (940.4 KiB/s)
>> ## Flattened Device Tree blob at 8300
>>Booting using the fdt blob at 0x8300
>>Using Device Tree in place at 8300, end 830060f0
>>
>> Starting kernel ...
>>
>> [0.00] Booting Linux on physical CPU 0x00 [0x410fd042]
>> [0.00] Linux version 5.2.0-03138-gd75da80dce39 
>> (mani@Mani-XPS-13-9360) (gcc versi9
>> [0.00] Machine model: Einfochips i.MX8QXP AI_ML
>> [0.00] efi: Getting EFI parameters from FDT:
>> [0.00] efi: UEFI not found.
>> [0.00] cma: Reserved 32 MiB at 0xfe00
>> [0.00] earlycon: lpuart32 at MMIO 0x5a08 (options '')
>> [0.00] printk: bootconsole [lpuart32] enabled
>>
>> Thanks,
>> Mani
>>
> 
> Any update on this patchset?

Sorry for delay. Anyway, I have applied the patch, but due to changes in
other subsystems (environment, etc.) it is not built clean. Could you
rebase and resend ? Thanks

Best regards,
Stefano

> 
> Thanks,
> Mani
> 
>> Note: This patchset depends on the below cleanup patches submitted:
>> [U-Boot,1/2] arm: imx8: factor out uart init code
>> [U-Boot,2/2] arm: imx8: don't duplicate build_info()
>>
>> Changes in v5:
>>
>> * Incorporated review comments from Lukasz.
>>
>> Changes in v4:
>>
>> * Incorporated review comments from Fabio.
>>
>> Changes in v3:
>>
>> * Incorporated review comments from Fabio. Major change is switching to
>>   distro_boot.
>> * Added Reviewed-by tag from Peng Fan.
>>
>> Changes in v2:
>>
>> * Rebased the patches on top of following patches:
>>   [U-Boot,1/2] arm: imx8: factor out uart init code
>>   [U-Boot,2/2] arm: imx8: don't duplicate build_info()
>>
>> Manivannan Sadhasivam (2):
>>   arm: dts: Add devicetree support for iMXQXP AI_ML board
>>   board: Add support for iMX8QXP AI_ML board
>>
>>  arch/arm/dts/Makefile |   1 +
>>  arch/arm/dts/fsl-imx8qxp-ai_ml-u-boot.dtsi| 117 +++
>>  arch/arm/dts/fsl-imx8qxp-ai_ml.dts| 181 ++
>>  arch/arm/mach-imx/imx8/Kconfig|   6 +
>>  board/einfochips/imx8qxp_ai_ml/Kconfig|  21 ++
>>  board/einfochips/imx8qxp_ai_ml/MAINTAINERS|   6 +
>>  board/einfochips/imx8qxp_ai_ml/Makefile   |   8 +
>>  board/einfochips/imx8qxp_ai_ml/README |  49 +
>>  .../einfochips/imx8qxp_ai_ml/imx8qxp_ai_ml.c  |  79 
>>  board/einfochips/imx8qxp_ai_ml/imximage.cfg   |  24 +++
>>  board/einfochips/imx8qxp_ai_ml/spl.c  |  39 
>>  configs/imx8qxp_ai_ml_defconfig   |  83 
>>  include/configs/imx8qxp_ai_ml.h   |  95 +
>>  13 files changed, 709 insertions(+)
>>  create mode 100644 arch/arm/dts/fsl-imx8qxp-ai_ml-u-boot.dtsi
>>  create mode 100644 arch/arm/dts/fsl-imx8qxp-ai_ml.dts
>>  create mode 100644 board/einfochips/imx8qxp_ai_ml/Kconfig
>>  create mode 100644 board/einfochips/imx8qxp_ai_ml/MAINTAINERS
>>  create mode 100644 board/einfochips/imx8qxp_ai_ml/Makefile
>>  create mode 100644 board/einfochips/imx8qxp_ai_ml/README
>>  create mode 100644 board/einfochips/imx8qxp_ai_ml/imx8qxp_ai_ml.c
>>  create mode 100644 board/einfochips/imx8qxp_ai_ml/imximage.cfg
>>  create mode 100644 board/einfochips/imx8qxp_ai_ml/spl.c
>>  create mode 100644 configs/imx8qxp_ai_ml_defconfig
>>  create mode 100644 include/configs/imx8qxp_ai_ml.h
>>
>> -- 
>> 2.17.1
>>


-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, G

[U-Boot] [PATCH v3 0/5] imx: nandbcb: support for i.MX7 and bcb only updates

2019-11-03 Thread Igor Opaniuk
This introduces support for writing BCB(FCB/FDDT) for i.MX7 NAND-based
platforms and additional subcommand for writing BCB
only (without firmware).

v3:
- Applied R-b and T-b tags
- Rebased on the latest master

v2:
- Switch to runtime detection of SoC(e.g. is_mx7()) instead of ifdeffery
- Fix build for imx6

Igor Opaniuk (5):
  imx: gpmi: add defines for hw randominizer
  nand: mxs_nand: add API for switching different BCH layouts
  imx: nandbcb: add support for i.MX7
  imx: nandbcb: refactor update function
  imx: nandbcb: add support for writing BCB only

 arch/arm/include/asm/mach-imx/imx-nandbcb.h |  12 +
 arch/arm/include/asm/mach-imx/regs-gpmi.h   |   5 +
 arch/arm/mach-imx/Kconfig   |   2 +-
 arch/arm/mach-imx/cmd_nandbcb.c | 318 +++-
 drivers/mtd/nand/raw/mxs_nand.c | 116 +++
 include/mxs_nand.h  |  22 ++
 6 files changed, 394 insertions(+), 81 deletions(-)

-- 
2.17.1

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


[U-Boot] [PATCH v3 3/5] imx: nandbcb: add support for i.MX7

2019-11-03 Thread Igor Opaniuk
From: Igor Opaniuk 

Add support for updating FCB/DBBT on i.MX7:
- additional new fields in FCB structure
- Leverage hardware BCH/randomizer for writing FCB

Signed-off-by: Igor Opaniuk 
Tested-by: Max Krummenacher 
Reviewed-by: Oleksandr Suvorov 
---

 arch/arm/include/asm/mach-imx/imx-nandbcb.h |  12 ++
 arch/arm/mach-imx/Kconfig   |   2 +-
 arch/arm/mach-imx/cmd_nandbcb.c | 137 +---
 3 files changed, 104 insertions(+), 47 deletions(-)

diff --git a/arch/arm/include/asm/mach-imx/imx-nandbcb.h 
b/arch/arm/include/asm/mach-imx/imx-nandbcb.h
index 033659a038..907e7ed8f9 100644
--- a/arch/arm/include/asm/mach-imx/imx-nandbcb.h
+++ b/arch/arm/include/asm/mach-imx/imx-nandbcb.h
@@ -106,6 +106,18 @@ struct fcb_block {
 
/* The swap position of main area in spare area */
u32 spare_offset;
+
+   /* Actual for iMX7 only */
+   u32 onfi_sync_enable;
+   u32 onfi_sync_speed;
+   u32 onfi_sync_nand_data;
+   u32 reserved2[6];
+   u32 disbbm_search;
+   u32 disbbm_search_limit;
+   u32 reserved3[15];
+   u32 read_retry_enable;
+   u32 reserved4[1];
+   u32 fill_to_1024[183];
 };
 
 #endif /* _IMX_NAND_BCB_H_ */
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index 4a2f39b110..3f93fe5174 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -82,7 +82,7 @@ config CMD_NANDBCB
bool "i.MX6 NAND Boot Control Block(BCB) command"
depends on NAND && CMD_MTDPARTS
select BCH if MX6UL || MX6ULL
-   default y if ARCH_MX6 && NAND_MXS
+   default y if (ARCH_MX6 && NAND_MXS) || (ARCH_MX7 && NAND_MXS)
help
  Unlike normal 'nand write/erase' commands, this command update
  Boot Control Block(BCB) for i.MX6 platform NAND IP's.
diff --git a/arch/arm/mach-imx/cmd_nandbcb.c b/arch/arm/mach-imx/cmd_nandbcb.c
index 1a2e017aaf..a3a44bc284 100644
--- a/arch/arm/mach-imx/cmd_nandbcb.c
+++ b/arch/arm/mach-imx/cmd_nandbcb.c
@@ -17,6 +17,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -131,26 +132,36 @@ static void fill_fcb(struct fcb_block *fcb, struct 
mtd_info *mtd)
 {
struct nand_chip *chip = mtd_to_nand(mtd);
struct mxs_nand_info *nand_info = nand_get_controller_data(chip);
+   struct mxs_nand_layout l;
+
+   mxs_nand_get_layout(mtd, &l);
 
fcb->fingerprint = FCB_FINGERPRINT;
fcb->version = FCB_VERSION_1;
+
fcb->pagesize = mtd->writesize;
fcb->oob_pagesize = mtd->writesize + mtd->oobsize;
fcb->sectors = mtd->erasesize / mtd->writesize;
 
-   /* Divide ECC strength by two and save the value into FCB structure. */
-   fcb->ecc_level = nand_info->bch_geometry.ecc_strength >> 1;
-
-   fcb->ecc_type = fcb->ecc_level;
+   fcb->meta_size = l.meta_size;
+   fcb->nr_blocks = l.nblocks;
+   fcb->ecc_nr = l.data0_size;
+   fcb->ecc_level = l.ecc0;
+   fcb->ecc_size = l.datan_size;
+   fcb->ecc_type = l.eccn;
 
/* Also hardcoded in kobs-ng */
-   fcb->ecc_nr = 0x0200;
-   fcb->ecc_size = 0x0200;
-   fcb->datasetup = 80;
-   fcb->datahold = 60;
-   fcb->addr_setup = 25;
-   fcb->dsample_time = 6;
-   fcb->meta_size = 10;
+   if (is_mx6()) {
+   fcb->datasetup = 80;
+   fcb->datahold = 60;
+   fcb->addr_setup = 25;
+   fcb->dsample_time = 6;
+   } else if (is_mx7()) {
+   fcb->datasetup = 10;
+   fcb->datahold = 7;
+   fcb->addr_setup = 15;
+   fcb->dsample_time = 6;
+   }
 
/* DBBT search area starts at second page on first block */
fcb->dbbt_start = 1;
@@ -162,6 +173,9 @@ static void fill_fcb(struct fcb_block *fcb, struct mtd_info 
*mtd)
 
fcb->nr_blocks = mtd->writesize / fcb->ecc_nr - 1;
 
+   fcb->disbbm = 0;
+   fcb->disbbm_search = 0;
+
fcb->checksum = calc_chksum((void *)fcb + 4, sizeof(*fcb) - 4);
 }
 
@@ -197,6 +211,7 @@ static int nandbcb_update(struct mtd_info *mtd, loff_t off, 
size_t size,
size_t fwsize, dummy;
int i, ret;
 
+   fcb_raw_page = 0;
/* erase */
memset(&opts, 0, sizeof(opts));
opts.offset = off;
@@ -287,50 +302,79 @@ static int nandbcb_update(struct mtd_info *mtd, loff_t 
off, size_t size,
else if (ret > 0)
dbbt->dbbtpages = 1;
 
-   /* write fcb/dbbt */
-   fcb_raw_page = kzalloc(mtd->writesize + mtd->oobsize, GFP_KERNEL);
-   if (!fcb_raw_page) {
-   debug("failed to allocate fcb_raw_page\n");
-   ret = -ENOMEM;
-   goto dbbt_data_page_err;
-   }
+   /*
+* We prepare raw page only for i.MX6, for i.MX7 we
+* leverage BCH hw module instead
+*/
+   if (is_mx6()) {
+   /* write fcb/dbbt */
+   fcb_raw_page = kzalloc(mtd->writesize + mtd->oobsize,
+  

[U-Boot] [PATCH v3 4/5] imx: nandbcb: refactor update function

2019-11-03 Thread Igor Opaniuk
From: Igor Opaniuk 

Move code for writing FCB/DBBT pages to a separate function

Signed-off-by: Igor Opaniuk 
Tested-by: Max Krummenacher 
Reviewed-by: Oleksandr Suvorov 
---

 arch/arm/mach-imx/cmd_nandbcb.c | 231 ++--
 1 file changed, 127 insertions(+), 104 deletions(-)

diff --git a/arch/arm/mach-imx/cmd_nandbcb.c b/arch/arm/mach-imx/cmd_nandbcb.c
index a3a44bc284..6e7e982ee5 100644
--- a/arch/arm/mach-imx/cmd_nandbcb.c
+++ b/arch/arm/mach-imx/cmd_nandbcb.c
@@ -128,7 +128,8 @@ static u32 calc_chksum(void *buf, size_t size)
return ~chksum;
 }
 
-static void fill_fcb(struct fcb_block *fcb, struct mtd_info *mtd)
+static void fill_fcb(struct fcb_block *fcb, struct mtd_info *mtd,
+u32 fw1_start, u32 fw2_start, u32 fw_pages)
 {
struct nand_chip *chip = mtd_to_nand(mtd);
struct mxs_nand_info *nand_info = nand_get_controller_data(chip);
@@ -176,6 +177,11 @@ static void fill_fcb(struct fcb_block *fcb, struct 
mtd_info *mtd)
fcb->disbbm = 0;
fcb->disbbm_search = 0;
 
+   fcb->fw1_start = fw1_start; /* Firmware image starts on this sector */
+   fcb->fw2_start = fw2_start; /* Secondary FW Image starting Sector */
+   fcb->fw1_pages = fw_pages; /* Number of sectors in firmware image */
+   fcb->fw2_pages = fw_pages; /* Number of sector in secondary FW image */
+
fcb->checksum = calc_chksum((void *)fcb + 4, sizeof(*fcb) - 4);
 }
 
@@ -199,6 +205,114 @@ static int dbbt_fill_data(struct mtd_info *mtd, void 
*buf, int num_blocks)
return n_bad_blocks;
 }
 
+static int write_fcb_dbbt(struct mtd_info *mtd, struct fcb_block *fcb,
+ struct dbbt_block *dbbt, void *dbbt_data_page,
+ loff_t off)
+{
+   void *fcb_raw_page = 0;
+   int i, ret;
+   size_t dummy;
+
+   /*
+* We prepare raw page only for i.MX6, for i.MX7 we
+* leverage BCH hw module instead
+*/
+   if (is_mx6()) {
+   /* write fcb/dbbt */
+   fcb_raw_page = kzalloc(mtd->writesize + mtd->oobsize,
+  GFP_KERNEL);
+   if (!fcb_raw_page) {
+   debug("failed to allocate fcb_raw_page\n");
+   ret = -ENOMEM;
+   return ret;
+   }
+
+#if defined(CONFIG_MX6UL) || defined(CONFIG_MX6ULL)
+   /* 40 bit BCH, for i.MX6UL(L) */
+   encode_bch_ecc(fcb_raw_page + 32, fcb, 40);
+#else
+   memcpy(fcb_raw_page + 12, fcb, sizeof(struct fcb_block));
+   encode_hamming_13_8(fcb_raw_page + 12,
+   fcb_raw_page + 12 + 512, 512);
+#endif
+   /*
+* Set the first and second byte of OOB data to 0xFF,
+* not 0x00. These bytes are used as the Manufacturers Bad
+* Block Marker (MBBM). Since the FCB is mostly written to
+* the first page in a block, a scan for
+* factory bad blocks will detect these blocks as bad, e.g.
+* when function nand_scan_bbt() is executed to build a new
+* bad block table.
+*/
+   memset(fcb_raw_page + mtd->writesize, 0xFF, 2);
+   }
+   for (i = 0; i < 2; i++) {
+   if (mtd_block_isbad(mtd, off)) {
+   printf("Block %d is bad, skipped\n", i);
+   continue;
+   }
+
+   /*
+* User BCH ECC hardware module for i.MX7
+*/
+   if (is_mx7()) {
+   u32 off = i * mtd->erasesize;
+   size_t rwsize = sizeof(*fcb);
+
+   printf("Writing %d bytes to 0x%x: ", rwsize, off);
+
+   /* switch nand BCH to FCB compatible settings */
+   mxs_nand_mode_fcb(mtd);
+   ret = nand_write(mtd, off, &rwsize,
+(unsigned char *)fcb);
+   mxs_nand_mode_normal(mtd);
+
+   printf("%s\n", ret ? "ERROR" : "OK");
+   } else if (is_mx6()) {
+   /* raw write */
+   mtd_oob_ops_t ops = {
+   .datbuf = (u8 *)fcb_raw_page,
+   .oobbuf = ((u8 *)fcb_raw_page) +
+ mtd->writesize,
+   .len = mtd->writesize,
+   .ooblen = mtd->oobsize,
+   .mode = MTD_OPS_RAW
+   };
+
+   ret = mtd_write_oob(mtd, mtd->erasesize * i, &ops);
+   if (ret)
+   goto fcb_raw_page_err;
+   debug("NAND fcb write: 0x%x offset 0x%x written: %s\n",
+ mtd->erasesize * i, ops.len, ret ?
+

[U-Boot] [PATCH v3 2/5] nand: mxs_nand: add API for switching different BCH layouts

2019-11-03 Thread Igor Opaniuk
From: Igor Opaniuk 

On i.MX7 in a sake of reducing the disturbances caused by a neighboring
cells in the FCB page in the NAND chip, a randomizer is enabled when
reading the FCB page by ROM bootloader.

Add API for setting BCH to specific layout (and restoring it back) used by
ROM bootloader to be able to burn it in a proper way to NAND using
nandbcb command.

Signed-off-by: Igor Opaniuk 
Signed-off-by: Anti Sullin 
Tested-by: Max Krummenacher 
Reviewed-by: Oleksandr Suvorov 
---

 drivers/mtd/nand/raw/mxs_nand.c | 116 
 include/mxs_nand.h  |  22 ++
 2 files changed, 138 insertions(+)

diff --git a/drivers/mtd/nand/raw/mxs_nand.c b/drivers/mtd/nand/raw/mxs_nand.c
index a41b9620d0..ad7b644886 100644
--- a/drivers/mtd/nand/raw/mxs_nand.c
+++ b/drivers/mtd/nand/raw/mxs_nand.c
@@ -740,6 +740,19 @@ static int mxs_nand_ecc_write_page(struct mtd_info *mtd,
d->cmd.pio_words[4] = (dma_addr_t)nand_info->data_buf;
d->cmd.pio_words[5] = (dma_addr_t)nand_info->oob_buf;
 
+   if (is_mx7() && nand_info->en_randomizer) {
+   d->cmd.pio_words[2] |= GPMI_ECCCTRL_RANDOMIZER_ENABLE |
+  GPMI_ECCCTRL_RANDOMIZER_TYPE2;
+   /*
+* Write NAND page number needed to be randomized
+* to GPMI_ECCCOUNT register.
+*
+* The value is between 0-255. For additional details
+* check 9.6.6.4 of i.MX7D Applications Processor reference
+*/
+   d->cmd.pio_words[3] |= (page % 255) << 16;
+   }
+
mxs_dma_desc_append(channel, d);
 
/* Flush caches */
@@ -1003,6 +1016,10 @@ int mxs_nand_setup_ecc(struct mtd_info *mtd)
uint32_t tmp;
int ret;
 
+   nand_info->en_randomizer = 0;
+   nand_info->oobsize = mtd->oobsize;
+   nand_info->writesize = mtd->writesize;
+
ret = mxs_nand_set_geometry(mtd, geo);
if (ret)
return ret;
@@ -1020,6 +1037,7 @@ int mxs_nand_setup_ecc(struct mtd_info *mtd)
tmp |= (geo->gf_len == 14 ? 1 : 0) <<
BCH_FLASHLAYOUT0_GF13_0_GF14_1_OFFSET;
writel(tmp, &bch_regs->hw_bch_flash0layout0);
+   nand_info->bch_flash0layout0 = tmp;
 
tmp = (mtd->writesize + mtd->oobsize)
<< BCH_FLASHLAYOUT1_PAGE_SIZE_OFFSET;
@@ -1028,6 +1046,7 @@ int mxs_nand_setup_ecc(struct mtd_info *mtd)
tmp |= (geo->gf_len == 14 ? 1 : 0) <<
BCH_FLASHLAYOUT1_GF13_0_GF14_1_OFFSET;
writel(tmp, &bch_regs->hw_bch_flash0layout1);
+   nand_info->bch_flash0layout1 = tmp;
 
/* Set *all* chip selects to use layout 0 */
writel(0, &bch_regs->hw_bch_layoutselect);
@@ -1303,3 +1322,100 @@ err:
free(nand_info);
 }
 #endif
+
+/*
+ * Read NAND layout for FCB block generation.
+ */
+void mxs_nand_get_layout(struct mtd_info *mtd, struct mxs_nand_layout *l)
+{
+   struct mxs_bch_regs *bch_regs = (struct mxs_bch_regs *)MXS_BCH_BASE;
+   u32 tmp;
+
+   tmp = readl(&bch_regs->hw_bch_flash0layout0);
+   l->nblocks = (tmp & BCH_FLASHLAYOUT0_NBLOCKS_MASK) >>
+   BCH_FLASHLAYOUT0_NBLOCKS_OFFSET;
+   l->meta_size = (tmp & BCH_FLASHLAYOUT0_META_SIZE_MASK) >>
+   BCH_FLASHLAYOUT0_META_SIZE_OFFSET;
+
+   tmp = readl(&bch_regs->hw_bch_flash0layout1);
+   l->data0_size = 4 * ((tmp & BCH_FLASHLAYOUT0_DATA0_SIZE_MASK) >>
+   BCH_FLASHLAYOUT0_DATA0_SIZE_OFFSET);
+   l->ecc0 = (tmp & BCH_FLASHLAYOUT0_ECC0_MASK) >>
+   BCH_FLASHLAYOUT0_ECC0_OFFSET;
+   l->datan_size = 4 * ((tmp & BCH_FLASHLAYOUT1_DATAN_SIZE_MASK) >>
+   BCH_FLASHLAYOUT1_DATAN_SIZE_OFFSET);
+   l->eccn = (tmp & BCH_FLASHLAYOUT1_ECCN_MASK) >>
+   BCH_FLASHLAYOUT1_ECCN_OFFSET;
+}
+
+/*
+ * Set BCH to specific layout used by ROM bootloader to read FCB.
+ */
+void mxs_nand_mode_fcb(struct mtd_info *mtd)
+{
+   u32 tmp;
+   struct mxs_bch_regs *bch_regs = (struct mxs_bch_regs *)MXS_BCH_BASE;
+   struct nand_chip *nand = mtd_to_nand(mtd);
+   struct mxs_nand_info *nand_info = nand_get_controller_data(nand);
+
+   nand_info->en_randomizer = 1;
+
+   mtd->writesize = 1024;
+   mtd->oobsize = 1862 - 1024;
+
+   /* 8 ecc_chunks_*/
+   tmp = 7 << BCH_FLASHLAYOUT0_NBLOCKS_OFFSET;
+   /* 32 bytes for metadata */
+   tmp |= 32 << BCH_FLASHLAYOUT0_META_SIZE_OFFSET;
+   /* using ECC62 level to be performed */
+   tmp |= 0x1F << BCH_FLASHLAYOUT0_ECC0_OFFSET;
+   /* 0x20 * 4 bytes of the data0 block */
+   tmp |= 0x20 << BCH_FLASHLAYOUT0_DATA0_SIZE_OFFSET;
+   tmp |= 0 << BCH_FLASHLAYOUT0_GF13_0_GF14_1_OFFSET;
+   writel(tmp, &bch_regs->hw_bch_flash0layout0);
+
+   /* 1024 for data + 838 for OOB */
+   tmp = 1862 << BCH_FLASHLAYOUT1_PAGE_SIZE_OFFSET;
+   /* using ECC62 level to be performed */

[U-Boot] [PATCH v3 5/5] imx: nandbcb: add support for writing BCB only

2019-11-03 Thread Igor Opaniuk
From: Igor Opaniuk 

Add subcommand for add writing BCB only, where we provide appropriate
offsets for firmware1 and firmware2 and size.

Example of usage:
> nandbcb bcbonly 0x0018 0x0008 0x0020
Writing 1024 bytes to 0x0: randomizing
OK
Writing 1024 bytes to 0x2: randomizing
OK

Signed-off-by: Igor Opaniuk 
Tested-by: Max Krummenacher 
Reviewed-by: Oleksandr Suvorov 
---

 arch/arm/mach-imx/cmd_nandbcb.c | 92 -
 1 file changed, 91 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-imx/cmd_nandbcb.c b/arch/arm/mach-imx/cmd_nandbcb.c
index 6e7e982ee5..09c4356529 100644
--- a/arch/arm/mach-imx/cmd_nandbcb.c
+++ b/arch/arm/mach-imx/cmd_nandbcb.c
@@ -433,6 +433,88 @@ err:
return ret;
 }
 
+static int do_nandbcb_bcbonly(int argc, char * const argv[])
+{
+   struct fcb_block *fcb;
+   struct dbbt_block *dbbt;
+   u32 fw_len, fw1_off, fw2_off;
+   struct mtd_info *mtd;
+   void *dbbt_page, *dbbt_data_page;
+   int dev, ret;
+
+   dev = nand_curr_device;
+   if ((dev < 0) || (dev >= CONFIG_SYS_MAX_NAND_DEVICE) ||
+   (!get_nand_dev_by_index(dev))) {
+   puts("No devices available\n");
+   return CMD_RET_FAILURE;
+   }
+
+   mtd = get_nand_dev_by_index(dev);
+
+   if (argc < 3)
+   return CMD_RET_FAILURE;
+
+   fw_len = simple_strtoul(argv[1], NULL, 16);
+   fw1_off = simple_strtoul(argv[2], NULL, 16);
+
+   if (argc > 3)
+   fw2_off = simple_strtoul(argv[3], NULL, 16);
+   else
+   fw2_off = fw1_off;
+
+   /* fill fcb */
+   fcb = kzalloc(sizeof(*fcb), GFP_KERNEL);
+   if (!fcb) {
+   debug("failed to allocate fcb\n");
+   ret = -ENOMEM;
+   return CMD_RET_FAILURE;
+   }
+
+   fill_fcb(fcb, mtd, fw1_off / mtd->writesize,
+fw2_off / mtd->writesize, fw_len / mtd->writesize);
+
+   /* fill dbbt */
+   dbbt_page = kzalloc(mtd->writesize, GFP_KERNEL);
+   if (!dbbt_page) {
+   debug("failed to allocate dbbt_page\n");
+   ret = -ENOMEM;
+   goto fcb_err;
+   }
+
+   dbbt_data_page = kzalloc(mtd->writesize, GFP_KERNEL);
+   if (!dbbt_data_page) {
+   debug("failed to allocate dbbt_data_page\n");
+   ret = -ENOMEM;
+   goto dbbt_page_err;
+   }
+
+   dbbt = dbbt_page;
+   dbbt->checksum = 0;
+   dbbt->fingerprint = DBBT_FINGERPRINT2;
+   dbbt->version = DBBT_VERSION_1;
+   ret = dbbt_fill_data(mtd, dbbt_data_page, 0);
+   if (ret < 0)
+   goto dbbt_data_page_err;
+   else if (ret > 0)
+   dbbt->dbbtpages = 1;
+
+   /* write fcb and dbbt to nand */
+   ret = write_fcb_dbbt(mtd, fcb, dbbt, dbbt_data_page, 0);
+dbbt_data_page_err:
+   kfree(dbbt_data_page);
+dbbt_page_err:
+   kfree(dbbt_page);
+fcb_err:
+   kfree(fcb);
+
+   if (ret < 0) {
+   printf("failed to write FCB/DBBT\n");
+   return CMD_RET_FAILURE;
+   }
+
+   return CMD_RET_SUCCESS;
+}
+
 static int do_nandbcb_update(int argc, char * const argv[])
 {
struct mtd_info *mtd;
@@ -489,6 +571,11 @@ static int do_nandbcb(cmd_tbl_t *cmdtp, int flag, int argc,
goto done;
}
 
+   if (strcmp(cmd, "bcbonly") == 0) {
+   ret = do_nandbcb_bcbonly(argc, argv);
+   goto done;
+   }
+
 done:
if (ret != -1)
return ret;
@@ -499,7 +586,10 @@ usage:
 #ifdef CONFIG_SYS_LONGHELP
 static char nandbcb_help_text[] =
"update addr off|partition len  - update 'len' bytes starting at\n"
-   "   'off|part' to memory address 'addr', skipping  bad blocks";
+   "   'off|part' to memory address 'addr', skipping  bad blocks\n"
+   "bcbonly fw-size fw1-off [fw2-off] - write only BCB (FCB and DBBT)\n"
+   "   where `fw-size` is fw sizes in bytes, `fw1-off` and\n"
+   "   and `fw2-off` - firmware offsets";
 #endif
 
 U_BOOT_CMD(nandbcb, 5, 1, do_nandbcb,
-- 
2.17.1

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


[U-Boot] [PATCH v3 1/5] imx: gpmi: add defines for hw randominizer

2019-11-03 Thread Igor Opaniuk
From: Igor Opaniuk 

Extend GPMI Integrated ECC Control Register Description, include
additional defines for enabling randomizer function and providing
proper randomizer type.

For additional details check i.MX7 APR, section
9.6.6.3 GPMI Integrated ECC Control Register Description
(GPMI_ECCCTRLn)

Signed-off-by: Igor Opaniuk 
Tested-by: Max Krummenacher 
Reviewed-by: Oleksandr Suvorov 
---

 arch/arm/include/asm/mach-imx/regs-gpmi.h | 5 +
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/include/asm/mach-imx/regs-gpmi.h 
b/arch/arm/include/asm/mach-imx/regs-gpmi.h
index 80cb731724..33daa53c45 100644
--- a/arch/arm/include/asm/mach-imx/regs-gpmi.h
+++ b/arch/arm/include/asm/mach-imx/regs-gpmi.h
@@ -70,6 +70,11 @@ struct mxs_gpmi_regs {
 #defineGPMI_ECCCTRL_ECC_CMD_OFFSET 13
 #defineGPMI_ECCCTRL_ECC_CMD_DECODE (0x0 << 13)
 #defineGPMI_ECCCTRL_ECC_CMD_ENCODE (0x1 << 13)
+#defineGPMI_ECCCTRL_RANDOMIZER_ENABLE  (1 << 11)
+#defineGPMI_ECCCTRL_RANDOMIZER_TYPE0   0
+#defineGPMI_ECCCTRL_RANDOMIZER_TYPE1   (1 << 9)
+#defineGPMI_ECCCTRL_RANDOMIZER_TYPE2   (2 << 9)
+
 #defineGPMI_ECCCTRL_ENABLE_ECC (1 << 12)
 #defineGPMI_ECCCTRL_BUFFER_MASK_MASK   0x1ff
 #defineGPMI_ECCCTRL_BUFFER_MASK_OFFSET 0
-- 
2.17.1

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


Re: [U-Boot] [PATCH v2 3/5] imx: nandbcb: add support for i.MX7

2019-11-03 Thread Igor Opaniuk
HI Stefano,

On Sun, Nov 3, 2019 at 2:55 PM Stefano Babic  wrote:
>
> Hi Igor,
>
> On 21/10/19 15:38, Igor Opaniuk wrote:
> > From: Igor Opaniuk 
> >
> > Add support for updating FCB/DBBT on i.MX7:
> > - additional new fields in FCB structure
> > - Leverage hardware BCH/randomizer for writing FCB
> >
> > Signed-off-by: Igor Opaniuk 
> > ---
> >
>
> Patch conflicts with the one for i.MX6UL, that I have currently applied
> (you see it on -next branch). Could you please rebase on it and resend ?
> Thanks !
Done, please check v3 here [1]
Thanks

[1] https://patchwork.ozlabs.org/project/uboot/list/?series=140330

>
> Regards,
> Stefano
>
> >  arch/arm/include/asm/mach-imx/imx-nandbcb.h |  12 ++
> >  arch/arm/mach-imx/Kconfig   |   2 +-
> >  arch/arm/mach-imx/cmd_nandbcb.c | 129 +---
> >  3 files changed, 100 insertions(+), 43 deletions(-)
> >
> > diff --git a/arch/arm/include/asm/mach-imx/imx-nandbcb.h 
> > b/arch/arm/include/asm/mach-imx/imx-nandbcb.h
> > index 033659a038..907e7ed8f9 100644
> > --- a/arch/arm/include/asm/mach-imx/imx-nandbcb.h
> > +++ b/arch/arm/include/asm/mach-imx/imx-nandbcb.h
> > @@ -106,6 +106,18 @@ struct fcb_block {
> >
> >   /* The swap position of main area in spare area */
> >   u32 spare_offset;
> > +
> > + /* Actual for iMX7 only */
> > + u32 onfi_sync_enable;
> > + u32 onfi_sync_speed;
> > + u32 onfi_sync_nand_data;
> > + u32 reserved2[6];
> > + u32 disbbm_search;
> > + u32 disbbm_search_limit;
> > + u32 reserved3[15];
> > + u32 read_retry_enable;
> > + u32 reserved4[1];
> > + u32 fill_to_1024[183];
> >  };
> >
> >  #endif   /* _IMX_NAND_BCB_H_ */
> > diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
> > index b0b9d2c070..c22e8f51b4 100644
> > --- a/arch/arm/mach-imx/Kconfig
> > +++ b/arch/arm/mach-imx/Kconfig
> > @@ -81,7 +81,7 @@ config CMD_HDMIDETECT
> >  config CMD_NANDBCB
> >   bool "i.MX6 NAND Boot Control Block(BCB) command"
> >   depends on NAND && CMD_MTDPARTS
> > - default y if ARCH_MX6 && NAND_MXS
> > + default y if (ARCH_MX6 && NAND_MXS) || (ARCH_MX7 && NAND_MXS)
> >   help
> > Unlike normal 'nand write/erase' commands, this command update
> > Boot Control Block(BCB) for i.MX6 platform NAND IP's.
> > diff --git a/arch/arm/mach-imx/cmd_nandbcb.c 
> > b/arch/arm/mach-imx/cmd_nandbcb.c
> > index 7811c61d22..aae2cc82f3 100644
> > --- a/arch/arm/mach-imx/cmd_nandbcb.c
> > +++ b/arch/arm/mach-imx/cmd_nandbcb.c
> > @@ -16,6 +16,7 @@
> >  #include 
> >  #include 
> >
> > +#include 
> >  #include 
> >  #include 
> >  #include 
> > @@ -67,26 +68,36 @@ static void fill_fcb(struct fcb_block *fcb, struct 
> > mtd_info *mtd)
> >  {
> >   struct nand_chip *chip = mtd_to_nand(mtd);
> >   struct mxs_nand_info *nand_info = nand_get_controller_data(chip);
> > + struct mxs_nand_layout l;
> > +
> > + mxs_nand_get_layout(mtd, &l);
> >
> >   fcb->fingerprint = FCB_FINGERPRINT;
> >   fcb->version = FCB_VERSION_1;
> > +
> >   fcb->pagesize = mtd->writesize;
> >   fcb->oob_pagesize = mtd->writesize + mtd->oobsize;
> >   fcb->sectors = mtd->erasesize / mtd->writesize;
> >
> > - /* Divide ECC strength by two and save the value into FCB structure. 
> > */
> > - fcb->ecc_level = nand_info->bch_geometry.ecc_strength >> 1;
> > -
> > - fcb->ecc_type = fcb->ecc_level;
> > + fcb->meta_size = l.meta_size;
> > + fcb->nr_blocks = l.nblocks;
> > + fcb->ecc_nr = l.data0_size;
> > + fcb->ecc_level = l.ecc0;
> > + fcb->ecc_size = l.datan_size;
> > + fcb->ecc_type = l.eccn;
> >
> >   /* Also hardcoded in kobs-ng */
> > - fcb->ecc_nr = 0x0200;
> > - fcb->ecc_size = 0x0200;
> > - fcb->datasetup = 80;
> > - fcb->datahold = 60;
> > - fcb->addr_setup = 25;
> > - fcb->dsample_time = 6;
> > - fcb->meta_size = 10;
> > + if (is_mx6()) {
> > + fcb->datasetup = 80;
> > + fcb->datahold = 60;
> > + fcb->addr_setup = 25;
> > + fcb->dsample_time = 6;
> > + } else if (is_mx7()) {
> > + fcb->datasetup = 10;
> > + fcb->datahold = 7;
> > + fcb->addr_setup = 15;
> > + fcb->dsample_time = 6;
> > + }
> >
> >   /* DBBT search area starts at second page on first block */
> >   fcb->dbbt_start = 1;
> > @@ -98,6 +109,9 @@ static void fill_fcb(struct fcb_block *fcb, struct 
> > mtd_info *mtd)
> >
> >   fcb->nr_blocks = mtd->writesize / fcb->ecc_nr - 1;
> >
> > + fcb->disbbm = 0;
> > + fcb->disbbm_search = 0;
> > +
> >   fcb->checksum = calc_chksum((void *)fcb + 4, sizeof(*fcb) - 4);
> >  }
> >
> > @@ -133,6 +147,7 @@ static int nandbcb_update(struct mtd_info *mtd, loff_t 
> > off, size_t size,
> >   size_t fwsize, dummy;
> >   int i, ret;
> >
> > + fcb_raw_page = 0;
> >   /* erase */
> >   memset(&opts, 0, sizeof(opts));
> >

Re: [U-Boot] [PATCH 4/4] mx6: Allow configuring the NoC registers on i.MX6QP

2019-11-03 Thread Stefano Babic
Hi Fabio,

On 03/11/19 13:17, Stefano Babic wrote:
> On 24/10/19 15:47, Fabio Estevam wrote:
>> Hi Stefano,
>>
>> On Fri, Jul 12, 2019 at 9:33 AM Fabio Estevam  wrote:
>>>
>>> The NoC registers on i.MX6QP needs to be configured, otherwise some
>>> usecases in the kernel behave incorrectly, such as rotation and resize.
>>>
>>> Currently the NoC registers are not configured in the kernel, so
>>> configure them in U-Boot like it is done in the NXP U-Boot tree.
>>>
>>> Signed-off-by: Fabio Estevam 
>>
>> It seems that only the first patch of this series got applied.
>>
>> Could you please consider applying patches 2-4 too?
> 
> Something went wrong, patches were already set to "Accepted" in
> patchwork. I have picked up the rest of series, thanks for remind.
> 

I found a good reason why they were out. Patch 4 breaks the build for
mx6sxsabresd because enable_[disable]ipu is called (of course, it should
not be).

Could you take a look and repost ? Thanks !

Best regards,
Stefano


-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v3 1/2] ARM: dts: imx6ull-colibri: change hierarchy of DTS files

2019-11-03 Thread Igor Opaniuk
Hi Stefano,

On Wed, Oct 16, 2019 at 12:39 PM Igor Opaniuk  wrote:
>
> From: Igor Opaniuk 
>
> Introduce imx6ull-colibri-u-boot.dtsi for u-boot specific properties to
> keep original imx6ull-colibri.dts in sync with Linux.
>
> Move all contents of imx6ull-colibri.dts to imx6ull-colibri.dtsi +
> additionally fix checkpatch warnings.
>
> Reviewed-by: Oleksandr Suvorov 
> Reviewed-by: Fabio Estevam 
> Signed-off-by: Igor Opaniuk 
> ---
>
>  arch/arm/dts/imx6ull-colibri-u-boot.dtsi  |   4 +
>  arch/arm/dts/imx6ull-colibri.dts  | 628 +
>  arch/arm/dts/imx6ull-colibri.dtsi | 633 ++
>  board/toradex/colibri-imx6ull/MAINTAINERS |   2 +
>  4 files changed, 641 insertions(+), 626 deletions(-)
>  create mode 100644 arch/arm/dts/imx6ull-colibri-u-boot.dtsi
>  create mode 100644 arch/arm/dts/imx6ull-colibri.dtsi
>
> diff --git a/arch/arm/dts/imx6ull-colibri-u-boot.dtsi 
> b/arch/arm/dts/imx6ull-colibri-u-boot.dtsi
> new file mode 100644
> index 00..e81ac8cb27
> --- /dev/null
> +++ b/arch/arm/dts/imx6ull-colibri-u-boot.dtsi
> @@ -0,0 +1,4 @@
> +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
> +/*
> + * Copyright 2019 Toradex AG
> + */
> diff --git a/arch/arm/dts/imx6ull-colibri.dts 
> b/arch/arm/dts/imx6ull-colibri.dts
> index 262205ac5e..15338a1ae3 100644
> --- a/arch/arm/dts/imx6ull-colibri.dts
> +++ b/arch/arm/dts/imx6ull-colibri.dts
> @@ -3,634 +3,10 @@
>   * Copyright 2018-2019 Toradex AG
>   */
>
> -/dts-v1/;
> -#include 
> -#include "imx6ull.dtsi"
> +#include "imx6ull-colibri.dtsi"
> +#include "imx6ull-colibri-u-boot.dtsi"
>
>  / {
> model = "Toradex Colibri iMX6ULL";
> compatible = "toradex,colibri-imx6ull", "fsl,imx6ull";
> -
> -   aliases {
> -   u-boot,dm-pre-reloc;
> -   mmc0 = &usdhc1;
> -   usb0 = &usbotg1; /* required for ums */
> -   display0 = &lcdif;
> -   };
> -
> -   chosen {
> -   stdout-path = &uart1;
> -   };
> -
> -   reg_module_3v3: regulator-module-3v3 {
> -   compatible = "regulator-fixed";
> -   regulator-always-on;
> -   regulator-name = "+V3.3";
> -   regulator-min-microvolt = <330>;
> -   regulator-max-microvolt = <330>;
> -   };
> -
> -   reg_module_3v3_avdd: regulator-module-3v3-avdd {
> -   compatible = "regulator-fixed";
> -   regulator-always-on;
> -   regulator-name = "+V3.3_AVDD_AUDIO";
> -   regulator-min-microvolt = <330>;
> -   regulator-max-microvolt = <330>;
> -   };
> -
> -   reg_5v0: regulator-5v0 {
> -   compatible = "regulator-fixed";
> -   regulator-name = "5V";
> -   regulator-min-microvolt = <500>;
> -   regulator-max-microvolt = <500>;
> -   };
> -
> -   reg_sd1_vmmc: regulator-sd1-vmmc {
> -   compatible = "regulator-gpio";
> -   gpio = <&gpio5 9 GPIO_ACTIVE_HIGH>;
> -   pinctrl-names = "default";
> -   pinctrl-0 = <&pinctrl_snvs_reg_sd>;
> -   regulator-always-on;
> -   regulator-name = "+V3.3_1.8_SD";
> -   regulator-min-microvolt = <180>;
> -   regulator-max-microvolt = <330>;
> -   states = <180 0x1 330 0x0>;
> -   vin-supply = <®_module_3v3>;
> -   };
> -
> -   reg_usbh_vbus: regulator-usbh-vbus {
> -   compatible = "regulator-fixed";
> -   pinctrl-names = "default";
> -   pinctrl-0 = <&pinctrl_usbh_reg>;
> -   regulator-name = "VCC_USB[1-4]";
> -   regulator-min-microvolt = <500>;
> -   regulator-max-microvolt = <500>;
> -   gpio = <&gpio1 2 GPIO_ACTIVE_LOW>; /* USBH_PEN */
> -   vin-supply = <®_5v0>;
> -   };
> -};
> -
> -&adc1 {
> -   num-channels = <10>;
> -   vref-supply = <®_module_3v3_avdd>;
> -};
> -
> -/* Colibri SPI */
> -&ecspi1 {
> -   cs-gpios = <&gpio3 26 GPIO_ACTIVE_HIGH>;
> -   pinctrl-names = "default";
> -   pinctrl-0 = <&pinctrl_ecspi1 &pinctrl_ecspi1_cs>;
> -};
> -
> -/* Ethernet */
> -&fec2 {
> -   pinctrl-names = "default";
> -   pinctrl-0 = <&pinctrl_enet2>;
> -   phy-mode = "rmii";
> -   phy-handle = <ðphy1>;
> -   status = "okay";
> -
> -   mdio {
> -   #address-cells = <1>;
> -   #size-cells = <0>;
> -
> -   ethphy1: ethernet-phy@2 {
> -   compatible = "ethernet-phy-ieee802.3-c22";
> -   max-speed = <100>;
> -   reg = <2>;
> -   };
> -   };
> -};
> -
> -/* NAND */
> -&gpmi {
> -   pinctrl-names = "default";
> -   pinctrl-0 = <&pinctrl_gpmi_nand>;
> -   nand-on-flash-bbt;
> -   nand-ecc-mode = "hw";
> -   nand-ecc-strength = <8>;
> -   nand-ecc-ste

Re: [U-Boot] [PATCH v3 2/2] ARM: dts: imx6ull-colibri: pre-reloc for uart pinmux modes

2019-11-03 Thread Igor Opaniuk
Hi Stefano,

On Wed, Oct 16, 2019 at 12:39 PM Igor Opaniuk  wrote:
>
> From: Igor Opaniuk 
>
> Add u-boot,dm-pre-reloc properties for uart pinmux configuration
> nodes, which enables UART as early as possible (before relocation).
>
> Without this we miss almost the half of output (U-boot version,
> CPU defails, Reset cause, DRAM details etc.).
>
> Fixes: cd69e8ef9b ("colibri-imx6ull: migrate pinctrl and regulators to 
> dtb/dm")
> Reviewed-by: Oleksandr Suvorov 
> Reviewed-by: Fabio Estevam 
> Signed-off-by: Igor Opaniuk 
> ---
>
>  arch/arm/dts/imx6ull-colibri-u-boot.dtsi | 8 
>  1 file changed, 8 insertions(+)
>
> diff --git a/arch/arm/dts/imx6ull-colibri-u-boot.dtsi 
> b/arch/arm/dts/imx6ull-colibri-u-boot.dtsi
> index e81ac8cb27..531cdcc4da 100644
> --- a/arch/arm/dts/imx6ull-colibri-u-boot.dtsi
> +++ b/arch/arm/dts/imx6ull-colibri-u-boot.dtsi
> @@ -2,3 +2,11 @@
>  /*
>   * Copyright 2019 Toradex AG
>   */
> +
> +&pinctrl_uart1 {
> +   u-boot,dm-pre-reloc;
> +};
> +
> +&pinctrl_uart1_ctrl1 {
> +   u-boot,dm-pre-reloc;
> +};
> --
> 2.17.1
>

Could you please also apply this patchset?

Thanks

-- 
Best regards - Freundliche Grüsse - Meilleures salutations

Senior Development Engineer,
Igor Opaniuk

Toradex AG
Altsagenstrasse 5 | 6048 Horw/Luzern | Switzerland | T: +41 41 500 48
00 (main line)
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v3 1/2] ARM: dts: imx6ull-colibri: change hierarchy of DTS files

2019-11-03 Thread Stefano Babic
On 03/11/19 17:20, Igor Opaniuk wrote:
> Hi Stefano,
> 
> On Wed, Oct 16, 2019 at 12:39 PM Igor Opaniuk  wrote:
>>
>> From: Igor Opaniuk 
>>
>> Introduce imx6ull-colibri-u-boot.dtsi for u-boot specific properties to
>> keep original imx6ull-colibri.dts in sync with Linux.
>>
>> Move all contents of imx6ull-colibri.dts to imx6ull-colibri.dtsi +
>> additionally fix checkpatch warnings.
>>
>> Reviewed-by: Oleksandr Suvorov 
>> Reviewed-by: Fabio Estevam 
>> Signed-off-by: Igor Opaniuk 
>> ---
>>
>>  arch/arm/dts/imx6ull-colibri-u-boot.dtsi  |   4 +
>>  arch/arm/dts/imx6ull-colibri.dts  | 628 +
>>  arch/arm/dts/imx6ull-colibri.dtsi | 633 ++
>>  board/toradex/colibri-imx6ull/MAINTAINERS |   2 +
>>  4 files changed, 641 insertions(+), 626 deletions(-)
>>  create mode 100644 arch/arm/dts/imx6ull-colibri-u-boot.dtsi
>>  create mode 100644 arch/arm/dts/imx6ull-colibri.dtsi
>>
>> diff --git a/arch/arm/dts/imx6ull-colibri-u-boot.dtsi 
>> b/arch/arm/dts/imx6ull-colibri-u-boot.dtsi
>> new file mode 100644
>> index 00..e81ac8cb27
>> --- /dev/null
>> +++ b/arch/arm/dts/imx6ull-colibri-u-boot.dtsi
>> @@ -0,0 +1,4 @@
>> +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
>> +/*
>> + * Copyright 2019 Toradex AG
>> + */
>> diff --git a/arch/arm/dts/imx6ull-colibri.dts 
>> b/arch/arm/dts/imx6ull-colibri.dts
>> index 262205ac5e..15338a1ae3 100644
>> --- a/arch/arm/dts/imx6ull-colibri.dts
>> +++ b/arch/arm/dts/imx6ull-colibri.dts
>> @@ -3,634 +3,10 @@
>>   * Copyright 2018-2019 Toradex AG
>>   */
>>
>> -/dts-v1/;
>> -#include 
>> -#include "imx6ull.dtsi"
>> +#include "imx6ull-colibri.dtsi"
>> +#include "imx6ull-colibri-u-boot.dtsi"
>>
>>  / {
>> model = "Toradex Colibri iMX6ULL";
>> compatible = "toradex,colibri-imx6ull", "fsl,imx6ull";
>> -
>> -   aliases {
>> -   u-boot,dm-pre-reloc;
>> -   mmc0 = &usdhc1;
>> -   usb0 = &usbotg1; /* required for ums */
>> -   display0 = &lcdif;
>> -   };
>> -
>> -   chosen {
>> -   stdout-path = &uart1;
>> -   };
>> -
>> -   reg_module_3v3: regulator-module-3v3 {
>> -   compatible = "regulator-fixed";
>> -   regulator-always-on;
>> -   regulator-name = "+V3.3";
>> -   regulator-min-microvolt = <330>;
>> -   regulator-max-microvolt = <330>;
>> -   };
>> -
>> -   reg_module_3v3_avdd: regulator-module-3v3-avdd {
>> -   compatible = "regulator-fixed";
>> -   regulator-always-on;
>> -   regulator-name = "+V3.3_AVDD_AUDIO";
>> -   regulator-min-microvolt = <330>;
>> -   regulator-max-microvolt = <330>;
>> -   };
>> -
>> -   reg_5v0: regulator-5v0 {
>> -   compatible = "regulator-fixed";
>> -   regulator-name = "5V";
>> -   regulator-min-microvolt = <500>;
>> -   regulator-max-microvolt = <500>;
>> -   };
>> -
>> -   reg_sd1_vmmc: regulator-sd1-vmmc {
>> -   compatible = "regulator-gpio";
>> -   gpio = <&gpio5 9 GPIO_ACTIVE_HIGH>;
>> -   pinctrl-names = "default";
>> -   pinctrl-0 = <&pinctrl_snvs_reg_sd>;
>> -   regulator-always-on;
>> -   regulator-name = "+V3.3_1.8_SD";
>> -   regulator-min-microvolt = <180>;
>> -   regulator-max-microvolt = <330>;
>> -   states = <180 0x1 330 0x0>;
>> -   vin-supply = <®_module_3v3>;
>> -   };
>> -
>> -   reg_usbh_vbus: regulator-usbh-vbus {
>> -   compatible = "regulator-fixed";
>> -   pinctrl-names = "default";
>> -   pinctrl-0 = <&pinctrl_usbh_reg>;
>> -   regulator-name = "VCC_USB[1-4]";
>> -   regulator-min-microvolt = <500>;
>> -   regulator-max-microvolt = <500>;
>> -   gpio = <&gpio1 2 GPIO_ACTIVE_LOW>; /* USBH_PEN */
>> -   vin-supply = <®_5v0>;
>> -   };
>> -};
>> -
>> -&adc1 {
>> -   num-channels = <10>;
>> -   vref-supply = <®_module_3v3_avdd>;
>> -};
>> -
>> -/* Colibri SPI */
>> -&ecspi1 {
>> -   cs-gpios = <&gpio3 26 GPIO_ACTIVE_HIGH>;
>> -   pinctrl-names = "default";
>> -   pinctrl-0 = <&pinctrl_ecspi1 &pinctrl_ecspi1_cs>;
>> -};
>> -
>> -/* Ethernet */
>> -&fec2 {
>> -   pinctrl-names = "default";
>> -   pinctrl-0 = <&pinctrl_enet2>;
>> -   phy-mode = "rmii";
>> -   phy-handle = <ðphy1>;
>> -   status = "okay";
>> -
>> -   mdio {
>> -   #address-cells = <1>;
>> -   #size-cells = <0>;
>> -
>> -   ethphy1: ethernet-phy@2 {
>> -   compatible = "ethernet-phy-ieee802.3-c22";
>> -   max-speed = <100>;
>> -   reg = <2>;
>> -   };
>> -   };
>> -};
>> -
>> -/* NAND */
>> -&gpmi {
>> - 

Re: [U-Boot] [PATCH v3 1/2] ARM: dts: imx6ull-colibri: change hierarchy of DTS files

2019-11-03 Thread Igor Opaniuk
On Sun, Nov 3, 2019 at 5:36 PM Stefano Babic  wrote:
>
> On 03/11/19 17:20, Igor Opaniuk wrote:
> > Hi Stefano,
> >
> > On Wed, Oct 16, 2019 at 12:39 PM Igor Opaniuk  
> > wrote:
> >>
> >> From: Igor Opaniuk 
> >>
> >> Introduce imx6ull-colibri-u-boot.dtsi for u-boot specific properties to
> >> keep original imx6ull-colibri.dts in sync with Linux.
> >>
> >> Move all contents of imx6ull-colibri.dts to imx6ull-colibri.dtsi +
> >> additionally fix checkpatch warnings.
> >>
> >> Reviewed-by: Oleksandr Suvorov 
> >> Reviewed-by: Fabio Estevam 
> >> Signed-off-by: Igor Opaniuk 
> >> ---
> >>
> >>  arch/arm/dts/imx6ull-colibri-u-boot.dtsi  |   4 +
> >>  arch/arm/dts/imx6ull-colibri.dts  | 628 +
> >>  arch/arm/dts/imx6ull-colibri.dtsi | 633 ++
> >>  board/toradex/colibri-imx6ull/MAINTAINERS |   2 +
> >>  4 files changed, 641 insertions(+), 626 deletions(-)
> >>  create mode 100644 arch/arm/dts/imx6ull-colibri-u-boot.dtsi
> >>  create mode 100644 arch/arm/dts/imx6ull-colibri.dtsi
> >>
> >> diff --git a/arch/arm/dts/imx6ull-colibri-u-boot.dtsi 
> >> b/arch/arm/dts/imx6ull-colibri-u-boot.dtsi
> >> new file mode 100644
> >> index 00..e81ac8cb27
> >> --- /dev/null
> >> +++ b/arch/arm/dts/imx6ull-colibri-u-boot.dtsi
> >> @@ -0,0 +1,4 @@
> >> +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
> >> +/*
> >> + * Copyright 2019 Toradex AG
> >> + */
> >> diff --git a/arch/arm/dts/imx6ull-colibri.dts 
> >> b/arch/arm/dts/imx6ull-colibri.dts
> >> index 262205ac5e..15338a1ae3 100644
> >> --- a/arch/arm/dts/imx6ull-colibri.dts
> >> +++ b/arch/arm/dts/imx6ull-colibri.dts
> >> @@ -3,634 +3,10 @@
> >>   * Copyright 2018-2019 Toradex AG
> >>   */
> >>
> >> -/dts-v1/;
> >> -#include 
> >> -#include "imx6ull.dtsi"
> >> +#include "imx6ull-colibri.dtsi"
> >> +#include "imx6ull-colibri-u-boot.dtsi"
> >>
> >>  / {
> >> model = "Toradex Colibri iMX6ULL";
> >> compatible = "toradex,colibri-imx6ull", "fsl,imx6ull";
> >> -
> >> -   aliases {
> >> -   u-boot,dm-pre-reloc;
> >> -   mmc0 = &usdhc1;
> >> -   usb0 = &usbotg1; /* required for ums */
> >> -   display0 = &lcdif;
> >> -   };
> >> -
> >> -   chosen {
> >> -   stdout-path = &uart1;
> >> -   };
> >> -
> >> -   reg_module_3v3: regulator-module-3v3 {
> >> -   compatible = "regulator-fixed";
> >> -   regulator-always-on;
> >> -   regulator-name = "+V3.3";
> >> -   regulator-min-microvolt = <330>;
> >> -   regulator-max-microvolt = <330>;
> >> -   };
> >> -
> >> -   reg_module_3v3_avdd: regulator-module-3v3-avdd {
> >> -   compatible = "regulator-fixed";
> >> -   regulator-always-on;
> >> -   regulator-name = "+V3.3_AVDD_AUDIO";
> >> -   regulator-min-microvolt = <330>;
> >> -   regulator-max-microvolt = <330>;
> >> -   };
> >> -
> >> -   reg_5v0: regulator-5v0 {
> >> -   compatible = "regulator-fixed";
> >> -   regulator-name = "5V";
> >> -   regulator-min-microvolt = <500>;
> >> -   regulator-max-microvolt = <500>;
> >> -   };
> >> -
> >> -   reg_sd1_vmmc: regulator-sd1-vmmc {
> >> -   compatible = "regulator-gpio";
> >> -   gpio = <&gpio5 9 GPIO_ACTIVE_HIGH>;
> >> -   pinctrl-names = "default";
> >> -   pinctrl-0 = <&pinctrl_snvs_reg_sd>;
> >> -   regulator-always-on;
> >> -   regulator-name = "+V3.3_1.8_SD";
> >> -   regulator-min-microvolt = <180>;
> >> -   regulator-max-microvolt = <330>;
> >> -   states = <180 0x1 330 0x0>;
> >> -   vin-supply = <®_module_3v3>;
> >> -   };
> >> -
> >> -   reg_usbh_vbus: regulator-usbh-vbus {
> >> -   compatible = "regulator-fixed";
> >> -   pinctrl-names = "default";
> >> -   pinctrl-0 = <&pinctrl_usbh_reg>;
> >> -   regulator-name = "VCC_USB[1-4]";
> >> -   regulator-min-microvolt = <500>;
> >> -   regulator-max-microvolt = <500>;
> >> -   gpio = <&gpio1 2 GPIO_ACTIVE_LOW>; /* USBH_PEN */
> >> -   vin-supply = <®_5v0>;
> >> -   };
> >> -};
> >> -
> >> -&adc1 {
> >> -   num-channels = <10>;
> >> -   vref-supply = <®_module_3v3_avdd>;
> >> -};
> >> -
> >> -/* Colibri SPI */
> >> -&ecspi1 {
> >> -   cs-gpios = <&gpio3 26 GPIO_ACTIVE_HIGH>;
> >> -   pinctrl-names = "default";
> >> -   pinctrl-0 = <&pinctrl_ecspi1 &pinctrl_ecspi1_cs>;
> >> -};
> >> -
> >> -/* Ethernet */
> >> -&fec2 {
> >> -   pinctrl-names = "default";
> >> -   pinctrl-0 = <&pinctrl_enet2>;
> >> -   phy-mode = "rmii";
> >> -   phy-handle = <ðphy1>;
> >> -   status = "okay";
> >> -
> >> -   mdio {
> >> -   #address-cells 

Re: [U-Boot] [PATCH v3 1/2] ARM: dts: imx6ull-colibri: change hierarchy of DTS files

2019-11-03 Thread Stefano Babic
On 03/11/19 18:02, Igor Opaniuk wrote:
> On Sun, Nov 3, 2019 at 5:36 PM Stefano Babic  wrote:
>>
>> On 03/11/19 17:20, Igor Opaniuk wrote:
>>> Hi Stefano,
>>>
>>> On Wed, Oct 16, 2019 at 12:39 PM Igor Opaniuk  
>>> wrote:

 From: Igor Opaniuk 

 Introduce imx6ull-colibri-u-boot.dtsi for u-boot specific properties to
 keep original imx6ull-colibri.dts in sync with Linux.

 Move all contents of imx6ull-colibri.dts to imx6ull-colibri.dtsi +
 additionally fix checkpatch warnings.

 Reviewed-by: Oleksandr Suvorov 
 Reviewed-by: Fabio Estevam 
 Signed-off-by: Igor Opaniuk 
 ---

  arch/arm/dts/imx6ull-colibri-u-boot.dtsi  |   4 +
  arch/arm/dts/imx6ull-colibri.dts  | 628 +
  arch/arm/dts/imx6ull-colibri.dtsi | 633 ++
  board/toradex/colibri-imx6ull/MAINTAINERS |   2 +
  4 files changed, 641 insertions(+), 626 deletions(-)
  create mode 100644 arch/arm/dts/imx6ull-colibri-u-boot.dtsi
  create mode 100644 arch/arm/dts/imx6ull-colibri.dtsi

 diff --git a/arch/arm/dts/imx6ull-colibri-u-boot.dtsi 
 b/arch/arm/dts/imx6ull-colibri-u-boot.dtsi
 new file mode 100644
 index 00..e81ac8cb27
 --- /dev/null
 +++ b/arch/arm/dts/imx6ull-colibri-u-boot.dtsi
 @@ -0,0 +1,4 @@
 +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
 +/*
 + * Copyright 2019 Toradex AG
 + */
 diff --git a/arch/arm/dts/imx6ull-colibri.dts 
 b/arch/arm/dts/imx6ull-colibri.dts
 index 262205ac5e..15338a1ae3 100644
 --- a/arch/arm/dts/imx6ull-colibri.dts
 +++ b/arch/arm/dts/imx6ull-colibri.dts
 @@ -3,634 +3,10 @@
   * Copyright 2018-2019 Toradex AG
   */

 -/dts-v1/;
 -#include 
 -#include "imx6ull.dtsi"
 +#include "imx6ull-colibri.dtsi"
 +#include "imx6ull-colibri-u-boot.dtsi"

  / {
 model = "Toradex Colibri iMX6ULL";
 compatible = "toradex,colibri-imx6ull", "fsl,imx6ull";
 -
 -   aliases {
 -   u-boot,dm-pre-reloc;
 -   mmc0 = &usdhc1;
 -   usb0 = &usbotg1; /* required for ums */
 -   display0 = &lcdif;
 -   };
 -
 -   chosen {
 -   stdout-path = &uart1;
 -   };
 -
 -   reg_module_3v3: regulator-module-3v3 {
 -   compatible = "regulator-fixed";
 -   regulator-always-on;
 -   regulator-name = "+V3.3";
 -   regulator-min-microvolt = <330>;
 -   regulator-max-microvolt = <330>;
 -   };
 -
 -   reg_module_3v3_avdd: regulator-module-3v3-avdd {
 -   compatible = "regulator-fixed";
 -   regulator-always-on;
 -   regulator-name = "+V3.3_AVDD_AUDIO";
 -   regulator-min-microvolt = <330>;
 -   regulator-max-microvolt = <330>;
 -   };
 -
 -   reg_5v0: regulator-5v0 {
 -   compatible = "regulator-fixed";
 -   regulator-name = "5V";
 -   regulator-min-microvolt = <500>;
 -   regulator-max-microvolt = <500>;
 -   };
 -
 -   reg_sd1_vmmc: regulator-sd1-vmmc {
 -   compatible = "regulator-gpio";
 -   gpio = <&gpio5 9 GPIO_ACTIVE_HIGH>;
 -   pinctrl-names = "default";
 -   pinctrl-0 = <&pinctrl_snvs_reg_sd>;
 -   regulator-always-on;
 -   regulator-name = "+V3.3_1.8_SD";
 -   regulator-min-microvolt = <180>;
 -   regulator-max-microvolt = <330>;
 -   states = <180 0x1 330 0x0>;
 -   vin-supply = <®_module_3v3>;
 -   };
 -
 -   reg_usbh_vbus: regulator-usbh-vbus {
 -   compatible = "regulator-fixed";
 -   pinctrl-names = "default";
 -   pinctrl-0 = <&pinctrl_usbh_reg>;
 -   regulator-name = "VCC_USB[1-4]";
 -   regulator-min-microvolt = <500>;
 -   regulator-max-microvolt = <500>;
 -   gpio = <&gpio1 2 GPIO_ACTIVE_LOW>; /* USBH_PEN */
 -   vin-supply = <®_5v0>;
 -   };
 -};
 -
 -&adc1 {
 -   num-channels = <10>;
 -   vref-supply = <®_module_3v3_avdd>;
 -};
 -
 -/* Colibri SPI */
 -&ecspi1 {
 -   cs-gpios = <&gpio3 26 GPIO_ACTIVE_HIGH>;
 -   pinctrl-names = "default";
 -   pinctrl-0 = <&pinctrl_ecspi1 &pinctrl_ecspi1_cs>;
 -};
 -
 -/* Ethernet */
 -&fec2 {
 -   pinctrl-names = "default";
 -   pinctrl-0 = <&pinctrl_enet2>;
 -   phy-mode = "rmii";
 -   phy-handle = <ðphy1>;
 -   status = "okay";
 -
 -   

Re: [U-Boot] [PATCH] imx: update i.MX8MQ device trees

2019-11-03 Thread Stefano Babic
On 01/11/19 17:27, Patrick Wildt wrote:
> Hi,
> 
> is this on your list for the next u-boot merge? :)
> 
> It's Acked-by: Peng Fan .
> 

It is, it is in my -next (for next PR, not next release).

Regards,
Stefano

> Thanks!
> Patrick
> 
> On Mon, Oct 14, 2019 at 01:19:02PM +0200, Patrick Wildt wrote:
>> This updates the i.MX8MQ device trees and, necessarily, also the
>> i.MX8MQ clock bindings.  These are taken verbatim from from the
>> Linux kernel version v5.4-rc2, which three small changes which
>> were already part of the previous device tree:
>>
>>  * Keep the PSCI reserved memory range
>>  * Keep the alias for ethernet, so that the MAC address can be set
>>  * Keep the modified #include for the IOMUXC pins
>>
>> Signed-off-by: Patrick Wildt 
>> ---
>>  arch/arm/dts/Makefile|5 +-
>>  arch/arm/dts/fsl-imx8mq-evk.dts  |  414 
>>  arch/arm/dts/fsl-imx8mq.dtsi |  462 -
>>  arch/arm/dts/imx8mq-evk.dts  |  486 ++
>>  arch/arm/dts/imx8mq.dtsi |  ++
>>  configs/imx8mq_evk_defconfig |2 +-
>>  include/configs/imx8mq_evk.h |2 +-
>>  include/dt-bindings/clock/imx8mq-clock.h |  571 ---
>>  8 files changed, 1785 insertions(+), 1268 deletions(-)
>>  delete mode 100644 arch/arm/dts/fsl-imx8mq-evk.dts
>>  delete mode 100644 arch/arm/dts/fsl-imx8mq.dtsi
>>  create mode 100644 arch/arm/dts/imx8mq-evk.dts
>>  create mode 100644 arch/arm/dts/imx8mq.dtsi
>>
>> diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
>> index 727da1a280..453d822ad7 100644
>> --- a/arch/arm/dts/Makefile
>> +++ b/arch/arm/dts/Makefile
>> @@ -645,8 +645,9 @@ dtb-$(CONFIG_ARCH_IMX8) += \
>>  fsl-imx8qxp-colibri.dtb \
>>  fsl-imx8qxp-mek.dtb
>>  
>> -dtb-$(CONFIG_ARCH_IMX8M) += fsl-imx8mq-evk.dtb \
>> -imx8mm-evk.dtb
>> +dtb-$(CONFIG_ARCH_IMX8M) += \
>> +imx8mm-evk.dtb \
>> +imx8mq-evk.dtb
>>  
>>  dtb-$(CONFIG_RCAR_GEN2) += \
>>  r8a7790-lager-u-boot.dtb \
>> diff --git a/arch/arm/dts/fsl-imx8mq-evk.dts 
>> b/arch/arm/dts/fsl-imx8mq-evk.dts
>> deleted file mode 100644
>> index 4a08099b3c..00
>> --- a/arch/arm/dts/fsl-imx8mq-evk.dts
>> +++ /dev/null
>> @@ -1,414 +0,0 @@
>> -// SPDX-License-Identifier: GPL-2.0+
>> -/*
>> - * Copyright 2018 NXP
>> - */
>> -
>> -/dts-v1/;
>> -
>> -/* First 128KB is for PSCI ATF. */
>> -/memreserve/ 0x4000 0x0002;
>> -
>> -#include "fsl-imx8mq.dtsi"
>> -
>> -/ {
>> -model = "Freescale i.MX8MQ EVK";
>> -compatible = "fsl,imx8mq-evk", "fsl,imx8mq";
>> -
>> -chosen {
>> -bootargs = "console=ttymxc0,115200 
>> earlycon=ec_imx6q,0x3086,115200";
>> -};
>> -
>> -regulators {
>> -compatible = "simple-bus";
>> -#address-cells = <1>;
>> -#size-cells = <0>;
>> -
>> -reg_usdhc2_vmmc: usdhc2_vmmc {
>> -compatible = "regulator-fixed";
>> -regulator-name = "VSD_3V3";
>> -regulator-min-microvolt = <330>;
>> -regulator-max-microvolt = <330>;
>> -gpio = <&gpio2 19 GPIO_ACTIVE_HIGH>;
>> -enable-active-high;
>> -};
>> -};
>> -
>> -pwmleds {
>> -compatible = "pwm-leds";
>> -
>> -ledpwm2 {
>> -label = "PWM2";
>> -pwms = <&pwm2 0 5>;
>> -max-brightness = <255>;
>> -};
>> -};
>> -};
>> -
>> -&iomuxc {
>> -pinctrl-names = "default";
>> -
>> -imx8mq-evk {
>> -pinctrl_fec1: fec1grp {
>> -fsl,pins = <
>> -MX8MQ_IOMUXC_ENET_MDC_ENET1_MDC 0x3
>> -MX8MQ_IOMUXC_ENET_MDIO_ENET1_MDIO   0x23
>> -MX8MQ_IOMUXC_ENET_TD3_ENET1_RGMII_TD3   0x1f
>> -MX8MQ_IOMUXC_ENET_TD2_ENET1_RGMII_TD2   0x1f
>> -MX8MQ_IOMUXC_ENET_TD1_ENET1_RGMII_TD1   0x1f
>> -MX8MQ_IOMUXC_ENET_TD0_ENET1_RGMII_TD0   0x1f
>> -MX8MQ_IOMUXC_ENET_RD3_ENET1_RGMII_RD3   0x91
>> -MX8MQ_IOMUXC_ENET_RD2_ENET1_RGMII_RD2   0x91
>> -MX8MQ_IOMUXC_ENET_RD1_ENET1_RGMII_RD1   0x91
>> -MX8MQ_IOMUXC_ENET_RD0_ENET1_RGMII_RD0   0x91
>> -MX8MQ_IOMUXC_ENET_TXC_ENET1_RGMII_TXC   0x1f
>> -MX8MQ_IOMUXC_ENET_RXC_ENET1_RGMII_RXC   0x91
>> -MX8MQ_IOMUXC_ENET_RX_CTL_ENET1_RGMII_RX_CTL 
>> 0x91
>> -MX8MQ_IOMUXC_ENET_TX_CTL_ENET1_RGMII_TX_CTL 
>> 0x1f
>> -MX8MQ_IOMUXC_GPIO1_IO09_GPIO1_IO9   0x19
>> ->;
>> -};
>> -
>> -pinctrl_i2c1: i2c1grp {
>> -fsl,pins

Re: [U-Boot] [PATCH v4 2/4] arm: socfpga: Convert reset manager from struct to defines

2019-11-03 Thread Simon Goldschmidt
On Wed, Oct 30, 2019 at 10:48 AM Ley Foon Tan  wrote:
>
> On Tue, Oct 29, 2019 at 6:31 PM Simon Goldschmidt
>  wrote:
> >
> >
> >
> > Ley Foon Tan  schrieb am Di., 29. Okt. 2019, 11:16:
> >>
> >> On Fri, Oct 25, 2019 at 5:37 PM Simon Goldschmidt
> >>  wrote:
> >> >
> >> > On Fri, Oct 25, 2019 at 11:17 AM Ley Foon Tan  
> >> > wrote:
> >> > >
> >> > > On Wed, Oct 23, 2019 at 2:11 AM Simon Goldschmidt
> >> > >  wrote:
> >> > > >
> >> > > > Am 10.10.2019 um 09:37 schrieb Ley Foon Tan:
> >> > > > > Convert reset manager for Gen5, Arria 10 and Stratix 10 from struct
> >> > > > > to defines.
> >> > > > >
> >> > > > > Change to get reset manager base address from DT node instead of 
> >> > > > > using
> >> > > > > #define.
> >> > > > >
> >> > > > > Signed-off-by: Ley Foon Tan 
> >> > > > >
> >> > > > > ---
> >> > > > > v4:
> >> > > > > - Update commit message about get base address from DT node.
> >> > > > >
> >> > > > > v3:
> >> > > > > - Remove "No functional change" in commit description.
> >> > > > >
> >> > > > > v2:
> >> > > > > - Get base address from DT
> >> > > > > - Revert to use writel(), readl(), setbits_le32() and 
> >> > > > > clrbits_le32().
> >> > > > > - Add prefix to defines.
> >> > > > > ---
> >> > > > >   arch/arm/mach-socfpga/include/mach/misc.h |  1 +
> >> > > > >   .../mach-socfpga/include/mach/reset_manager.h |  2 +
> >> > > > >   .../include/mach/reset_manager_arria10.h  | 43 
> >> > > > > -
> >> > > > >   .../include/mach/reset_manager_gen5.h | 22 -
> >> > > > >   .../include/mach/reset_manager_s10.h  | 33 ++---
> >> > > > >   arch/arm/mach-socfpga/misc.c  | 32 +
> >> > > > >   arch/arm/mach-socfpga/misc_gen5.c |  7 ++-
> >> > > > >   arch/arm/mach-socfpga/reset_manager_arria10.c | 47 
> >> > > > > ++-
> >> > > > >   arch/arm/mach-socfpga/reset_manager_gen5.c| 28 +--
> >> > > > >   arch/arm/mach-socfpga/reset_manager_s10.c | 34 +++---
> >> > > > >   arch/arm/mach-socfpga/spl_a10.c   |  7 ++-
> >> > > > >   arch/arm/mach-socfpga/spl_gen5.c  | 12 ++---
> >> > > > >   arch/arm/mach-socfpga/spl_s10.c   | 12 +++--
> >> > > > >   drivers/sysreset/sysreset_socfpga.c   |  6 +--
> >> > > > >   14 files changed, 137 insertions(+), 149 deletions(-)
> >> > > > >
> >> > > > > diff --git a/arch/arm/mach-socfpga/include/mach/misc.h 
> >> > > > > b/arch/arm/mach-socfpga/include/mach/misc.h
> >> > > > > index 27d0b6a370..a29b049742 100644
> >> > > > > --- a/arch/arm/mach-socfpga/include/mach/misc.h
> >> > > > > +++ b/arch/arm/mach-socfpga/include/mach/misc.h
> >> > > > > @@ -41,5 +41,6 @@ void socfpga_sdram_remap_zero(void);
> >> > > > >
> >> > > > >   void do_bridge_reset(int enable, unsigned int mask);
> >> > > > >   void socfpga_pl310_clear(void);
> >> > > > > +void socfpga_get_manager_addr(void);
> >> > > > >
> >> > > > >   #endif /* _MISC_H_ */
> >> > > > > diff --git a/arch/arm/mach-socfpga/include/mach/reset_manager.h 
> >> > > > > b/arch/arm/mach-socfpga/include/mach/reset_manager.h
> >> > > > > index 6ad037e325..a5b6931350 100644
> >> > > > > --- a/arch/arm/mach-socfpga/include/mach/reset_manager.h
> >> > > > > +++ b/arch/arm/mach-socfpga/include/mach/reset_manager.h
> >> > > > > @@ -6,6 +6,8 @@
> >> > > > >   #ifndef _RESET_MANAGER_H_
> >> > > > >   #define _RESET_MANAGER_H_
> >> > > > >
> >> > > > > +extern phys_addr_t socfpga_rstmgr_base;
> >> > > >
> >> > > > Did I write before that I think this is an ugly hack that should be
> >> > > > removed in the future by converting *all* drivers to DM? :-)
> >> > > Agreed, it is ugly. But, we still need it they convert to DM.
> >> >
> >> > What do you mean, we still need it? I don't think so.
> >> What I mean is if we still use global variable for base address, but
> >> still need this externs.
> >> >
> >> > > >
> >> > > > > +
> >> > > > >   void reset_cpu(ulong addr);
> >> > > > >
> >> > > > >   void socfpga_per_reset(u32 reset, int set);
> >> > > > > diff --git 
> >> > > > > a/arch/arm/mach-socfpga/include/mach/reset_manager_arria10.h 
> >> > > > > b/arch/arm/mach-socfpga/include/mach/reset_manager_arria10.h
> >> > > > > index 6623ebee65..41169aa677 100644
> >> > > > > --- a/arch/arm/mach-socfpga/include/mach/reset_manager_arria10.h
> >> > > > > +++ b/arch/arm/mach-socfpga/include/mach/reset_manager_arria10.h
> >> > > > > @@ -14,40 +14,15 @@ int 
> >> > > > > socfpga_reset_deassert_bridges_handoff(void);
> >> > > > >   void socfpga_reset_deassert_osc1wd0(void);
> >> > > > >   int socfpga_bridges_reset(void);
> >> > > > >
> >> > > > > -struct socfpga_reset_manager {
> >> > > > > - u32 stat;
> >> > > > > - u32 ramstat;
> >> > > > > - u32 miscstat;
> >> > > > > - u32 ctrl;
> >> > > > > - u32 hdsken;
> >> > > > > - u32 hdskreq;
> >> > > > > - u32 hdskack;
> >> > > > > - u32 counts;
> >> > > > > - u32 mpumod

Re: [U-Boot] [PATCH v3] board/BuR/brppt2: initial commit

2019-11-03 Thread Stefano Babic
Hi Hannes,

On 17/07/19 14:29, Hannes Schmelzer wrote:
> This commit adds support for the brppt2 board. The board is based on the
> i.mx6 dual-lite SoC.
> 
> Signed-off-by: Hannes Schmelzer 
> 
> ---
> 
Build is broken for this board because CONFIG_SYS_SPI_U_BOOT_OFFS went
to Kconfig and it is redefined. I fix it with:

diff --git a/configs/brppt2_defconfig b/configs/brppt2_defconfig
index f426317318..8f76262c5f 100644
--- a/configs/brppt2_defconfig
+++ b/configs/brppt2_defconfig
@@ -72,6 +72,7 @@ CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_SPI_FLASH_WINBOND=y
+CONFIG_SYS_SPI_U_BOOT_OFFS=0x10
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
 CONFIG_PHYLIB=y
 CONFIG_PHY_FIXED=y
diff --git a/include/configs/brppt2.h b/include/configs/brppt2.h
index 7849ca29f8..d369315090 100644
--- a/include/configs/brppt2.h
+++ b/include/configs/brppt2.h
@@ -116,10 +116,5 @@ BUR_COMMON_ENV \
 #ifdef CONFIG_SPL
 #include "imx6_spl.h"

-/* SPI support */
-#if defined(CONFIG_SPL_SPI_SUPPORT)
-# define CONFIG_SYS_SPI_U_BOOT_OFFS0x10
-#endif
-
 #endif /* CONFIG_SPL */
 #endif /* __CONFIG_BRPP2_IMX6_H */

and I applied to u-boot-imx. Let me know if something does not match.

Best regards,
Stefano

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH] ARM: omap3_logic: Power on MMC when setting up PMIC

2019-11-03 Thread Adam Ford
The PMIC enables power to the MMC card by default, but depending
on the state it was left when restarted, it's possible the MMC
may be powered down.

This patch patch explicitly tells the twl4030 to power the MMC.

Signed-off-by: Adam Ford 

diff --git a/board/logicpd/omap3som/omap3logic.c 
b/board/logicpd/omap3som/omap3logic.c
index ee77ce077c..43f049e592 100644
--- a/board/logicpd/omap3som/omap3logic.c
+++ b/board/logicpd/omap3som/omap3logic.c
@@ -141,6 +141,7 @@ void spl_board_prepare_for_linux(void)
 int misc_init_r(void)
 {
twl4030_power_init();
+   twl4030_power_mmc_init(0);
omap_die_id_display();
return 0;
 }
-- 
2.20.1

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


[U-Boot] [PATCH 1/2] ARM: dts: logicpd-torpedo-37xx-devkit-u-boot: Remove unused GPIO

2019-11-03 Thread Adam Ford
The only GPIO bank needed in SPL is GPIO4 and the SPL space is tight.

This patch removes the all but GPIO4 from the spl device tree to
reduce the SPL footprint.

Signed-off-by: Adam Ford 

diff --git a/arch/arm/dts/logicpd-torpedo-37xx-devkit-u-boot.dtsi 
b/arch/arm/dts/logicpd-torpedo-37xx-devkit-u-boot.dtsi
index 976330f897..76f74326ae 100644
--- a/arch/arm/dts/logicpd-torpedo-37xx-devkit-u-boot.dtsi
+++ b/arch/arm/dts/logicpd-torpedo-37xx-devkit-u-boot.dtsi
@@ -21,6 +21,26 @@
clock-frequency = <40>;
 };
 
+&gpio1 {
+   /delete-property/ u-boot,dm-spl;
+};
+
+&gpio2 {
+   /delete-property/ u-boot,dm-spl;
+};
+
+&gpio3 {
+   /delete-property/ u-boot,dm-spl;
+};
+
+&gpio5 {
+   /delete-property/ u-boot,dm-spl;
+};
+
+&gpio6 {
+   /delete-property/ u-boot,dm-spl;
+};
+
 /delete-node/ &uart2;
 /delete-node/ &uart3;
 /delete-node/ &mmc2;
-- 
2.20.1

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


[U-Boot] [PATCH 2/2] Revert "ARM: omap3_logic/omap35_logic: Enable GPIO in SPL"

2019-11-03 Thread Adam Ford
The SPL is too tight, and it cannot start any longer.  To
help reduce the size of SPL, we need to remove some non-critical
features.

This reverts commit 66063a7c1388fb724e8671b03c529fb5cda992dd.

Signed-off-by: Adam Ford 

diff --git a/configs/omap35_logic_defconfig b/configs/omap35_logic_defconfig
index 78fcbaaca2..3c9acd7e41 100644
--- a/configs/omap35_logic_defconfig
+++ b/configs/omap35_logic_defconfig
@@ -4,6 +4,7 @@ CONFIG_ARM=y
 CONFIG_ARCH_OMAP2PLUS=y
 CONFIG_SYS_TEXT_BASE=0x8010
 CONFIG_TI_COMMON_CMD_OPTIONS=y
+# CONFIG_SPL_GPIO_SUPPORT is not set
 CONFIG_SYS_MALLOC_F_LEN=0x4000
 CONFIG_TARGET_OMAP3_LOGIC=y
 # CONFIG_SPL_OMAP3_ID_NAND is not set
diff --git a/configs/omap3_logic_defconfig b/configs/omap3_logic_defconfig
index 81b57a8f7a..51547e7149 100644
--- a/configs/omap3_logic_defconfig
+++ b/configs/omap3_logic_defconfig
@@ -4,6 +4,7 @@ CONFIG_ARM=y
 CONFIG_ARCH_OMAP2PLUS=y
 CONFIG_SYS_TEXT_BASE=0x8010
 CONFIG_TI_COMMON_CMD_OPTIONS=y
+# CONFIG_SPL_GPIO_SUPPORT is not set
 CONFIG_SYS_MALLOC_F_LEN=0x4000
 CONFIG_TARGET_OMAP3_LOGIC=y
 # CONFIG_SPL_OMAP3_ID_NAND is not set
-- 
2.20.1

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


Re: [U-Boot] [PATCH 1/1] ARM: i.MX6: TARGET_NITROGEN6X: add 'select MX6QDL'

2019-11-03 Thread Troy Kisky
On 11/3/2019 6:44 AM, Stefano Babic wrote:
> On 26/09/19 18:18, Troy Kisky wrote:
>> On 9/25/2019 5:30 PM, Troy Kisky wrote:
>>> This fixes commit <91435cd40d30> "ARM: i.MX6: exclude the ARM errata
>>>  from i.MX6 UP system"
>>>
>>> for nitrogen6x. The above commit removed the errata for the board
>>> since MX6Q/MXDL/MX6S is selected via CONFIG_SYS_EXTRA_OPTIONS
>>>
>>> This restores the errata configs.
>>>
>>> Signed-off-by: Troy Kisky 
>>>
>>> ---
>>> Note:
>>> marsboard, mx6qarm2, seem to have same problem.
>>> ---
>>>  arch/arm/mach-imx/mx6/Kconfig | 1 +
>>>  1 file changed, 1 insertion(+)
>>>
>>> diff --git a/arch/arm/mach-imx/mx6/Kconfig b/arch/arm/mach-imx/mx6/Kconfig
>>> index 01f0121beb..2c2edaa093 100644
>>> --- a/arch/arm/mach-imx/mx6/Kconfig
>>> +++ b/arch/arm/mach-imx/mx6/Kconfig
>>> @@ -412,6 +412,7 @@ config TARGET_NITROGEN6X
>>> imply USB_ETHER_MCS7830
>>> imply USB_ETHER_SMSC95XX
>>> imply USB_HOST_ETHER
>>> +   select MX6QDL
>>>  
>>>  config TARGET_OPOS6ULDEV
>>> bool "Armadeus OPOS6ULDev board"
>>>
>>
>>
>> Maybe the more correct fix is to allow MX6Q/MX6DL/MX6S to be selected in the 
>> defconfig (add a text
>> string in the Kconfig). That way MX6S boards won't have unneeded errata 
>> applied.
> 
> Not sure. This is really that cannot be configured. If a board has just
> a i.MX6DL, well, it should not simply configured via menuconfig. It is
> bound with the hardware.
> 
> By the way, this simple patch breaks all nitrogen boards, I have to
> reject it.

Oops! sorry about that. I'll send a V2.

> 
> Regards,
> Stefano
>>
>> Thoughts?
>>
>> Troy
>>
> 
> 

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


[U-Boot] [PATCH 1/2] ARM: dts: logicpd-som-lv-37xx-devkit-u-boot: Remove unused GPIO

2019-11-03 Thread Adam Ford
The only GPIO bank needed in SPL is GPIO4 and the SPL space is tight.

This patch removes the all but GPIO4 from the spl device tree to
reduce the SPL footprint.

Signed-off-by: Adam Ford 

diff --git a/arch/arm/dts/logicpd-som-lv-37xx-devkit-u-boot.dtsi 
b/arch/arm/dts/logicpd-som-lv-37xx-devkit-u-boot.dtsi
index 1abd9a3887..e5d9e4f1b1 100644
--- a/arch/arm/dts/logicpd-som-lv-37xx-devkit-u-boot.dtsi
+++ b/arch/arm/dts/logicpd-som-lv-37xx-devkit-u-boot.dtsi
@@ -17,6 +17,26 @@
};
 };
 
+&gpio1 {
+   /delete-property/ u-boot,dm-spl;
+};
+
+&gpio2 {
+   /delete-property/ u-boot,dm-spl;
+};
+
+&gpio3 {
+   /delete-property/ u-boot,dm-spl;
+};
+
+&gpio5 {
+   /delete-property/ u-boot,dm-spl;
+};
+
+&gpio6 {
+   /delete-property/ u-boot,dm-spl;
+};
+
 &i2c1 {
clock-frequency = <40>;
 };
-- 
2.20.1

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


[U-Boot] [PATCH 2/2] configs: omap3_logic_somlv: Remove GPIO from SPL

2019-11-03 Thread Adam Ford
The SPL is too tight, and it cannot start any longer.  To
help reduce the size of SPL, we need to remove some non-critical
features.

This patch removes SPL_GPIO_SUPPORT to free up some operating space.

Signed-off-by: Adam Ford 

diff --git a/configs/omap3_logic_somlv_defconfig 
b/configs/omap3_logic_somlv_defconfig
index 656a2d5cb1..cec5e7ef2e 100644
--- a/configs/omap3_logic_somlv_defconfig
+++ b/configs/omap3_logic_somlv_defconfig
@@ -4,6 +4,7 @@ CONFIG_ARM=y
 CONFIG_ARCH_OMAP2PLUS=y
 CONFIG_SYS_TEXT_BASE=0x8010
 CONFIG_TI_COMMON_CMD_OPTIONS=y
+# CONFIG_SPL_GPIO_SUPPORT is not set
 CONFIG_SYS_MALLOC_F_LEN=0x4000
 CONFIG_TARGET_OMAP3_LOGIC=y
 # CONFIG_SPL_OMAP3_ID_NAND is not set
-- 
2.20.1

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


[U-Boot] [PATCH] imx: Make NAND BCB dependent on ARCH_MX6

2019-11-03 Thread Adam Ford
The options to enable CMD_NANDBCB appear when the i.MX6 is not the
target architecture, but it only applies to the i.MX6.

This patch makes the option depend on ARCH_MX6 so it's hidden
from irrelevant platforms.

Signed-off-by: Adam Ford 

diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index b0b9d2c070..2b8d223b92 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -80,8 +80,8 @@ config CMD_HDMIDETECT
 
 config CMD_NANDBCB
bool "i.MX6 NAND Boot Control Block(BCB) command"
-   depends on NAND && CMD_MTDPARTS
-   default y if ARCH_MX6 && NAND_MXS
+   depends on NAND && CMD_MTDPARTS && ARCH_MX6
+   default y if NAND_MXS
help
  Unlike normal 'nand write/erase' commands, this command update
  Boot Control Block(BCB) for i.MX6 platform NAND IP's.
-- 
2.20.1

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


Re: [U-Boot] [PATCH v3 013/108] x86: spi: Add helper functions for Intel Fast SPI

2019-11-03 Thread Simon Glass
Hi Bin,

On Sun, 3 Nov 2019 at 07:36, Simon Glass  wrote:
>
> Hi Bin,
>
> On Sat, 2 Nov 2019 at 17:18, Bin Meng  wrote:
> >
> > Hi Simon,
> >
> > On Sun, Nov 3, 2019 at 5:04 AM Simon Glass  wrote:
> > >
> > > Hi Bin,
> > >
> > > On Fri, 1 Nov 2019 at 22:14, Bin Meng  wrote:
> > > >
> > > > On Mon, Oct 21, 2019 at 11:33 AM Simon Glass  wrote:
> > > > >
> > > > > Most x86 CPUs use a mechanism where the SPI flash is mapped into the 
> > > > > very
> > > > > top of 32-bit address space, so that it can be executed in place and 
> > > > > read
> > > > > simply by copying from memory. For an 8MB ROM the mapping starts at
> > > > > 0xff80.
> > > > >
> > > > > However some recent Intel CPUs do not use a simple 1:1 memory map. 
> > > > > Instead
> > > > > the map starts at a different address and not all of the SPI flash is
> > > > > accessible through the map. This 'Fast SPI' feature requires that 
> > > > > U-Boot
> > > > > check the location of the map. It is also possible (optionally) to 
> > > > > read
> > > > > from the SPI flash using a driver.
> > > > >
> > > > > Add support for booting from Fast SPI. The memory-mapped version is 
> > > > > used
> > > > > by both TPL and SPL on apollolake.
> > > > >
> > > > > In respect of a SPI flash driver, the actual SPI driver is ich.c - 
> > > > > this
> > > > > just adds a few helper functions and definitions.
> > > > >
> > > > > This is used by Apollolake.
> > > > >
> > > > > Signed-off-by: Simon Glass 
> > > > > ---
> > > > >
> > > > > Changes in v3:
> > > > > - Add support for of-platdata for TPL
> > > > > - Add the missing header file
> > > > > - Change Fast-SPI driver into a helper file used by ICH SPI
> > > > > - Don't include write() and erase() in TPL
> > > > > - Merge in patch "x86: Add support for booting from Fast SPI"
> > > > > - Reorder file so that write() and erase() are together
> > > > > - Use pci_get_devfn()
> > > > >
> > > > > Changes in v2: None
> > > > >
> > > > >  arch/x86/cpu/intel_common/Makefile   |  1 +
> > > > >  arch/x86/cpu/intel_common/fast_spi.c | 73 
> > > > > 
> > > > >  arch/x86/include/asm/fast_spi.h  | 68 ++
> > > > >  arch/x86/include/asm/spl.h   |  1 +
> > > > >  4 files changed, 143 insertions(+)
> > > > >  create mode 100644 arch/x86/cpu/intel_common/fast_spi.c
> > > > >  create mode 100644 arch/x86/include/asm/fast_spi.h
> > > [..]
> > >
> > > > > +/* Register offsets from the MMIO region base (PCI_BASE_ADDRESS_0) */
> > > > > +struct fast_spi_regs {
> > > > > +   u32 bfp;
> > > > > +   u32 hsfsts_ctl;
> > > > > +   u32 faddr;
> > > > > +   u32 dlock;
> > > > > +
> > > > > +   u32 fdata[0x10];
> > > > > +
> > > > > +   u32 fracc;
> > > > > +   u32 freg[12];
> > > > > +   u32 fpr[5];
> > > > > +   u32 gpr0;
> > > > > +   u32 spare2;
> > > > > +   u32 sts_ctl;
> > > > > +   u16 preop;  /* a4 */
> > > >
> > > > I assume a4 is the offset of preop? Leaving it causes confusion and it
> > > > can be dropped, I think.
> > > >
> > >
> > > Will do.
> > >
> > > I'm rebasing on your applied patches and moving the code around to
> > > address Andy's comments. I'll send a new version v4 by Monday.
> >
> > Or maybe you can wait until I looked at all v3 patches. I just wanted
> > to send a PR for a collection of good patches so far, instead of
> > giving Tom a huge list :)
>
> OK that's fine with me.

I've completed the update and there are quite a few changes in perhaps
1/3 of the patches. You can see it at u-boot-dm/coral-working - but
let me know if I should send v4.

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


Re: [U-Boot] Please pull u-boot-x86

2019-11-03 Thread Tom Rini
On Sun, Nov 03, 2019 at 07:23:25AM +0800, Bin Meng wrote:

> Hi Tom,
> 
> This PR includes the following changes for x86:
> 
> - Add support for Intel FSP-S and FSP-T in binman
> - Correct priority selection for image loaders for SPL
> - Add a size check for TPL
> - Various small SPL/TPL bug fixes and changes
> - SPI: Add support for memory-mapped flash
> 
> The following changes since commit 5d6f05352b69d4858a2a9e9136ac3a734f0222bb:
> 
>   azure: Update the script to prepend PATH not override PATH
> (2019-11-01 13:59:14 -0400)
> 
> are available in the git repository at:
> 
>   https://gitlab.denx.de/u-boot/custodians/u-boot-x86
> 
> for you to fetch changes up to 73c6cd6c0bdb3af76d573f619bbcc141758bb16b:
> 
>   x86: Quieten TPL's jump_to_image_no_args() (2019-11-03 07:20:29 +0800)
> 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH] tbs2910: Disable Plan9/RTEMS bootm support

2019-11-03 Thread Tom Rini
On Sun, Nov 03, 2019 at 03:32:13PM +0100, Stefano Babic wrote:
> On 03/11/19 13:41, Tom Rini wrote:
> > We have once again reached a point where this board does not build in
> > some cases with supported toolchains due to reaching a size constraint.
> > To regain some space, disable support for Plan 9 / RTEMS images with the
> > bootm command.
> > 
> > Signed-off-by: Tom Rini 
> > ---
> >  configs/tbs2910_defconfig | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/configs/tbs2910_defconfig b/configs/tbs2910_defconfig
> > index 42e6f58eee19..ba29b7144d6e 100644
> > --- a/configs/tbs2910_defconfig
> > +++ b/configs/tbs2910_defconfig
> > @@ -17,6 +17,8 @@ CONFIG_BOARD_EARLY_INIT_F=y
> >  CONFIG_HUSH_PARSER=y
> >  CONFIG_SYS_PROMPT="Matrix U-Boot> "
> >  CONFIG_CMD_BOOTZ=y
> > +# CONFIG_BOOTM_PLAN9 is not set
> > +# CONFIG_BOOTM_RTEMS is not set
> >  # CONFIG_CMD_FDT is not set
> >  CONFIG_CMD_MEMTEST=y
> >  # CONFIG_CMD_FLASH is not set
> > 
> 
> Acked-by: Stefano Babic 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] Please pull ARC fixes for v2020.01-rc2

2019-11-03 Thread Tom Rini
On Fri, Nov 01, 2019 at 02:04:44PM +, Alexey Brodkin wrote:

> Hi Tom,
> 
> The following changes since commit 82679624f9aa6d1be733c46f3555d5166b6f5b72:
> 
>   Merge branch '2019-10-30-master-imports' (2019-11-01 09:23:21 -0400)
> 
> are available in the Git repository at:
> 
>   g...@gitlab.denx.de:u-boot/custodians/u-boot-arc.git 
> tags/arc-fixes-for-2020.01-rc2
> 
> for you to fetch changes up to 3f6b4ea225656b41613fd538925e29141f22c4a7:
> 
>   arc: emsdp: docs: Prefer Degilent over Opella-XD (2019-11-01 16:45:40 +0300)
> 
> Please note that there's something new in this pull-request which is
> reset driver for ARC HSDK board. Due to ELCE and preparations [as always :(]
> I completely forgot to send out ARC changes in time of merge window.
> 
> That said if you prefer I may re-send you the same pull-request with
> HSDK reset driver removed so that only real fixes will be in.
> 
> Sorry for that anyways.
> 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH V4 5/6] net: fec_mxc: support i.MX8M with CLK_CCF

2019-11-03 Thread Peng Fan
Hi Stefano,


> -Original Message-
> From: Stefano Babic 
> Sent: 2019年11月3日 23:20
> To: Peng Fan ; sba...@denx.de; feste...@gmail.com;
> lu...@denx.de; joe.hershber...@ni.com
> Cc: dl-uboot-imx ; u-boot@lists.denx.de;
> frieder.schre...@kontron.de
> Subject: Re: [PATCH V4 5/6] net: fec_mxc: support i.MX8M with CLK_CCF
> 
> Hi Peng,
> 
> On 25/10/19 11:48, Peng Fan wrote:
> > Add more clks for fec_mxc according to Linux Kernel 5.4.0-rc1
> > drivers/net/ethernet/freescale/fec_main.c.
> >
> > Since i.MX8MQ not support CLK_CCF, so add a check to restrict the code
> > only effect when CONFIG_IMX8M and CONFIG_CLK_CCF both defined.
> >
> > Reviewed-by: Frieder Schrempf 
> > Signed-off-by: Peng Fan 
> > ---
> >
> 
> This seems to break most of i.MX8 boards - does it build o your side ?

I rebased imx/next to Tom's tree and apply some of my patches,
https://github.com/MrVan/u-boot/commits/imx-next-11-1

The build pass:
https://travis-ci.org/MrVan/u-boot/builds/605898636

Thanks,
Peng.

> 
> Regards,
> Stefano
> 
> > V4:
> >  Fix build warning
> >  Add R-b
> >
> > V3:
> >  Drop unneeded else
> >  correct ipg->ahb
> >  Other patches keep V1
> >
> > V2:
> >  Use CONFIG_IS_ENABLED
> >
> >
> >  drivers/net/fec_mxc.c | 79
> > +--
> >  drivers/net/fec_mxc.h |  4 +++
> >  2 files changed, 68 insertions(+), 15 deletions(-)
> >
> > diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c index
> > 080dbcf7db..131d1998a7 100644
> > --- a/drivers/net/fec_mxc.c
> > +++ b/drivers/net/fec_mxc.c
> > @@ -123,30 +123,38 @@ static int fec_mdio_read(struct ethernet_regs
> *eth, uint8_t phyaddr,
> > return val;
> >  }
> >
> > +#ifndef imx_get_fecclk
> > +u32 __weak imx_get_fecclk(void)
> > +{
> > +   return 0;
> > +}
> > +#endif
> > +
> >  static int fec_get_clk_rate(void *udev, int idx)  { -#if
> > IS_ENABLED(CONFIG_IMX8)
> > struct fec_priv *fec;
> > struct udevice *dev;
> > int ret;
> >
> > -   dev = udev;
> > -   if (!dev) {
> > -   ret = uclass_get_device(UCLASS_ETH, idx, &dev);
> > -   if (ret < 0) {
> > -   debug("Can't get FEC udev: %d\n", ret);
> > -   return ret;
> > +   if (IS_ENABLED(CONFIG_IMX8) ||
> > +   CONFIG_IS_ENABLED(CLK_CCF)) {
> > +   dev = udev;
> > +   if (!dev) {
> > +   ret = uclass_get_device(UCLASS_ETH, idx, &dev);
> > +   if (ret < 0) {
> > +   debug("Can't get FEC udev: %d\n", ret);
> > +   return ret;
> > +   }
> > }
> > -   }
> >
> > -   fec = dev_get_priv(dev);
> > -   if (fec)
> > -   return fec->clk_rate;
> > +   fec = dev_get_priv(dev);
> > +   if (fec)
> > +   return fec->clk_rate;
> >
> > -   return -EINVAL;
> > -#else
> > -   return imx_get_fecclk();
> > -#endif
> > +   return -EINVAL;
> > +   } else {
> > +   return imx_get_fecclk();
> > +   }
> >  }
> >
> >  static void fec_mii_setspeed(struct ethernet_regs *eth) @@ -1335,6
> > +1343,47 @@ static int fecmxc_probe(struct udevice *dev)
> > return ret;
> > }
> >
> > +   priv->clk_rate = clk_get_rate(&priv->ipg_clk);
> > +   } else if (CONFIG_IS_ENABLED(CLK_CCF)) {
> > +   ret = clk_get_by_name(dev, "ipg", &priv->ipg_clk);
> > +   if (ret < 0) {
> > +   debug("Can't get FEC ipg clk: %d\n", ret);
> > +   return ret;
> > +   }
> > +   ret = clk_enable(&priv->ipg_clk);
> > +   if(ret)
> > +   return ret;
> > +
> > +   ret = clk_get_by_name(dev, "ahb", &priv->ahb_clk);
> > +   if (ret < 0) {
> > +   debug("Can't get FEC ahb clk: %d\n", ret);
> > +   return ret;
> > +   }
> > +   ret = clk_enable(&priv->ahb_clk);
> > +   if (ret)
> > +   return ret;
> > +
> > +   ret = clk_get_by_name(dev, "enet_out", &priv->clk_enet_out);
> > +   if (!ret) {
> > +   ret = clk_enable(&priv->clk_enet_out);
> > +   if (ret)
> > +   return ret;
> > +   }
> > +
> > +   ret = clk_get_by_name(dev, "enet_clk_ref", &priv->clk_ref);
> > +   if (!ret) {
> > +   ret = clk_enable(&priv->clk_ref);
> > +   if (ret)
> > +   return ret;
> > +   }
> > +
> > +   ret = clk_get_by_name(dev, "ptp", &priv->clk_ptp);
> > +   if (!ret) {
> > +   ret = clk_enable(&priv->clk_ptp);
> > +   if (ret)
> > +   return ret;
> > +   }
> > +
> > priv->clk_rate = clk_get_rate(&priv->ipg_clk);
> > }
> >
> > diff --git a/drivers/net/fec_mxc.h b/drivers/net/fec_mxc.h index
> > e5f2dd75c5..723b06a651 100644
> > --- a/drivers/net/fec_mxc.h
> > +++

Re: [U-Boot] [PATCH V4 5/6] net: fec_mxc: support i.MX8M with CLK_CCF

2019-11-03 Thread Peng Fan
> Subject: RE: [PATCH V4 5/6] net: fec_mxc: support i.MX8M with CLK_CCF
> 
> Hi Stefano,
> 
> 
> > -Original Message-
> > From: Stefano Babic 
> > Sent: 2019年11月3日 23:20
> > To: Peng Fan ; sba...@denx.de;
> feste...@gmail.com;
> > lu...@denx.de; joe.hershber...@ni.com
> > Cc: dl-uboot-imx ; u-boot@lists.denx.de;
> > frieder.schre...@kontron.de
> > Subject: Re: [PATCH V4 5/6] net: fec_mxc: support i.MX8M with CLK_CCF
> >
> > Hi Peng,
> >
> > On 25/10/19 11:48, Peng Fan wrote:
> > > Add more clks for fec_mxc according to Linux Kernel 5.4.0-rc1
> > > drivers/net/ethernet/freescale/fec_main.c.
> > >
> > > Since i.MX8MQ not support CLK_CCF, so add a check to restrict the
> > > code only effect when CONFIG_IMX8M and CONFIG_CLK_CCF both
> defined.
> > >
> > > Reviewed-by: Frieder Schrempf 
> > > Signed-off-by: Peng Fan 
> > > ---
> > >
> >
> > This seems to break most of i.MX8 boards - does it build o your side ?
> 
> I rebased imx/next to Tom's tree and apply some of my patches,
> https://github.com/MrVan/u-boot/commits/imx-next-11-1
> 
> The build pass:
> https://travis-ci.org/MrVan/u-boot/builds/605898636

Forget the mention, I add a patch to fix build CI. Will send it out soon.

Thanks,
Peng.

> 
> Thanks,
> Peng.
> 
> >
> > Regards,
> > Stefano
> >
> > > V4:
> > >  Fix build warning
> > >  Add R-b
> > >
> > > V3:
> > >  Drop unneeded else
> > >  correct ipg->ahb
> > >  Other patches keep V1
> > >
> > > V2:
> > >  Use CONFIG_IS_ENABLED
> > >
> > >
> > >  drivers/net/fec_mxc.c | 79
> > > +--
> > >  drivers/net/fec_mxc.h |  4 +++
> > >  2 files changed, 68 insertions(+), 15 deletions(-)
> > >
> > > diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c index
> > > 080dbcf7db..131d1998a7 100644
> > > --- a/drivers/net/fec_mxc.c
> > > +++ b/drivers/net/fec_mxc.c
> > > @@ -123,30 +123,38 @@ static int fec_mdio_read(struct ethernet_regs
> > *eth, uint8_t phyaddr,
> > >   return val;
> > >  }
> > >
> > > +#ifndef imx_get_fecclk
> > > +u32 __weak imx_get_fecclk(void)
> > > +{
> > > + return 0;
> > > +}
> > > +#endif
> > > +
> > >  static int fec_get_clk_rate(void *udev, int idx)  { -#if
> > > IS_ENABLED(CONFIG_IMX8)
> > >   struct fec_priv *fec;
> > >   struct udevice *dev;
> > >   int ret;
> > >
> > > - dev = udev;
> > > - if (!dev) {
> > > - ret = uclass_get_device(UCLASS_ETH, idx, &dev);
> > > - if (ret < 0) {
> > > - debug("Can't get FEC udev: %d\n", ret);
> > > - return ret;
> > > + if (IS_ENABLED(CONFIG_IMX8) ||
> > > + CONFIG_IS_ENABLED(CLK_CCF)) {
> > > + dev = udev;
> > > + if (!dev) {
> > > + ret = uclass_get_device(UCLASS_ETH, idx, &dev);
> > > + if (ret < 0) {
> > > + debug("Can't get FEC udev: %d\n", ret);
> > > + return ret;
> > > + }
> > >   }
> > > - }
> > >
> > > - fec = dev_get_priv(dev);
> > > - if (fec)
> > > - return fec->clk_rate;
> > > + fec = dev_get_priv(dev);
> > > + if (fec)
> > > + return fec->clk_rate;
> > >
> > > - return -EINVAL;
> > > -#else
> > > - return imx_get_fecclk();
> > > -#endif
> > > + return -EINVAL;
> > > + } else {
> > > + return imx_get_fecclk();
> > > + }
> > >  }
> > >
> > >  static void fec_mii_setspeed(struct ethernet_regs *eth) @@ -1335,6
> > > +1343,47 @@ static int fecmxc_probe(struct udevice *dev)
> > >   return ret;
> > >   }
> > >
> > > + priv->clk_rate = clk_get_rate(&priv->ipg_clk);
> > > + } else if (CONFIG_IS_ENABLED(CLK_CCF)) {
> > > + ret = clk_get_by_name(dev, "ipg", &priv->ipg_clk);
> > > + if (ret < 0) {
> > > + debug("Can't get FEC ipg clk: %d\n", ret);
> > > + return ret;
> > > + }
> > > + ret = clk_enable(&priv->ipg_clk);
> > > + if(ret)
> > > + return ret;
> > > +
> > > + ret = clk_get_by_name(dev, "ahb", &priv->ahb_clk);
> > > + if (ret < 0) {
> > > + debug("Can't get FEC ahb clk: %d\n", ret);
> > > + return ret;
> > > + }
> > > + ret = clk_enable(&priv->ahb_clk);
> > > + if (ret)
> > > + return ret;
> > > +
> > > + ret = clk_get_by_name(dev, "enet_out", &priv->clk_enet_out);
> > > + if (!ret) {
> > > + ret = clk_enable(&priv->clk_enet_out);
> > > + if (ret)
> > > + return ret;
> > > + }
> > > +
> > > + ret = clk_get_by_name(dev, "enet_clk_ref", &priv->clk_ref);
> > > + if (!ret) {
> > > + ret = clk_enable(&priv->clk_ref);
> > > + if (ret)
> > > + return ret;
> > > + }
> > > +
> > > + ret = clk_get_by_name(dev, "ptp", &priv->clk_ptp);
> > > + if (!ret) {
> > > + ret = clk_e

[U-Boot] [PATCH] imx: Kconfig: fix dependency of SPL_IMX_ROMAPI_LOADADDR

2019-11-03 Thread Peng Fan
Fix dependency of SPL_IMX_ROMAPI_LOADADDR, currently only i.MX8MN
has this feature.

Signed-off-by: Peng Fan 
---

V1:
 CI build with imx/next rebased to Tom's tree and apply some patches
 https://travis-ci.org/MrVan/u-boot/builds/605898636

 arch/arm/mach-imx/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index 6b8a57d0aa..3b3b9e5a6d 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -111,4 +111,4 @@ config DDRMC_VF610_CALIBRATION
 
 config SPL_IMX_ROMAPI_LOADADDR
hex "Default load address to load image through ROM API"
-   depends on SPL_BOOTROM_SUPPORT
+   depends on IMX8MN
-- 
2.16.4

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


Re: [U-Boot] [PATCH] configs: Rename roc-rk3399-pc -> roc-pc-rk3399 defconfig

2019-11-03 Thread djw

The mainline uses 'rk3399-*', so there're rk3399-firefly.dts,
rk3399-roc-pc.dts, rk3399-khadas-edge.dts, etc. Shall we follow the kernel
convention, or adding another roc-pc-rk3399 to the matrix?

--
Best Regards,
Levin Du


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


[U-Boot] [PATCH v2 1/2] nitrogen6x: prepare for CONFIG_MX6QDL

2019-11-03 Thread Troy Kisky
The next patch adds CONFIG_MX6QDL so that
errata will be enabled again.

Signed-off-by: Troy Kisky 

---
v2: new patch

The macro I2C_PADS_INFO_ENTRY definition has
the checkpatch output:
Macro argument reuse 'i2cnum' - possible side-effects?

for all of its arguments. Since this is a data structure
macro, this does not apply.
---
 board/boundary/nitrogen6x/nitrogen6x.c | 370 +
 1 file changed, 194 insertions(+), 176 deletions(-)

diff --git a/board/boundary/nitrogen6x/nitrogen6x.c 
b/board/boundary/nitrogen6x/nitrogen6x.c
index 33653b5949..5018167fcf 100644
--- a/board/boundary/nitrogen6x/nitrogen6x.c
+++ b/board/boundary/nitrogen6x/nitrogen6x.c
@@ -57,6 +57,8 @@ DECLARE_GLOBAL_DATA_PTR;
PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | PAD_CTL_HYS |   \
PAD_CTL_ODE | PAD_CTL_SRE_FAST)
 
+#define RGB_PAD_CTRL   PAD_CTL_DSE_120ohm
+
 #define WEAK_PULLUP(PAD_CTL_PUS_100K_UP |  \
PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | PAD_CTL_HYS |   \
PAD_CTL_SRE_SLOW)
@@ -67,6 +69,56 @@ DECLARE_GLOBAL_DATA_PTR;
 
 #define OUTPUT_40OHM (PAD_CTL_SPEED_MED|PAD_CTL_DSE_40ohm)
 
+/* Prevent compiler error if gpio number 08 or 09 is used */
+#define not_octal(gp) 0x##gp >> 4) & 0xf) * 10) + ((0x##gp & 0xf)))
+
+#define _I2C_PADS_INFO_CPU(cpu, i2cnum, scl_pad, scl_bank, scl_gp,\
+   sda_pad, sda_bank, sda_gp, pad_ctrl, join_io) {\
+   .scl = {   \
+   .i2c_mode = NEW_PAD_CTRL(cpu##_PAD_##scl_pad##__##i2cnum##_SCL,\
+pad_ctrl),\
+   .gpio_mode = NEW_PAD_CTRL( \
+   cpu##_PAD_##scl_pad##__GPIO##scl_bank##join_io##scl_gp,\
+   pad_ctrl), \
+   .gp = IMX_GPIO_NR(scl_bank, not_octal(scl_gp)) \
+   }, \
+   .sda = {   \
+   .i2c_mode = NEW_PAD_CTRL(cpu##_PAD_##sda_pad##__##i2cnum##_SDA,\
+pad_ctrl),\
+   .gpio_mode = NEW_PAD_CTRL( \
+   cpu##_PAD_##sda_pad##__GPIO##sda_bank##join_io##sda_gp,\
+   pad_ctrl), \
+   .gp = IMX_GPIO_NR(sda_bank, not_octal(sda_gp)) \
+   }  \
+}
+
+#define I2C_PADS_INFO_CPU(cpu, i2cnum, scl_pad, scl_bank, scl_gp, \
+   sda_pad, sda_bank, sda_gp, pad_ctrl)   \
+   _I2C_PADS_INFO_CPU(cpu, i2cnum, scl_pad, scl_bank, scl_gp, \
+   sda_pad, sda_bank, sda_gp, pad_ctrl, _IO)
+
+#if defined(CONFIG_MX6QDL)
+#define I2C_PADS_INFO_ENTRY(i2cnum, scl_pad, scl_bank, scl_gp, \
+   sda_pad, sda_bank, sda_gp, pad_ctrl)\
+   I2C_PADS_INFO_CPU(MX6Q, i2cnum, scl_pad, scl_bank, scl_gp,  \
+   sda_pad, sda_bank, sda_gp, pad_ctrl),   \
+   I2C_PADS_INFO_CPU(MX6DL, i2cnum, scl_pad, scl_bank, scl_gp, \
+   sda_pad, sda_bank, sda_gp, pad_ctrl)
+#define I2C_PADS_INFO_ENTRY_SPACING 2
+
+#define IOMUX_PAD_CTRL(name, pad_ctrl) \
+   NEW_PAD_CTRL(MX6Q_PAD_##name, pad_ctrl),\
+   NEW_PAD_CTRL(MX6DL_PAD_##name, pad_ctrl)
+#else
+#define I2C_PADS_INFO_ENTRY(i2cnum, scl_pad, scl_bank, scl_gp, \
+   sda_pad, sda_bank, sda_gp, pad_ctrl)\
+   I2C_PADS_INFO_CPU(MX6, i2cnum, scl_pad, scl_bank, scl_gp,   \
+   sda_pad, sda_bank, sda_gp, pad_ctrl)
+#define I2C_PADS_INFO_ENTRY_SPACING 1
+
+#define IOMUX_PAD_CTRL(name, pad_ctrl) NEW_PAD_CTRL(MX6_PAD_##name, pad_ctrl)
+#endif
+
 int dram_init(void)
 {
gd->ram_size = ((ulong)CONFIG_DDR_MB * 1024 * 1024);
@@ -75,140 +127,105 @@ int dram_init(void)
 }
 
 static iomux_v3_cfg_t const uart1_pads[] = {
-   MX6_PAD_SD3_DAT6__UART1_RX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL),
-   MX6_PAD_SD3_DAT7__UART1_TX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL),
+   IOMUX_PAD_CTRL(SD3_DAT6__UART1_RX_DATA, UART_PAD_CTRL),
+   IOMUX_PAD_CTRL(SD3_DAT7__UART1_TX_DATA, UART_PAD_CTRL),
 };
 
 static iomux_v3_cfg_t const uart2_pads[] = {
-   MX6_PAD_EIM_D26__UART2_TX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL),
-   MX6_PAD_EIM_D27__UART2_RX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL),
-};
-
-#define PC MUX_PAD_CTRL(I2C_PAD_CTRL)
-
-/* I2C1, SGTL5000 */
-static struct i2c_pads_info i2c_pad_info0 = {
-   .scl = {
-   .i2c_mode = MX6_PAD_EIM_D21__I2C1_SCL | PC,
-   .gpio_mode = MX6_PAD

[U-Boot] [PATCH v2 2/2] ARM: i.MX6: TARGET_NITROGEN6X: add 'select MX6QDL'

2019-11-03 Thread Troy Kisky
This fixes commit <91435cd40d30> "ARM: i.MX6: exclude the ARM errata
 from i.MX6 UP system"

for nitrogen6x. The above commit removed the errata for the board
since MX6Q/MXDL/MX6S is selected via CONFIG_SYS_EXTRA_OPTIONS

This restores the errata configs.

Signed-off-by: Troy Kisky 

---
Note:
marsboard, mx6qarm2, seem to have same problem.

v2: unchanged
---
 arch/arm/mach-imx/mx6/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-imx/mx6/Kconfig b/arch/arm/mach-imx/mx6/Kconfig
index 00e3c486bc..3fa0b4b477 100644
--- a/arch/arm/mach-imx/mx6/Kconfig
+++ b/arch/arm/mach-imx/mx6/Kconfig
@@ -417,6 +417,7 @@ config TARGET_NITROGEN6X
imply USB_ETHER_MCS7830
imply USB_ETHER_SMSC95XX
imply USB_HOST_ETHER
+   select MX6QDL
 
 config TARGET_OPOS6ULDEV
bool "Armadeus OPOS6ULDev board"
-- 
2.18.0

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


Re: [U-Boot] [PATCH 4/7] pci: i2c: designware: Add compatible string

2019-11-03 Thread Heiko Schocher

Hello Simon,

Am 02.11.2019 um 14:59 schrieb Simon Glass:

Add a compatible string for this driver so that it can have children.

Signed-off-by: Simon Glass 
---

  drivers/i2c/dw_i2c_pci.c | 6 ++
  1 file changed, 6 insertions(+)


Reviewed-by: Heiko Schocher 

bye,
Heiko
--
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: h...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 6/7] i2c: designware: Drop invalid debugging

2019-11-03 Thread Heiko Schocher

Hello Simon,

Am 02.11.2019 um 14:59 schrieb Simon Glass:

This printf() should not be there.

Signed-off-by: Simon Glass 
---

  drivers/i2c/designware_i2c.c | 1 -
  1 file changed, 1 deletion(-)


Thanks!

Reviewed-by: Heiko Schocher 

bye,
Heiko
--
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: h...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH] The sata port can be configured when driver model enabled.

2019-11-03 Thread liu hao
 - CONFIG_SYS_SCSI_MAX_SCSI_ID
 - CONFIG_SYS_SCSI_MAX_LUN

 - These two configs can be used here.

Signed-off-by: Steven Hao 
---
Changes for v1:
 - The sata driver only support 2 ports.
   It is not suited for all user.
   We can make it can be configured.
---
 drivers/ata/ahci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index d10f9f0..594982c 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -1167,8 +1167,8 @@ int ahci_probe_scsi(struct udevice *ahci_dev, ulong base)
return -ENODEV;
uc_plat = dev_get_uclass_platdata(dev);
uc_plat->base = base;
-   uc_plat->max_lun = 1;
-   uc_plat->max_id = 2;
+   uc_plat->max_lun = CONFIG_SYS_SCSI_MAX_LUN;
+   uc_plat->max_id = CONFIG_SYS_SCSI_MAX_SCSI_ID;
 
uc_priv = dev_get_uclass_priv(ahci_dev);
ret = ahci_init_one(uc_priv, dev);
-- 
2.7.4

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


[U-Boot] [PATCH v3] armv8: ls1028a: Add environment variables to facilitate the boot

2019-11-03 Thread Yuantian Tang
Add some environment variables to facilitate the auto boot.

Signed-off-by: Yuantian Tang 
---
v3:
- rebase to the latest code
 include/configs/ls1028a_common.h | 28 +---
 1 file changed, 25 insertions(+), 3 deletions(-)

diff --git a/include/configs/ls1028a_common.h b/include/configs/ls1028a_common.h
index 0db86396e9..022981bfa3 100644
--- a/include/configs/ls1028a_common.h
+++ b/include/configs/ls1028a_common.h
@@ -67,6 +67,7 @@
 
 #define BOOT_TARGET_DEVICES(func) \
func(MMC, mmc, 0) \
+   func(MMC, mmc, 1) \
func(USB, usb, 0)
 #include 
 
@@ -127,25 +128,46 @@
"${scripthdraddr} ${prefix}${boot_script_hdr} " \
"&& esbc_validate ${scripthdraddr};"\
"source ${scriptaddr}\0"  \
-   "sd_bootcmd=echo Trying load from SD ..;"   \
+   "xspi_bootcmd=echo Trying load from FlexSPI flash ...;" \
+   "sf probe 0:0 && sf read $load_addr " \
+   "$kernel_start $kernel_size ; env exists secureboot &&" \
+   "sf read $kernelheader_addr_r $kernelheader_start " \
+   "$kernelheader_size && esbc_validate ${kernelheader_addr_r}; "\
+   " bootm $load_addr#$board\0" \
+   "xspi_hdploadcmd=echo Trying load HDP firmware from FlexSPI...;" \
+   "sf probe 0:0 && sf read $load_addr 0x94 0x3 " \
+   "&& hdp load $load_addr 0x2000\0"   \
+   "sd_bootcmd=echo Trying load from SD ...;" \
"mmcinfo; mmc read $load_addr " \
"$kernel_addr_sd $kernel_size_sd && "   \
"env exists secureboot && mmc read $kernelheader_addr_r " \
"$kernelhdr_addr_sd $kernelhdr_size_sd "\
" && esbc_validate ${kernelheader_addr_r};" \
"bootm $load_addr#$board\0" \
+   "sd_hdploadcmd=echo Trying load HDP firmware from SD..;"\
+   "mmcinfo;mmc read $load_addr 0x4a00 0x200 " \
+   "&& hdp load $load_addr 0x2000\0"   \
"emmc_bootcmd=echo Trying load from EMMC ..;"   \
"mmcinfo; mmc dev 1; mmc read $load_addr "  \
"$kernel_addr_sd $kernel_size_sd && "   \
"env exists secureboot && mmc read $kernelheader_addr_r " \
"$kernelhdr_addr_sd $kernelhdr_size_sd "\
" && esbc_validate ${kernelheader_addr_r};" \
-   "bootm $load_addr#$board\0"
+   "bootm $load_addr#$board\0" \
+   "emmc_hdploadcmd=echo Trying load HDP firmware from EMMC..;"  \
+   "mmc dev 1;mmcinfo;mmc read $load_addr 0x4a00 0x200 "   \
+   "&& hdp load $load_addr 0x2000\0"
 
 #undef CONFIG_BOOTCOMMAND
 
+#define XSPI_NOR_BOOTCOMMAND   \
+   "run xspi_hdploadcmd; run distro_bootcmd; run xspi_bootcmd; " \
+   "env exists secureboot && esbc_halt;;"
 #define SD_BOOTCOMMAND \
-   "run distro_bootcmd;run sd_bootcmd; " \
+   "run sd_hdploadcmd; run distro_bootcmd;run sd_bootcmd; " \
+   "env exists secureboot && esbc_halt;"
+#define SD2_BOOTCOMMAND\
+   "run emmc_hdploadcmd; run distro_bootcmd;run emmc_bootcmd; " \
"env exists secureboot && esbc_halt;"
 
 /* Monitor Command Prompt */
-- 
2.17.1

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