diff mbox

[U-Boot,v2,27/27] RFC: sunxi: Enable SPL FIT support

Message ID 1456206959-29115-28-git-send-email-sjg@chromium.org
State RFC
Delegated to: Tom Rini
Headers show

Commit Message

Simon Glass Feb. 23, 2016, 5:55 a.m. UTC
Enable SPL FIT support for the Linksprite pcDuino3 as an example of how this
feature is used.

This is only for demonstration purposes and is not to be applied.
Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v2: None

 arch/arm/cpu/armv7/sunxi/board.c      | 5 +++++
 configs/Linksprite_pcDuino3_defconfig | 4 ++++
 2 files changed, 9 insertions(+)

Comments

Michal Simek April 28, 2016, 9:44 a.m. UTC | #1
Hi Simon and Tom,

On 23.2.2016 06:55, Simon Glass wrote:
> Enable SPL FIT support for the Linksprite pcDuino3 as an example of how this
> feature is used.
> 
> This is only for demonstration purposes and is not to be applied.
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
> 
> Changes in v2: None
> 
>  arch/arm/cpu/armv7/sunxi/board.c      | 5 +++++
>  configs/Linksprite_pcDuino3_defconfig | 4 ++++
>  2 files changed, 9 insertions(+)

I have played with SPL_FIT support and find some things
First of all
"mkimage: Support placing data outside the FIT"
(722ebc8f84d5bccd2e70fad1079a0dd40cceddec)
is missing description in usage function to see what -E options does.

Then I have found a problem with fit address calculation because it has
to be aligned.
I have sent an RFC for it
"SPL: FIT: Align loading address for header"

I have also added support for ram load for FIT - please review.
"SPL: FIT: Enable SPL_FIT_LOAD in RAM based boot mode"
And also for SD fat based images.
"SPL: FIT: Enable SPL_FIT_LOAD for sd bootmode for fat partions"

Is there any plan to support falcon mode?
Also I see kind of interesting to have one fit image with ATF, Secure
OS, bitstreams and U-Boot and Linux kernel + dtbs
Currently spl_load_simple_fit() seems to me expecting to blindly read
the first fit partition and say this is u-boot and then based
configuration description choose dtb.

Do you have any plan to get even u-boot image from configurations instead?
The we should get a support for loadables.

Thanks,
Michal
Tom Rini April 28, 2016, 1:07 p.m. UTC | #2
On Thu, Apr 28, 2016 at 11:44:50AM +0200, Michal Simek wrote:
> Hi Simon and Tom,
> 
> On 23.2.2016 06:55, Simon Glass wrote:
> > Enable SPL FIT support for the Linksprite pcDuino3 as an example of how this
> > feature is used.
> > 
> > This is only for demonstration purposes and is not to be applied.
> > Signed-off-by: Simon Glass <sjg@chromium.org>
> > ---
> > 
> > Changes in v2: None
> > 
> >  arch/arm/cpu/armv7/sunxi/board.c      | 5 +++++
> >  configs/Linksprite_pcDuino3_defconfig | 4 ++++
> >  2 files changed, 9 insertions(+)
> 
> I have played with SPL_FIT support and find some things
> First of all
> "mkimage: Support placing data outside the FIT"
> (722ebc8f84d5bccd2e70fad1079a0dd40cceddec)
> is missing description in usage function to see what -E options does.
> 
> Then I have found a problem with fit address calculation because it has
> to be aligned.
> I have sent an RFC for it
> "SPL: FIT: Align loading address for header"
> 
> I have also added support for ram load for FIT - please review.
> "SPL: FIT: Enable SPL_FIT_LOAD in RAM based boot mode"

I think these are reasonable.

> And also for SD fat based images.
> "SPL: FIT: Enable SPL_FIT_LOAD for sd bootmode for fat partions"

Ug, sorry.  You missed the series from Lokesh that added a bunch more
features along those lines.  I didn't pull them in since it was past the
merge window but will for the next release.

> Is there any plan to support falcon mode?
> Also I see kind of interesting to have one fit image with ATF, Secure
> OS, bitstreams and U-Boot and Linux kernel + dtbs
> Currently spl_load_simple_fit() seems to me expecting to blindly read
> the first fit partition and say this is u-boot and then based
> configuration description choose dtb.
> 
> Do you have any plan to get even u-boot image from configurations instead?
> The we should get a support for loadables.

