[linux-sunxi] Re: [PATCH 0/5] sunxi: enable automatic eMMC boot partition support

2020-11-10 Thread Tom Rini
On Tue, Nov 10, 2020 at 12:57:09PM +, André Przywara wrote:
> On 10/11/2020 12:38, Tom Rini wrote:
> 
> Hi Tom,
> 
> > On Sun, Nov 08, 2020 at 03:48:23PM +, André Przywara wrote:
> >> On 08/11/2020 14:59, Peter Robinson wrote:
> >>
> >> Hi,
> >>
> >>> On Sun, Nov 8, 2020 at 1:14 PM Andre Przywara  
> >>> wrote:
> 
>  The eMMC standard describes the concept of boot partitions, consisting
>  of two storage areas separate from the main user data partition.
>  The Allwinner BootROM supports loading SPL/Boot0 from such a boot
>  partition, if that is configured in the eMMC device [1].
> 
>  To load U-Boot proper along with the SPL from there, currently this
>  requires to enable CONFIG_SUPPORT_EMMC_BOOT, and this means that this
>  build won't boot from the normal eMMC user partition anymore.
>  Also the raw MMC sector offset needs to be adjusted manually, preventing
>  a boot from an SD card.
> 
>  This series introduces automatic detection of eMMC boot partition boot.
>  Patch 3/5 automates the raw MMC sector offset decision, allowing such
>  a build to also boot from an SD card.
>  Unfortunately the BootROM does not mark an eMMC boot partition boot
>  differently from the normal eMMC user data partition boot, so patch 4/5
>  introduces a function that repeats the BootROM algorithm, so that the SPL
>  comes to the same conclusion as the BootROM. This allows to build one
>  single image that boots from everywhere: eMMC user data, eMMC boot,
>  SD card, SPI flash.
>  Patch 1/5 contains a bugfix that's needed in a later patch, patch 2/5
>  extends the generic spl_mmc_boot_mode() interface to make 4/5 feasible.
> 
>  Without enabling CONFIG_SUPPORT_EMMC_BOOT, the AArch64 SPL grows by
>  92 bytes, ARMv7 grows by 36 bytes. With enabling the feature, the size
>  goes up by 444 bytes (AArch64) and 260 bytes (ARMv7).
>  Even for AArch64 this is still 4.5 KB below the SPL limit, so patch 5/5
>  enables this new mechanism for some boards I could test this on.
> 
>  Please have a look and test this if you have a board with eMMC.
>  I put installation instructions into the linux-sunxi Wiki:
>  http://linux-sunxi.org/Bootable_eMMC
> >>>
> >>> It would probably be good to put that link in the local Allwinner docs
> >>> so it's easier for people to find.
> >>
> >> Yeah, actually as you mention it:
> >> There does not seem to be some generic README.sunxi file where this
> >> would belong to.
> >>
> >> Jagan: would it make sense to create one, and describe how to get U-Boot
> >> into the devices (SD card, eMMC, SPI flash, FEL)? That could move some
> >> parts of README.sunxi64 out of there, since they apply to all Allwinner
> >> devices.
> >>
> >> If people agree that this is the right thing to do, I would be happy to
> >> send a patch.
> > 
> > Well, rST file in doc/boards/ and all of that, but, yes please.
> 
> Ah, thanks for the pointer, looks good.
> Do we accept symlinks in the tree? There are quite some references to
> board/sunxi/README.sunxi64 out there. Or shall I keep a stub instead?

As there's external references to the README file, yes, please stub it
out pointing people to the new rST file.  Thanks!

-- 
Tom

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/20201110130816.GC5340%40bill-the-cat.


signature.asc
Description: PGP signature


[linux-sunxi] Re: [PATCH 0/5] sunxi: enable automatic eMMC boot partition support

2020-11-10 Thread André Przywara
On 10/11/2020 12:38, Tom Rini wrote:

Hi Tom,

