From: Marek Behún
Change kwboot_img_patch() to avoid code repetition of setting errno to
EINVAL.
Signed-off-by: Marek Behún
---
tools/kwboot.c | 55 ++
1 file changed, 20 insertions(+), 35 deletions(-)
diff --git a/tools/kwboot.c b/tools
From: Pali Rohár
Retrieve current terminal settings via tcgetattr(), set to raw mode with
cfmakeraw(), enable receiver via CREAD and ignore modem control lines
via CLOCAL.
Signed-off-by: Pali Rohár
Signed-off-by: Marek Behún
---
tools/kwboot.c | 9 +
1 file changed, 5 insertions
From: Pali Rohár
Function kwboot_tty_recv() has its own handling of read timeout, we
don't need to do set it in tty settings.
Signed-off-by: Pali Rohár
Signed-off-by: Marek Behún
---
tools/kwboot.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/kwboot.c b/tools
From: Marek Behún
Mention all supported platforms in file header.
Signed-off-by: Marek Behún
---
tools/kwboot.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/kwboot.c b/tools/kwboot.c
index 9da5b42ebf..6fa6dff04d 100644
--- a/tools/kwboot.c
+++ b/tools/kwboot.c
From: Marek Behún
Add entry for these tools with Marek, Pali and Stefan as maintainers.
Signed-off-by: Marek Behún
---
MAINTAINERS | 10 ++
1 file changed, 10 insertions(+)
diff --git a/MAINTAINERS b/MAINTAINERS
index 67c96a6045..6f103230da 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
On Fri, 24 Sep 2021 22:09:15 +0200
Marek Vasut wrote:
> I have a feeling the discussion is again banking toward "mtdparts" and
> "DT", which really is a solved problem, or at least we agreed upon the
> solution.
I was trying to explain to Patrick how he can convert the ST board so
that the
On Fri, 24 Sep 2021 20:00:31 -0400
Tom Rini wrote:
> On Sat, Sep 25, 2021 at 01:49:26AM +0200, Marek Behún wrote:
>
> > Hi Tom, Jagan,
> >
> > in July I resent the series
> > Fix `mtd erase` when used with mtdpart
> > https://patchwork.ozlabs.o
.
Signed-off-by: Pali Rohár
Reviewed-by: Marek Behún
---
arch/arm/mach-mvebu/serdes/a38x/ctrl_pex.c | 128 -
arch/arm/mach-mvebu/serdes/a38x/ctrl_pex.h | 60 --
2 files changed, 188 deletions(-)
diff --git a/arch/arm/mach-mvebu/serdes/a38x/ctrl_pex.c
b/arch/arm/mach-mvebu
speed even with missing link
retraining). Compliant cards which just need longer initialization should
work better after this change.
Signed-off-by: Pali Rohár
Reviewed-by: Marek Behún
---
arch/arm/mach-mvebu/serdes/a38x/ctrl_pex.c | 128 +
1 file changed, 1 insertion(+), 127
and execution
addresses from SPI/NOR XIP area to DDR area 0x0080 (which is default
for A38x).
Signed-off-by: Pali Rohár
[ refactored ]
Signed-off-by: Marek Behún
---
tools/kwboot.c | 8
1 file changed, 8 insertions(+)
diff --git a/tools/kwboot.c b/tools/kwboot.c
index 907a574bfc
From: Pali Rohár
Some image types have source address in non-bytes unit; for example for
SATA images, it is in 512 B units.
We need to multiply by unit size when patching image type to UART.
Signed-off-by: Pali Rohár
[ refactored ]
Signed-off-by: Marek Behún
---
tools/kwboot.c | 40
From: Pali Rohár
It is not possible to modify image with secure header due to
cryptographic signature.
Signed-off-by: Pali Rohár
[ refactored ]
Signed-off-by: Marek Behún
---
tools/kwboot.c | 30 +-
1 file changed, 25 insertions(+), 5 deletions(-)
diff --git
From: Marek Behún
Add spaces around the | operator.
Signed-off-by: Marek Behún
---
tools/kwboot.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/kwboot.c b/tools/kwboot.c
index 5e491f31a4..9eb007f1bb 100644
--- a/tools/kwboot.c
+++ b/tools/kwboot.c
@@ -644,7
From: Pali Rohár
These structures are relevant for several other platforms, mention them
all.
Signed-off-by: Pali Rohár
Signed-off-by: Marek Behún
---
tools/kwbimage.c | 3 ++-
tools/kwbimage.h | 6 +++---
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/tools/kwbimage.c b
From: Pali Rohár
Add Pali and Marek as another authors of the kwboot utility.
Signed-off-by: Pali Rohár
Signed-off-by: Marek Behún
---
tools/kwboot.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tools/kwboot.c b/tools/kwboot.c
index 6fa6dff04d..6a1a030308 100644
--- a/tools/kwboot.c
From: Pali Rohár
These are part of SOC_CONTROL_REG1 register, not PEX_CAPABILITIES_REG.
Signed-off-by: Pali Rohár
Reviewed-by: Marek Behún
---
arch/arm/mach-mvebu/serdes/a38x/ctrl_pex.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/mach-mvebu/serdes/a38x
correctly
here, then access PCI config space of the endpoint card behind this Root
Port does not work.
Signed-off-by: Pali Rohár
Reviewed-by: Marek Behún
---
arch/arm/mach-mvebu/serdes/a38x/ctrl_pex.c| 22 --
arch/arm/mach-mvebu/serdes/a38x/ctrl_pex.h| 4 ++
.../serdes/a38x
-by: Pali Rohár
Reviewed-by: Marek Behún
---
.../mach-mvebu/serdes/a38x/high_speed_env_spec.c | 15 ---
1 file changed, 15 deletions(-)
diff --git a/arch/arm/mach-mvebu/serdes/a38x/high_speed_env_spec.c
b/arch/arm/mach-mvebu/serdes/a38x/high_speed_env_spec.c
index a712fa8994..824f4d3e3d
not be overwritten globally for all A38x devices.
Signed-off-by: Pali Rohár
Reviewed-by: Marek Behún
---
arch/arm/mach-mvebu/serdes/a38x/ctrl_pex.c | 27 --
1 file changed, 27 deletions(-)
diff --git a/arch/arm/mach-mvebu/serdes/a38x/ctrl_pex.c
b/arch/arm/mach-mvebu/serdes/a38x
From: Pali Rohár
Add comments to understand what this magic code is doing.
Signed-off-by: Pali Rohár
Reviewed-by: Marek Behún
---
arch/arm/mach-mvebu/serdes/a38x/ctrl_pex.c | 14 +-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-mvebu/serdes/a38x
From: Marek Behún
There are 3 instances in kwboot.c where we need to write() a given
buffer whole (iteratively writing until all data are written), and 2 of
those instances are wrong, for they do not increment the buffer pointer.
Refactor the code into a new function kwboot_write() where
From: Marek Behún
The compiler complains that we are comparing int with size_t when
compiled with -W.
Signed-off-by: Marek Behún
---
tools/kwboot.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/tools/kwboot.c b/tools/kwboot.c
index 88353d19c0..3d9f73e697 100644
From: Marek Behún
This buffer is never written to. Make it const.
Signed-off-by: Marek Behún
---
tools/kwboot.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/kwboot.c b/tools/kwboot.c
index e6e99849a7..f18f6d2134 100644
--- a/tools/kwboot.c
+++ b/tools/kwboot.c
-by: Marek Behún
---
tools/kwboot.c | 5 +
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/tools/kwboot.c b/tools/kwboot.c
index b9a402ca91..88353d19c0 100644
--- a/tools/kwboot.c
+++ b/tools/kwboot.c
@@ -347,7 +347,7 @@ kwboot_debugmsg(int tty, void *msg)
return rc
From: Marek Behún
On 32-bit ARM the compiler complains:
tools/kwbimage.c:547: warning: format ‘%lu’ expects argument of type
‘long unsigned int’, but argument 4 has
type ‘unsigned int’
Fix this by using %zu instead of %lu
From: Marek Behún
Rename this function to kwbimage_version() and don't cast argument if
not needed.
Signed-off-by: Marek Behún
---
tools/kwbimage.c | 8
tools/kwbimage.h | 4 ++--
tools/kwboot.c | 4 ++--
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/tools
From: Pali Rohár
The kwboot_img_patch_hdr() function already decides if header patching
is needed. Always call this function and deprecate the unneeded command
line option `-p`.
Signed-off-by: Pali Rohár
Reviewed-by: Marek Behún
---
tools/kwboot.c | 23 ++-
1 file changed
From: Marek Behún
Currently if BootROM fails to respond with ACK/NAK to a xmodem block, we
will be waiting indefinitely for such response.
Make sure that we only wait at most 1 second (blk_rsp_timeo) for ACK/NAK
for each block in case non-xmodem text output is not being expected.
Interpret
it is required there
until the CLOCAL flag is set on the tty.
Signed-off-by: Pali Rohár
Signed-off-by: Marek Behún
---
tools/kwboot.c | 10 +-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/tools/kwboot.c b/tools/kwboot.c
index a527c79cf3..5e491f31a4 100644
--- a/tools/kwboot.c
+++ b
From: Pali Rohár
Print kwboot's (U-Boot's) version when printing usage.
Signed-off-by: Pali Rohár
Reviewed-by: Marek Behún
---
tools/kwboot.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tools/kwboot.c b/tools/kwboot.c
index 22cdd137ad..454339db14 100644
--- a/tools/kwboot.c
+++ b
the
now unnecessary break.
In other failure cases return immediately.
Signed-off-by: Pali Rohár
Reviewed-by: Marek Behún
---
tools/kwboot.c | 9 ++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/tools/kwboot.c b/tools/kwboot.c
index 454339db14..b9a402ca91 100644
--- a/tools
From: Pali Rohár
Ensure that `pos` is still in range up to the `width` so printing 100%
works also for bigger images. After printing 100% progress reset it to
zero, so that next progressbar can be started.
Signed-off-by: Pali Rohár
Reviewed-by: Marek Behún
---
tools/kwboot.c | 9 +++--
1
Hi Tom, Jagan,
in July I resent the series
Fix `mtd erase` when used with mtdpart
https://patchwork.ozlabs.org/project/uboot/list/?series=253565=*
There was a build error in CI, more info at
https://lists.denx.de/pipermail/u-boot/2021-July/455851.html
The CI link mentioned
From: Marek Behún
After getting MTD device via get_mtd_device_nm(), we need to put it with
put_mtd_device(), otherwise we get
Removing MTD device #0 (mx25l6405d) with use count 1
before booting kernel.
Signed-off-by: Marek Behún
---
board/CZ.NIC/turris_omnia/turris_omnia.c | 3 +++
1 file
From: Marek Behún
This is a non-functional change that should make the code more readable.
Signed-off-by: Marek Behún
---
tools/kwboot.c | 10 --
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/tools/kwboot.c b/tools/kwboot.c
index 7f231c0823..2e5684b91c 100644
From: Pali Rohár
This change is required to implement other features in kwboot.
Split sending header and data parts of the image into two stages.
Signed-off-by: Pali Rohár
[ refactored ]
Signed-off-by: Marek Behún
---
tools/kwbimage.h | 8 +++--
tools/kwboot.c | 84
From: Marek Behún
When executing header code (which contains U-Boot SPL in most cases),
wait 10s after every non-xmodem character received (i.e. printed by
U-Boot SPL) before timing out.
Sometimes DDR training, which runs in SPL, may be slow.
Signed-off-by: Marek Behún
---
tools/kwboot.c
BootROM only in this case.
Signed-off-by: Pali Rohár
[ refactored & simplified ]
Signed-off-by: Marek Behún
---
tools/kwboot.c | 70 ++
1 file changed, 53 insertions(+), 17 deletions(-)
diff --git a/tools/kwboot.c b/tools/kwboot.c
i
From: Pali Rohár
After kwboot sends EOT, BootROM sends back ACK. Add code for handling
this and retry sending EOT on error.
Signed-off-by: Pali Rohár
[ refactored ]
Signed-off-by: Marek Behún
---
tools/kwboot.c | 62 --
1 file changed, 45
From: Marek Behún
There is no separation between output from the code from binary header
(U-Boot SPL in most cases) and subsequent kwboot output.
Print '\n' to make distinguishing these two easier.
Signed-off-by: Marek Behún
---
tools/kwboot.c | 11 +--
1 file changed, 9 insertions
From: Pali Rohár
When progress was not completed, current terminal position is in progress
bar. So print newline before printing error message to make error message
more readable.
Signed-off-by: Pali Rohár
Reviewed-by: Marek Behún
---
tools/kwboot.c | 1 +
1 file changed, 1 insertion
From: Marek Behún
Update man page for the kwboot utility.
Signed-off-by: Marek Behún
---
doc/kwboot.1 | 60 ++--
1 file changed, 39 insertions(+), 21 deletions(-)
diff --git a/doc/kwboot.1 b/doc/kwboot.1
index 1e9ca268f7..acdea891d9 100644
()
and pcie_advk_write_config() functions to correctly calculate real
Aardvark bus number of the target device from U-Boot's bus number as:
busno = PCI_BUS(bdf) - dev_seq(bus)
Signed-off-by: Pali Rohár
Reviewed-by: Marek Behún
---
drivers/pci/pci-aardvark.c | 143 -
1
From: Pali Rohár
Now that PCI Bridge is working for the PCIe Root Port, U-Boot's PCI_PNP
code automatically enables memory access and bus mastering when needed.
We do not need to enable it when setting the HW up.
Signed-off-by: Pali Rohár
Reviewed-by: Marek Behún
---
drivers/pci/pci
is provided in read-only
Root Capabilities register. So manually inject this CRSVIS bit into read
response for that register.
Signed-off-by: Pali Rohár
Reviewed-by: Marek Behún
---
drivers/pci/pci-aardvark.c | 26 ++
include/pci.h | 4
2 files changed, 26
From: Pali Rohár
Aardvark reports Disabled and Hot Reset LTSSM states as values >= 0x20.
Link is not up in these states, so fix pcie_advk_link_up() function.
Signed-off-by: Pali Rohár
Reviewed-by: Marek Behún
---
drivers/pci/pci-aardvark.c | 3 ++-
1 file changed, 2 insertions(+), 1 delet
From: Marek Behún
Hello Stefan,
Pali has worked on some more enhancements for Armada 3720 PCIe driver
(Aardvark).
The main change is adding support for accessing configuration space of
the PCI Bridge on the PCIe Root Port. Linux does something similar with
pci-bridge-emul.
Marek
Marek Behún
From: Marek Behún
Update indentation in driver's private structure.
Signed-off-by: Marek Behún
---
drivers/pci/pci-aardvark.c | 14 +++---
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/pci/pci-aardvark.c b/drivers/pci/pci-aardvark.c
index 53e9e23d4a..b4f350ca2c
From: Marek Behún
The spi_nor_erase() function does not check return value of the
write_enable() call. Fix this.
Signed-off-by: Marek Behún
Reviewed-by: Simon Glass
Reviewed-by: Jagan Teki
Tested-by: Masami Hiramatsu
---
drivers/mtd/spi/spi-nor-core.c | 4 +++-
1 file changed, 3 insertions
From: Marek Behún
The _erase() method of the mtdpart driver, part_erase(), currently
implements offset shifting (for given mtdpart partition) in a weird way:
1. part_erase() adds partition offset to block address
2. parent driver's _erase() method is called
3. parent driver's _erase
From: Marek Behún
The spi_nor_erase() function does not call mtd_erase_callback() as it
should.
The mtdpart code currently implements the subtraction of partition
offset in mtd_erase_callback().
This results in partition offset being added prior calling
spi_nor_erase(), but not subtracted back
From: Marek Behún
The cleanup code of the spi_nor_erase() function overwrites the ret
variable with return value of clean_bar(), even if the ret variable is
already set. Fix this.
Signed-off-by: Marek Behún
Reviewed-by: Simon Glass
Tested-by: Masami Hiramatsu
---
drivers/mtd/spi/spi-nor
From: Marek Behún
This check is already done in mtdcore's mtd_erase(), no reason to do
this here as well.
Signed-off-by: Marek Behún
Reviewed-by: Simon Glass
Tested-by: Masami Hiramatsu
---
drivers/mtd/spi/spi-nor-core.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/mtd/spi
From: Marek Behún
May it possible to interrupt the spi_nor_erase() function.
Signed-off-by: Marek Behún
Reviewed-by: Simon Glass
Tested-by: Masami Hiramatsu
---
drivers/mtd/spi/spi-nor-core.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers
From: Marek Behún
The cleanup code of spi_nor_erase() function calls write_disable(), but
does not return it's return value even in case of failure. Fix this.
Signed-off-by: Marek Behún
Reviewed-by: Simon Glass
Tested-by: Masami Hiramatsu
---
drivers/mtd/spi/spi-nor-core.c | 4 +++-
1 file
From: Marek Behún
Use the cleanup codepath of spi_nor_erase() also in the event of failure
of writing the BAR register.
Signed-off-by: Marek Behún
Reviewed-by: Simon Glass
Reviewed-by: Jagan Teki
Tested-by: Masami Hiramatsu
---
drivers/mtd/spi/spi-nor-core.c | 2 +-
1 file changed, 1
From: Marek Behún
The original cover letter said:
this patch series fixes the `mtd erase` command when used with mtdpart
with a partition of non-zero offset.
Currently when the `mtd erase` command is used for such a partition,
it does not erase all blocks. Instead after a block is erased
From: Marek Behún
There were several changes for this structure but the documentation was
not changed at the time. Fix this.
Signed-off-by: Marek Behún
---
drivers/pci/pci-aardvark.c | 17 +
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/drivers/pci/pci
From: Marek Behún
The original purpose of mtd_erase_callback() in Linux at the time it was
imported to U-Boot, was to inform the caller that erasing is done (since
it was an asynchronous operation).
All supplied callback methods in U-Boot do nothing, but the
mtd_erase_callback() function
From: Marek Behún
Instead of declaring CONFIG_SPL_DRIVERS_MISC in board config header,
select it in Kconfig.
Signed-off-by: Marek Behún
---
arch/arm/mach-mvebu/Kconfig| 1 +
include/configs/turris_omnia.h | 1 -
2 files changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/mach
From: Marek Behún
On mvebu this is defined if and only if !ARM64.
Otherwise it is defined for boards with ARCH_MX23, ARCH_TEGRA and
ARCH_ZYNQ, and also for SOC_AR934X (tplink_wdr4300).
Signed-off-by: Marek Behún
---
arch/arm/mach-kirkwood/include/mach/config.h | 7 ---
arch/mips/mach
From: Marek Behún
In preparation for moving this option to Kconfig, rename it to be
consistent with other USB EHCI Kconfig options.
Signed-off-by: Marek Behún
---
arch/arm/mach-kirkwood/include/mach/config.h | 2 +-
drivers/usb/host/ehci-hcd.c | 2 +-
include/configs
From: Marek Behún
This option is only used for
mx23evk_defconfig
mx23_olinuxino_defconfig
which are the only i.MX23 boards.
Add depend on ARCH_MX23 and default to y.
Signed-off-by: Marek Behún
---
drivers/usb/host/Kconfig | 7 +++
include/configs/mxs.h| 1 -
scripts
From: Marek Behún
This config option doesn't do anything.
nas220 uses USB_EHCI_MARVELL.
Signed-off-by: Marek Behún
---
include/configs/nas220.h | 1 -
scripts/config_whitelist.txt | 1 -
2 files changed, 2 deletions(-)
diff --git a/include/configs/nas220.h b/include/configs/nas220.h
> > > > +config MVEBU_MAC_HW_INFO_OFFSET
> > > > + hex "Marvell hw_info (mac) SPI flash offset"
> > > > + depends on MVEBU_MAC_HW_INFO
> > > > + default 0x3E
> > > > + help
> > > > + This option defines the SPI flash offset of the Marvell
> > > > + hw_info area.
From: Marek Behún
Currently we always overwrite ethaddrs with those from EEPROM.
In order to allow user to use a cloned MAC address in U-Boot, change the
code so that it sets ethaddr variables only if they aren't set or are
invalid.
Signed-off-by: Marek Behún
---
board/CZ.NIC/turris_omnia
From: Marek Behún
Instead of declaring CONFIG_SYS_MALLOC_SIMPLE dependant on
CONFIG_SPL_BUILD in board config header, select
CONFIG_SPL_SYS_MALLOC_SIMPLE in Kconfig.
Signed-off-by: Marek Behún
---
arch/arm/mach-mvebu/Kconfig| 1 +
include/configs/turris_omnia.h | 4
2 files changed
From: Marek Behún
We are printing board information in last_stage_init(), but U-Boot has
dedicated function, show_board_info(), for this.
Move code which prints board information (board version, serial number,
module topology, ...) to show_board_info().
Signed-off-by: Marek Behún
---
board
From: Marek Behún
Currently we overwrite ethaddr and eth1addr only if these variables
don't exist.
Better overwrite them even if the env variable exists, but is invalid -
eth_env_get_enetaddr_by_index() checks for validity.
Refactor the code to use a for cycle.
Signed-off-by: Marek Behún
From: Marek Behún
We are printing board information in checkboard() function, which is
called from the default weak implementation of show_board_info().
Rename checkboard() to show_board_info(). This throws away the weak
implementation of show_board_info().
Signed-off-by: Marek Behún
From: Marek Behún
Handle reset button even if we can't configure modules.
This happens if we fail retrieving reset GPIO with which we can reset
the modules.
(Note that this GPIO is different from reset button GPIO.)
Signed-off-by: Marek Behún
---
board/CZ.NIC/turris_mox/turris_mox.c | 3
From: Marek Behún
Reorder the definitions in Turris MOX' board config header, drop the
comment relics from when this file was copied, fix indentation.
Signed-off-by: Marek Behún
---
include/configs/turris_mox.h | 61 +---
1 file changed, 22 insertions(+), 39
From: Marek Behún
Move the config option CONFIG_I2C_MV to a Kconfig option
CONFIG_SYS_I2C_MV and move the default definition from config header
files into defconfigs.
Signed-off-by: Marek Behún
---
configs/mvebu_db-88f3720_defconfig | 1 +
configs/mvebu_espressobin-88f3720_defconfig
From: Marek Behún
This option is not used anywhere.
Signed-off-by: Marek Behún
---
include/configs/SBx81LIFKW.h| 5 -
include/configs/SBx81LIFXCAT.h | 5 -
include/configs/edminiv2.h | 6 --
include/configs/mv-common.h | 1 -
include/configs
From: Marek Behún
Hi Stefan,
these are some small changes for Turris Omnia and MOX, mainly moving
options from board config header to Kconfig, but also some other.
Two patchs are touching other mvebu boards.
Marek
Marek Behún (12):
arm: mvebu: turris_mox: Drop SF_DEFAULT_MODE from
From: Marek Behún
Move config options CONFIG_LAST_STAGE_INIT and
CONFIG_DISPLAY_BOARDINFO_LATE to turris_mox_defconfig.
Signed-off-by: Marek Behún
---
configs/turris_mox_defconfig | 2 ++
include/configs/turris_mox.h | 7 ---
2 files changed, 2 insertions(+), 7 deletions(-)
diff --git
From: Marek Behún
This config option defaults to 0, so it is redundant in defconfig.
Signed-off-by: Marek Behún
---
configs/turris_mox_defconfig | 1 -
1 file changed, 1 deletion(-)
diff --git a/configs/turris_mox_defconfig b/configs/turris_mox_defconfig
index 82ad68b6a1..6ff551e477 100644
From: Marek Behún
Move the following functions from cmd/nvedit.c to env/common.c:
env_set_ulong()
env_set_hex()
env_get_hex()
eth_env_get_enetaddr()
eth_env_set_enetaddr()
env_get()
from_env()
env_get_f()
env_get_ulong()
since these functions are not specific for U-Boot's CLI
From: Marek Behún
Currently the env_get_f() function's return value behaves weirdly: it
returns the number of bytes written into `buf`, but whether this is
excluding the terminating NULL-byte or including it depends on whether
there was enough space in `buf`.
Change the function to always
From: Marek Behún
The `nxt` variable actually points to the terminating null-byte of the
current env var, and the next env var is at `nxt + 1`, not `nxt`. So a
better name for this variable is `end`.
Signed-off-by: Marek Behún
---
cmd/nvedit.c | 8
1 file changed, 4 insertions(+), 4
From: Marek Behún
This function is a relic from the past when environment was read from
underlying device one character at a time.
It is used only in the case when getting an environemnt variable prior
relocation, and the function is simple enough to be inlined there.
Since env_get_char
From: Marek Behún
Since we no longer use env_get_char() to access n-th character of
linearized environment data, but rather access the arrays themselves, we
can convert the iteration to use string pointers instead of position
indexes.
Signed-off-by: Marek Behún
---
cmd/nvedit.c | 34
From: Marek Behún
Test non-NULL name immediately, not in env_match().
Signed-off-by: Marek Behún
---
cmd/nvedit.c | 7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/cmd/nvedit.c b/cmd/nvedit.c
index 9f0caceadf..7c99a693ea 100644
--- a/cmd/nvedit.c
+++ b/cmd/nvedit.c
From: Marek Behún
Copy the value of the found variable into given buffer with memcpy()
instead of ad-hoc code.
Signed-off-by: Marek Behún
---
cmd/nvedit.c | 18 ++
1 file changed, 6 insertions(+), 12 deletions(-)
diff --git a/cmd/nvedit.c b/cmd/nvedit.c
index 8989c85d20
From: Marek Behún
There is a possible overflow in env_match(): if environment contains
a terminating null-byte before '=' character (i.e. environment is
broken), the env_match() function can access data after the terminating
null-byte from parameter pointer.
Example: if env_get_char() returns
From: Marek Behún
This function was used by other parts of U-Boot in the past when
environment was read from underlying device one character at a time.
This is not the case anymore.
Signed-off-by: Marek Behún
---
cmd/nvedit.c | 30 +++---
include/env.h | 11
From: Marek Behún
Commit b2cdef4861be ("env: restore old env_get_char() behaviour")
dropped the .get_char() method from struct env_driver, but left the two
existing implementations (eeprom and nvram) in case someone would use
them by overwriting weak function env_get_char_spec
From: Marek Behún
This comment is not true since commit 6215bd4c1fd6 ("api: Use hashtable
function for API_env_enum").
Signed-off-by: Marek Behún
---
examples/api/glue.c | 5 -
1 file changed, 5 deletions(-)
diff --git a/examples/api/glue.c b/examples/api/glue.c
index
From: Marek Behún
Do we really allow zero-length variable name? I guess not.
Signed-off-by: Marek Behún
---
cmd/nvedit.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cmd/nvedit.c b/cmd/nvedit.c
index 742e0924af..e2e8a38b5d 100644
--- a/cmd/nvedit.c
+++ b/cmd/nvedit.c
On Mon, 11 Oct 2021 18:16:02 +0200
Luka Kovacic wrote:
>> eth1_mac_addr: eth1addr {
>> compatible = "mac-address-string";
>> name = "eth1addr";
>> };
>
> I don't see any better approach than just matching strings to retrieve
> values for specific keys (for
On Tue, 12 Oct 2021 13:04:56 +0200
Marek Behún wrote:
> - while (*s1 == env_get_char(i2++))
> + while (*s1 != '\0' && *s1 == env_get_char(i2++))
This check has to be done in the other order:
while (*s1 == env_get_char(i2++) && *s1 != '\0')
so that i2 gets i
From: Marek Behún
This function actually returns:
- the number of bytes written into @buf excluding the terminating
NULL-byte, if there was enough space in @buf
- the number of bytes written into @buf including the terminating
NULL-byte, if there wasn't enough space in @buf
- -1
From: Marek Behún
Hi Simon, Tom,
env_get_char() is a relic from the past when env was read char-by-char
from underlying device. Currently it only accesses in-memory arrays.
We can remove it and access the arrays directly. This simplifies the old
code of env_get_f().
Changes since v1:
- use
should be used by the ethernet controller node.
Signed-off-by: Marek Behún
---
.../bindings/nvmem/denx,u-boot-env.yaml | 88 +++
include/dt-bindings/nvmem/u-boot-env.h| 18
2 files changed, 106 insertions(+)
create mode 100644 Documentation/devicetree/bindings
From: Marek Behún
Move the following functions from cmd/nvedit.c to env/common.c:
env_set_ulong()
env_set_hex()
env_get_hex()
eth_env_get_enetaddr()
eth_env_set_enetaddr()
env_get()
from_env()
env_get_f()
env_get_ulong()
since these functions are not specific for U-Boot's CLI
From: Marek Behún
There is a possible overflow in env_match(): if environment contains
a terminating null-byte before '=' character (i.e. environment is
broken), the env_match() function can access data after the terminating
null-byte from parameter pointer.
Example: if env_get_char() returns
From: Marek Behún
Since we no longer use env_get_char() to access n-th character of
linearized environment data, but rather access the arrays themselves, we
can convert the iteration to use string pointers instead of position
indexes.
Signed-off-by: Marek Behún
---
cmd/nvedit.c | 37
From: Marek Behún
This comment is not true since commit 6215bd4c1fd6 ("api: Use hashtable
function for API_env_enum").
Signed-off-by: Marek Behún
---
examples/api/glue.c | 5 -
1 file changed, 5 deletions(-)
diff --git a/examples/api/glue.c b/examples/api/glue.c
index
From: Marek Behún
Test non-NULL name immediately, not in env_match().
Signed-off-by: Marek Behún
---
cmd/nvedit.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/cmd/nvedit.c b/cmd/nvedit.c
index 4664b7b872..412918a000 100644
--- a/cmd/nvedit.c
+++ b/cmd/nvedit.c
From: Marek Behún
This function is a relic from the past when environment was read from
underlying device one character at a time.
It is used only in the case when getting an environemnt variable prior
relocation, and the function is simple enough to be inlined there.
Since env_get_char
801 - 900 of 1638 matches
Mail list logo