[U-Boot] [PATCH v2 1/2] disk: part: scan the disk if the part_type is unknown

2018-02-10 Thread Kever Yang
If a DUT do not have partition table, and we write one with 'gpt write'
cmd, we should able to list the partition with 'part list' cmd.
It's reasonable to scan the disk again if the initial part_type is
unknown in case we just write a new one into disk.

Signed-off-by: Kever Yang 
---

Changes in v2:
- update commit message to make it more clear why we need this patch

 disk/part.c | 24 ++--
 1 file changed, 18 insertions(+), 6 deletions(-)

diff --git a/disk/part.c b/disk/part.c
index 66b8101..df0d50d 100644
--- a/disk/part.c
+++ b/disk/part.c
@@ -27,16 +27,28 @@
 DECLARE_GLOBAL_DATA_PTR;
 
 #ifdef HAVE_BLOCK_DEVICE
-static struct part_driver *part_driver_lookup_type(int part_type)
+static struct part_driver *part_driver_lookup_type(struct blk_desc *dev_desc)
 {
struct part_driver *drv =
ll_entry_start(struct part_driver, part_driver);
const int n_ents = ll_entry_count(struct part_driver, part_driver);
struct part_driver *entry;
 
-   for (entry = drv; entry != drv + n_ents; entry++) {
-   if (part_type == entry->part_type)
-   return entry;
+   if (dev_desc->part_type == PART_TYPE_UNKNOWN) {
+   for (entry = drv; entry != drv + n_ents; entry++) {
+   int ret;
+
+   ret = entry->test(dev_desc);
+   if (!ret) {
+   dev_desc->part_type = entry->part_type;
+   return entry;
+   }
+   }
+   } else {
+   for (entry = drv; entry != drv + n_ents; entry++) {
+   if (dev_desc->part_type == entry->part_type)
+   return entry;
+   }
}
 
/* Not found */
@@ -285,7 +297,7 @@ void part_print(struct blk_desc *dev_desc)
 {
struct part_driver *drv;
 
-   drv = part_driver_lookup_type(dev_desc->part_type);
+   drv = part_driver_lookup_type(dev_desc);
if (!drv) {
printf("## Unknown partition table type %x\n",
   dev_desc->part_type);
@@ -314,7 +326,7 @@ int part_get_info(struct blk_desc *dev_desc, int part,
info->type_guid[0] = 0;
 #endif
 
-   drv = part_driver_lookup_type(dev_desc->part_type);
+   drv = part_driver_lookup_type(dev_desc);
if (!drv) {
debug("## Unknown partition table type %x\n",
  dev_desc->part_type);
-- 
1.9.1

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


[U-Boot] [PATCH v2 2/2] disk: part: use common api to lookup part driver

2018-02-10 Thread Kever Yang
Do not need to scan disk every time when we get part info
by name.

Signed-off-by: Kever Yang 
---

Changes in v2:
- rebase to latest version
- add error handle for partition tbale not exist

 disk/part.c | 35 ---
 1 file changed, 16 insertions(+), 19 deletions(-)

diff --git a/disk/part.c b/disk/part.c
index df0d50d..b80a4b1 100644
--- a/disk/part.c
+++ b/disk/part.c
@@ -644,28 +644,25 @@ cleanup:
 int part_get_info_by_name_type(struct blk_desc *dev_desc, const char *name,
   disk_partition_t *info, int part_type)
 {
-   struct part_driver *first_drv =
-   ll_entry_start(struct part_driver, part_driver);
-   const int n_drvs = ll_entry_count(struct part_driver, part_driver);
struct part_driver *part_drv;
-
-   for (part_drv = first_drv; part_drv != first_drv + n_drvs; part_drv++) {
-   int ret;
-   int i;
-   for (i = 1; i < part_drv->max_entries; i++) {
-   if (part_type >= 0 && part_type != part_drv->part_type)
-   break;
-   ret = part_drv->get_info(dev_desc, i, info);
-   if (ret != 0) {
-   /* no more entries in table */
-   break;
-   }
-   if (strcmp(name, (const char *)info->name) == 0) {
-   /* matched */
-   return i;
-   }
+   int ret;
+   int i;
+
+   part_drv = part_driver_lookup_type(dev_desc);
+   if (!part_drv)
+   return -1;
+   for (i = 1; i < part_drv->max_entries; i++) {
+   ret = part_drv->get_info(dev_desc, i, info);
+   if (ret != 0) {
+   /* no more entries in table */
+   break;
+   }
+   if (strcmp(name, (const char *)info->name) == 0) {
+   /* matched */
+   return i;
}
}
+
return -1;
 }
 
-- 
1.9.1

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


Re: [U-Boot] [PATCH v2] spl: eMMC/SD: Provide one __weak spl_boot_mode() function

2018-02-10 Thread Lukasz Majewski
Hi Jonathan,

> On Sat, Feb 10, 2018 at 01:45:16AM +0100, Lukasz Majewski wrote:
> > Hi Jonathan,
> >   
> > > On Sat, Feb 03, 2018 at 11:00:35AM -0200, Fabio Estevam wrote:  
> > > > On Sat, Feb 3, 2018 at 5:29 AM, Lukasz Majewski 
> > > > wrote:
> > > > > The goal of this patch is to clean up the code related to
> > > > > choosing SPL MMC boot mode.
> > > > >
> > > > > The spl_boot_mode() now is called only in spl_mmc_load_image()
> > > > > function, which is only compiled in if CONFIG_SPL_MMC_SUPPORT
> > > > > is enabled.
> > > > >
> > > > > To achieve the goal, all per mach/arch implementations
> > > > > eligible for unification has been replaced with one __weak
> > > > > implementation.
> > > > >
> > > > > Signed-off-by: Lukasz Majewski 
> > > > > Reviewed-by: Marek Vasut 
> > > > > Reviewed-by: Stefano Babic 
> > > > > Acked-by: Michal Simek  (For
> > > > > ZynqMP)
> > > > 
> > > > Nice cleanup:
> > > > 
> > > > Reviewed-by: Fabio Estevam 
> > > 
> > > This has broken booting via mmc with mx6cuboxi for me.
> > > 
> > > SPL loops on
> > > 
> > > U-Boot SPL 2018.03-rc1-00212-g48914fc119 (Feb 10 2018 - 11:04:33
> > > +1300) Trying to boot from MMC1
> > > Failed to mount ext2 filesystem...
> > > spl_load_image_ext: ext4fs mount err - 0  
> > 
> > Could you check what is the status of following defines in
> > your .config file:
> > 
> > CONFIG_SPL_FAT_SUPPORT
> > CONFIG_SUPPORT_EMMC_BOOT  
> 
> "# CONFIG_SPL_FAT_SUPPORT is not set"
> 
> CONFIG_SUPPORT_EMMC_BOOT is not in the .config at all
> 
> CONFIG_SPL_EXT_SUPPORT previously for imx6 would result in
> MMCSD_MODE_RAW but now it results in MMCSD_MODE_FS.
> 
> > 
> > And if by any chance your don't have:
> > CONFIG_SPL_EXT_SUPPORT defined?  
> 
> CONFIG_SPL_EXT_SUPPORT=y

Could you for test comment out the above define?

Thanks in advance,
Łukasz

> CONFIG_SPL_MMC_SUPPORT=y
> 
> mx6cuboxi_defconfig with no changes
> 
> > 
> > From what you have written above I assume that you boot from the
> > same medium - i.e. eMMC (so SPL and u-boot.img are on the same
> > medium) ?  
> 
> Both SPL and u-boot.img are on a microsd card.
> 
> The set CONFIG_SPL_* in .config are
> 
> CONFIG_SPL_SYS_THUMB_BUILD=y
> CONFIG_SPL_USE_ARCH_MEMCPY=y
> CONFIG_SPL_USE_ARCH_MEMSET=y
> CONFIG_SPL_LDSCRIPT="arch/arm/mach-omap2/u-boot-spl.lds"
> CONFIG_SPL_GPIO_SUPPORT=y
> CONFIG_SPL_LIBCOMMON_SUPPORT=y
> CONFIG_SPL_LIBGENERIC_SUPPORT=y
> CONFIG_SPL_MMC_SUPPORT=y
> CONFIG_SPL_SERIAL_SUPPORT=y
> CONFIG_SPL_LIBDISK_SUPPORT=y
> CONFIG_SPL_WATCHDOG_SUPPORT=y
> CONFIG_SPL_SYS_MALLOC_F_LEN=0x400
> CONFIG_SPL_BOOTSTAGE_RECORD_COUNT=5
> CONFIG_SPL_LOGLEVEL=4
> CONFIG_SPL=y
> CONFIG_SPL_LEGACY_IMAGE_SUPPORT=y
> CONFIG_SPL_EXT_SUPPORT=y
> CONFIG_SPL_I2C_SUPPORT=y
> CONFIG_SPL_DOS_PARTITION=y
> CONFIG_SPL_ISO_PARTITION=y
> CONFIG_SPL_EFI_PARTITION=y




Best regards,

Lukasz Majewski

--

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


pgpDeOMz56_VG.pgp
Description: OpenPGP digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2] spl: eMMC/SD: Provide one __weak spl_boot_mode() function

2018-02-10 Thread Marek Vasut
On 02/10/2018 10:57 AM, Lukasz Majewski wrote:
> Hi Jonathan,
> 
>> On Sat, Feb 10, 2018 at 01:45:16AM +0100, Lukasz Majewski wrote:
>>> Hi Jonathan,
>>>   
 On Sat, Feb 03, 2018 at 11:00:35AM -0200, Fabio Estevam wrote:  
> On Sat, Feb 3, 2018 at 5:29 AM, Lukasz Majewski 
> wrote:
>> The goal of this patch is to clean up the code related to
>> choosing SPL MMC boot mode.
>>
>> The spl_boot_mode() now is called only in spl_mmc_load_image()
>> function, which is only compiled in if CONFIG_SPL_MMC_SUPPORT
>> is enabled.
>>
>> To achieve the goal, all per mach/arch implementations
>> eligible for unification has been replaced with one __weak
>> implementation.
>>
>> Signed-off-by: Lukasz Majewski 
>> Reviewed-by: Marek Vasut 
>> Reviewed-by: Stefano Babic 
>> Acked-by: Michal Simek  (For
>> ZynqMP)
>
> Nice cleanup:
>
> Reviewed-by: Fabio Estevam 

 This has broken booting via mmc with mx6cuboxi for me.

 SPL loops on

 U-Boot SPL 2018.03-rc1-00212-g48914fc119 (Feb 10 2018 - 11:04:33
 +1300) Trying to boot from MMC1
 Failed to mount ext2 filesystem...
 spl_load_image_ext: ext4fs mount err - 0  
>>>
>>> Could you check what is the status of following defines in
>>> your .config file:
>>>
>>> CONFIG_SPL_FAT_SUPPORT
>>> CONFIG_SUPPORT_EMMC_BOOT  
>>
>> "# CONFIG_SPL_FAT_SUPPORT is not set"
>>
>> CONFIG_SUPPORT_EMMC_BOOT is not in the .config at all
>>
>> CONFIG_SPL_EXT_SUPPORT previously for imx6 would result in
>> MMCSD_MODE_RAW but now it results in MMCSD_MODE_FS.
>>
>>>
>>> And if by any chance your don't have:
>>> CONFIG_SPL_EXT_SUPPORT defined?  
>>
>> CONFIG_SPL_EXT_SUPPORT=y
> 
> Could you for test comment out the above define?

If you look at the logic in spl_mmc.c , you'll see this will work. But
what about users who have EXT enabled and want to use it as fallback
after loading from RAW failed ? :)

-- 
Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] Convert CONFIG_BOOTCOUNT_LIMIT to Kconfig

2018-02-10 Thread Lukasz Majewski
Hi Alex,

> On Fri, Feb 9, 2018 at 10:50 PM, Lukasz Majewski 
> wrote:
> > diff --git a/configs/mx53ppd_defconfig b/configs/mx53ppd_defconfig
> > index 3fbca2a08c..b83cf72022 100644
> > --- a/configs/mx53ppd_defconfig
> > +++ b/configs/mx53ppd_defconfig
> > @@ -21,6 +21,7 @@ CONFIG_CMD_EXT4_WRITE=y
> >  CONFIG_CMD_FAT=y
> >  CONFIG_CMD_FS_GENERIC=y
> >  CONFIG_BOOTCOUNT=y
> > +CONFIG_BOOTCOUNT_LIMIT=y
> >  CONFIG_BOOTCOUNT_EXT=y
> >  CONFIG_SYS_BOOTCOUNT_EXT_DEVPART="0:5"
> >  CONFIG_NETDEVICES=y  
> 
> ...
> 
> > diff --git a/drivers/bootcount/Kconfig b/drivers/bootcount/Kconfig
> > index c9d627cce2..cb6be73d52 100644
> > --- a/drivers/bootcount/Kconfig
> > +++ b/drivers/bootcount/Kconfig
> > @@ -11,6 +11,12 @@ config BOOTCOUNT
> >   number of times the board has booted on a number of
> > different persistent storage mediums.
> >
> > +config BOOTCOUNT_LIMIT
> > +   bool "Enable support for checking boot count limit"
> > +   help
> > + Enable checking for exceeding the boot count limit.
> > + More information:
> > http://www.denx.de/wiki/DULG/UBootBootCountLimit +
> >  if BOOTCOUNT
> >
> >  config BOOTCOUNT_EXT  
> 
> Can't CONFIG_BOOTCOUNT and CONFIG_BOOTCOUNT_LIMIT be merged?

This patch was mostly generated by moveconfig utility.


> 
>   config BOOTCOUNT
>  bool "Enable Boot count support"
> help
>   Enable boot count support, which provides the ability to
> store the number of times the board has booted on a number of
> different persistent storage mediums.
> 
> AFAICT mx53ppd is the only board which has CONFIG_BOOTCOUNT set,

I would use pragmatic approach here - leave this patch as is, and
prepare next one on top of it to replace CONFIG_BOOTCOUNT with
CONFIG_BOOTCOUNT_LIMIT (as the last one is used in many places).

> BOOTCOUNT is just used within Kconfig, not actually consumed either by
> a Makefile or any piece of code and should probably go?

Yes. It could be replaced with CONFIG_BOOTCOUNT_LIMIT.

> 




Best regards,

Lukasz Majewski

--

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


pgpT3AiAEjG5v.pgp
Description: OpenPGP digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v1 1/5] bootcount: config: Make the SYS_BOOTCOUNT_ADDR available also for non EXT setups

2018-02-10 Thread Lukasz Majewski
This commit gives the opportunity to reuse the CONFIG_SYS_BOOTCOUNT_ADDR
Kconfig entry also for boards, which do not use EXT as a storage for
bootcount (i.e. on flash ones).

Signed-off-by: Lukasz Majewski 

---

 drivers/bootcount/Kconfig | 13 ++---
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/bootcount/Kconfig b/drivers/bootcount/Kconfig
index d82289f57b..1254bb51ca 100644
--- a/drivers/bootcount/Kconfig
+++ b/drivers/bootcount/Kconfig
@@ -31,6 +31,12 @@ config BOOTCOUNT_EXT
  Add support for maintaining boot count in a file on an EXT
  filesystem.
 
+config SYS_BOOTCOUNT_ADDR
+   hex "RAM address used for reading and writing the boot counter"
+   default 0x7000A000
+   help
+ Set the address used for reading and writing the boot counter.
+
 if BOOTCOUNT_EXT
 
 config SYS_BOOTCOUNT_EXT_INTERFACE
@@ -56,13 +62,6 @@ config SYS_BOOTCOUNT_EXT_NAME
help
  Set the filename and path of the file used to store the boot counter.
 
-config SYS_BOOTCOUNT_ADDR
-   hex "RAM address used for reading and writing the boot counter"
-   default 0x7000A000
-   depends on BOOTCOUNT_EXT
-   help
- Set the address used for reading and writing the boot counter.
-
 endif
 
 endif
-- 
2.11.0

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


[U-Boot] [PATCH v1 2/5] bootcount: Add function wrappers to handle bootcount increment and error checking

2018-02-10 Thread Lukasz Majewski
Those two functions can be used in either SPL or U-boot proper to provide
easy bootcount management.

Signed-off-by: Lukasz Majewski 
---

 include/bootcount.h | 25 +
 1 file changed, 25 insertions(+)

diff --git a/include/bootcount.h b/include/bootcount.h
index 06fb4d3578..534875a5a5 100644
--- a/include/bootcount.h
+++ b/include/bootcount.h
@@ -38,3 +38,28 @@ static inline u32 raw_bootcount_load(volatile u32 *addr)
return in_be32(addr);
 }
 #endif
+
+#ifdef CONFIG_SPL_BOOTCOUNT_LIMIT
+static inline bool bootcount_error(void)
+{
+   unsigned long bootcount = bootcount_load();
+   unsigned long bootlimit = env_get_ulong("bootlimit", 10, 0);
+
+   if (bootlimit && (bootcount >= bootlimit)) {
+   printf("Warning: Bootlimit (%lu) exceeded.\n", bootcount);
+   return true;
+   }
+
+   return false;
+}
+
+static inline void bootcount_inc(void)
+{
+   unsigned long bootcount = bootcount_load();
+
+   bootcount_store(++bootcount);
+}
+#else
+static inline bool bootcount_error(void) { return false; }
+static inline void bootcount_inc(void) {}
+#endif /* CONFIG_SPL_BOOTCOUNT_LIMIT */
-- 
2.11.0

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


[U-Boot] [PATCH v1 5/5] arm: display5: Extend SPL to support bootcount checking

2018-02-10 Thread Lukasz Majewski
This patch is necessary for providing basic bootcount checking in the case
of using "falcon" boot mode.

It forces u-boot proper boot, when we exceed the number of errors.

Signed-off-by: Lukasz Majewski 
---

 board/liebherr/display5/spl.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/board/liebherr/display5/spl.c b/board/liebherr/display5/spl.c
index 0a36e656c0..e21b4bee75 100644
--- a/board/liebherr/display5/spl.c
+++ b/board/liebherr/display5/spl.c
@@ -20,6 +20,7 @@
 #include 
 #include 
 #include 
+#include 
 #include "common.h"
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -214,7 +215,7 @@ void board_boot_order(u32 *spl_boot_list)
env_load();
 
s = env_get("BOOT_FROM");
-   if (s && strcmp(s, "ACTIVE") == 0) {
+   if (s && !bootcount_error() && strcmp(s, "ACTIVE") == 0) {
spl_boot_list[0] = BOOT_DEVICE_MMC1;
spl_boot_list[1] = spl_boot_device();
}
@@ -242,6 +243,7 @@ int spl_start_uboot(void)
if (env_get_yesno("boot_os") != 1)
return 1;
 #endif
+   bootcount_inc();
return 0;
 }
 #endif
-- 
2.11.0

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


[U-Boot] [PATCH v1 3/5] spl: bootcount: Enable bootcount support in SPL

2018-02-10 Thread Lukasz Majewski
New, SPL related config option - CONFIG_SPL_BOOTCOUNT_LIMIT has been
added to allow drivers/bootcount code re-usage in SPL.

This code is necessary to use and setup bootcount in SPL in the case of
falcon boot mode.

Signed-off-by: Lukasz Majewski 
---

 common/spl/Kconfig | 9 +
 drivers/Makefile   | 1 +
 2 files changed, 10 insertions(+)

diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index 65b3aff244..37354e262e 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -46,6 +46,15 @@ config SPL_BOOTROM_SUPPORT
  BOOT_DEVICE_BOOTROM (or fall-through to the next boot device in the
  boot device list, if not implemented for a given board)
 
+config SPL_BOOTCOUNT_LIMIT
+   bool "Support bootcount in SPL"
+   depends on SPL_ENV_SUPPORT
+   help
+ On some boards, which use 'falcon' mode, it is necessary to check
+ and increment the number of boot attempts. Such boards do not
+ use proper U-Boot for normal boot flow and hence needs those
+ adjustments to be done in the SPL.
+
 config SPL_RAW_IMAGE_SUPPORT
bool "Support SPL loading and booting of RAW images"
default n if (ARCH_MX6 && (SPL_MMC_SUPPORT || SPL_SATA_SUPPORT))
diff --git a/drivers/Makefile b/drivers/Makefile
index e6062a5683..2a988360a0 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -20,6 +20,7 @@ obj-$(CONFIG_$(SPL_TPL_)TIMER) += timer/
 ifndef CONFIG_TPL_BUILD
 ifdef CONFIG_SPL_BUILD
 
+obj-$(CONFIG_SPL_BOOTCOUNT_LIMIT) += bootcount/
 obj-$(CONFIG_SPL_CPU_SUPPORT) += cpu/
 obj-$(CONFIG_SPL_CRYPTO_SUPPORT) += crypto/
 obj-$(CONFIG_SPL_GPIO_SUPPORT) += gpio/
-- 
2.11.0

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


[U-Boot] [PATCH v1 4/5] config: display5: Enable boot count feature in the display5 board

2018-02-10 Thread Lukasz Majewski
The boot count is enabled in both SPL and u-boot proper.

Signed-off-by: Lukasz Majewski 
---

 configs/display5_defconfig | 5 +
 1 file changed, 5 insertions(+)

diff --git a/configs/display5_defconfig b/configs/display5_defconfig
index 1502b77fea..97c3b6a60c 100644
--- a/configs/display5_defconfig
+++ b/configs/display5_defconfig
@@ -14,6 +14,7 @@ CONFIG_SPL_LOAD_FIT=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg,MX6Q"
 CONFIG_SPL=y
+CONFIG_SPL_BOOTCOUNT_LIMIT=y
 # CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR is not set
 CONFIG_SPL_DMA_SUPPORT=y
 CONFIG_SPL_ENV_SUPPORT=y
@@ -49,6 +50,10 @@ CONFIG_EFI_PARTITION=y
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_OF_CONTROL=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
+CONFIG_BOOTCOUNT=y
+CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_SYS_BOOTCOUNT_SINGLEWORD=y
+CONFIG_SYS_BOOTCOUNT_ADDR=0x020CC068
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_BAR=y
 CONFIG_SPI_FLASH_SPANSION=y
-- 
2.11.0

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


[U-Boot] [PATCH v1 0/5] Provide SPL support for bootcount (in the case of using falcon boot mode)

2018-02-10 Thread Lukasz Majewski
This patch series provides support for controlling bootcount limits in SPL.
It also enables this feature on display5 board to present usage patterns.

"Green" travis CI build:
https://travis-ci.org/lmajewski/u-boot-dfu

This patch has been applied on top of u-boot/master:
SHA1: 1811a928c6c7604d6d05a84b4d552a7c31b4994e

This patch series shall be applied on top of:
[U-Boot,1/2] Convert CONFIG_BOOTCOUNT_LIMIT to Kconfig
http://patchwork.ozlabs.org/patch/871585/

[U-Boot,2/2] Convert CONFIG_SYS_BOOTCOUNT_SINGLEWORD to Kconfig
http://patchwork.ozlabs.org/patch/871586/


Lukasz Majewski (5):
  bootcount: config: Make the SYS_BOOTCOUNT_ADDR available also for non
EXT setups
  bootcount: Add function wrappers to handle bootcount increment and
error checking
  spl: bootcount: Enable bootcount support in SPL
  config: display5: Enable boot count feature in the display5 board
  arm: display5: Extend SPL to support bootcount checking

 board/liebherr/display5/spl.c |  4 +++-
 common/spl/Kconfig|  9 +
 configs/display5_defconfig|  5 +
 drivers/Makefile  |  1 +
 drivers/bootcount/Kconfig | 13 ++---
 include/bootcount.h   | 25 +
 6 files changed, 49 insertions(+), 8 deletions(-)

-- 
2.11.0

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


Re: [U-Boot] [PATCH v2] spl: eMMC/SD: Provide one __weak spl_boot_mode() function

2018-02-10 Thread Lukasz Majewski
On Sat, 10 Feb 2018 11:00:12 +0100
Marek Vasut  wrote:

> On 02/10/2018 10:57 AM, Lukasz Majewski wrote:
> > Hi Jonathan,
> >   
> >> On Sat, Feb 10, 2018 at 01:45:16AM +0100, Lukasz Majewski wrote:  
> >>> Hi Jonathan,
> >>> 
>  On Sat, Feb 03, 2018 at 11:00:35AM -0200, Fabio Estevam
>  wrote:
> > On Sat, Feb 3, 2018 at 5:29 AM, Lukasz Majewski 
> > wrote:  
> >> The goal of this patch is to clean up the code related to
> >> choosing SPL MMC boot mode.
> >>
> >> The spl_boot_mode() now is called only in spl_mmc_load_image()
> >> function, which is only compiled in if CONFIG_SPL_MMC_SUPPORT
> >> is enabled.
> >>
> >> To achieve the goal, all per mach/arch implementations
> >> eligible for unification has been replaced with one __weak
> >> implementation.
> >>
> >> Signed-off-by: Lukasz Majewski 
> >> Reviewed-by: Marek Vasut 
> >> Reviewed-by: Stefano Babic 
> >> Acked-by: Michal Simek  (For
> >> ZynqMP)  
> >
> > Nice cleanup:
> >
> > Reviewed-by: Fabio Estevam   
> 
>  This has broken booting via mmc with mx6cuboxi for me.
> 
>  SPL loops on
> 
>  U-Boot SPL 2018.03-rc1-00212-g48914fc119 (Feb 10 2018 - 11:04:33
>  +1300) Trying to boot from MMC1
>  Failed to mount ext2 filesystem...
>  spl_load_image_ext: ext4fs mount err - 0
> >>>
> >>> Could you check what is the status of following defines in
> >>> your .config file:
> >>>
> >>> CONFIG_SPL_FAT_SUPPORT
> >>> CONFIG_SUPPORT_EMMC_BOOT
> >>
> >> "# CONFIG_SPL_FAT_SUPPORT is not set"
> >>
> >> CONFIG_SUPPORT_EMMC_BOOT is not in the .config at all
> >>
> >> CONFIG_SPL_EXT_SUPPORT previously for imx6 would result in
> >> MMCSD_MODE_RAW but now it results in MMCSD_MODE_FS.
> >>  
> >>>
> >>> And if by any chance your don't have:
> >>> CONFIG_SPL_EXT_SUPPORT defined?
> >>
> >> CONFIG_SPL_EXT_SUPPORT=y  
> > 
> > Could you for test comment out the above define?  
> 
> If you look at the logic in spl_mmc.c , you'll see this will work. But
> what about users who have EXT enabled and want to use it as fallback
> after loading from RAW failed ? :)
> 

The code now in __weak function has been took directly from socfpga
port (as looked as clean and simple). 

Apparently, this port did not provide such fallback facility :-)

It seems to me that the code from imx function would need to be used
instead.


Best regards,

Lukasz Majewski

--

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


pgpCEEkJy_3e8.pgp
Description: OpenPGP digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2] spl: eMMC/SD: Provide one __weak spl_boot_mode() function