> On Sun, Nov 08, 2020 at 03:48:23PM +, André Przywara wrote:
>> On 08/11/2020 14:59, Peter Robinson wrote:
>>
>> Hi,
>>
>>> On Sun, Nov 8, 2020 at 1:14 PM Andre Przywara  
>>> wrote:

 The eMMC standard describes the concept of boot partitions, consisting
 of two storage areas separate from the main user data partition.
 The Allwinner BootROM supports loading SPL/Boot0 from such a boot
 partition, if that is configured in the eMMC device [1].

 To load U-Boot proper along with the SPL from there, currently this
 requires to enable CONFIG_SUPPORT_EMMC_BOOT, and this means that this
 build won't boot from the normal eMMC user partition anymore.
 Also the raw MMC sector offset needs to be adjusted manually, preventing
 a boot from an SD card.

 This series introduces automatic detection of eMMC boot partition boot.
 Patch 3/5 automates the raw MMC sector offset decision, allowing such
 a build to also boot from an SD card.
 Unfortunately the BootROM does not mark an eMMC boot partition boot
 differently from the normal eMMC user data partition boot, so patch 4/5
 introduces a function that repeats the BootROM algorithm, so that the SPL
 comes to the same conclusion as the BootROM. This allows to build one
 single image that boots from everywhere: eMMC user data, eMMC boot,
 SD card, SPI flash.
 Patch 1/5 contains a bugfix that's needed in a later patch, patch 2/5
 extends the generic spl_mmc_boot_mode() interface to make 4/5 feasible.

 Without enabling CONFIG_SUPPORT_EMMC_BOOT, the AArch64 SPL grows by
 92 bytes, ARMv7 grows by 36 bytes. With enabling the feature, the size
 goes up by 444 bytes (AArch64) and 260 bytes (ARMv7).
 Even for AArch64 this is still 4.5 KB below the SPL limit, so patch 5/5
 enables this new mechanism for some boards I could test this on.

 Please have a look and test this if you have a board with eMMC.
 I put installation instructions into the linux-sunxi Wiki:
 http://linux-sunxi.org/Bootable_eMMC
>>>
>>> It would probably be good to put that link in the local Allwinner docs
>>> so it's easier for people to find.
>>
>> Yeah, actually as you mention it:
>> There does not seem to be some generic README.sunxi file where this
>> would belong to.
>>
>> Jagan: would it make sense to create one, and describe how to get U-Boot
>> into the devices (SD card, eMMC, SPI flash, FEL)? That could move some
>> parts of README.sunxi64 out of there, since they apply to all Allwinner
>> devices.
>>
>> If people agree that this is the right thing to do, I would be happy to
>> send a patch.
> 
> Well, rST file in doc/boards/ and all of that, but, yes please.

Ah, thanks for the pointer, looks good.
Do we accept symlinks in the tree? There are quite some references to
board/sunxi/README.sunxi64 out there. Or shall I keep a stub instead?

Cheers,
Andre

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/ae6751af-3465-03aa-34ca-42c9fb1fbff2%40arm.com.


[linux-sunxi] Re: [PATCH 0/5] sunxi: enable automatic eMMC boot partition support

2020-11-10 Thread Tom Rini
On Sun, Nov 08, 2020 at 03:48:23PM +, André Przywara wrote:
> On 08/11/2020 14:59, Peter Robinson wrote:
> 
> Hi,
> 
> > On Sun, Nov 8, 2020 at 1:14 PM Andre Przywara  
> > wrote:
> >>
> >> The eMMC standard describes the concept of boot partitions, consisting
> >> of two storage areas separate from the main user data partition.
> >> The Allwinner BootROM supports loading SPL/Boot0 from such a boot
> >> partition, if that is configured in the eMMC device [1].
> >>
> >> To load U-Boot proper along with the SPL from there, currently this
> >> requires to enable CONFIG_SUPPORT_EMMC_BOOT, and this means that this
> >> build won't boot from the normal eMMC user partition anymore.
> >> Also the raw MMC sector offset needs to be adjusted manually, preventing
> >> a boot from an SD card.
> >>
> >> This series introduces automatic detection of eMMC boot partition boot.
> >> Patch 3/5 automates the raw MMC sector offset decision, allowing such
> >> a build to also boot from an SD card.
> >> Unfortunately the BootROM does not mark an eMMC boot partition boot
> >> differently from the normal eMMC user data partition boot, so patch 4/5
> >> introduces a function that repeats the BootROM algorithm, so that the SPL
> >> comes to the same conclusion as the BootROM. This allows to build one
> >> single image that boots from everywhere: eMMC user data, eMMC boot,
> >> SD card, SPI flash.
> >> Patch 1/5 contains a bugfix that's needed in a later patch, patch 2/5
> >> extends the generic spl_mmc_boot_mode() interface to make 4/5 feasible.
> >>
> >> Without enabling CONFIG_SUPPORT_EMMC_BOOT, the AArch64 SPL grows by
> >> 92 bytes, ARMv7 grows by 36 bytes. With enabling the feature, the size
> >> goes up by 444 bytes (AArch64) and 260 bytes (ARMv7).
> >> Even for AArch64 this is still 4.5 KB below the SPL limit, so patch 5/5
> >> enables this new mechanism for some boards I could test this on.
> >>
> >> Please have a look and test this if you have a board with eMMC.
> >> I put installation instructions into the linux-sunxi Wiki:
> >> http://linux-sunxi.org/Bootable_eMMC
> > 
> > It would probably be good to put that link in the local Allwinner docs
> > so it's easier for people to find.
> 
> Yeah, actually as you mention it:
> There does not seem to be some generic README.sunxi file where this
> would belong to.
> 
> Jagan: would it make sense to create one, and describe how to get U-Boot
> into the devices (SD card, eMMC, SPI flash, FEL)? That could move some
> parts of README.sunxi64 out of there, since they apply to all Allwinner
> devices.
> 
> If people agree that this is the right thing to do, I would be happy to
> send a patch.

