[PATCH u-boot v2] Enable FIT image support and FDT loading for AST2400/AST2500
Joel Stanley
joel at jms.id.au
Wed Nov 2 17:31:34 AEDT 2016
Hi Rick,
On Wed, Nov 2, 2016 at 3:56 PM, Rick Altherr <raltherr at google.com> wrote:
> FIT is the modern u-boot native image format for kernels, device trees,
> and ramdisks. Enabling FIT only compiles in support for the image
> format. For these devices, the kernel+dtb and ramdisk are loaded from
> separate locations in flash and can be any mix of legacy or FIT images.
> When using FIT images, the dtb is stored as a separate entry that
> requires CONFIG_OF_LIBFDT to load it into RAM and pass it to the kernel.
>
> Tested under qemu with both legacy and FIT kernel+dtb images for
> palmetto and witherspoon.
The changes look good to me.
Is the FIT support in v2016.07 new enough for us? Is there any reason
to move to a v2016.09 base?
It does introduce a warning in a hack we carry for loading the
initramfs, which I think points to a legitimate issue:
common/image.c: In function ‘boot_get_ramdisk’:
common/image.c:1078:4: warning: ‘rd_load’ may be used uninitialized in
this function [-Wmaybe-uninitialized]
memmove ((void *)rd_load, (uchar *)rd_data, rd_len);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This code an Aspeed hack we carry. It is required to copy the
initramfs from flash. Cedric was doing some investigation into why we
need the hack, and it appears to be an upstream bug.
If I read the code correctly, prior to enabling FIT we only accepted
IMAGE_FORMAT_LEGACY. If we move the hack to be part of that case we
should be ok, as we don't need to do the hack when loading from FIT.
Can you try that and add a second patch to your series that moves the hack?
Finally, I took a look at the impact on code size. I used
arm-linux-gnueabi-gcc (Ubuntu 6.2.0-5ubuntu12) 6.2.0 20161005 from
Ubuntu 16.10.
$ size u-boot
text data bss dec hex filename
151636 4576 61620 217832 352e8 u-boot
222302 7952 62768 293022 4789e u-boot
Wow, the FIT image is fatter. What does FIT support pull in that
increases the code size so much?
The on disk size suggests that size isn't lying:
Unfit: 156012
FIT: 230056
Did we expect the change to be that large?
This is not a blocker, as we currently set aside 384KB for u-boot.
Cheers,
Joel
>
> Signed-off-by: Rick Altherr <raltherr at google.com>
> ---
> Changes since v1:
> - Fixed commit message grammar
> - Clarified config option needed for FDT loading
> ---
> configs/ast_g4_ncsi_defconfig | 3 +++
> configs/ast_g4_phy_defconfig | 3 +++
> configs/ast_g5_ncsi_defconfig | 3 +++
> configs/ast_g5_phy_defconfig | 3 +++
> 4 files changed, 12 insertions(+)
>
> diff --git a/configs/ast_g4_ncsi_defconfig b/configs/ast_g4_ncsi_defconfig
> index 4ee71c5..70cd3c2 100644
> --- a/configs/ast_g4_ncsi_defconfig
> +++ b/configs/ast_g4_ncsi_defconfig
> @@ -3,5 +3,8 @@ CONFIG_TARGET_AST_G4=y
> CONFIG_SYS_PROMPT="ast# "
> CONFIG_CMD_DHCP=y
> CONFIG_CMD_PING=y
> +CONFIG_FIT=y
> +CONFIG_FIT_VERBOSE=y
> +CONFIG_OF_LIBFDT=y
> CONFIG_SPI_FLASH=y
> CONFIG_SYS_NS16550=y
> diff --git a/configs/ast_g4_phy_defconfig b/configs/ast_g4_phy_defconfig
> index 61fd69b..468fbc4 100644
> --- a/configs/ast_g4_phy_defconfig
> +++ b/configs/ast_g4_phy_defconfig
> @@ -4,5 +4,8 @@ CONFIG_ASPEED_NET_PHY=y
> CONFIG_SYS_PROMPT="ast# "
> CONFIG_CMD_DHCP=y
> CONFIG_CMD_PING=y
> +CONFIG_FIT=y
> +CONFIG_FIT_VERBOSE=y
> +CONFIG_OF_LIBFDT=y
> CONFIG_SPI_FLASH=y
> CONFIG_SYS_NS16550=y
> diff --git a/configs/ast_g5_ncsi_defconfig b/configs/ast_g5_ncsi_defconfig
> index 6d11afb..8a9c297 100644
> --- a/configs/ast_g5_ncsi_defconfig
> +++ b/configs/ast_g5_ncsi_defconfig
> @@ -3,5 +3,8 @@ CONFIG_TARGET_AST_G5=y
> CONFIG_SYS_PROMPT="ast# "
> CONFIG_CMD_DHCP=y
> CONFIG_CMD_PING=y
> +CONFIG_FIT=y
> +CONFIG_FIT_VERBOSE=y
> +CONFIG_OF_LIBFDT=y
> CONFIG_SPI_FLASH=y
> CONFIG_SYS_NS16550=y
> diff --git a/configs/ast_g5_phy_defconfig b/configs/ast_g5_phy_defconfig
> index 20f62e0..fd450b9 100644
> --- a/configs/ast_g5_phy_defconfig
> +++ b/configs/ast_g5_phy_defconfig
> @@ -4,5 +4,8 @@ CONFIG_ASPEED_NET_PHY=y
> CONFIG_SYS_PROMPT="ast# "
> CONFIG_CMD_DHCP=y
> CONFIG_CMD_PING=y
> +CONFIG_FIT=y
> +CONFIG_FIT_VERBOSE=y
> +CONFIG_OF_LIBFDT=y
> CONFIG_SPI_FLASH=y
> CONFIG_SYS_NS16550=y
> --
> 2.8.0.rc3.226.g39d4020
>
> _______________________________________________
> openbmc mailing list
> openbmc at lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/openbmc
More information about the openbmc
mailing list