2018-02-10 Thread Marek Vasut
On 02/10/2018 11:25 AM, Lukasz Majewski wrote:
> On Sat, 10 Feb 2018 11:00:12 +0100
> Marek Vasut  wrote:
> 
>> On 02/10/2018 10:57 AM, Lukasz Majewski wrote:
>>> Hi Jonathan,
>>>   
 On Sat, Feb 10, 2018 at 01:45:16AM +0100, Lukasz Majewski wrote:  
> Hi Jonathan,
> 
>> On Sat, Feb 03, 2018 at 11:00:35AM -0200, Fabio Estevam
>> wrote:
>>> On Sat, Feb 3, 2018 at 5:29 AM, Lukasz Majewski 
>>> wrote:  
 The goal of this patch is to clean up the code related to
 choosing SPL MMC boot mode.

 The spl_boot_mode() now is called only in spl_mmc_load_image()
 function, which is only compiled in if CONFIG_SPL_MMC_SUPPORT
 is enabled.

 To achieve the goal, all per mach/arch implementations
 eligible for unification has been replaced with one __weak
 implementation.

 Signed-off-by: Lukasz Majewski 
 Reviewed-by: Marek Vasut 
 Reviewed-by: Stefano Babic 
 Acked-by: Michal Simek  (For
 ZynqMP)  