Well, rST file in doc/boards/ and all of that, but, yes please.

-- 
Tom

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/20201110123839.GZ5340%40bill-the-cat.


signature.asc
Description: PGP signature


[linux-sunxi] Re: [PATCH 0/5] sunxi: enable automatic eMMC boot partition support

2020-11-08 Thread André Przywara
On 08/11/2020 14:59, Peter Robinson wrote:

Hi,

> On Sun, Nov 8, 2020 at 1:14 PM Andre Przywara  wrote:
>>
>> The eMMC standard describes the concept of boot partitions, consisting
>> of two storage areas separate from the main user data partition.
>> The Allwinner BootROM supports loading SPL/Boot0 from such a boot
>> partition, if that is configured in the eMMC device [1].
>>
>> To load U-Boot proper along with the SPL from there, currently this
>> requires to enable CONFIG_SUPPORT_EMMC_BOOT, and this means that this
>> build won't boot from the normal eMMC user partition anymore.
>> Also the raw MMC sector offset needs to be adjusted manually, preventing
>> a boot from an SD card.
>>
>> This series introduces automatic detection of eMMC boot partition boot.
>> Patch 3/5 automates the raw MMC sector offset decision, allowing such
>> a build to also boot from an SD card.
>> Unfortunately the BootROM does not mark an eMMC boot partition boot
>> differently from the normal eMMC user data partition boot, so patch 4/5
>> introduces a function that repeats the BootROM algorithm, so that the SPL
>> comes to the same conclusion as the BootROM. This allows to build one
>> single image that boots from everywhere: eMMC user data, eMMC boot,
>> SD card, SPI flash.
>> Patch 1/5 contains a bugfix that's needed in a later patch, patch 2/5
>> extends the generic spl_mmc_boot_mode() interface to make 4/5 feasible.
>>
>> Without enabling CONFIG_SUPPORT_EMMC_BOOT, the AArch64 SPL grows by
>> 92 bytes, ARMv7 grows by 36 bytes. With enabling the feature, the size
>> goes up by 444 bytes (AArch64) and 260 bytes (ARMv7).
>> Even for AArch64 this is still 4.5 KB below the SPL limit, so patch 5/5
>> enables this new mechanism for some boards I could test this on.
>>
>> Please have a look and test this if you have a board with eMMC.
>> I put installation instructions into the linux-sunxi Wiki:
>> http://linux-sunxi.org/Bootable_eMMC
> 
> It would probably be good to put that link in the local Allwinner docs
> so it's easier for people to find.

Yeah, actually as you mention it:
There does not seem to be some generic README.sunxi file where this
would belong to.

Jagan: would it make sense to create one, and describe how to get U-Boot
into the devices (SD card, eMMC, SPI flash, FEL)? That could move some
parts of README.sunxi64 out of there, since they apply to all Allwinner
devices.

If people agree that this is the right thing to do, I would be happy to
send a patch.

Cheers,
Andre

>>
>> [1] http://linux-sunxi.org/Bootable_eMMC#The_BROM_implementation_details
>>
>> Andre Przywara (5):
>>   sunxi: Fix is_boot0_magic macro
>>   spl: mmc: extend spl_mmc_boot_mode() to take mmc argument
>>   sunxi: Simplify eMMC boot partition booting
>>   sunxi: eMMC: Add automatic boot detection
>>   sunxi: defconfig: enable eMMC boot partition support
>>
>>  arch/arm/include/asm/arch-sunxi/spl.h  |  2 +-
>>  arch/arm/mach-imx/spl.c|  2 +-
>>  arch/arm/mach-k3/am6_init.c|  2 +-
>>  arch/arm/mach-k3/j721e_init.c  |  2 +-
>>  arch/arm/mach-omap2/boot-common.c  |  2 +-
>>  arch/arm/mach-rockchip/spl.c   |  2 +-
>>  arch/arm/mach-socfpga/spl_a10.c|  2 +-
>>  arch/arm/mach-socfpga/spl_agilex.c |  2 +-
>>  arch/arm/mach-socfpga/spl_gen5.c   |  2 +-
>>  arch/arm/mach-socfpga/spl_s10.c|  2 +-
>>  arch/arm/mach-stm32mp/spl.c|  2 +-
>>  arch/arm/mach-sunxi/board.c| 94 +-
>>  arch/arm/mach-uniphier/mmc-boot-mode.c |  5 +-
>>  common/spl/spl_mmc.c   |  4 +-
>>  configs/bananapi_m64_defconfig |  1 +
>>  configs/emlid_neutis_n5_devboard_defconfig |  1 +
>>  configs/pine64-lts_defconfig   |  1 +
>>  configs/pine_h64_defconfig |  1 +
>>  include/spl.h  |  3 +-
>>  19 files changed, 113 insertions(+), 19 deletions(-)
>>
>> --
>> 2.17.5
>>

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/965afbad-61b3-c3f4-8b1f-e3ddba01e79d%40arm.com.