Well, the first itch I needed scratched was supporting many similar
platforms in DM+DT from a single binary, and that's what's there today.
So long as we can do things in a clean way, all of these other use cases
sound interesting and clearly useful to some people, so I don't object.
Michal Simek April 28, 2016, 1:12 p.m. UTC | #3
On 28.4.2016 15:07, Tom Rini wrote:
> On Thu, Apr 28, 2016 at 11:44:50AM +0200, Michal Simek wrote:
>> Hi Simon and Tom,
>>
>> On 23.2.2016 06:55, Simon Glass wrote:
>>> Enable SPL FIT support for the Linksprite pcDuino3 as an example of how this
>>> feature is used.
>>>
>>> This is only for demonstration purposes and is not to be applied.
>>> Signed-off-by: Simon Glass <sjg@chromium.org>
>>> ---
>>>
>>> Changes in v2: None
>>>
>>>  arch/arm/cpu/armv7/sunxi/board.c      | 5 +++++
>>>  configs/Linksprite_pcDuino3_defconfig | 4 ++++
>>>  2 files changed, 9 insertions(+)
>>
>> I have played with SPL_FIT support and find some things
>> First of all
>> "mkimage: Support placing data outside the FIT"
>> (722ebc8f84d5bccd2e70fad1079a0dd40cceddec)
>> is missing description in usage function to see what -E options does.
>>
>> Then I have found a problem with fit address calculation because it has
>> to be aligned.
>> I have sent an RFC for it
>> "SPL: FIT: Align loading address for header"
>>
>> I have also added support for ram load for FIT - please review.
>> "SPL: FIT: Enable SPL_FIT_LOAD in RAM based boot mode"
> 
> I think these are reasonable.
> 
>> And also for SD fat based images.
>> "SPL: FIT: Enable SPL_FIT_LOAD for sd bootmode for fat partions"
> 
> Ug, sorry.  You missed the series from Lokesh that added a bunch more
> features along those lines.  I didn't pull them in since it was past the
> merge window but will for the next release.

Ah ok. Will look.

> 
>> Is there any plan to support falcon mode?
>> Also I see kind of interesting to have one fit image with ATF, Secure
>> OS, bitstreams and U-Boot and Linux kernel + dtbs
>> Currently spl_load_simple_fit() seems to me expecting to blindly read
>> the first fit partition and say this is u-boot and then based
>> configuration description choose dtb.
>>
>> Do you have any plan to get even u-boot image from configurations instead?
>> The we should get a support for loadables.
> 
> Well, the first itch I needed scratched was supporting many similar
> platforms in DM+DT from a single binary, and that's what's there today.
> So long as we can do things in a clean way, all of these other use cases
> sound interesting and clearly useful to some people, so I don't object.
> 

How do you identify platform you are running at?

Thanks,
Michal
Tom Rini April 28, 2016, 7:05 p.m. UTC | #4
On Thu, Apr 28, 2016 at 03:12:19PM +0200, Michal Simek wrote:
> On 28.4.2016 15:07, Tom Rini wrote:
> > On Thu, Apr 28, 2016 at 11:44:50AM +0200, Michal Simek wrote:
> >> Hi Simon and Tom,
> >>
> >> On 23.2.2016 06:55, Simon Glass wrote:
> >>> Enable SPL FIT support for the Linksprite pcDuino3 as an example of how this
> >>> feature is used.
> >>>
> >>> This is only for demonstration purposes and is not to be applied.
> >>> Signed-off-by: Simon Glass <sjg@chromium.org>
> >>> ---
> >>>
> >>> Changes in v2: None
> >>>
> >>>  arch/arm/cpu/armv7/sunxi/board.c      | 5 +++++
> >>>  configs/Linksprite_pcDuino3_defconfig | 4 ++++
> >>>  2 files changed, 9 insertions(+)
> >>
> >> I have played with SPL_FIT support and find some things
> >> First of all
> >> "mkimage: Support placing data outside the FIT"
> >> (722ebc8f84d5bccd2e70fad1079a0dd40cceddec)
> >> is missing description in usage function to see what -E options does.
> >>
> >> Then I have found a problem with fit address calculation because it has
> >> to be aligned.
> >> I have sent an RFC for it
> >> "SPL: FIT: Align loading address for header"
> >>
> >> I have also added support for ram load for FIT - please review.
> >> "SPL: FIT: Enable SPL_FIT_LOAD in RAM based boot mode"
> > 
> > I think these are reasonable.
> > 
> >> And also for SD fat based images.
> >> "SPL: FIT: Enable SPL_FIT_LOAD for sd bootmode for fat partions"
> > 
> > Ug, sorry.  You missed the series from Lokesh that added a bunch more
> > features along those lines.  I didn't pull them in since it was past the
> > merge window but will for the next release.
> 
> Ah ok. Will look.
> 
> > 
> >> Is there any plan to support falcon mode?
> >> Also I see kind of interesting to have one fit image with ATF, Secure
> >> OS, bitstreams and U-Boot and Linux kernel + dtbs
> >> Currently spl_load_simple_fit() seems to me expecting to blindly read
> >> the first fit partition and say this is u-boot and then based
> >> configuration description choose dtb.
> >>
> >> Do you have any plan to get even u-boot image from configurations instead?
> >> The we should get a support for loadables.
> > 
> > Well, the first itch I needed scratched was supporting many similar
> > platforms in DM+DT from a single binary, and that's what's there today.
> > So long as we can do things in a clean way, all of these other use cases
> > sound interesting and clearly useful to some people, so I don't object.
> 
> 
> How do you identify platform you are running at?

