Skip to contentSkip to conversation

Please pull u-boot-marvell/master

DISCUSSION Stefan Roese 3 participants 6 messages Jul 31, 2021 – Aug 1, 2021

lore
Share & tools
lore
#0 lore raw

Hi Tom,

please pull the next batch of Marvell MVEBU related patches. Here the summary log:

----------------------------------------------------------------
- kwboot / kwbimage improvements reducing image size (Pali & Marek)
- a37xx: pinctrl: Correct PWM pins definitions (Marek)
- Convert the Dreamplug Ethernet and SATA to Driver Model (Tony)
- serial: a37xx: DEBUG_UART improvements / fixes (Pali)
----------------------------------------------------------------

Here the Azure build, without any issues:

https://dev.azure.com/sr0718/u-boot/_build/results?buildId=104&view=results

Thanks,
Stefan

The following changes since commit 15f7e0dc01d8a851fb1bfbf0e47eab5b67ed26b3:

Merge branch '2021-07-28-assorted-fixes' (2021-07-29 12:10:55 -0400)

are available in the Git repository at:

[email protected]:u-boot/custodians/u-boot-marvell.git

for you to fetch changes up to 2cc4be280c259ac1e8e74c643c72e0331266056f:

serial: a37xx: Do not call get_ref_clk() in _debug_uart_init()
(2021-07-31 09:59:59 +0200)

----------------------------------------------------------------
Marek Behún (3):
tools: kwbimage: Add constant for SDIO bootfrom
tools: kwbimage: Cosmetic fix - remove redundant space character
arm64: a37xx: pinctrl: Correct PWM pins definitions

Pali Rohár (41):
tools: kwbimage: Fix compilation without CONFIG_SYS_U_BOOT_OFFS
tools: kwbimage: Simplify aligning and calculating checksum
tools: kwbimage: Align SPI and NAND images to 256 bytes
tools: kwbimage: Fix generation of SATA, SDIO and PCIe images
tools: kwbimage: Don't crash when binary file name does not
contain '/'
tools: kwbimage: Fix check for v0 extended header checksum
tools: kwbimage: Validate extended headers of v1 images
tools: kwbimage: Validate data checksum of v1 images
tools: kwbimage: Print size of binary header in
kwbimage_print_header()
tools: kwbimage: Use -a parameter (load address) for v1 images
tools: kwbimage: Change maximum number of arguments in binary
header to 256
tools: kwbimage: Fix calculating size of binary header
tools: kwbimage: Add support for more BINARY headers
tools: kwbimage: Don't parse PAYLOAD keyword
tools: kwbimage: Add support for DATA command also for v1 images
tools: kwbimage: Add support for a new DATA_DELAY command
tools: kwbimage: Do not hide usage of secure header under
CONFIG_ARMADA_38X
tools: kwbimage: Mark all BootROM structures __packed
tools: dumpimage: Fix crashing when trying to extract data from
kwbimage
tools: dumpimage: Show error message when trying to extract data
from kwbimage
tools: kwboot: Fix wrong parameter passed to read()
tools: kwboot: Fix restoring terminal
tools: kwboot: Print trailing newline after terminal is terminated
tools: kwboot: Cosmetic fix - add missing curly brackets
tools: kwboot: Check for v1 header size
tools: kwboot: Fix checking image header version
arm: mvebu: Fix return_to_bootrom()
arm: mvebu: Mark return_to_bootrom() as a noreturn function
arm: mvebu: Implement return_to_bootrom() via U-Boot's SPL framework
arm: mvebu: Use U-Boot's SPL BootROM framework for booting from
NAND/UART
SPL: Add support for specifying offset between header and image
SPL: Add support for parsing board / BootROM specific image types
arm: mvebu: Load U-Boot proper binary in SPL code based on
kwbimage header
arm: mvebu: Remove legacy U-Boot header from kwbimage v1 files
tools: kwbimage: Remove v1 kwbimage SPL padding to
CONFIG_SYS_U_BOOT_OFFS bytes
arm: mvebu: Remove unused macro CONFIG_SYS_U_BOOT_OFFS
arm: mvebu: gdsys: Remove custom spl_board_init()
kwbimage: Add support for extracting images via dumpimage tool
kwbimage: Update help message about how to extract from an
existing image
serial: a37xx: Use CONFIG_BAUDRATE for initializing early debug UART
serial: a37xx: Do not call get_ref_clk() in _debug_uart_init()