>>>
>>> Nice cleanup:
>>>
>>> Reviewed-by: Fabio Estevam   
>>
>> This has broken booting via mmc with mx6cuboxi for me.
>>
>> SPL loops on
>>
>> U-Boot SPL 2018.03-rc1-00212-g48914fc119 (Feb 10 2018 - 11:04:33
>> +1300) Trying to boot from MMC1
>> Failed to mount ext2 filesystem...
>> spl_load_image_ext: ext4fs mount err - 0
>
> Could you check what is the status of following defines in
> your .config file:
>
> CONFIG_SPL_FAT_SUPPORT
> CONFIG_SUPPORT_EMMC_BOOT

 "# CONFIG_SPL_FAT_SUPPORT is not set"

 CONFIG_SUPPORT_EMMC_BOOT is not in the .config at all

 CONFIG_SPL_EXT_SUPPORT previously for imx6 would result in
 MMCSD_MODE_RAW but now it results in MMCSD_MODE_FS.
  
>
> And if by any chance your don't have:
> CONFIG_SPL_EXT_SUPPORT defined?

 CONFIG_SPL_EXT_SUPPORT=y  
>>>
>>> Could you for test comment out the above define?  
>>
>> If you look at the logic in spl_mmc.c , you'll see this will work. But
>> what about users who have EXT enabled and want to use it as fallback
>> after loading from RAW failed ? :)
>>
> 
> The code now in __weak function has been took directly from socfpga
> port (as looked as clean and simple). 
> 
> Apparently, this port did not provide such fallback facility :-)