[linux-sunxi] Re: [PATCH 0/5] sunxi: enable automatic eMMC boot partition support

2020-11-08 Thread Peter Robinson
On Sun, Nov 8, 2020 at 1:14 PM Andre Przywara  wrote:
>
> The eMMC standard describes the concept of boot partitions, consisting
> of two storage areas separate from the main user data partition.
> The Allwinner BootROM supports loading SPL/Boot0 from such a boot
> partition, if that is configured in the eMMC device [1].
>
> To load U-Boot proper along with the SPL from there, currently this
> requires to enable CONFIG_SUPPORT_EMMC_BOOT, and this means that this
> build won't boot from the normal eMMC user partition anymore.
> Also the raw MMC sector offset needs to be adjusted manually, preventing
> a boot from an SD card.
>
> This series introduces automatic detection of eMMC boot partition boot.
> Patch 3/5 automates the raw MMC sector offset decision, allowing such
> a build to also boot from an SD card.
> Unfortunately the BootROM does not mark an eMMC boot partition boot
> differently from the normal eMMC user data partition boot, so patch 4/5
> introduces a function that repeats the BootROM algorithm, so that the SPL
> comes to the same conclusion as the BootROM. This allows to build one
> single image that boots from everywhere: eMMC user data, eMMC boot,
> SD card, SPI flash.
> Patch 1/5 contains a bugfix that's needed in a later patch, patch 2/5
> extends the generic spl_mmc_boot_mode() interface to make 4/5 feasible.
>
> Without enabling CONFIG_SUPPORT_EMMC_BOOT, the AArch64 SPL grows by
> 92 bytes, ARMv7 grows by 36 bytes. With enabling the feature, the size
> goes up by 444 bytes (AArch64) and 260 bytes (ARMv7).
> Even for AArch64 this is still 4.5 KB below the SPL limit, so patch 5/5
> enables this new mechanism for some boards I could test this on.
>
> Please have a look and test this if you have a board with eMMC.
> I put installation instructions into the linux-sunxi Wiki:
> http://linux-sunxi.org/Bootable_eMMC

It would probably be good to put that link in the local Allwinner docs
so it's easier for people to find.

Peter

> Cheers,
> Andre
>
> [1] http://linux-sunxi.org/Bootable_eMMC#The_BROM_implementation_details
>
> Andre Przywara (5):
>   sunxi: Fix is_boot0_magic macro
>   spl: mmc: extend spl_mmc_boot_mode() to take mmc argument
>   sunxi: Simplify eMMC boot partition booting
>   sunxi: eMMC: Add automatic boot detection
>   sunxi: defconfig: enable eMMC boot partition support
>
>  arch/arm/include/asm/arch-sunxi/spl.h  |  2 +-
>  arch/arm/mach-imx/spl.c|  2 +-
>  arch/arm/mach-k3/am6_init.c|  2 +-
>  arch/arm/mach-k3/j721e_init.c  |  2 +-
>  arch/arm/mach-omap2/boot-common.c  |  2 +-
>  arch/arm/mach-rockchip/spl.c   |  2 +-
>  arch/arm/mach-socfpga/spl_a10.c|  2 +-
>  arch/arm/mach-socfpga/spl_agilex.c |  2 +-
>  arch/arm/mach-socfpga/spl_gen5.c   |  2 +-
>  arch/arm/mach-socfpga/spl_s10.c|  2 +-
>  arch/arm/mach-stm32mp/spl.c|  2 +-
>  arch/arm/mach-sunxi/board.c| 94 +-
>  arch/arm/mach-uniphier/mmc-boot-mode.c |  5 +-
>  common/spl/spl_mmc.c   |  4 +-
>  configs/bananapi_m64_defconfig |  1 +
>  configs/emlid_neutis_n5_devboard_defconfig |  1 +
>  configs/pine64-lts_defconfig   |  1 +
>  configs/pine_h64_defconfig |  1 +
>  include/spl.h  |  3 +-
>  19 files changed, 113 insertions(+), 19 deletions(-)
>
> --
> 2.17.5
>

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/CALeDE9Oo8vvwADE5M%2BDz17d5Zf7mTmerC3Lid9%2B-9iTX1nMVdg%40mail.gmail.com.