In these cases we know there is an I2C EEPROM with information in a
given format so we can go from there.
Michal Simek April 29, 2016, 6:17 a.m. UTC | #5
On 28.4.2016 21:05, Tom Rini wrote:
> On Thu, Apr 28, 2016 at 03:12:19PM +0200, Michal Simek wrote:
>> On 28.4.2016 15:07, Tom Rini wrote:
>>> On Thu, Apr 28, 2016 at 11:44:50AM +0200, Michal Simek wrote:
>>>> Hi Simon and Tom,
>>>>
>>>> On 23.2.2016 06:55, Simon Glass wrote:
>>>>> Enable SPL FIT support for the Linksprite pcDuino3 as an example of how this
>>>>> feature is used.
>>>>>
>>>>> This is only for demonstration purposes and is not to be applied.
>>>>> Signed-off-by: Simon Glass <sjg@chromium.org>
>>>>> ---
>>>>>
>>>>> Changes in v2: None
>>>>>
>>>>>  arch/arm/cpu/armv7/sunxi/board.c      | 5 +++++
>>>>>  configs/Linksprite_pcDuino3_defconfig | 4 ++++
>>>>>  2 files changed, 9 insertions(+)
>>>>
>>>> I have played with SPL_FIT support and find some things
>>>> First of all
>>>> "mkimage: Support placing data outside the FIT"
>>>> (722ebc8f84d5bccd2e70fad1079a0dd40cceddec)
>>>> is missing description in usage function to see what -E options does.
>>>>
>>>> Then I have found a problem with fit address calculation because it has
>>>> to be aligned.
>>>> I have sent an RFC for it
>>>> "SPL: FIT: Align loading address for header"
>>>>
>>>> I have also added support for ram load for FIT - please review.
>>>> "SPL: FIT: Enable SPL_FIT_LOAD in RAM based boot mode"
>>>
>>> I think these are reasonable.
>>>
>>>> And also for SD fat based images.
>>>> "SPL: FIT: Enable SPL_FIT_LOAD for sd bootmode for fat partions"
>>>
>>> Ug, sorry.  You missed the series from Lokesh that added a bunch more
>>> features along those lines.  I didn't pull them in since it was past the
>>> merge window but will for the next release.
>>
>> Ah ok. Will look.
>>
>>>
>>>> Is there any plan to support falcon mode?
>>>> Also I see kind of interesting to have one fit image with ATF, Secure
>>>> OS, bitstreams and U-Boot and Linux kernel + dtbs
>>>> Currently spl_load_simple_fit() seems to me expecting to blindly read
>>>> the first fit partition and say this is u-boot and then based
>>>> configuration description choose dtb.
>>>>
>>>> Do you have any plan to get even u-boot image from configurations instead?
>>>> The we should get a support for loadables.
>>>
>>> Well, the first itch I needed scratched was supporting many similar
>>> platforms in DM+DT from a single binary, and that's what's there today.
>>> So long as we can do things in a clean way, all of these other use cases
>>> sound interesting and clearly useful to some people, so I don't object.
>>
>>
>> How do you identify platform you are running at?
> 
> In these cases we know there is an I2C EEPROM with information in a
> given format so we can go from there.

OK. I see. We have eeproms on boards too which could be used for it too.
It means there is sort of plan to add i2c DM eeprom support to SPL.

Thanks,
Michal
diff mbox

Patch

diff --git a/arch/arm/cpu/armv7/sunxi/board.c b/arch/arm/cpu/armv7/sunxi/board.c
index eb5f4b6..407adb5 100644
--- a/arch/arm/cpu/armv7/sunxi/board.c
+++ b/arch/arm/cpu/armv7/sunxi/board.c
@@ -103,6 +103,11 @@  static int gpio_init(void)
 	return 0;
 }
 
+int board_fit_config_name_match(const char *name)
+{
+	return strcmp(name, "sun7i-a20-pcduino3");
+}
+
 int spl_board_load_image(void)
 {
 	debug("Returning to FEL sp=%x, lr=%x\n", fel_stash.sp, fel_stash.lr);
diff --git a/configs/Linksprite_pcDuino3_defconfig b/configs/Linksprite_pcDuino3_defconfig
index d1f93ea..253b64c 100644
--- a/configs/Linksprite_pcDuino3_defconfig
+++ b/configs/Linksprite_pcDuino3_defconfig
@@ -14,3 +14,7 @@  CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC,AHCI,SATAPWR=SUNXI_GPH(2)"
 CONFIG_CMD_GPIO=y
 CONFIG_ETH_DESIGNWARE=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_FIT=y
+CONFIG_SPL_OF_LIBFDT=y
+CONFIG_SPL_LOAD_FIT=y
+CONFIG_OF_LIST="sun7i-a20-pcduino3 sun7i-a20-bananapro"