That's correct (for reasons which are beyond the scope of this discussion).

> It seems to me that the code from imx function would need to be used
> instead.
The code in IMX will fail if you have only CONFIG_SPL_FAT_SUPPORT
enabled in SPL .

Give it some more thought and look esp. for the case fallthroughs in the
spl_mmc code, that makes it nasty.

The RAW support is there only to support legacy stuff until those ports
discover filesystems and their benefits (IMO).

-- 
Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2] spl: eMMC/SD: Provide one __weak spl_boot_mode() function

2018-02-10 Thread Jonathan Gray
On Sat, Feb 10, 2018 at 10:57:26AM +0100, Lukasz Majewski wrote:
> Hi Jonathan,
> 
> > On Sat, Feb 10, 2018 at 01:45:16AM +0100, Lukasz Majewski wrote:
> > > Hi Jonathan,
> > >   
> > > > On Sat, Feb 03, 2018 at 11:00:35AM -0200, Fabio Estevam wrote:  
> > > > > On Sat, Feb 3, 2018 at 5:29 AM, Lukasz Majewski 
> > > > > wrote:
> > > > > > The goal of this patch is to clean up the code related to
> > > > > > choosing SPL MMC boot mode.
> > > > > >
> > > > > > The spl_boot_mode() now is called only in spl_mmc_load_image()
> > > > > > function, which is only compiled in if CONFIG_SPL_MMC_SUPPORT
> > > > > > is enabled.
> > > > > >
> > > > > > To achieve the goal, all per mach/arch implementations
> > > > > > eligible for unification has been replaced with one __weak
> > > > > > implementation.
> > > > > >
> > > > > > Signed-off-by: Lukasz Majewski 
> > > > > > Reviewed-by: Marek Vasut 
> > > > > > Reviewed-by: Stefano Babic 
> > > > > > Acked-by: Michal Simek  (For
> > > > > > ZynqMP)
> > > > > 
> > > > > Nice cleanup:
> > > > > 
> > > > > Reviewed-by: Fabio Estevam 
> > > > 
> > > > This has broken booting via mmc with mx6cuboxi for me.
> > > > 
> > > > SPL loops on
> > > > 
> > > > U-Boot SPL 2018.03-rc1-00212-g48914fc119 (Feb 10 2018 - 11:04:33
> > > > +1300) Trying to boot from MMC1
> > > > Failed to mount ext2 filesystem...
> > > > spl_load_image_ext: ext4fs mount err - 0  
> > > 
> > > Could you check what is the status of following defines in
> > > your .config file:
> > > 
> > > CONFIG_SPL_FAT_SUPPORT
> > > CONFIG_SUPPORT_EMMC_BOOT  
> > 
> > "# CONFIG_SPL_FAT_SUPPORT is not set"
> > 
> > CONFIG_SUPPORT_EMMC_BOOT is not in the .config at all
> > 
> > CONFIG_SPL_EXT_SUPPORT previously for imx6 would result in
> > MMCSD_MODE_RAW but now it results in MMCSD_MODE_FS.
> > 
> > > 
> > > And if by any chance your don't have:
> > > CONFIG_SPL_EXT_SUPPORT defined?  
> > 
> > CONFIG_SPL_EXT_SUPPORT=y
> 
> Could you for test comment out the above define?

Removing CONFIG_SPL_EXT_SUPPORT=y from the defconfig or using the
following diff makes the system boot.

diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
index 351f4edd41..1541a4837d 100644
--- a/common/spl/spl_mmc.c
+++ b/common/spl/spl_mmc.c
@@ -283,7 +283,7 @@ static int spl_mmc_do_fs_boot(struct spl_image_info 
*spl_image, struct mmc *mmc)
 
 u32 __weak spl_boot_mode(const u32 boot_device)
 {
-#if defined(CONFIG_SPL_FAT_SUPPORT) || defined(CONFIG_SPL_EXT_SUPPORT)
+#if defined(CONFIG_SPL_FAT_SUPPORT)
return MMCSD_MODE_FS;
 #elif defined(CONFIG_SUPPORT_EMMC_BOOT)
return MMCSD_MODE_EMMCBOOT;
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2] spl: eMMC/SD: Provide one __weak spl_boot_mode() function

2018-02-10 Thread Lukasz Majewski
Hi Jonathan,

