linux-sunxi.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] sunxi: Improve automatic eMMC boot partition support
@ 2021-07-11 22:38 Andre Przywara
  2021-07-11 22:38 ` [PATCH v2 1/3] spl: mmc: extend spl_mmc_boot_mode() to take mmc argument Andre Przywara
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Andre Przywara @ 2021-07-11 22:38 UTC (permalink / raw)
  To: Jagan Teki
  Cc: Samuel Holland, Jernej Skrabec, Icenowy Zheng,
	Aleksandr Aleksandrov, Sunil Mohan Adapa, linux-sunxi

The Allwinner BootROM supports loading the SPL from eMMC boot partitions,
but so far the SPL support for this case was a bit lacking, as it was a
compile time decision, and even required a manual config change.
This actually got accidentally fixed in v2021.04 (c0b417b2f1a3 "sunxi:
support loading with SPL > 32KB"), but still some gaps remain: When just
enabling an eMMC boot partition, but having no bootable code there, the
BROM will just continue with booting from the user data partition, but
U-Boot does not detect this and will try to load U-Boot proper from that
boot partition.

This series fixes this, by replicating the BROMs decisions in the SPL,
to decide on the partition to continue loading from.

Patch 1/3 prepares a generic function to take an extra argument, while
patch 2/3 implements the actual algorithm.
As this now allows to always have eMMC boot support on, patch 3/3 just
activates this for a number of boards I could test it on.

I'd like to encourage other people to test this on boards with eMMC, to
enable this in the respective defconfig, maybe even centrally.

Some more details on eMMC boot partition support and how to install
U-Boot in there can be found in the linux-sunxi Wiki:
http://linux-sunxi.org/Bootable_eMMC

Cheers,
Andre

Changelog v1 .. v2:
- drop patch 1/5 (bugfix): already merged
- drop patch 3/5, as it was obsoleted by c0b417b2f1a3
- remove check for 32KB SPL limit (not applicable for H6 and beyond)
- remove extra sector offset adjustment (obsoleted by c0b417b2f1a3)

Andre Przywara (3):
  spl: mmc: extend spl_mmc_boot_mode() to take mmc argument
  sunxi: eMMC: Improve automatic boot source detection
  sunxi: defconfig: enable eMMC boot partition support

 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_gen5.c           |  2 +-
 arch/arm/mach-stm32mp/spl.c                |  2 +-
 arch/arm/mach-sunxi/board.c                | 80 ++++++++++++++++++++++
 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 +-
 16 files changed, 97 insertions(+), 15 deletions(-)

-- 
2.17.5


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-07-12 19:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-11 22:38 [PATCH v2 0/3] sunxi: Improve automatic eMMC boot partition support Andre Przywara
2021-07-11 22:38 ` [PATCH v2 1/3] spl: mmc: extend spl_mmc_boot_mode() to take mmc argument Andre Przywara
2021-07-12  0:52   ` Peng Fan (OSS)
2021-07-12 19:43   ` Simon Glass
2021-07-11 22:38 ` [PATCH v2 2/3] sunxi: eMMC: Improve automatic boot source detection Andre Przywara
2021-07-11 22:38 ` [PATCH v2 3/3] sunxi: defconfig: enable eMMC boot partition support Andre Przywara

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).