[U-Boot] [PATCH] spl: net: Add FIT image support over network boot
Lokesh Vutla
lokeshvutla at ti.com
Wed Feb 8 14:05:51 UTC 2017
On Wednesday 08 February 2017 04:29 AM, Andrew F. Davis wrote:
> FIT support in the net boot case is much like the RAM boot case in that
> we load our image to "load_addr" and pass a dummy read function into
> "spl_load_simple_fit()". As the load address is no longer hard-coded to
> the final execution address, RAW image loading will rely on "load_addr"
> pointing to the execution address as they should have before.
>
> Signed-off-by: Andrew F. Davis <afd at ti.com>
> ---
> common/spl/spl_net.c | 30 +++++++++++++++++++++++++++---
> 1 file changed, 27 insertions(+), 3 deletions(-)
>
> diff --git a/common/spl/spl_net.c b/common/spl/spl_net.c
> index 0fba0172ea..b7a4a89198 100644
> --- a/common/spl/spl_net.c
> +++ b/common/spl/spl_net.c
> @@ -11,19 +11,29 @@
> #include <errno.h>
> #include <spl.h>
> #include <net.h>
> +#include <libfdt.h>
>
> DECLARE_GLOBAL_DATA_PTR;
>
> +static ulong spl_net_load_read(struct spl_load_info *load, ulong sector,
> + ulong count, void *buf)
> +{
> + debug("%s: sector %lx, count %lx, buf %lx\n",
> + __func__, sector, count, (ulong)buf);
> + memcpy(buf, (void *)(load_addr + sector), count);
> + return count;
> +}
> +
> #if defined(CONFIG_SPL_ETH_SUPPORT) || defined(CONFIG_SPL_USBETH_SUPPORT)
> static int spl_net_load_image(struct spl_image_info *spl_image,
> struct spl_boot_device *bootdev)
> {
> + struct image_header *header = (struct image_header *)load_addr;
Just wondering what is the default load_addr or who sets load_addr
before doing tftp? have you verified both FIT and not FIT case?
Thanks and regards,
Lokesh
More information about the U-Boot
mailing list