]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
sunxi: boards: Enable SPI flash support in U-Boot proper
authorAndre Przywara <andre.przywara@arm.com>
Tue, 11 Jan 2022 12:46:06 +0000 (12:46 +0000)
committerJagan Teki <jagan@amarulasolutions.com>
Thu, 10 Mar 2022 12:04:44 +0000 (17:34 +0530)
Some sunxi boards ship with SPI flash, which allows booting through the
BootROM. We cover this functionality by a separate SPL "mini" driver.
Separately we have a proper DM_SPI driver for U-Boot proper, which
provides access to the SPI flash through the "sf" command. That allows
to update the firmware on the SPI flash, also to store the environment
there.

However only very few boards actually enable support for U-Boot proper,
even though that would work and the SPL part is configured.

Use the cleaned up configuration scheme to enable SPI flash on those
boards which mention a SPI flash in their .dts, or which use the SPL SPI
support.

Out of the box this would enable storing the environment on the SPI
flash, and allows people to read or write the flash from U-Boot, for
instance to update the SPI flash when booted via an SD card.

For this to actually work there must be a "spi0" alias in the DT, which
most boards are missing. But this should be addressed separately.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
configs/orangepi_pc2_defconfig
configs/orangepi_r1_defconfig
configs/orangepi_win_defconfig
configs/orangepi_zero2_defconfig
configs/orangepi_zero_defconfig
configs/pine64-lts_defconfig
configs/pine_h64_defconfig
configs/pinecube_defconfig

index 2eaddcf684134a833ddb60b79fb3c2e14587347f..777af8c60ea7035d3cc09c071ff5a0a482b6c9e7 100644 (file)
@@ -11,9 +11,11 @@ CONFIG_SPL_SPI_SUNXI=y
 CONFIG_SPL_I2C=y
 CONFIG_SPL_SYS_I2C_LEGACY=y
 CONFIG_SYS_I2C_MVTWSI=y
+CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SUN8I_EMAC=y
 CONFIG_SY8106A_POWER=y
 CONFIG_SY8106A_VOUT1_VOLT=1100
+CONFIG_SPI=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_OHCI_HCD=y
 CONFIG_USB_MUSB_GADGET=y
index 745451c4bf6fc06a74549b031b42d9194a9f13c4..4496aa4a45c7360266a955d5112a2f08cc404cad 100644 (file)
@@ -8,6 +8,8 @@ CONFIG_DRAM_CLK=624
 CONFIG_SPL_SPI_SUNXI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_CONSOLE_MUX=y
+CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_SUN8I_EMAC=y
+CONFIG_SPI=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_OHCI_HCD=y
index 133755291a701faeb8dbd7a1b2c88fdf37ce1e33..3b78ad7e52d4fc2aafc4ba4adc8653a4700ff714 100644 (file)
@@ -7,6 +7,7 @@ CONFIG_RESERVE_ALLWINNER_BOOT0_HEADER=y
 CONFIG_MACPWR="PD14"
 CONFIG_SPL_SPI_SUNXI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_PHY_REALTEK=y
 CONFIG_SUN8I_EMAC=y
 CONFIG_SPI=y
index 22563c864feed1f74796261961dd6b2d190115f8..54faf6aba2cf8511e2d54fb6fee8e58613830e42 100644 (file)
@@ -15,5 +15,7 @@ CONFIG_SPL_SYS_I2C_LEGACY=y
 CONFIG_SYS_I2C_MVTWSI=y
 CONFIG_SYS_I2C_SLAVE=0x7f
 CONFIG_SYS_I2C_SPEED=400000
+CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_PHY_REALTEK=y
 CONFIG_SUN8I_EMAC=y
+CONFIG_SPI=y
index 332cd4739ea5683a612aaaf925bcda19bfe3b23b..2dc69d2994a111ff8144c5f7b9d3df8f1eb1eaa9 100644 (file)
@@ -8,6 +8,8 @@ CONFIG_DRAM_CLK=624
 CONFIG_SPL_SPI_SUNXI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_CONSOLE_MUX=y
+CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_SUN8I_EMAC=y
+CONFIG_SPI=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_OHCI_HCD=y
index 75a77acc44ba296a3cd9a73fa3c3fd887811ddea..45a9e77e0ea240e3650d99d8055d77aa5b02e6ba 100644 (file)
@@ -10,6 +10,7 @@ CONFIG_MMC0_CD_PIN=""
 CONFIG_MMC_SUNXI_SLOT_EXTRA=2
 CONFIG_SPL_SPI_SUNXI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_SUN8I_EMAC=y
 CONFIG_SPI=y
 CONFIG_USB_EHCI_HCD=y
index 1928509dd7b2d56a770edea43d0713705954301c..1e730dd9fa175def2b1dfe20ec772fd9703b4982 100644 (file)
@@ -11,8 +11,10 @@ CONFIG_USB3_VBUS_PIN="PL5"
 CONFIG_SPL_SPI_SUNXI=y
 # CONFIG_PSCI_RESET is not set
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_SUN8I_EMAC=y
 CONFIG_PHY_SUN50I_USB3=y
+CONFIG_SPI=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_EHCI_HCD=y
index 0c71d59418590b2d16831facb7bb88538410c779..e779663a0dd4330c17d302e60d312ba40a66f3ec 100644 (file)
@@ -12,8 +12,10 @@ CONFIG_SPL_SYS_I2C_LEGACY=y
 CONFIG_SYS_I2C_MVTWSI=y
 CONFIG_SYS_I2C_SLAVE=0x7f
 CONFIG_SYS_I2C_SPEED=400000
+CONFIG_SPI_FLASH_WINBOND=y
 # CONFIG_NETDEVICES is not set
 CONFIG_AXP209_POWER=y
 CONFIG_AXP_DCDC2_VOLT=1250
 CONFIG_AXP_DCDC3_VOLT=3300
 CONFIG_CONS_INDEX=3
+CONFIG_SPI=y