mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <sha@pengutronix.de>
To: Trent Piepho <tpiepho@gmail.com>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] imx-image: Fix uninitialized add_barebox_header
Date: Thu, 27 May 2021 09:11:05 +0200	[thread overview]
Message-ID: <20210527071105.GC19819@pengutronix.de> (raw)
In-Reply-To: <20210526065856.368345-1-trent.piepho@igorinstitute.com>

On Tue, May 25, 2021 at 11:58:56PM -0700, Trent Piepho wrote:
> From: Trent Piepho <tpiepho@gmail.com>
> 
> It's set to 1 if the -b option is used, but is neither initialized nor
> set to 0 if not.  Since the barebox image building recipies only uses -b
> with this tool, it wasn't noticed.

Applied to master, thanks.

> 
> Note that ommiting -b, so as to not add a barebox header, still adds a
> 1024 byte header, it's just blank.  I think it would be better if it was
> not added at all.  If flashing to an SD card or eMMC main block, this
> header overlaps the partition table, and so needs to not be flashed.
> It's not part of the imx image.  It's just padding to place the imx
> image at the correct location w.r.t. the start of flash.

The idea is that you can put the imx image at the beginning of an SD/MMC
card without knowing any offsets. Yes, you'll overwrite the partition
table in that case, but once you know that you can skip/seek 512 bytes
on both the image and the card and be done. Note that with newer i.MX
SoCs like i.MX8 the offset was changed to 33k to support GPT partition
tables. With i.MX8MP they changed the offset again to 32k. I think
Having to know all these offsets is not better than the current
situation.

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
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


  reply	other threads:[~2021-05-27  7:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-26  6:58 Trent Piepho
2021-05-27  7:11 ` Sascha Hauer [this message]
2021-05-27  8:13   ` Trent Piepho
2021-05-27  9:21     ` Sascha Hauer

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=20210527071105.GC19819@pengutronix.de \
    --to=sha@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=tpiepho@gmail.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