Tony Dinh (3):
arm: kirkwood: Dreamplug: Add DM Ethernet and DM SATA configs
arm: kirkwood: Dreamplug: Use Ethernet PHY name and address from
device tree
arm: kirkwood: Dreamplug: Add DM SATA and remove IDE configs

 Makefile                                           |   2 +-
 arch/arm/mach-mvebu/Kconfig                        |  26 +-
 arch/arm/mach-mvebu/include/mach/cpu.h             |   2 +-
 arch/arm/mach-mvebu/lowlevel_spl.S                 |   3 +-
 arch/arm/mach-mvebu/spl.c                          | 248 ++++++++++--
 board/Marvell/dreamplug/dreamplug.c                |  62 ++-
 board/gdsys/a38x/Makefile                          |   2 +-
 board/gdsys/a38x/spl.c                             |  20 -
 board/kobol/helios4/Kconfig                        |   5 -
 board/solidrun/clearfog/Kconfig                    |   5 -
 common/spl/Kconfig                                 |   4 +-
 common/spl/spl.c                                   |   9 +
 common/spl/spl_mmc.c                               |  16 +-
 common/spl/spl_sata.c                              |  12 +-
 common/spl/spl_spi.c                               |   2 +-
 configs/clearfog_defconfig                         |   1 -
 configs/controlcenterdc_defconfig                  |   2 -
 configs/db-88f6720_defconfig                       |   1 -
 configs/db-88f6820-amc_defconfig                   |   1 -
 configs/db-88f6820-gp_defconfig                    |   2 -
 configs/db-mv784mp-gp_defconfig                    |   1 -
 configs/dreamplug_defconfig                        |   4 +
 configs/ds414_defconfig                            |   1 -
 configs/helios4_defconfig                          |   1 -
 configs/maxbcm_defconfig                           |   1 -
 configs/theadorable_debug_defconfig                |   1 -
 configs/turris_omnia_defconfig                     |   1 -
 configs/x530_defconfig                             |   1 -
 .../pinctrl/marvell,armada-37xx-pinctrl.txt        |   8 +-
 drivers/pinctrl/mvebu/pinctrl-armada-37xx.c        |  17 +-
 drivers/serial/serial_mvebu_a3700.c                |   9 +-
 include/configs/clearfog.h                         |   7 +-
 include/configs/controlcenterdc.h                  |   9 -
 include/configs/db-88f6720.h                       |   3 -
 include/configs/db-88f6820-amc.h                   |   5 -
 include/configs/db-88f6820-gp.h                    |   7 -
 include/configs/db-mv784mp-gp.h                    |   3 -
 include/configs/dreamplug.h                        |  12 +-
 include/configs/ds414.h                            |   5 -
 include/configs/helios4.h                          |   7 +-
 include/configs/theadorable.h                      |   3 -
 include/configs/turris_omnia.h                     |   7 -
 include/configs/x530.h                             |   3 -
 include/spl.h                                      |   1 +
 scripts/config_whitelist.txt                       |   1 -
 tools/Makefile                                     |   8 -
 tools/kwbimage.c                                   | 437 
+++++++++++++++------
 tools/kwbimage.h                                   |  54 ++-
 tools/kwboot.c                                     |  24 +-
 49 files changed, 730 insertions(+), 336 deletions(-)
 delete mode 100644 board/gdsys/a38x/spl.c
#1 lore raw
Quoted 4 lines · Stefan Roese

Hi Tom,

please pull the next batch of Marvell MVEBU related patches. Here the summary log:

First off, I've applied the whole series to u-boot/master and pushed.

Second, I see from:
commit 5fce2875569d6e859443af7af3477c3aebfee383

Author: Pali Rohár <[email protected]>
Date:   Fri Jul 23 11:14:27 2021 +0200

SPL: Add support for specifying offset between header and image

That a number of boards are now doing:
variscite_dart6ul: spl/u-boot-spl:all +144 spl/u-boot-spl:text +144
spl-u-boot-spl: add: 3/0, grow: 2/-1 bytes: 142/-4 (138)
function old new delta
memmove - 42 +42
spl_mmc_load 320 356 +36
__aeabi_uidivmod - 24 +24
__aeabi_idivmod - 24 +24
spl_parse_image_header 24 40 +16
board_init_r 220 216 -4

Which I think is because we need to use do_div and so rather than '/' and '%' directly in the code. Thanks!

Signature · 1 line
Tom
#2 lore raw
Quoted 27 lines · Tom Rini
Quoted 4 lines · Stefan Roese

Hi Tom,

please pull the next batch of Marvell MVEBU related patches. Here the summary log:

First off, I've applied the whole series to u-boot/master and pushed.

Second, I see from:
commit 5fce2875569d6e859443af7af3477c3aebfee383

Author: Pali Rohár <[email protected]>
Date:   Fri Jul 23 11:14:27 2021 +0200

SPL: Add support for specifying offset between header and image

That a number of boards are now doing:
variscite_dart6ul: spl/u-boot-spl:all +144 spl/u-boot-spl:text +144
spl-u-boot-spl: add: 3/0, grow: 2/-1 bytes: 142/-4 (138)
function old new delta
memmove - 42 +42
spl_mmc_load 320 356 +36
__aeabi_uidivmod - 24 +24
__aeabi_idivmod - 24 +24
spl_parse_image_header 24 40 +16
board_init_r 220 216 -4

Quoted 2 lines

Which I think is because we need to use do_div and so rather than '/' and '%' directly in the code. Thanks!

Pali, could you please take a look at this?

Thanks,
Stefan

#3 lore raw
Quoted 28 lines · On Sunday 01 August 2021 07:26:51 Stefan Roese wrote:
Quoted 27 lines · Tom Rini
Quoted 4 lines · Stefan Roese

Hi Tom,

please pull the next batch of Marvell MVEBU related patches. Here the summary log:

First off, I've applied the whole series to u-boot/master and pushed.

Second, I see from:
commit 5fce2875569d6e859443af7af3477c3aebfee383

Author: Pali Rohár <[email protected]>
Date:   Fri Jul 23 11:14:27 2021 +0200

SPL: Add support for specifying offset between header and image

That a number of boards are now doing:
variscite_dart6ul: spl/u-boot-spl:all +144 spl/u-boot-spl:text +144
spl-u-boot-spl: add: 3/0, grow: 2/-1 bytes: 142/-4 (138)
function old new delta
memmove - 42 +42
spl_mmc_load 320 356 +36
__aeabi_uidivmod - 24 +24
__aeabi_idivmod - 24 +24
spl_parse_image_header 24 40 +16
board_init_r 220 216 -4

Quoted 4 lines
Quoted 2 lines

Which I think is because we need to use do_div and so rather than '/' and '%' directly in the code. Thanks!

Pali, could you please take a look at this?

And what we can do here? 32-bit arm does not have 32-bit division instruction, so it is needed to use some sort of *idiv* function.

do_div() is macro which is doing 64-bit division by using 32-bit C operations '/' and '%', therefore it does not help with anything as this code is doing 32-bit math (not 64-bit).

Moreover in do_div() implementation is already check that first passed argument is of 64-bit type, so we cannot use it for 32-bit values.

Also note that in files which are touched by this commit are already used 32-bit division operations via C '/' operator.

So I really do not know what is expected to do here...

Quoted 2 lines

Thanks,
Stefan

#4 lore raw
Quoted 41 lines · Pali Rohár
Quoted 28 lines · On Sunday 01 August 2021 07:26:51 Stefan Roese wrote:
Quoted 27 lines · Tom Rini
Quoted 4 lines · Stefan Roese

Hi Tom,

please pull the next batch of Marvell MVEBU related patches. Here the summary log:

First off, I've applied the whole series to u-boot/master and pushed.

Second, I see from:
commit 5fce2875569d6e859443af7af3477c3aebfee383

Author: Pali Rohár <[email protected]>
Date:   Fri Jul 23 11:14:27 2021 +0200

SPL: Add support for specifying offset between header and image

