Re: [PATCH v2] cmd: mmc: Add mmc reg read command for reading card registers

2023-10-31 Thread Lothar Waßmann
ot;RCA: 0x%08x\n", mmc->rca); > + if (argv[4]) > + env_set_hex(argv[4], mmc->rca); > + return CMD_RET_SUCCESS; > + } > + if (!strcmp(argv[2], "extcsd") && > + mmc->version >= MMC_VERSION_4_41) { > + ret = mmc_send_ext_csd(mmc, ext_csd); > + if (ret) > + return ret; return CMD_RET_FAILURE; Lothar Waßmann

Re: [PATCH v2] misc: i2c_eeprom: consider pagesize when writing to eeprom

2023-10-25 Thread Lothar Waßmann
e); > } > > +static int i2c_eeprom_len(unsigned int offset, unsigned int len, unsigned > int pagesize) > +{ > + int page_offset = ((offset) & (pagesize - 1)); int page_offset = offset & (pagesize - 1); 2 many () Lothar Waßmann -- ___

Re: [PATCH] net: eth-uclass: Improve error message when MAC is not found

2023-10-20 Thread Lothar Waßmann
printf("\nError: %s address not set.\n", > + printf("\nError: %s a valid MAC address was not found.\n", > printf("\nError: %s No valid MAC address found.\n", Lothar Waßmann

Re: [PATCH 2/3] net: bootp: BOOTP/DHCPv4 retransmission improvements

2023-09-26 Thread Lothar Waßmann
gt; - u32 bootp_id; > struct in_addr zero_ip; > struct in_addr bcast_ip; > char *ep; /* Environment pointer */ > @@ -745,6 +765,12 @@ void bootp_request(void) > else > time_taken_max = TIMEOUT_MS; > > + ep = env_get("bootpretransmitperiodmax"); > + if (ep) > + retransmit_period_max_ms = dectoul(ep, NULL); > + else > + retransmit_period_max_ms = RETRANSMIT_PERIOD_MAX_MS; > + see above Lothar Waßmann

Re: [PATCH V7 11/14] common: Enable splash functions at SPL

2023-04-18 Thread Lothar Waßmann
2 deletions(-) > [...] > diff --git a/include/splash.h b/include/splash.h > index 33e45e6941..083c978582 100644 > --- a/include/splash.h > +++ b/include/splash.h > @@ -78,4 +78,4 @@ static inline int splash_display(void) > > #define BMP_ALIGN_CENTER 0x7FFF >

Re: [PATCH v2 2/3] cmd: fdt: allow standalone "fdt move"

2023-02-10 Thread Lothar Waßmann
dr; > int len; > int err; > @@ -263,9 +255,20 @@ static int do_fdt(struct cmd_tbl *cmdtp, int flag, int > argc, char *const argv[]) > return 1; > } It's not part of your changes, but this should rather be: return CMD_RET_FAILURE; Lothar Waßmann

Re: [PATCH v2 3/3] fdt: introduce fsapply command

2023-02-10 Thread Lothar Waßmann
rrno: %d\n", ret); > + continue; > + } > + if (!fdt_valid()) { > + /* fdt_valid() clears the pointer upon failure */ > + dtbo = map_sysmem(addr, 0); > + continue; > + } > + > + if (fdt_overlay_apply_verbose(working_fdt, dtbo) == 0) > + printf("applied\n"); > + } > + unmap_sysmem(dtbo); > + > + fs_closedir(dirs); > + > + return 0; return CMD_RET_SUCCESS; Lothar Waßmann

Re: [PATCH V5 09/12] arm: dts: iot2050: Optionally embed OTP programming data into image

2023-02-03 Thread Lothar Waßmann
> +#else > fill@0x6c { > offset = <0x6c>; > size = <0x01>; > fill-byte = [ff]; > +#endif > }; > I would rather include the closing brace in the #if #else block... Otherwise pe

Re: [PATCH v2 2/2] serial: mxc: Wait for TX completion before reset

2023-01-10 Thread Lothar Waßmann
l_device mxc_serial_drv = { > .name = "mxc_serial", > .start = mxc_serial_init, > - .stop = NULL, > + .stop = mxc_serial_stop, > .setbrg = mxc_serial_setbrg, > .putc = mxc_serial_putc, > .puts = default_serial_puts, > That looks go

Re: [PATCH] serial: mxc: Speed-up character transmission

2023-01-09 Thread Lothar Waßmann
orruption can be seen when priting inside board_init(). | |Revert it to avoid the regression. | |Reported-by: Tim Harvey |Signed-off-by: Fabio Estevam |Acked-by: Tim Harvey Lothar Waßmann

Re: [U-Boot] list files on tftp / large kernel-image

2018-12-21 Thread Lothar Waßmann
ain. > 80200040: 616d4975 345f6567 2e39312e 63722d30uImage_4.19.0-rc > 80200050: 64682d31 0076696d fcffbdf71-hdmiv. > > seems to set 58 (was ff before) > > any idea why higher address counts backwards? > little endian integer representation! Try 'md.b' inste

Re: [U-Boot] Unable to saveenv to MMC

2018-12-17 Thread Lothar Waßmann
.bin of=/dev/disk2 bs=1024 seek=8 > I have no idea how your SD card is partitioned but I guess that with this command you are overwriting your FAT formatted partition. Lothar Waßmann ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot

Re: [U-Boot] [PATCH V4 24/32] power: Add power domain driver for i.MX8

2018-09-13 Thread Lothar Waßmann
; > + struct imx8_power_domain_priv *ppriv; > + sc_err_t ret; > + > + struct power_domain parent_domain; > + struct udevice *parent = dev_get_parent(dev); > + > + /* Need to power on parent node first */ > +

Re: [U-Boot] [PATCH V4 32/32] imx: add i.MX8QXP MEK board support

2018-09-13 Thread Lothar Waßmann
41 > + SC_P_USDHC1_CMD_CONN_USDHC1_CMD > 0x0021 > + SC_P_USDHC1_DATA0_CONN_USDHC1_DATA0 > 0x0021 > + SC_P_USDHC1_DATA1_CONN_USDHC1_DAT

Re: [U-Boot] [PATCH V3 1/2] spl: Fix redundant image of uboot

2018-07-11 Thread Lothar Waßmann
> The function used before was always return 0 without any evaluation of the > > error. We try to make it work properly > > > > Signed-off-by: Michael Trimarchi > > Any more comment? > Apart from the typos in your first sentence of your co

Re: [U-Boot] [PATCH 1/2] spl: Fix redundant image of uboot

2018-07-04 Thread Lothar Waßmann
Michael Nazzareno Trimarchi wrote: > Hi > > On Wed, Jul 4, 2018 at 4:19 PM, Lothar Waßmann > wrote: > > Hi, > > > > On Wed, 4 Jul 2018 15:53:36 +0200 Michael Trimarchi wrote: > >> We need to address the redundat image case and undestand if the >

Re: [U-Boot] [PATCH 1/2] spl: Fix redundant image of uboot

2018-07-04 Thread Lothar Waßmann
heck_hcrc(...) { > + debug("Header checksum failed\n"); > + return -EINVAL; > + } > + err = image_check_dcrc((const image_header_t *)spl_image->load_addr); > + if (!err) { > dto. > + debug("Image checksum failed\n"); >

Re: [U-Boot] [PATCH v3 1/2] cmd: nvedit: env import can now import only variables passed as parameters

2018-05-25 Thread Lothar Waßmann
v_import(cmd_tbl_t *cmdtp, int flag, > > printf("## Info: input data size = %zu = 0x%zX\n", size, > size); > > } > > > + if (argc > 2) > > + wl = 1; > > + > > if (chk) { > >

Re: [U-Boot] [PATCH v2 1/2] cmd: nvedit: add whitelist option for env import

2018-05-20 Thread Lothar Waßmann
free(tmp); > + return CMD_RET_FAILURE; > + } > + > wl_count should probably be zeroed here... But I would keep the predetermined vlaue of wl_count and check against it in the following loop to be sure not to overflow the allocated array, even in the improbable case, that strtok() should happen to return more tokens, than you tested before with the strchr() loop. Lothar Waßmann ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot

Re: [U-Boot] [PATCH v2] tools: buildman: Don't use the working dir as build dir

2018-04-03 Thread Lothar Waßmann
Hi, On Mon, 2 Apr 2018 02:43:12 -0600 Simon Glass wrote: > From: Lothar Waßmann <l...@karo-electronics.de> > > When the U-Boot base directory happens to have the same name as the branch > that buildman is directed to use via the '-b' option and no output > directory

Re: [U-Boot] [PATCH v3 2/5] ARM: dts: i.MX6QDL: U-Boot specific dts for u-boot, dm-spl

2018-03-27 Thread Lothar Waßmann
/arm/dts/imx6dl-icore.dts > +F: arch/arm/dts/imx6dl-icore-u-boot.dtsi > F: arch/arm/dts/imx6qdl-icore-rqs.dtsi > +F: arch/arm/dts/imx6qdl-icore-rqs-u-boot.dtsi > F: arch/arm/dts/imx6q-icore-rqs.dts > +F: arch/arm/dts/imx6q-icore-rqs-u-boot.dtis > s/dtis/dtsi/ Lothar Waßmann ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot

Re: [U-Boot] [PATCH v2 2/6] i.MX6: Change SYS_SOC from mx6 to imx6

2018-03-26 Thread Lothar Waßmann
> board/logicpd/imx6/mx6q_2x_MT41K512M16HA.cfg | 6 +++--- > > board/technexion/pico-imx6ul/Kconfig | 2 +- > > board/toradex/apalis_imx6/Kconfig | 2 +- > > board/toradex/colibri_imx6/Kconfig |

Re: [U-Boot] [PATCH 4/5] net: fec: sharing MDIO for two enet controllers

2018-03-20 Thread Lothar Waßmann
_setup(priv); > > priv->dev_id = dev->seq; > + > +#ifdef CONFIG_FEC_MXC_MDIO_BASE > + bus = fec_get_miibus((ulong)CONFIG_FEC_MXC_MDIO_BASE, dev->seq); > +#else > bus = fec_get_miibus((ulong)priv->eth, dev->seq); > +#endif > if (!bus) { > ret = -ENOMEM; > goto err_mii; Lothar Waßmann ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot

Re: [U-Boot] [PATCH 2/5] net: fec_mxc: simplify fec_get_miibus

2018-03-20 Thread Lothar Waßmann
nt dev_id) > -#endif > +struct mii_dev *fec_get_miibus(ulong base_addr, int dev_id) > { > -#ifdef CONFIG_DM_ETH > - struct fec_priv *priv = dev_get_priv(dev); > - struct ethernet_regs *eth = priv->eth; > -#else > struct ethernet_re

Re: [U-Boot] [PATCH 1/4] imx: hab: Add routine to set HAB IVT address

2018-03-16 Thread Lothar Waßmann
> + env_set_hex("hab_ivt_addr", addr); > + > + return CMD_RET_SUCCESS; > +} > + > U_BOOT_CMD( > hab_status, CONFIG_SYS_MAXARGS, 1, do_hab_status, > "display HAB status", > What does this function offer, that a 'setexpr hab_ivt_addr ${loadaddr} + 0x400' could not do as well? Lothar Waßmann ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot

Re: [U-Boot] imx: get_ticks in syscounter.c get miscompiled by GCC 6

2018-03-06 Thread Lothar Waßmann
; : "=r" (now)); > + asm volatile("mrrc p15, 0, %Q0, %R0, c14" : "=r" (now)); > > gd->arch.tbl = (unsigned long)(now & 0x); > gd->arch.tbu = (unsigned long)(now >> 32); > Lothar Waßmann ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot

Re: [U-Boot] U-Boot

2018-03-02 Thread Lothar Waßmann
is out of reach for the kernel. Try setting the fdt_high variable to limit the range where U-Boot will copy the fdt. fdt_high= will prevent copying the fdt at all, other values specify the upper limit for the memory address where the fdt will end after copying. Lothar Waßmann _

Re: [U-Boot] [PATCH v9 4/4] common: Generic firmware loader for file system

2018-02-27 Thread Lothar Waßmann
then use this loader to program whatever, > ie. the FPGA device. > > Signed-off-by: Tien Fong Chee <tien.fong.c...@intel.com> > Reviewed-by: Lothar Waßmann <l...@karo-electronics.de> > --- > common/Kconfig | 10 ++ > common/Makefile

Re: [U-Boot] [PATCH v8 4/4] common: Generic firmware loader for file system

2018-02-22 Thread Lothar Waßmann
then use this loader to program whatever, > ie. the FPGA device. > > Signed-off-by: Tien Fong Chee <tien.fong.c...@intel.com> > Reviewed-by: Lothar Waßmann <l...@karo-electronics.de> > --- > common/Kconfig | 9 ++ > common/Makefile

Re: [U-Boot] [PATCH] fdt: Fixup only valid memory banks

2018-01-30 Thread Lothar Waßmann
if (start[i] == 0 && size[i] == 0) > + break; > + > + banks = i; > + > len = fdt_pack_reg(blob, tmp, start, size, banks); > > err = fdt_setprop(blob, nodeoffset, "reg", tmp, len); > Does an empty bank always impl

Re: [U-Boot] [PATCH v6 2/2] common: Generic firmware loader for file system

2018-01-22 Thread Lothar Waßmann
gt; > > + err = usb_stor_scan(1) < 0 ? -ENODEV : 0; > > > > if (err) > > > > return err; > > > > ? > > > > > > > This is last line code of the function, so it's always return the > > > result regardless error or not. &

Re: [U-Boot] [PATCH v6 0/2] Generic firmware loader

2018-01-08 Thread Lothar Waßmann
Hi, On Wed, 3 Jan 2018 08:46:09 + Chee, Tien Fong wrote: > On Rab, 2017-12-27 at 13:04 +0800, tien.fong.c...@intel.com wrote: > Hi Lothar Waßmann, > > From: Tien Fong Chee <tien.fong.c...@intel.com> > > > > This patchset contains generic firmware loader wh

Re: [U-Boot] [PATCH v5 2/2] common: Generic firmware loader for file system

2017-12-22 Thread Lothar Waßmann
Hi, On Fri, 22 Dec 2017 08:04:32 + Chee, Tien Fong wrote: > On Jum, 2017-12-22 at 08:44 +0100, Lothar Waßmann wrote: > > Hi, > > > > On Fri, 22 Dec 2017 01:43:38 + Chee, Tien Fong wrote: > > > > > > On Kha, 2017-12-21 at 16:08 +0100, Lo

Re: [U-Boot] [PATCH v5 2/2] common: Generic firmware loader for file system

2017-12-21 Thread Lothar Waßmann
Hi, On Fri, 22 Dec 2017 01:43:38 + Chee, Tien Fong wrote: > On Kha, 2017-12-21 at 16:08 +0100, Lothar Waßmann wrote: > > Hi, > > > > On Thu, 21 Dec 2017 12:48:53 + Chee, Tien Fong wrote: > > > > > > On Kha, 2017-12-21 at 12:53 +0100, Lo

Re: [U-Boot] [PATCH v5 2/2] common: Generic firmware loader for file system

2017-12-21 Thread Lothar Waßmann
Hi, On Thu, 21 Dec 2017 12:48:53 + Chee, Tien Fong wrote: > On Kha, 2017-12-21 at 12:53 +0100, Lothar Waßmann wrote: > > Hi, > > > > On Thu, 21 Dec 2017 09:36:41 + Chee, Tien Fong wrote: > > > > > > On Kha, 2017-12-21 at 09:48 +0100, Lo

Re: [U-Boot] [PATCH v5 2/2] common: Generic firmware loader for file system

2017-12-21 Thread Lothar Waßmann
Hi, On Thu, 21 Dec 2017 09:36:41 + Chee, Tien Fong wrote: > On Kha, 2017-12-21 at 09:48 +0100, Lothar Waßmann wrote: > > Hi, > > > > On Thu, 21 Dec 2017 15:25:29 +0800 tien.fong.c...@intel.com wrote: > > > > > > From: Tien Fong Chee <tien.fong

Re: [U-Boot] [PATCH v5 2/2] common: Generic firmware loader for file system

2017-12-21 Thread Lothar Waßmann
riv = NULL; > + loff_t actread; > + char *dev_part; > + int ret; > + > + dev_part = env_get("fw_dev_part"); > + if (dev_part) > + set_storage_devpart(location->name, dev_part); > + > + ret = init_storage_device(location); > + if (ret) > + goto out; > + > + select_fs_dev(location); > 'ret = ' is missing. > + if (ret) > + goto out; > + > + fw_priv = firmware_p->priv; > + > + ret = fs_read(fw_priv->name, (ulong)firmware_p->data, fw_priv->offset, > + firmware_p->size, ); > + > + if (ret) { > + printf("Error: %d Failed to read %s from flash %lld != %d.\n", > + ret, fw_priv->name, actread, firmware_p->size); > + return ret; Y Shouldn't this be 'goto out', do do the umount_ubifs() as in all other error cases? > + } else { > + ret = actread; > + } > What if actread != firmware_p->size? You handled it as an error before, now you happily return the number of bytes read in case of a short read. > + > +out: > +#ifdef CONFIG_CMD_UBIFS > + if (location->ubivol != NULL) > + umount_ubifs(); > +#endif > + > + return ret; > +} > + Lothar Waßmann ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot

Re: [U-Boot] [PATCH] bootm: flush cache on aligned region

2017-12-20 Thread Lothar Waßmann
1 bytes of the image may not be flushed in the worst case. > + flush_cache(load_a, ALIGN(*load_end - load_a, ARCH_DMA_MINALIGN)); > > debug(" kernel loaded at 0x%08lx, end = 0x%08lx\n", load, *load_end); > bootstage_mark(BOOTSTAGE_ID_KERNEL_LOADED);

Re: [U-Boot] [PATCH v4 2/2] common: Generic firmware loader for file system

2017-12-19 Thread Lothar Waßmann
Hi, On Tue, 19 Dec 2017 10:31:13 + Chee, Tien Fong wrote: > On Isn, 2017-12-18 at 08:39 +0100, Lothar Waßmann wrote: > > Hi, > > > > On Mon, 18 Dec 2017 13:10:56 +0800 tien.fong.c...@intel.com wrote: > > > > > > From: Tien Fong Chee <tien.fong

Re: [U-Boot] [PATCH v2 3/4] arm: imx: m53evk: remove usage of mx53_dram_size

2017-12-19 Thread Lothar Waßmann
board runs from RAM at that point already. > That's not the point. Zero-initialized variables (static or not) are located in the .bss section, which is overlayed by the .rel.dyn section. Thus writing to such a variable before relocation will trash t

Re: [U-Boot] [PATCH v4 2/2] common: Generic firmware loader for file system

2017-12-17 Thread Lothar Waßmann
{ > + printf("Error: %d Failed to read %s from flash %lld != %d.\n", > + ret, fw_priv->name, actread, firmware_p->size); > + return -EPERM; Quoting myself from an earlier mail (20171212091442.2f682...@karo-electronics.de): |That's definitely not the right return code in this situation. |If 'ret' is != 0 you should return 'ret', otherwise EIO is more |appropriate here. Lothar Waßmann ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot

Re: [U-Boot] [PATCH] arm: imx: cx9020: remove usage of mx53_dram_size

2017-12-15 Thread Lothar Waßmann
Hi, On Fri, 15 Dec 2017 13:56:15 +0100 linux-kernel-...@beckhoff.com wrote: > From: Patrick Bruenn <p.bru...@beckhoff.com> > > Global variables are not available during board_init_f(). > s/Global/static/ Lothar Waßmann ___ U-Boot m

Re: [U-Boot] [PATCH v3 2/2] common: Generic firmware loader for file system

2017-12-12 Thread Lothar Waßmann
requirements for their private data, thus there is no use in defining this globally. > + > +struct firmware { > + size_t size;/* Size of a file */ > + const u8 *data; /* Buffer for file */ > + void *priv; /* Firmware loader private fields

Re: [U-Boot] [PATCH v2 3/5] Introduce CONFIG_ENABLE_BUG_CHECKS to disable BUG{_ON} by default

2017-12-12 Thread Lothar Waßmann
t; diff --git a/lib/Kconfig b/lib/Kconfig > index 00ac650..36b1b3b 100644 > --- a/lib/Kconfig > +++ b/lib/Kconfig > @@ -45,6 +45,13 @@ config USE_TINY_PRINTF > > The supported format specifiers are %c, %s, %u/%d and %x. > > +config ENABLE_BUG_CHECKS > + bool

Re: [U-Boot] [PATCH v2 2/2] common: Generic firmware loader for file system

2017-12-12 Thread Lothar Waßmann
ading > + * > + * This firmware is loaded directly into the buffer pointed to by @buf and > + * the @firmware_p data member is pointed at @buf. > + * > + * @return: size of total read > + * -ve when error > + */ > +int request_firmware_into_buf(struct firmware **firmw

Re: [U-Boot] [PATCH 2/2] common: Generic firmware loader for file system

2017-12-11 Thread Lothar Waßmann
nc__); > + return -ENOMEM; > + } > + > + firmware->name = name; > + firmware->data = dbuf; > + firmware->size = size; > + firmware->offset = offset; > + > + return ret; > +} > + Lothar Waßmann ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot

Re: [U-Boot] [PATCH v5 07/20] common: Generic firmware loader for file system

2017-12-08 Thread Lothar Waßmann
Hi, On Fri, 8 Dec 2017 05:25:58 + Chee, Tien Fong wrote: > On Kha, 2017-12-07 at 10:00 +0100, Lothar Waßmann wrote: > > Hi, > > > > On Thu, 7 Dec 2017 08:10:06 + Chee, Tien Fong wrote: > > > > > > On Kha, 2017-12-07 at 08:49 +0100, Lo

Re: [U-Boot] [PATCH v5 07/20] common: Generic firmware loader for file system

2017-12-07 Thread Lothar Waßmann
Hi, On Thu, 7 Dec 2017 08:10:06 + Chee, Tien Fong wrote: > On Kha, 2017-12-07 at 08:49 +0100, Lothar Waßmann wrote: > > Hi, > > > > On Thu, 7 Dec 2017 05:29:24 + Chee, Tien Fong wrote: > > > > > > On Rab, 2017-12-06 at 12:00 +0100, Lo

Re: [U-Boot] [PATCH v5 07/20] common: Generic firmware loader for file system

2017-12-06 Thread Lothar Waßmann
Hi, On Thu, 7 Dec 2017 05:29:24 + Chee, Tien Fong wrote: > On Rab, 2017-12-06 at 12:00 +0100, Lothar Waßmann wrote: > > Hi, > > > > On Wed, 6 Dec 2017 10:06:21 + Chee, Tien Fong wrote: > > > > > > On Sel, 2017-12-05 at 09:53 +0100, Lo

Re: [U-Boot] [PATCH v5 07/20] common: Generic firmware loader for file system

2017-12-06 Thread Lothar Waßmann
Hi, On Wed, 6 Dec 2017 10:06:21 + Chee, Tien Fong wrote: > On Sel, 2017-12-05 at 09:53 +0100, Lothar Waßmann wrote: > > Hi, > > > > On Tue,  5 Dec 2017 15:57:57 +0800 tien.fong.c...@intel.com wrote: > > > > > > From: Tien Fong Chee <tien.fong.c...@i

Re: [U-Boot] [PATCH v5 07/20] common: Generic firmware loader for file system

2017-12-05 Thread Lothar Waßmann
buf, size, offset); > + > + if (ret < 0) /* error */ > Unnecessary blank line. > + return ret; > + > + ret = fw_get_filesystem_firmware(location, *firmware_p); > + > + return ret; > +} > diff --git a/include/fs_loader.h b/include/fs_loader.h > new file mode 100644 > index 000..dacc1f3 > --- /dev/null > +++ b/include/fs_loader.h > @@ -0,0 +1,30 @@ > +/* > + * Copyright (C) 2017 Intel Corporation > + * > + * SPDX-License-Identifier:GPL-2.0 > + */ > +#ifndef _FS_LOADER_H_ > +#define _FS_LOADER_H_ > + > +#include > + > +struct firmware { > + size_t size;/* Size of a file */ > + const u8 *data; /* Buffer for file */ > const void *data? > + const char *name; /* Filename */ > + u32 offset; /* Offset of reading a file */ > + void *priv; /* Firmware loader private fields */ > +}; > + > +struct device_location { > + char *name; /* Such as mmc, usb,and sata. */ > + char *devpart; /* Use the load command dev:part conventions */ > + char *mtdpart; /* MTD partition for ubi part */ > + char *ubivol; /* UBI volume-name for ubifsmount */ > +}; > + > +int request_firmware_into_buf(struct firmware **firmware_p, > + const char *name, > + struct device_location *location, > + void *buf, size_t size, u32 offset); > +#endif Lothar Waßmann ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot

Re: [U-Boot] [PATCH] tools: env: Add support for direct read/write UBI volumes

2017-12-01 Thread Lothar Waßmann
continue; > + > + fprintf(stderr, "Cannot write %u bytes to ubi volume\n", > + (unsigned int)count); > '%zu' is an appropriate format string for size_t values. No need for a type cast. > @@ -1347,8 +1587,12 @@ int fw_env_close(

Re: [U-Boot] [PATCH] fdtdec: Support parsing multiple /memory nodes

2017-11-29 Thread Lothar Waßmann
longer have further "reg" entries and CONFIG_NR_DRAM_BANKS still > allows for more DRAM banks, the code moves on to the next memory node > and checks it's "reg"s. This makes it possible to handle both systems > s/it's/its/ Lothar Waßmann

Re: [U-Boot] [PATCH] imx: serial: Wait for ongoing transmission to finish before serial reset

2017-10-04 Thread Lothar Waßmann
finish - for example > + * from pre-relocation enabled UART > + */ > + while (!(readl(>sr2) & USR2_TXDC)) > + ; > + > Loops that poll for HW activated bits should always have a timeout. Hardware will definitely break some day and deliver unexpected results. Software sho

Re: [U-Boot] [PATCH] dm: video: Add basic ANSI escape sequence support

2017-09-11 Thread Lothar Waßmann
*parsenum(char *s, int *num) > > > > Can you use simple_strtoul() or similar? > > Possibly, but I'm not sure it is a good idea.. I don't think escape > sequences are meant to be encoded with hex or octal number strings. > From a quick look, I don't see any escape code terminate

Re: [U-Boot] video: ipu_common: fix build error

2017-09-07 Thread Lothar Waßmann
_common.c b/drivers/video/ipu_common.c > >>> index 36d4b23..5676a0f 100644 > >>> --- a/drivers/video/ipu_common.c > >>> +++ b/drivers/video/ipu_common.c > >>> @@ -352,7 +352,9 @@ static int ipu_pixel_clk_set_rate(struct clk *clk, >

Re: [U-Boot] [UBOOT] [PATCH] cmd: usb: ignore block devices under mass storage device

2017-09-01 Thread Lothar Waßmann
gt; + if ((device_get_uclass_id(child) != UCLASS_USB_EMUL) && (device_get_uclass_id(child) != UCLASS_BLK)) { Lothar Waßmann ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot

Re: [U-Boot] ** Can't read Driver Desriptor Block **

2017-08-30 Thread Lothar Waßmann
y: not available > >> > >> I think we observe two independent errors here: > >> > >> - The hard disk Device 0 is not read. > >> - The ide command stops at the first device that is not available. > >> > >> I guess only the first is c

Re: [U-Boot] [PATCH] cmd: blk: Use LBAFD in the common block command

2017-08-22 Thread Lothar Waßmann
cnt); > + printf("\n%s write: device %d block # "LBAFD", count > %ld ... ", > +if_name, *cur_devnump, blk, cnt); > > n = blk_write_devnum(if_type, *cur_

Re: [U-Boot] [PATCH v1 5/7] spl: add serial download protocol (SDP) support

2017-08-08 Thread Lothar Waßmann
struct spl_boot_device *bootdev) > +{ > + int ret; > + > + g_dnl_clear_detach(); > + g_dnl_register("usb_dnl_sdp"); > + > + ret = sdp_init(); > + if (ret) { > + error("SDP init failed:

Re: [U-Boot] [PATCH v1 2/7] usb: gadget: add SDP driver

2017-08-08 Thread Lothar Waßmann
TE_TX_REGISTER; > + else > + sdp->state = SDP_STATE_IDLE; > + break; > + default: > + error("Wrong State: %d", sdp->state); > + sdp->state = SDP_STATE_IDLE; > + brea

Re: [U-Boot] [PATCH] spi: mxc_spi: support driver model

2017-08-08 Thread Lothar Waßmann
; +} > +#else > + > +static int mxc_spi_probe(struct udevice *bus) > +{ > + struct mxc_spi_slave *plat = bus->platdata; > + struct mxc_spi_slave *mxcs = dev_get_platdata(bus); > + int node = dev_of_offset(bus); > + const vo

Re: [U-Boot] [PATCH] tools: buildman: prevent trying to use the working directory as build dorectory

2017-07-14 Thread Lothar Waßmann
Hi, On Thu, 13 Jul 2017 13:09:58 -0600 Simon Glass wrote: > On 5 July 2017 at 01:34, Lothar Waßmann <l...@karo-electronics.de> wrote: > > When the U-Boot base directory happens to have the same name as the > > branch that buildman is directed to use via the '-b' option and no

[U-Boot] [PATCH v2 BUGFIX] net: fec_mxc: adjust prototype of fec_get_miibus() for DM_ETH

2017-07-14 Thread Lothar Waßmann
prototype of fec_get_miibus() for the DM_ETH case. Signed-off-by: Lothar Waßmann <l...@karo-electronics.de> --- Changes vs. v1: added missing prototype change in netdev.h drivers/net/fec_mxc.c | 9 + include/netdev.h | 5 + 2 files changed, 14 insertions(+) diff --git a/drive

Re: [U-Boot] [PATCH BUGFIX] net: fec_mxc: adjust prototype of fec_get_miibus() for DM_ETH

2017-07-14 Thread Lothar Waßmann
Hi, On Thu, 13 Jul 2017 16:45:00 +0200 Stefano Babic wrote: > On 13/07/2017 07:57, Lothar Waßmann wrote: > > commit 306dd7dabd64 ("net: fec_mxc: fix PHY initialization bug with > > CONFIG_DM_ETH") > > has broken the build of the fec_mxc driver with CONFIG_DM_ETH

[U-Boot] [PATCH BUGFIX] net: fec_mxc: adjust prototype of fec_get_miibus() for DM_ETH

2017-07-12 Thread Lothar Waßmann
prototype of fec_get_miibus() for the DM_ETH case. Signed-off-by: Lothar Waßmann <l...@karo-electronics.de> --- drivers/net/fec_mxc.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c index 4ad4ddc..e42d54b 100644 --- a/drivers/net/fec_mxc

Re: [U-Boot] Warning due to commit 6a516ef15d79

2017-07-12 Thread Lothar Waßmann
Hi Stefano, On Wed, 12 Jul 2017 10:45:21 +0200 Stefano Babic wrote: > Hi Lothar, > > your recent patch : > > commit 306dd7dabd6472b8b66ab5106d5a6a516ef15d79 > Author: Lothar Waßmann <l...@karo-electronics.de> > Date: Tue Jun 27 15:23:16 2017 +0200 > > net

Re: [U-Boot] [PATCH v6 4/5] drivers: phy: add generic_phy_valid() method

2017-07-10 Thread Lothar Waßmann
user, const char *phy_name, > struct phy *phy); > > +/** > + * generic_phy_valid() - check if PHY port is valid > + * > + * @phy: the PHY port to check > + * @return TRUE if valid, or FALSE > + */ > +bool generic_phy_valid(struct phy *phy

[U-Boot] [PATCH] cmd, nand: fix broken output of "nand info"

2017-07-10 Thread Lothar Waßmann
072 b | subpagesize 2048 b | options 0x4200 | bbt options 0x 6 Change the format string to produce leading zeroes filling the gap. Signed-off-by: Lothar Waßmann <l...@karo-electronics.de> --- cmd/nand.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

Re: [U-Boot] [PATCH] dm: video: fix abuse of enum

2017-07-07 Thread Lothar Waßmann
Hi, On Thu, 6 Jul 2017 12:22:52 + Marcel Ziswiler wrote: > Dear Lothar > > On Thu, 2017-07-06 at 09:50 +0200, Lothar Waßmann wrote: > > Hi, > > > > On Wed, 5 Jul 2017 22:49:28 -0600 Simon Glass wrote: > > > Hi Lothar, > > > > > &g

Re: [U-Boot] Nios II 10m50 is not working

2017-07-06 Thread Lothar Waßmann
th leading to the node where you need it. Lothar Waßmann ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot

Re: [U-Boot] [PATCH] dm: video: fix abuse of enum

2017-07-06 Thread Lothar Waßmann
Hi, On Wed, 5 Jul 2017 22:49:28 -0600 Simon Glass wrote: > Hi Lothar, > > On 23 June 2017 at 00:30, Lothar Waßmann <l...@karo-electronics.de> wrote: > > Hi, > > > > On Wed, 21 Jun 2017 09:59:05 +0200 Lothar Waßmann wrote: > >> Hi, > >> > &

[U-Boot] [PATCH] tools: buildman: prevent trying to use the working directory as build dorectory

2017-07-05 Thread Lothar Waßmann
20] Not a directory: '..//boards.cfg Add a check to the builderthread.Mkdir function to verify that the path it tries to create does not match the current working directory. Signed-off-by: Lothar Waßmann <l...@karo-electronics.de> --- tools/buildman/builderthread.py | 4 1 file chan

Re: [U-Boot] [PATCH 5/5] fit: Introduce methods for applying overlays on fit-load

2017-07-05 Thread Lothar Waßmann
> > > > + return -ENOMEM; > > > > + } > > > > + memcpy(conf_uname_copy, conf_uname, len); > > > > > > Is that like strdup() here ? > > > > No. The space allocated is not the full st

Re: [U-Boot] [PATCH 3/5] fdt: Allow stacked overlays phandle references

2017-07-05 Thread Lothar Waßmann
on stack ? > buffers on stack are a disatrous stack overflow waiting to happen. Lothar Waßmann ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot

Re: [U-Boot] [PATCH v8 8/10] GPT: read partition table from device into a data structure

2017-07-03 Thread Lothar Waßmann
o out; > + } > + return --valid_parts; > I personally find it somewhat strange to initialize a counter to 1 and then return its value reduced by one, rather than initializing it to 0 and returning the exact counter value. Lothar Waßmann ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot

Re: [U-Boot] [PATCH v6 3/3] GPT: provide commands to selectively rename partitions

2017-07-03 Thread Lothar Waßmann
ithout NULL-termination, > That's nonsense. _Every_ string in the environment is NULL terminated. In the former case of your example the characters after the first semicolon are interpreted as commands and lead to an error message Unknown command '2' - try 'help' ... because the ';' is treated as a com

Re: [U-Boot] [PATCH 10/10] gpt: harden set_gpt_info() against non NULL-terminated strings

2017-07-03 Thread Lothar Waßmann
dtp=0x714e20 <_u_boot_list_2_cmd_2_gpt>) at common/command.c:500 > #5 cmd_process (flag=, argc=0x5, argv=0x7fffef09a8f0, > repeatable=repeatable@entry=0x726c04 , > ticks=ticks@entry=0x0) at common/command.c:539 > > Suggested-by: Lothar Waßmann <l...@karo-electronics

Re: [U-Boot] [PATCH 03/16] usb: Remove unnecessary work in usb_setup_descriptor()

2017-06-30 Thread Lothar Waßmann
if (dev->speed == USB_SPEED_LOW) > > + dev->descriptor.bMaxPacketSize0 = 8; > > + else > > + dev->descriptor.bMaxPacketSize0 = 64; > > } > > > > dev->epmaxpacketin[0] = dev->descriptor.bMaxPacketSize0; > > -- > > For some reason that I don't understand, this patch breaks EHCI. > dev->maxpacketsize is equal to zero with this patch, which leads to a > 'divide error' exception in ehci_submit_async(). Not sure if anyone > has some hints? > In the do_read case the dev->descriptor.bMaxPacketSize0 is not set up. Lothar Waßmann ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot

[U-Boot] [PATCH] net: fec_mxc: fix PHY initialization bug with CONFIG_DM_ETH

2017-06-27 Thread Lothar Waßmann
this. Signed-off-by: Lothar Waßmann <l...@karo-electronics.de> --- drivers/net/fec_mxc.c | 24 +--- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c index 910879b..f61268c 100644 --- a/drivers/net/fec_mxc.c

Re: [U-Boot] [PATCH v6 3/3] GPT: provide commands to selectively rename partitions

2017-06-27 Thread Lothar Waßmann
Hi, On Tue, 27 Jun 2017 09:05:14 +0200 Lothar Waßmann wrote: > Hi, > > On Sun, 25 Jun 2017 14:54:56 -0700 Alison Chaiken wrote: > > On Sun, Jun 18, 2017 at 4:03 AM, Wolfgang Denk <w...@denx.de> wrote: > > > > > Dear Alison, > > > > > > In message

Re: [U-Boot] [PATCH v6 3/3] GPT: provide commands to selectively rename partitions

2017-06-27 Thread Lothar Waßmann
Hi, On Sun, 25 Jun 2017 14:54:56 -0700 Alison Chaiken wrote: > On Sun, Jun 18, 2017 at 4:03 AM, Wolfgang Denk wrote: > > > Dear Alison, > > > > In message

Re: [U-Boot] [PATCH v7 9/9] GPT: provide commands to selectively rename partitions

2017-06-26 Thread Lothar Waßmann
nce v7: > > -- Removed several casts in create_gpt_partitions_list() and >do_rename_gpt_parts() as suggested by Lothar Waßmann. The cast of >gpt_part_info.name to char* is needed to silence a compiler >warning. > > -- Substituted simple_strtol() for atoi() in

Re: [U-Boot] [PATCH v7 8/9] GPT: read partition table from device into a data structure

2017-06-26 Thread Lothar Waßmann
_disk_part; > + > + if (disk_partitions.next == NULL) > + INIT_LIST_HEAD(_partitions); > + > + for (p = 1; p <= MAX_SEARCH_PARTITIONS; p++) { > + ret = part_get_info(dev_desc, p, ); > + if (ret) > + continue; > + > + new_disk_part = allocate_disk_part(, valid_parts); > + if (IS_ERR(new_disk_part)) > + goto out; > + > + list_add_tail(_disk_part->list, _partitions); > + valid_parts++; > + } > + if (!valid_parts) { > You initialize valid_parts to '1' and only ever increment it, so it can never be '0' here. Lothar Waßmann ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot

Re: [U-Boot] [PATCH] dm: video: fix abuse of enum

2017-06-23 Thread Lothar Waßmann
Hi, On Wed, 21 Jun 2017 09:59:05 +0200 Lothar Waßmann wrote: > Hi, > > On Tue, 20 Jun 2017 12:26:29 -0600 Simon Glass wrote: > > Hi Lothar, > > > > On 20 June 2017 at 04:25, Lothar Waßmann <l...@karo-electronics.de> wrote: > > > LCD_M

Re: [U-Boot] [PATCH v8 02/10] reset: add reset_assert_all()

2017-06-21 Thread Lothar Waßmann
, assert/deasser a reset line, ...) and free it right away. The caller of reset_assert_all() should make sure that all reset resources are requested before calling this function and keep them requested until after relinquish using them. The same holds for the clk_disable_all() in your other

Re: [U-Boot] [PATCH] dm: video: fix abuse of enum

2017-06-21 Thread Lothar Waßmann
Hi, On Tue, 20 Jun 2017 12:26:29 -0600 Simon Glass wrote: > Hi Lothar, > > On 20 June 2017 at 04:25, Lothar Waßmann <l...@karo-electronics.de> wrote: > > LCD_MAX_WIDTH, LCD_MAX_HEIGHT and LCD_MAX_LSBPP are not alternative > > values for one specific variable, but unrel

Re: [U-Boot] [PATCH v7 08/10] usb: host: ohci-generic: add CLOCK support

2017-06-21 Thread Lothar Waßmann
Hi, On Tue, 20 Jun 2017 12:56:48 + Patrice CHOTARD wrote: > Hi Lothar > > On 06/20/2017 02:06 PM, Lothar Waßmann wrote: > > Hi, > > > > On Tue, 20 Jun 2017 11:59:09 +0200 patrice.chot...@st.com wrote: > >> From: Patrice Chotard <patrice.chot...@st.c

Re: [U-Boot] [PATCH v7 03/10] clk: add clk_disable_all()

2017-06-20 Thread Lothar Waßmann
quot;, __func__, clk, count); > + > + for (i = 0; i < count; i++) { > + ret = clk_request(clk->dev, [i]); > Shouldn't this be: ret = clk_request(clk[i].dev, [i]); Lothar Waßmann ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot

Re: [U-Boot] [PATCH v7 08/10] usb: host: ohci-generic: add CLOCK support

2017-06-20 Thread Lothar Waßmann
return 0; would be more easy to follow. > +clk_err: > + ret = clk_disable_all(priv->clocks, priv->clock_count); > + if (ret) > + return ret; > + > + return err; > } > > static int ohci_usb_remove(struct udevice *dev) > { > - retur

Re: [U-Boot] [PATCH v7 06/10] usb: host: ehci-generic: add error path and .remove callback

2017-06-20 Thread Lothar Waßmann
ic int ehci_usb_remove(struct udevice *dev) > +{ > + struct generic_ehci *priv = dev_get_priv(dev); > + int ret; > + > + ret = ehci_deregister(dev); > + if (ret) > + return ret; > + > + ret = reset_assert_all(priv->resets, priv->reset_count); > + if (ret) > + return ret; > + > + return clk_disable_all(priv->clocks, priv->clock_count); > } > > static const struct udevice_id ehci_usb_ids[] = { > @@ -67,7 +145,7 @@ U_BOOT_DRIVER(ehci_generic) = { > .id = UCLASS_USB, > .of_match = ehci_usb_ids, > .probe = ehci_usb_probe, > - .remove = ehci_deregister, > + .remove = ehci_usb_remove, > .ops= _usb_ops, > .priv_auto_alloc_size = sizeof(struct generic_ehci), > .flags = DM_FLAG_ALLOC_PRIV_DMA, Lothar Waßmann ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot

Re: [U-Boot] [PATCH v7 06/10] usb: host: ehci-generic: add error path and .remove callback

2017-06-20 Thread Lothar Waßmann
clk_free(); > > - } > > + int i, err, ret, clock_nb, reset_nb; > > + > > + err = 0; > > + priv->clock_count = 0; > > + clock_nb = ofnode_count_phandle_with_args(dev_ofnode(dev), "clocks", > > + "#clock-cells"); > > + if (clock_nb > 0) { > > + priv->clocks = devm_kmalloc(dev, sizeof(struct clk) * clock_nb, > > + GFP_KERNEL); > > devm_kzalloc() > devm_kcalloc(dev, clock_nb, sizeof()...) Lothar Waßmann ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot

[U-Boot] [PATCH] dm: video: fix abuse of enum

2017-06-20 Thread Lothar Waßmann
size (e.g. 4096x4096). Signed-off-by: Lothar Waßmann <l...@karo-electronics.de> --- drivers/video/atmel_hlcdfb.c | 8 +++- drivers/video/atmel_lcdfb.c | 10 -- drivers/video/sandbox_sdl.c | 8 +++- drivers/video/tegra.c| 12 +--- drivers

Re: [U-Boot] [PATCH 2/2] mmc: rpmb: update size format for write_counter

2017-06-19 Thread Lothar Waßmann
short. > > Is there a doc for which kind of data format prefer to use first in U-Boot? > unsigned int, uint32_t, u32; > uint32_t is guaranteed to be of size 32bit according to the C spec. '[unsigned] int' is only guaranteed to be at least 32bit but can be l

Re: [U-Boot] [PATCH v7 14/17] net: fec_mxc: Add 'phy-reset-gpios' support

2017-06-16 Thread Lothar Waßmann
0:2]addr = 00 */ > @@ -254,6 +258,10 @@ struct fec_priv { > > #ifdef CONFIG_DM_ETH > u32 interface; > + > +# ifdef CONFIG_DM_GPIO > + struct gpio_desc reset_gpio; > +# endif > #endif > }; > > diff --git a/include/netdev.h b/include/netdev.h > index 8eb8b46..e5668f4 100644 > --- a/include/netdev.h > +++ b/include/netdev.h > @@ -133,7 +133,12 @@ static inline int pci_eth_init(bd_t *bis) > return num; > } > > +#ifdef CONFIG_DM_ETH > +struct mii_dev *fec_get_miibus(struct udevice *dev, int dev_id); > +#else > struct mii_dev *fec_get_miibus(uint32_t base_addr, int dev_id); > +#endif > + > #ifdef CONFIG_PHYLIB > struct phy_device; > int fec_probe(bd_t *bd, int dev_id, uint32_t base_addr, Lothar Waßmann ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot

Re: [U-Boot] [PATCH] ARM: provide a valid exception stack address for startup code

2017-06-13 Thread Lothar Waßmann
Hi, On Mon, 12 Jun 2017 17:50:45 -0600 Simon Glass wrote: > On 8 June 2017 at 02:16, Lothar Waßmann <l...@karo-electronics.de> wrote: > > Create exception stack in IRAM if available to facilitate debugging of > > pre-relocation code by catching exceptions rather than stopping

[U-Boot] [PATCH] cmd: nvedit: bring error message in sync with condition under which it appears

2017-06-08 Thread Lothar Waßmann
The list of symbols listed in the error message for missing Kconfig symbols is out of sync with the symbols actually tested. Add the missing symbols and reorder their appearance to be in sync with the #if statement for easier checking. Signed-off-by: Lothar Waßmann <l...@karo-electronics

[U-Boot] [PATCH] cmd: mtdparts: fix uninitialized variable warning

2017-06-08 Thread Lothar Waßmann
commit 06a040a31bcf ("cmd: mtdparts: fix null pointer dereference in parse_mtdparts") removed the initialization of a pointer variable, which is subsequently used in a debug() call. This produces an uninitialized variable warning, when compiling with DEBUG defined. Signed-off-by: Loth

[U-Boot] [PATCH] board_f: fix calculation of reloc_off

2017-06-08 Thread Lothar Waßmann
that is prepended to the actual code. Thus CONFIG_TEXT_BASE will differ from __image_copy_start, while the calculation 'gd->relocaddr - __image_copy_start' still gives the right relocation offset. Signed-off-by: Lothar Waßmann <l...@karo-electronics.de> --- common/board_f.c | 7 +-- 1 file c

[U-Boot] [PATCH] ARM: provide a valid exception stack address for startup code

2017-06-08 Thread Lothar Waßmann
Create exception stack in IRAM if available to facilitate debugging of pre-relocation code by catching exceptions rather than stopping dead. Signed-off-by: Lothar Waßmann <l...@karo-electronics.de> --- arch/arm/lib/vectors.S | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff

  1   2   >