> On Sat, Feb 10, 2018 at 10:57:26AM +0100, Lukasz Majewski wrote:
> > Hi Jonathan,
> >   
> > > On Sat, Feb 10, 2018 at 01:45:16AM +0100, Lukasz Majewski wrote:  
> > > > Hi Jonathan,
> > > > 
> > > > > On Sat, Feb 03, 2018 at 11:00:35AM -0200, Fabio Estevam
> > > > > wrote:
> > > > > > On Sat, Feb 3, 2018 at 5:29 AM, Lukasz Majewski
> > > > > >  wrote:  
> > > > > > > The goal of this patch is to clean up the code related to
> > > > > > > choosing SPL MMC boot mode.
> > > > > > >
> > > > > > > The spl_boot_mode() now is called only in
> > > > > > > spl_mmc_load_image() function, which is only compiled in
> > > > > > > if CONFIG_SPL_MMC_SUPPORT is enabled.
> > > > > > >
> > > > > > > To achieve the goal, all per mach/arch implementations
> > > > > > > eligible for unification has been replaced with one __weak
> > > > > > > implementation.
> > > > > > >
> > > > > > > Signed-off-by: Lukasz Majewski 
> > > > > > > Reviewed-by: Marek Vasut 
> > > > > > > Reviewed-by: Stefano Babic 
> > > > > > > Acked-by: Michal Simek  (For
> > > > > > > ZynqMP)  
> > > > > > 
> > > > > > Nice cleanup:
> > > > > > 
> > > > > > Reviewed-by: Fabio Estevam   
> > > > > 
> > > > > This has broken booting via mmc with mx6cuboxi for me.
> > > > > 
> > > > > SPL loops on
> > > > > 
> > > > > U-Boot SPL 2018.03-rc1-00212-g48914fc119 (Feb 10 2018 -
> > > > > 11:04:33 +1300) Trying to boot from MMC1
> > > > > Failed to mount ext2 filesystem...
> > > > > spl_load_image_ext: ext4fs mount err - 0
> > > > 
> > > > Could you check what is the status of following defines in
> > > > your .config file:
> > > > 
> > > > CONFIG_SPL_FAT_SUPPORT
> > > > CONFIG_SUPPORT_EMMC_BOOT
> > > 
> > > "# CONFIG_SPL_FAT_SUPPORT is not set"
> > > 
> > > CONFIG_SUPPORT_EMMC_BOOT is not in the .config at all
> > > 
> > > CONFIG_SPL_EXT_SUPPORT previously for imx6 would result in
> > > MMCSD_MODE_RAW but now it results in MMCSD_MODE_FS.
> > >   
> > > > 
> > > > And if by any chance your don't have:
> > > > CONFIG_SPL_EXT_SUPPORT defined?
> > > 
> > > CONFIG_SPL_EXT_SUPPORT=y  
> > 
> > Could you for test comment out the above define?  
> 
> Removing CONFIG_SPL_EXT_SUPPORT=y from the defconfig or using the
> following diff makes the system boot.
> 
> diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
> index 351f4edd41..1541a4837d 100644
> --- a/common/spl/spl_mmc.c
> +++ b/common/spl/spl_mmc.c
> @@ -283,7 +283,7 @@ static int spl_mmc_do_fs_boot(struct
> spl_image_info *spl_image, struct mmc *mmc) 
>  u32 __weak spl_boot_mode(const u32 boot_device)
>  {
> -#if defined(CONFIG_SPL_FAT_SUPPORT) ||
> defined(CONFIG_SPL_EXT_SUPPORT) +#if defined(CONFIG_SPL_FAT_SUPPORT)
>   return MMCSD_MODE_FS;
>  #elif defined(CONFIG_SUPPORT_EMMC_BOOT)
>   return MMCSD_MODE_EMMCBOOT;


Original iMX code (CONFIG_SPL_EXT_SUPPORT is not taken into account at
all):


-#if defined(CONFIG_SPL_MMC_SUPPORT)
-/* called from spl_mmc to see type of boot mode for storage (RAW or
FAT) */ -u32 spl_boot_mode(const u32 boot_device)
-{
-   switch (spl_boot_device()) {
-   /* for MMC return either RAW or FAT mode */
-   case BOOT_DEVICE_MMC1:
-   case BOOT_DEVICE_MMC2:
-#if defined(CONFIG_SPL_FAT_SUPPORT)
-   return MMCSD_MODE_FS;
-#elif defined(CONFIG_SUPPORT_EMMC_BOOT)
-   return MMCSD_MODE_EMMCBOOT;
-#else
-   return MMCSD_MODE_RAW;
-#endif
-   break;
-   default:
-   puts("spl: ERROR:  unsupported device\n");
-   hang();
-   }
-}
-#endif

Current code (socfpga):

+u32 __weak spl_boot_mode(const u32 boot_device)
+{
+#if defined(CONFIG_SPL_FAT_SUPPORT) || defined(CONFIG_SPL_EXT_SUPPORT)
+   return MMCSD_MODE_FS;
+#elif defined(CONFIG_SUPPORT_EMMC_BOOT)
+   return MMCSD_MODE_EMMCBOOT;
+#else
+   return MMCSD_MODE_RAW;
+#endif
+}


So with the original iMX code the MMCSD_MODE_RAW is returned even when
you do have CONFIG_SPL_EXT_SUPPORT enabled.



Best regards,

Lukasz Majewski

--

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


pgpRZHHKmFRR1.pgp
Description: OpenPGP digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] Convert CONFIG_BOOTCOUNT_LIMIT to Kconfig

2018-02-10 Thread Alex Kiernan
On Sat, Feb 10, 2018 at 10:01 AM, Lukasz Majewski  wrote:
> Hi Alex,
>
>> On Fri, Feb 9, 2018 at 10:50 PM, Lukasz Majewski 
>> wrote:
>> > diff --git a/configs/mx53ppd_defconfig b/configs/mx53ppd_defconfig
>> > index 3fbca2a08c..b83cf72022 100644
>> > --- a/configs/mx53ppd_defconfig
>> > +++ b/configs/mx53ppd_defconfig
>> > @@ -21,6 +21,7 @@ CONFIG_CMD_EXT4_WRITE=y
>> >  CONFIG_CMD_FAT=y
>> >  CONFIG_CMD_FS_GENERIC=y
>> >  CONFIG_BOOTCOUNT=y
>> > +CONFIG_BOOTCOUNT_LIMIT=y
>> >  CONFIG_BOOTCOUNT_EXT=y
>> >  CONFIG_SYS_BOOTCOUNT_EXT_DEVPART="0:5"
>> >  CONFIG_NETDEVICES=y
>>
>> ...
>>
>> > diff --git a/drivers/bootcount/Kconfig b/drivers/bootcount/Kconfig
>> > index c9d627cce2..cb6be73d52 100644
>> > --- a/drivers/bootcount/Kconfig
>> > +++ b/drivers/bootcount/Kconfig
>> > @@ -11,6 +11,12 @@ config BOOTCOUNT
>> >   number of times the board has booted on a number of
>> > different persistent storage mediums.
>> >
>> > +config BOOTCOUNT_LIMIT
>> > +   bool "Enable support for checking boot count limit"
>> > +   help
>> > + Enable checking for exceeding the boot count limit.
>> > + More information:
>> > http://www.denx.de/wiki/DULG/UBootBootCountLimit +
>> >  if BOOTCOUNT
>> >
>> >  config BOOTCOUNT_EXT
>>
>> Can't CONFIG_BOOTCOUNT and CONFIG_BOOTCOUNT_LIMIT be merged?
>
> This patch was mostly generated by moveconfig utility.
>

Yeah, I've a similar patch series where I'd done the same thing.

>
>>
>>   config BOOTCOUNT
>>  bool "Enable Boot count support"
>> help
>>   Enable boot count support, which provides the ability to
>> store the number of times the board has booted on a number of
>> different persistent storage mediums.
>>
>> AFAICT mx53ppd is the only board which has CONFIG_BOOTCOUNT set,
>
> I would use pragmatic approach here - leave this patch as is, and
> prepare next one on top of it to replace CONFIG_BOOTCOUNT with
> CONFIG_BOOTCOUNT_LIMIT (as the last one is used in many places).
>
>> BOOTCOUNT is just used within Kconfig, not actually consumed either by
>> a Makefile or any piece of code and should probably go?
>
> Yes. It could be replaced with CONFIG_BOOTCOUNT_LIMIT.
>

Broadly what I had, only I'd reused the description from
CONFIG_BOOTCOUNT. I also worked through all the drivers, and made
bootlimit configurable from Kconfig. But I see you're doing way more
work around BOOTCOUNT, so I'll hold off on them.

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


[U-Boot] [PATCH 1/3] cmd: fitupd: Convert CONFIG_CMD_FITUPD

2018-02-10 Thread Marek Vasut
Convert the CONFIG_CMD_FITUPD symbol to Kconfig.

Signed-off-by: Marek Vasut 
Cc: Tom Rini 
---
 cmd/Kconfig | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/cmd/Kconfig b/cmd/Kconfig
index 7368b6df52..7c51749398 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -308,6 +308,12 @@ config CMD_SPL_WRITE_SIZE
  flash used by Falcon-mode boot. See the documentation until CMD_SPL
  for detail.
 
+config CMD_FITUPD
+   bool "fitImage update command"
+   help
+ Implements the 'fitupd' command, which allows to automatically
+ store software updates present on a TFTP server in NOR Flash
+
 config CMD_THOR_DOWNLOAD
bool "thor - TIZEN 'thor' download"
help
-- 
2.15.1

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


[U-Boot] [PATCH 2/3] cmd: fitupd: Convert CONFIG_UPDATE_TFTP and co.

2018-02-10 Thread Marek Vasut
Convert the CONFIG_UPDATE_TFTP and related symbols to Kconfig.

Signed-off-by: Marek Vasut 
Cc: Tom Rini 
---
 common/Kconfig   | 21 +
 scripts/config_whitelist.txt |  3 ---
 2 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/common/Kconfig b/common/Kconfig
index dcab69d321..d5bc37e4c7 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -601,4 +601,25 @@ config HASH
 
 endmenu
 
+menu "Update support"
+
+config UPDATE_TFTP
+   bool "Auto-update using fitImage via TFTP"
+   depends on FIT
+   help
+ This option allows performing update of NOR with data in fitImage
+ sent via TFTP boot.
+
+config UPDATE_TFTP_CNT_MAX
+   int "The number of connection retries during auto-update"
+   default 0
+   depends on UPDATE_TFTP
+
+config UPDATE_TFTP_MSEC_MAX
+   int "Delay in mSec to wait for the TFTP server during auto-update"
+   default 100
+   depends on UPDATE_TFTP
+
+endmenu
+
 source "common/spl/Kconfig"
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index 1be3f23432..e5b6831633 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -4740,9 +4740,6 @@ CONFIG_ULPI_REF_CLK
 CONFIG_UMSDEVS
 CONFIG_UPDATEB
 CONFIG_UPDATE_LOAD_ADDR
-CONFIG_UPDATE_TFTP
-CONFIG_UPDATE_TFTP_CNT_MAX
-CONFIG_UPDATE_TFTP_MSEC_MAX
 CONFIG_USART1
 CONFIG_USART_BASE
 CONFIG_USART_ID
-- 
2.15.1

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


[U-Boot] [PATCH 3/3] tftp: update: Include missing cfi_flash.h header

2018-02-10 Thread Marek Vasut
Add the missing header, otherwise CONFIG_SYS_MAX_FLASH_BANKS
may be undeclared.

Signed-off-by: Marek Vasut 
Cc: Tom Rini 
---
 common/update.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/update.c b/common/update.c
index 33bffaa89e..ef61790f4b 100644
--- a/common/update.c
+++ b/common/update.c
@@ -24,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 
 /* env variable holding the location of the update file */
 #define UPDATE_FILE_ENV"updatefile"
-- 
2.15.1

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


Re: [U-Boot] [PATCH 1/2] Convert CONFIG_BOOTCOUNT_LIMIT to Kconfig

2018-02-10 Thread Lukasz Majewski
Hi Alex,

> On Sat, Feb 10, 2018 at 10:01 AM, Lukasz Majewski 
> wrote:
> > Hi Alex,
> >  
> >> On Fri, Feb 9, 2018 at 10:50 PM, Lukasz Majewski 
> >> wrote:  
> >> > diff --git a/configs/mx53ppd_defconfig
> >> > b/configs/mx53ppd_defconfig index 3fbca2a08c..b83cf72022 100644
> >> > --- a/configs/mx53ppd_defconfig
> >> > +++ b/configs/mx53ppd_defconfig
> >> > @@ -21,6 +21,7 @@ CONFIG_CMD_EXT4_WRITE=y
> >> >  CONFIG_CMD_FAT=y
> >> >  CONFIG_CMD_FS_GENERIC=y
> >> >  CONFIG_BOOTCOUNT=y
> >> > +CONFIG_BOOTCOUNT_LIMIT=y
> >> >  CONFIG_BOOTCOUNT_EXT=y
> >> >  CONFIG_SYS_BOOTCOUNT_EXT_DEVPART="0:5"
> >> >  CONFIG_NETDEVICES=y  
> >>
> >> ...
> >>  
> >> > diff --git a/drivers/bootcount/Kconfig
> >> > b/drivers/bootcount/Kconfig index c9d627cce2..cb6be73d52 100644
> >> > --- a/drivers/bootcount/Kconfig
> >> > +++ b/drivers/bootcount/Kconfig
> >> > @@ -11,6 +11,12 @@ config BOOTCOUNT
> >> >   number of times the board has booted on a number of
> >> > different persistent storage mediums.
> >> >
> >> > +config BOOTCOUNT_LIMIT
> >> > +   bool "Enable support for checking boot count limit"
> >> > +   help
> >> > + Enable checking for exceeding the boot count limit.
> >> > + More information:
> >> > http://www.denx.de/wiki/DULG/UBootBootCountLimit +
> >> >  if BOOTCOUNT
> >> >
> >> >  config BOOTCOUNT_EXT  
> >>
> >> Can't CONFIG_BOOTCOUNT and CONFIG_BOOTCOUNT_LIMIT be merged?  
> >
> > This patch was mostly generated by moveconfig utility.
> >  
> 
> Yeah, I've a similar patch series where I'd done the same thing.

I see :/

> 
> >  
> >>
> >>   config BOOTCOUNT
> >>  bool "Enable Boot count support"
> >> help
> >>   Enable boot count support, which provides the ability to
> >> store the number of times the board has booted on a number of
> >> different persistent storage mediums.
> >>
> >> AFAICT mx53ppd is the only board which has CONFIG_BOOTCOUNT set,  
> >
> > I would use pragmatic approach here - leave this patch as is, and
> > prepare next one on top of it to replace CONFIG_BOOTCOUNT with
> > CONFIG_BOOTCOUNT_LIMIT (as the last one is used in many places).
> >  
> >> BOOTCOUNT is just used within Kconfig, not actually consumed
> >> either by a Makefile or any piece of code and should probably go?  
> >
> > Yes. It could be replaced with CONFIG_BOOTCOUNT_LIMIT.
> >  
> 
> Broadly what I had, only I'd reused the description from
> CONFIG_BOOTCOUNT. 

As you have written above - the CONFIG_BOOTCOUNT_LIMIT is used
in ./drivers/bootcount.

> I also worked through all the drivers, and made
> bootlimit configurable from Kconfig. But I see you're doing way more
> work around BOOTCOUNT, so I'll hold off on them.

Maybe you can share / send the code, which replaces CONFIG_BOOTCOUNT
with CONFIG_BOOTCOUNT_LIMIT?

Or even better, place such patch on top of this series?

Thanks in advance,

Best regards,

Lukasz Majewski

--

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


pgpFrvLZW5d8H.pgp
Description: OpenPGP digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] Convert CONFIG_BOOTCOUNT_LIMIT to Kconfig

2018-02-10 Thread Alex Kiernan
>> I also worked through all the drivers, and made
>> bootlimit configurable from Kconfig. But I see you're doing way more
>> work around BOOTCOUNT, so I'll hold off on them.
>
> Maybe you can share / send the code, which replaces CONFIG_BOOTCOUNT
> with CONFIG_BOOTCOUNT_LIMIT?
>
> Or even better, place such patch on top of this series?
>

Yes of course... just trying to pick it apart sensibly.

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


[U-Boot] [PATCH 1/3] ubifs: Reintroduce using CONFIG_UBIFS_SILENCE_MSG

2018-02-10 Thread Petr Vorel
Use of CONFIG_UBIFS_SILENCE_MSG was added in
147162dac6 ("ubi: ubifs: Turn off verbose prints")

Then it was removed in
ff94bc40af ("mtd, ubi, ubifs: resync with Linux-3.14")

Cc: Joe Hershberger 
Cc: Heiko Schocher 
Signed-off-by: Petr Vorel 
---
Note, not sure whether we need to keep this workaround.  If not, it
might be better to get rid of both CONFIG_UBI_SILENCE_MSG and
CONFIG_UBIFS_SILENCE_MSG.

Petr
---
 fs/ubifs/ubifs.h | 4 
 1 file changed, 4 insertions(+)

diff --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h
index 1d89465205..b4ce706a8e 100644
--- a/fs/ubifs/ubifs.h
+++ b/fs/ubifs/ubifs.h
@@ -618,9 +618,13 @@ static inline ino_t parent_ino(struct dentry *dentry)
 #define UBIFS_VERSION 1
 
 /* Normal UBIFS messages */
+#ifdef CONFIG_UBIFS_SILENCE_MSG
+#define ubifs_msg(c, fmt, ...)
+#else
 #define ubifs_msg(c, fmt, ...)  \
