mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: "Eric Bénard" <eric@eukrea.com>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 1/2] mx53-loco: provide the right header for serial downloader
Date: Thu, 11 Apr 2013 10:02:53 +0200	[thread overview]
Message-ID: <20130411080253.GI1906@pengutronix.de> (raw)
In-Reply-To: <1365603058-9368-1-git-send-email-eric@eukrea.com>

Hi Eric,

On Wed, Apr 10, 2013 at 04:10:57PM +0200, Eric Bénard wrote:
> this patch allows barebox to run when loaded on the iMX53QSB
> using the serial downloader.

What serial downloader do you use? We have a serial downloader here:

git://git.pengutronix.de/git/tools/imx-usb-loader.git

This one works by parsing the flash headers from the images and
executing them manually by doing register writes. It works with
the currently generated images just fine.

I though about integrating this tool into barebox. Part of the reason
for doing this is that this repository also contains a image generation
tool which could replace the compiler/linker mechanism we currently use
to generate i.MX images. Using a dedicated tool for this job seems more
flexible.

> 
> Signed-off-by: Eric Bénard <eric@eukrea.com>
> ---
>  arch/arm/boards/freescale-mx53-loco/flash_header.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/arch/arm/boards/freescale-mx53-loco/flash_header.c b/arch/arm/boards/freescale-mx53-loco/flash_header.c
> index dc1162b..5358f0b 100644
> --- a/arch/arm/boards/freescale-mx53-loco/flash_header.c
> +++ b/arch/arm/boards/freescale-mx53-loco/flash_header.c
> @@ -34,10 +34,17 @@ struct imx_flash_header_v2 __flash_header_section flash_header = {
>  	.header.length		= cpu_to_be16(32),
>  	.header.version		= IVT_VERSION,
>  
> +#ifdef CONFIG_ARCH_IMX_INTERNAL_BOOT_SERIAL
> +	.entry			= APP_DEST + 0x400,
> +	.dcd_ptr		= APP_DEST + offsetof(struct imx_flash_header_v2, dcd),
> +	.boot_data_ptr		= APP_DEST + offsetof(struct imx_flash_header_v2, boot_data),
> +	.self			= APP_DEST,
> +#else
>  	.entry			= APP_DEST + 0x1000,
>  	.dcd_ptr		= APP_DEST + 0x400 + offsetof(struct imx_flash_header_v2, dcd),
>  	.boot_data_ptr		= APP_DEST + 0x400 + offsetof(struct imx_flash_header_v2, boot_data),
>  	.self			= APP_DEST + 0x400,
> +#endif

We already have a FLASH_HEADER_OFFSET define which seems to solve half
of the problem. Extending the ifdefs already present int the header
file should work better.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2013-04-11  8:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-10 14:10 Eric Bénard
2013-04-10 14:10 ` [PATCH 2/2] i.MX53: add serial downloader bootsource Eric Bénard
2013-04-10 16:08 ` [PATCH 1/2] mx53-loco: provide the right header for serial downloader Jean-Christophe PLAGNIOL-VILLARD
2013-04-11  8:02 ` Sascha Hauer [this message]
2013-04-11  8:12   ` Eric Bénard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130411080253.GI1906@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=eric@eukrea.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox