u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
From: Xavier Drudis Ferran <xdrudis@tinet.cat>
To: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Cc: Xavier Drudis Ferran <xdrudis@tinet.cat>,
	Quentin Schulz <foss+uboot@0leil.net>,
	kever.yang@rock-chips.com, andy.yan@rock-chips.com,
	hl@rock-chips.com, chenjh@rock-chips.com,
	manivannan.sadhasivam@linaro.org, nick@khadas.com,
	jbx6244@gmail.com, deepakdas.linux@gmail.com, linux@alxd.me,
	u-boot@lists.denx.de
Subject: Re: [SPAM] [PATCH v2 0/7] migrate u-boot-rockchip.bin to binman and generate an image for SPI
Date: Mon, 25 Jul 2022 13:20:40 +0200	[thread overview]
Message-ID: <20220725112040.GC2029@begut> (raw)
In-Reply-To: <effac6eb-f524-74c5-8218-c75efcf01882@theobroma-systems.com>

El Mon, Jul 25, 2022 at 12:54:04PM +0200, Quentin Schulz deia:
 
> You'd need a new binman entry I assume for calling mkenvimage.
>

 
> It's not a super safe assumption that CONFIG_ENV_OFFSET will be used for
> declaring where the environment is stored. E.g., CONFIG_ENV_OFFSET for Puma
> declares where the env is located on SPI-NOR, however for MMC devices, it is
> specified with u-boot,mmc-env-offset DT property (though, if it is not
> defined, it defaults to CONFIG_ENV_OFFSET, c.f. env/mmc.c). But maybe the
> same comment as I did for CONFIG_SYS_SPI_U_BOOT_OFFS would be enough? e.g.
> states that this should be in sync with the DT property if there's one for
> the board in question. See: https://lore.kernel.org/u-boot/20220722160655.3904213-13-foss+uboot@0leil.net/
> for what I needed to do for Puma to get u-boot-rockchip-spi.bin support.
> 
> But that overall seems like a reasonable feature to add.
> 

But it is interesting enough ? 
I mean once you could call mkenvimage you'd still need to give it
some environment (variables values). And what would you give it
that would be different from the default environment ?
Maybe what's wanted is just to fail to read the environment
the first time. And the user can save it from hush (or run mkenvimage
themselves). 

> > Or maybe we should just disable CONFIG_ENV_IS_IN_MMC in the board ? (I
> > think it conflicts with trust settings anyway).
> > 
> 
> Yes, anything but ENV_IS_NOWHERE depends on !CHAIN_OF_TRUST. So I guess a
> check on #ifndef CONFIG_CHAIN_OF_TRUST for that section in binman would do
> the trick?
>

If we need to add the environment to binman we could just check ENV_IS_IN_...
because those will already be false if CHAIN_OF_TRUST is false, I think.
 
But mayeb we don't need to do that, or we just want to leave some 
empty space somewhere (yeah, difficult to know where if the offset can be in dt or Kconfig).

> 
> If there's no environment where U-Boot is looking for it, it'll not fatally
> fail right now. The next time you save the environment (saveenv), it'll be
> written in the correct location and read during next boot. Again, this patch
> series does not modify u-boot-rockchip.bin current behavior :)
>

You're right, so maybe we don't really need to run mkenvimage to build the image,
we leave the environment empty, and let the user do their thing. We may want 
to make sure we don't put something else there, though.
 
> > Now that we have Quentin's patches maybe we can remove the Makefile
> > warning about CONFIG_USE_SPL_FIT_GENERATOR and move the task that
> > arch/arm/mach-rockchip/make_fit_atf.py is doing to binman.
> 
> I wasn't aware of this entry, maybe it is actually possible. That'd be nice
> to have :)
> 

I'm playing with this right now. I don't have anything that boots.
First attempt complains that SPL can't allocate so much RAM to fit the
internal image (not really feeling like increasing space a lot for
many boards) and 2nd attempt at having an external image to make it closer
to what make_fit_atf.py used to do and have less breakage, then it doesn't even
complain, just stops short of running ATF.

I'll play some more...

> 
> My understanding is that there's a will to replace make_fit_atf.py output
> generated by binman instead, if binman supports everything needed to do this
> migration, I don't know.
>

Thanks for your confirmation.

  reply	other threads:[~2022-07-25 11:20 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-22 11:34 [PATCH v2 0/7] migrate u-boot-rockchip.bin to binman and generate an image for SPI Quentin Schulz
2022-07-22 11:34 ` [PATCH v2 1/7] rockchip: generate idbloader.img content for u-boot-rockchip.bin with binman for ARM Quentin Schulz
2022-07-23 12:07   ` Johan Jonker
2022-07-23 18:04     ` Matwey V. Kornilov
2022-07-23 19:49     ` [SPAM] " Xavier Drudis Ferran
2022-07-25 10:25     ` Quentin Schulz
2022-07-25 11:05       ` Xavier Drudis Ferran
2022-07-25 11:56         ` Johan Jonker
2022-07-28 13:26   ` Jagan Teki
2022-07-22 11:35 ` [PATCH v2 2/7] rockchip: generate u-boot-rockchip.bin with binman for ARM64 boards Quentin Schulz
2022-07-22 11:35 ` [PATCH v2 3/7] rockchip: remove unneeded CONFIG_SPL_PAD_TO Quentin Schulz
2022-07-22 11:35 ` [PATCH v2 4/7] rockchip: simplify binman image dependencies addition to INPUTS Quentin Schulz
2022-07-22 11:35 ` [PATCH v2 5/7] rockchip: allow to build SPI images even without HAS_ROM option Quentin Schulz
2022-07-22 11:35 ` [PATCH v2 6/7] binman: add support for skipping file concatenation for mkimage Quentin Schulz
2022-07-22 11:35 ` [PATCH v2 7/7] rockchip: add u-boot-rockchip-spi.bin image for booting from SPI-NOR flash Quentin Schulz
2022-07-24  7:46 ` [SPAM] [PATCH v2 0/7] migrate u-boot-rockchip.bin to binman and generate an image for SPI Xavier Drudis Ferran
2022-07-25 10:54   ` Quentin Schulz
2022-07-25 11:20     ` Xavier Drudis Ferran [this message]
2022-07-25 16:39       ` Quentin Schulz

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=20220725112040.GC2029@begut \
    --to=xdrudis@tinet.cat \
    --cc=andy.yan@rock-chips.com \
    --cc=chenjh@rock-chips.com \
    --cc=deepakdas.linux@gmail.com \
    --cc=foss+uboot@0leil.net \
    --cc=hl@rock-chips.com \
    --cc=jbx6244@gmail.com \
    --cc=kever.yang@rock-chips.com \
    --cc=linux@alxd.me \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=nick@khadas.com \
    --cc=quentin.schulz@theobroma-systems.com \
    --cc=u-boot@lists.denx.de \
    /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;
as well as URLs for NNTP newsgroup(s).