That a number of boards are now doing:
variscite_dart6ul: spl/u-boot-spl:all +144 spl/u-boot-spl:text +144
spl-u-boot-spl: add: 3/0, grow: 2/-1 bytes: 142/-4 (138)
function old new delta
memmove - 42 +42
spl_mmc_load 320 356 +36
__aeabi_uidivmod - 24 +24
__aeabi_idivmod - 24 +24
spl_parse_image_header 24 40 +16
board_init_r 220 216 -4

Quoted 4 lines
Quoted 2 lines

Which I think is because we need to use do_div and so rather than '/' and '%' directly in the code. Thanks!

Pali, could you please take a look at this?

And what we can do here? 32-bit arm does not have 32-bit division instruction, so it is needed to use some sort of *idiv* function.

do_div() is macro which is doing 64-bit division by using 32-bit C operations '/' and '%', therefore it does not help with anything as this code is doing 32-bit math (not 64-bit).

Quoted 7 lines

Moreover in do_div() implementation is already check that first passed argument is of 64-bit type, so we cannot use it for 32-bit values.

Also note that in files which are touched by this commit are already used 32-bit division operations via C '/' operator.

So I really do not know what is expected to do here...

Thanks for checking. I saw block stuff and that typically does involve a 64bit value somewhere along the way. So if the answer is:
- There's no 64-bit math here, really.
- There's no existing shift macros we can use instead (or that ends up being larger!)
- There's no existing shift macros we just need to import from the kernel.

Then we're good.

Signature · 1 line
Tom
#5 lore raw
Quoted 58 lines · On Sunday 01 August 2021 10:33:33 Tom Rini wrote:
Quoted 41 lines · Pali Rohár
Quoted 28 lines · On Sunday 01 August 2021 07:26:51 Stefan Roese wrote:
Quoted 27 lines · Tom Rini
Quoted 4 lines · Stefan Roese

Hi Tom,

please pull the next batch of Marvell MVEBU related patches. Here the summary log:

First off, I've applied the whole series to u-boot/master and pushed.

Second, I see from:
commit 5fce2875569d6e859443af7af3477c3aebfee383

Author: Pali Rohár <[email protected]>
Date:   Fri Jul 23 11:14:27 2021 +0200

SPL: Add support for specifying offset between header and image

That a number of boards are now doing:
variscite_dart6ul: spl/u-boot-spl:all +144 spl/u-boot-spl:text +144
spl-u-boot-spl: add: 3/0, grow: 2/-1 bytes: 142/-4 (138)
function old new delta
memmove - 42 +42
spl_mmc_load 320 356 +36
__aeabi_uidivmod - 24 +24
__aeabi_idivmod - 24 +24
spl_parse_image_header 24 40 +16
board_init_r 220 216 -4

Quoted 4 lines
Quoted 2 lines

Which I think is because we need to use do_div and so rather than '/' and '%' directly in the code. Thanks!

Pali, could you please take a look at this?

And what we can do here? 32-bit arm does not have 32-bit division instruction, so it is needed to use some sort of *idiv* function.

do_div() is macro which is doing 64-bit division by using 32-bit C operations '/' and '%', therefore it does not help with anything as this code is doing 32-bit math (not 64-bit).

Quoted 7 lines

Moreover in do_div() implementation is already check that first passed argument is of 64-bit type, so we cannot use it for 32-bit values.

Also note that in files which are touched by this commit are already used 32-bit division operations via C '/' operator.

So I really do not know what is expected to do here...

Thanks for checking. I saw block stuff and that typically does involve a 64bit value somewhere along the way. So if the answer is:
- There's no 64-bit math here, really.
- There's no existing shift macros we can use instead (or that ends up being larger!)
- There's no existing shift macros we just need to import from the kernel.

Quoted 1 line

Then we're good.

Well, "offset" member in mentioned commit is defined as "u32 offset". So it is not 64-bit for sure.

And about shift macros...
Problematic part is probably mmc->read_bl_len and stor_dev->blksz. I guess that storage block size is always power of two. Or are are some mmc / sata / usb / ... devices which have block / erase size which is not power of two?

So these two members (read_bl_len and blksz) could stored as log2() value and then code can use shifts instead of division.

But such change is big in U-Boot as it would touch whole U-Boot codebase.

Maybe mmc and storage maintainers could decide if such thing is useful and try to do it?

Quoted 3 lines
Signature · 2 lines
-- 
Tom