pr_notice("UBIFS (ubi%d:%d): " fmt "\n",\
  (c)->vi.ubi_num, (c)->vi.vol_id, ##__VA_ARGS__)
+#endif
 /* UBIFS error messages */
 #ifndef __UBOOT__
 #define ubifs_err(c, fmt, ...)  \
-- 
2.16.1

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


[U-Boot] [PATCH 2/3] Convert CONFIG_UBIFS_SILENCE_MSG to Kconfig

2018-02-10 Thread Petr Vorel
Signed-off-by: Petr Vorel 
Cc: Joe Hershberger 
Cc: Heiko Schocher 
---
 README| 6 --
 configs/am335x_igep003x_defconfig | 1 +
 configs/igep0032_defconfig| 1 +
 env/Kconfig   | 1 -
 fs/ubifs/Kconfig  | 7 +++
 include/configs/am335x_igep003x.h | 1 -
 include/configs/omap3_igep00x0.h  | 1 -
 scripts/config_whitelist.txt  | 1 -
 8 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/README b/README
index 81b7ee1ce8..25614bd6dc 100644
--- a/README
+++ b/README
@@ -2644,12 +2644,6 @@ FIT uImage format:
Enable UBI fastmap debug
default: 0
 
-- UBIFS support
-   CONFIG_UBIFS_SILENCE_MSG
-
-   Make the verbose messages from UBIFS stop printing.  This leaves
-   warnings and errors enabled.
-
 - SPL framework
CONFIG_SPL
Enable building of SPL globally.
diff --git a/configs/am335x_igep003x_defconfig 
b/configs/am335x_igep003x_defconfig
index 04f2d33747..ac07744ffe 100644
--- a/configs/am335x_igep003x_defconfig
+++ b/configs/am335x_igep003x_defconfig
@@ -46,6 +46,7 @@ CONFIG_MTDIDS_DEFAULT="nand0=omap2-nand.0"
 CONFIG_MTDPARTS_DEFAULT="mtdparts=omap2-nand.0:512k(SPL),-(UBI)"
 CONFIG_CMD_UBI=y
 # CONFIG_CMD_UBIFS is not set
+# CONFIG_UBIFS_SILENCE_MSG is not set
 CONFIG_ISO_PARTITION=y
 CONFIG_EFI_PARTITION=y
 CONFIG_ENV_IS_IN_UBI=y
diff --git a/configs/igep0032_defconfig b/configs/igep0032_defconfig
index b0daee1a61..8398e064bf 100644
--- a/configs/igep0032_defconfig
+++ b/configs/igep0032_defconfig
@@ -28,6 +28,7 @@ CONFIG_CMD_CACHE=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_UBI=y
 # CONFIG_CMD_UBIFS is not set
+# CONFIG_UBIFS_SILENCE_MSG is not set
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
diff --git a/env/Kconfig b/env/Kconfig
index a3c6298273..36d6e799fc 100644
--- a/env/Kconfig
+++ b/env/Kconfig
@@ -361,7 +361,6 @@ config ENV_IS_IN_UBI
  It is assumed that both volumes are in the same MTD partition.
 
  - CONFIG_UBI_SILENCE_MSG
- - CONFIG_UBIFS_SILENCE_MSG
 
  You will probably want to define these to avoid a really noisy system
  when storing the env in UBI.
diff --git a/fs/ubifs/Kconfig b/fs/ubifs/Kconfig
index e69de29bb2..1a8f084e36 100644
--- a/fs/ubifs/Kconfig
+++ b/fs/ubifs/Kconfig
@@ -0,0 +1,7 @@
+config UBIFS_SILENCE_MSG
+   bool "UBIFS silence verbose messages"
+   depends on CMD_UBIFS
+   default ENV_IS_IN_UBI
+   help
+ Make the verbose messages from UBIFS stop printing. This leaves
+ warnings and errors enabled.
diff --git a/include/configs/am335x_igep003x.h 
b/include/configs/am335x_igep003x.h
index d5b63e630e..6f53f42ac8 100644
--- a/include/configs/am335x_igep003x.h
+++ b/include/configs/am335x_igep003x.h
@@ -24,7 +24,6 @@
 
 /* Make the verbose messages from UBI stop printing */
 #define CONFIG_UBI_SILENCE_MSG
-#define CONFIG_UBIFS_SILENCE_MSG
 
 #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
 
diff --git a/include/configs/omap3_igep00x0.h b/include/configs/omap3_igep00x0.h
index 76d8e13d52..ab54a25d1a 100644
--- a/include/configs/omap3_igep00x0.h
+++ b/include/configs/omap3_igep00x0.h
@@ -137,7 +137,6 @@
 #define CONFIG_ENV_UBI_VOLUME  "config"
 #define CONFIG_ENV_UBI_VOLUME_REDUND   "config_r"
 #define CONFIG_UBI_SILENCE_MSG 1
-#define CONFIG_UBIFS_SILENCE_MSG   1
 #define CONFIG_ENV_SIZE(32*1024)
 
 #endif /* __IGEP00X0_H */
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index 1be3f23432..58278d1c40 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -4711,7 +4711,6 @@ CONFIG_T_SH7706LSR
 CONFIG_UART_BR_PRELIM
 CONFIG_UART_OR_PRELIM
 CONFIG_UBIBLOCK
-CONFIG_UBIFS_SILENCE_MSG
 CONFIG_UBIFS_VOLUME
 CONFIG_UBI_PART
 CONFIG_UBI_SILENCE_MSG
-- 
2.16.1

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


[U-Boot] [PATCH 3/3] Convert CONFIG_UBI_SILENCE_MSG to Kconfig

2018-02-10 Thread Petr Vorel
Signed-off-by: Petr Vorel 
---
 README| 6 --
 configs/am335x_igep003x_defconfig | 1 +
 configs/igep0032_defconfig| 1 +
 drivers/mtd/ubi/Kconfig   | 8 
 env/Kconfig   | 5 -
 include/configs/am335x_igep003x.h | 3 ---
 include/configs/omap3_igep00x0.h  | 1 -
 scripts/config_whitelist.txt  | 1 -
 8 files changed, 10 insertions(+), 16 deletions(-)

diff --git a/README b/README
index 25614bd6dc..84ff94de45 100644
--- a/README
+++ b/README
@@ -2577,12 +2577,6 @@ FIT uImage format:
kernel. Needed for UBI support.
 
 - UBI support
-   CONFIG_UBI_SILENCE_MSG
-
-   Make the verbose messages from UBI stop printing.  This leaves
-   warnings and errors enabled.
-
-
CONFIG_MTD_UBI_WL_THRESHOLD
This parameter defines the maximum difference between the 
highest
erase counter value and the lowest erase counter value of 
eraseblocks
diff --git a/configs/am335x_igep003x_defconfig 
b/configs/am335x_igep003x_defconfig
index ac07744ffe..0affd3feef 100644
--- a/configs/am335x_igep003x_defconfig
+++ b/configs/am335x_igep003x_defconfig
@@ -45,6 +45,7 @@ CONFIG_CMD_FS_GENERIC=y
 CONFIG_MTDIDS_DEFAULT="nand0=omap2-nand.0"
 CONFIG_MTDPARTS_DEFAULT="mtdparts=omap2-nand.0:512k(SPL),-(UBI)"
 CONFIG_CMD_UBI=y
+CONFIG_UBI_SILENCE_MSG=y
 # CONFIG_CMD_UBIFS is not set
 # CONFIG_UBIFS_SILENCE_MSG is not set
 CONFIG_ISO_PARTITION=y
diff --git a/configs/igep0032_defconfig b/configs/igep0032_defconfig
index 8398e064bf..a3f938a328 100644
--- a/configs/igep0032_defconfig
+++ b/configs/igep0032_defconfig
@@ -27,6 +27,7 @@ CONFIG_CMD_SPI=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_UBI=y
+CONFIG_UBI_SILENCE_MSG=y
 # CONFIG_CMD_UBIFS is not set
 # CONFIG_UBIFS_SILENCE_MSG is not set
 CONFIG_NET_RANDOM_ETHADDR=y
diff --git a/drivers/mtd/ubi/Kconfig b/drivers/mtd/ubi/Kconfig
index caa5197df5..d5c656730b 100644
--- a/drivers/mtd/ubi/Kconfig
+++ b/drivers/mtd/ubi/Kconfig
@@ -1,5 +1,13 @@
 menu "UBI support"
 
+config CONFIG_UBI_SILENCE_MSG
+   bool "UBI silence verbose messages"
+   depends on CMD_UBI
+   default ENV_IS_IN_UBI
+   help
+ Make the verbose messages from UBI stop printing. This leaves
+ warnings and errors enabled.
+
 config MTD_UBI
bool "Enable UBI - Unsorted block images"
select CRC32
diff --git a/env/Kconfig b/env/Kconfig
index 36d6e799fc..35548721bd 100644
--- a/env/Kconfig
+++ b/env/Kconfig
@@ -360,11 +360,6 @@ config ENV_IS_IN_UBI
  the environment in.  This will enable redundant environments in UBI.
  It is assumed that both volumes are in the same MTD partition.
 
- - CONFIG_UBI_SILENCE_MSG
-
- You will probably want to define these to avoid a really noisy system
- when storing the env in UBI.
-
 config ENV_FAT_INTERFACE
string "Name of the block device for the environment"
depends on ENV_IS_IN_FAT
diff --git a/include/configs/am335x_igep003x.h 
b/include/configs/am335x_igep003x.h
index 6f53f42ac8..89dc1608de 100644
--- a/include/configs/am335x_igep003x.h
+++ b/include/configs/am335x_igep003x.h
@@ -22,9 +22,6 @@
 
 #define CONFIG_ENV_SIZE(96 << 10)  /*  96 KiB */
 
-/* Make the verbose messages from UBI stop printing */
-#define CONFIG_UBI_SILENCE_MSG
-
 #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
 
 #ifndef CONFIG_SPL_BUILD
diff --git a/include/configs/omap3_igep00x0.h b/include/configs/omap3_igep00x0.h
index ab54a25d1a..e2a7f63e4f 100644
--- a/include/configs/omap3_igep00x0.h
+++ b/include/configs/omap3_igep00x0.h
@@ -136,7 +136,6 @@
 #define CONFIG_ENV_UBI_PART"UBI"
 #define CONFIG_ENV_UBI_VOLUME  "config"
 #define CONFIG_ENV_UBI_VOLUME_REDUND   "config_r"
-#define CONFIG_UBI_SILENCE_MSG 1
 #define CONFIG_ENV_SIZE(32*1024)
 
 #endif /* __IGEP00X0_H */
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index 58278d1c40..8dbf0270cc 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -4713,7 +4713,6 @@ CONFIG_UART_OR_PRELIM
 CONFIG_UBIBLOCK
 CONFIG_UBIFS_VOLUME
 CONFIG_UBI_PART
-CONFIG_UBI_SILENCE_MSG
 CONFIG_UBI_SIZE
 CONFIG_UBOOT1_ENV_ADDR
 CONFIG_UBOOT2_ENV_ADDR
-- 
2.16.1

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


Re: [U-Boot] [PATCH] configs: Re-sync with CONFIG_DISTRO_DEFAULTS

2018-02-10 Thread Tom Rini
On Sat, Feb 10, 2018 at 04:54:38PM -0500, Tom Rini wrote:

> A number of platforms include config_distro_defaults.h but do not enable
> CONFIG_DISTRO_DEFAULTS.  As they plainly intended to, set that flag and
> re-sync config files.
> 
> Signed-off-by: Tom Rini 

This is not size neutral.  There are a number of platforms that had not
been selecting DISTRO_DEFAULTS and started including
 after options started migrating to Kconfig.
This likely means that these platforms don't function in all distro use
cases today.

I'm also quite happy to see more patches that when appropriate only
select various commands if the relevant underlying kind of hardware
exists.  This should help in cases of wanting to reduce the binary size.

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


Re: [U-Boot] [PULL] efi v2018.03 patch queue 2018-02-10

2018-02-10 Thread Tom Rini
On Sat, Feb 10, 2018 at 12:28:21AM +0100, Alexander Graf wrote:

> Hi Tom,
> 
> This is my current patch queue for efi against v2018.03.  Please pull.
> 
> Alex
> 
> 
> The following changes since commit 1811a928c6c7604d6d05a84b4d552a7c31b4994e:
> 
>   Move most CONFIG_HAVE_BLOCK_DEVICE to Kconfig (2018-02-08 19:09:03 -0500)
> 
> are available in the git repository at:
> 
>   git://github.com/agraf/u-boot.git tags/signed-efi-v2018.03
> 
> for you to fetch changes up to df9cf561b04dd3fc5a94f7a2c2500948ae8ba56b:
> 
>   efi_loader: correct efi_disk_register (2018-02-10 00:25:49 +0100)
> 

Applied to u-boot/master, thanks!

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


Re: [U-Boot] TCP & Overrrun

2018-02-10 Thread Duncan Hare
On Sun, 11 Feb 2018 00:39:05 + (UTC)
Duncan Hare  wrote:

>  Duncan Hare
> 
> 714 931 7952
> 
>  
> - Forwarded Message -
>  From: Joe Hershberger 
>  To: Duncan Hare  
> Cc: Joe Hershberger ; u-boot
>  Sent: Friday, February 9, 2018 1:11 PM
>  Subject: Re: [U-Boot] TCP & Overrrun
>
> On Thu, Feb 8, 2018 at 8:41 PM, Duncan Hare  wrote:
> > On Thu, 8 Feb 2018 22:15:44 + (UTC)
> > Duncan Hare  wrote:
> >  
> >>  Duncan Hare
> >>
> >> 714 931 7952
> >>
> >>
> >> - Forwarded Message -
> >>  From: Joe Hershberger 
> >>  To: Duncan Hare 
> >> Cc: u-boot ; Joe Hershberger
> >>  Sent: Thursday, February 8, 2018 11:40 AM
> >>  Subject: Re: [U-Boot] TCP & Overrrun
> >>
> >> Hi Duncan,
> >>
> >> On Wed, Feb 7, 2018 at 8:40 PM, Duncan Hare 
> >> wrote:  
> >> > I'm gettin overrun on the raspberry pi.
> >> >
> >> > Which ethernet drived does it use?  
> >>
> >> You didn't specify which one you are talking about, but here's how
> >> to find out...
> >>
> >> Assuming rpi3, find the config first...
> >>
> >> configs/rpi_3_defconfig says:
> >> CONFIG_DEFAULT_DEVICE_TREE="bcm2837-rpi-3-b"
> >> arch/arm/dts/bcm2837-rpi-3-b.dts says: #include
> >> "bcm283x-rpi-smsc9514.dtsi" arch/arm/dts/bcm283x-rpi-smsc9514.dtsi
> >> says:                ethernet: usbether@1 {
> >> compatible = "usb424,ec00"; grep -rn ec00 drivers/ says:
> >> drivers/usb/eth/smsc95xx.c
> >>
> >> Cheers,
> >> -Joe
> >>  
> >> > I need to determine if it
> >> > uses CONFIG_SYS_RX_ETH_BUFFER" from net.h and the
> >> > "net_rx_packets" buffer pool defined in net/net.c
> >> >
> >> > grep suggests it is not using net_rx_packets.
> >> >
> >> > Thanks
> >> >
> >> > Duncan Hare
> >> > ___
> >> > U-Boot mailing list
> >> > U-Boot@lists.denx.de
> >> > https://lists.denx.de/listinfo/u-boot  
> > ___
> > Joe
> >
> > Two solutions:
> >
> > Option 1.
> >  
> 
> I think option 1 is the way to go.
> 
> Thanks,
> -Joe

Joe

The overruns were caused by printing error messages. The print
process is (very) slow compared with packet and computer speeds, and
causes overruns.

I turned off all the error messages in tcp.c and the overruns also
stopped.

Makes debugging harder.

Duncan

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


[U-Boot] [PATCH 1/6] rockchip: clk: rk3036: convert to use live dt

2018-02-10 Thread Kever Yang
Use live dt api to get cru base addr.

Signed-off-by: Kever Yang 
---

 drivers/clk/rockchip/clk_rk3036.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/rockchip/clk_rk3036.c 
b/drivers/clk/rockchip/clk_rk3036.c
index 510a00a..560222b 100644
--- a/drivers/clk/rockchip/clk_rk3036.c
+++ b/drivers/clk/rockchip/clk_rk3036.c
@@ -321,7 +321,7 @@ static int rk3036_clk_probe(struct udevice *dev)
 {
struct rk3036_clk_priv *priv = dev_get_priv(dev);
 
-   priv->cru = (struct rk3036_cru *)devfdt_get_addr(dev);
+   priv->cru = dev_read_addr_ptr(dev);
rkclk_init(priv->cru);
 
return 0;
-- 
1.9.1

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


[U-Boot] [PATCH 2/6] rockchip: clk: rk3188: convert to use live dt

2018-02-10 Thread Kever Yang
Use live dt api to get cru base addr.

Signed-off-by: Kever Yang 
---

 drivers/clk/rockchip/clk_rk3188.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/rockchip/clk_rk3188.c 
b/drivers/clk/rockchip/clk_rk3188.c
index 6451c95..ad8df5a 100644
--- a/drivers/clk/rockchip/clk_rk3188.c
+++ b/drivers/clk/rockchip/clk_rk3188.c
@@ -541,7 +541,7 @@ static int rk3188_clk_ofdata_to_platdata(struct udevice 
*dev)
 #if !CONFIG_IS_ENABLED(OF_PLATDATA)
struct rk3188_clk_priv *priv = dev_get_priv(dev);
 
-   priv->cru = (struct rk3188_cru *)devfdt_get_addr(dev);
+   priv->cru = dev_read_addr_ptr(dev);
 #endif
 
return 0;
-- 
1.9.1

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


[U-Boot] [PATCH 4/6] rockchip: clk: rk3288: convert to use live dt

2018-02-10 Thread Kever Yang
Use live dt api to get cru base addr.

Signed-off-by: Kever Yang 
---

 drivers/clk/rockchip/clk_rk3288.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/rockchip/clk_rk3288.c 
b/drivers/clk/rockchip/clk_rk3288.c
index 552a71a..3a36d04 100644
--- a/drivers/clk/rockchip/clk_rk3288.c
+++ b/drivers/clk/rockchip/clk_rk3288.c
@@ -906,7 +906,7 @@ static int rk3288_clk_ofdata_to_platdata(struct udevice 
*dev)
 #if !CONFIG_IS_ENABLED(OF_PLATDATA)
struct rk3288_clk_priv *priv = dev_get_priv(dev);
 
-   priv->cru = (struct rk3288_cru *)devfdt_get_addr(dev);
+   priv->cru = dev_read_addr_ptr(dev);
 #endif
 
return 0;
-- 
1.9.1

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


[U-Boot] [PATCH 6/6] rockchip: clk: rk1108: convert to use live dt

2018-02-10 Thread Kever Yang
Use live dt api to get cru base addr.

Signed-off-by: Kever Yang 
---

 drivers/clk/rockchip/clk_rv1108.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/rockchip/clk_rv1108.c 
b/drivers/clk/rockchip/clk_rv1108.c
index 224c813..958fc78 100644
--- a/drivers/clk/rockchip/clk_rv1108.c
+++ b/drivers/clk/rockchip/clk_rv1108.c
@@ -213,7 +213,7 @@ static int rv1108_clk_probe(struct udevice *dev)
 {
struct rv1108_clk_priv *priv = dev_get_priv(dev);
 
-   priv->cru = (struct rv1108_cru *)devfdt_get_addr(dev);
+   priv->cru = dev_read_addr_ptr(dev);
 
rkclk_init(priv->cru);
 
-- 
1.9.1

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


[U-Boot] [PATCH 3/6] rockchip: clk: rk322x: convert to use live dt

2018-02-10 Thread Kever Yang
Use live dt api to get cru base addr.

Signed-off-by: Kever Yang 
---

 drivers/clk/rockchip/clk_rk322x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/rockchip/clk_rk322x.c 
b/drivers/clk/rockchip/clk_rk322x.c
index 4e6d2f0..ebcab73 100644
--- a/drivers/clk/rockchip/clk_rk322x.c
+++ b/drivers/clk/rockchip/clk_rk322x.c
@@ -475,7 +475,7 @@ static int rk322x_clk_ofdata_to_platdata(struct udevice 
*dev)
 {
struct rk322x_clk_priv *priv = dev_get_priv(dev);
 
-   priv->cru = (struct rk322x_cru *)devfdt_get_addr(dev);
+   priv->cru = dev_read_addr_ptr(dev);
 
return 0;
 }
-- 
1.9.1

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


[U-Boot] [PATCH 5/6] rockchip: clk: rk3328: convert to use live dt

2018-02-10 Thread Kever Yang
Use live dt api to get cru base addr.

Signed-off-by: Kever Yang 
---

 drivers/clk/rockchip/clk_rk3328.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/rockchip/clk_rk3328.c 
b/drivers/clk/rockchip/clk_rk3328.c
index 2ccc798..046b4e4 100644
--- a/drivers/clk/rockchip/clk_rk3328.c
+++ b/drivers/clk/rockchip/clk_rk3328.c
@@ -767,7 +767,7 @@ static int rk3328_clk_ofdata_to_platdata(struct udevice 
*dev)
 {
struct rk3328_clk_priv *priv = dev_get_priv(dev);
 
-   priv->cru = (struct rk3328_cru *)devfdt_get_addr(dev);
+   priv->cru = dev_read_addr_ptr(dev);
 
return 0;
 }
-- 
1.9.1

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