public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Andre Przywara <andre.przywara@arm.com>
To: Jagan Teki <jagan@amarulasolutions.com>
Cc: Simon Glass <sjg@chromium.org>, Tom Rini <trini@konsulko.com>,
	Chen-Yu Tsai <wens@csie.org>, Hauke Mehrtens <hauke@hauke-m.de>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Samuel Holland <samuel@sholland.org>,
	Icenowy Zheng <icenowy@aosc.xyz>,
	Joe Hershberger <joe.hershberger@ni.com>,
	Wolfgang Denk <wd@denx.de>,
	Daniel Wagenknecht <dwagenk@mailbox.org>,
	u-boot@lists.denx.de
Subject: [PATCH 2/7] sunxi: Kconfig: Fix up SPI configuration
Date: Tue, 11 Jan 2022 12:46:02 +0000	[thread overview]
Message-ID: <20220111124607.863952-3-andre.przywara@arm.com> (raw)
In-Reply-To: <20220111124607.863952-1-andre.przywara@arm.com>

Commit 7945caf22c44 ("arm: sunxi: Enable SPI/SPI-FLASH support for A64")
selected CONFIG_SPI by default on all Allwinner A64 boards, even though
only 4 out of the 14 A64 boards have a SPI flash chip. All other SoCs
had to manually select DM_SPI and friends, even though they are a
platform property (the sunxi SPI driver is DM_SPI only).

Clean this up to allow easy selection of SPI flash support in U-Boot
proper, by selecting DM_SPI and DM_SPI_FLASH *if* CONFIG_SPI is
selected, for *all* Allwinner SoCs. This simplifies the defconfig for
two Libretech boards already.

Also remove the forced CONFIG_SPI from the A64 Kconfig, instead let the
four boards which allow SPI booting select this explicitly.

Any board wishing to support SPI flash in U-Boot proper now just defines
CONFIG_SPI and CONFIG_SPI_FLASH_<vendor> in its defconfig, Kconfig takes
care of the rest.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
 arch/arm/Kconfig                         | 2 ++
 arch/arm/mach-sunxi/Kconfig              | 3 ---
 configs/libretech_all_h3_it_h5_defconfig | 2 --
 configs/libretech_all_h5_cc_h5_defconfig | 2 --
 configs/oceanic_5205_5inmfd_defconfig    | 1 +
 configs/orangepi_win_defconfig           | 1 +
 configs/pine64-lts_defconfig             | 1 +
 configs/sopine_baseboard_defconfig       | 1 +
 8 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 7264d72bde..0f63bfdded 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1055,6 +1055,8 @@ config ARCH_SUNXI
 	select DM_ETH
 	select DM_GPIO
 	select DM_I2C if I2C
+	select DM_SPI if SPI
+	select DM_SPI_FLASH if SPI
 	select DM_KEYBOARD
 	select DM_MMC if MMC
 	select DM_SCSI if SCSI
diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig
index 2c18cf02d1..56ff1e197c 100644
--- a/arch/arm/mach-sunxi/Kconfig
+++ b/arch/arm/mach-sunxi/Kconfig
@@ -324,9 +324,6 @@ config MACH_SUN9I
 config MACH_SUN50I
 	bool "sun50i (Allwinner A64)"
 	select ARM64
-	select SPI
-	select DM_SPI if SPI
-	select DM_SPI_FLASH
 	select PHY_SUN4I_USB
 	select SUN6I_PRCM
 	select SUNXI_DE2
diff --git a/configs/libretech_all_h3_it_h5_defconfig b/configs/libretech_all_h3_it_h5_defconfig
index 7f0e0be50b..cb7ffb4d7d 100644
--- a/configs/libretech_all_h3_it_h5_defconfig
+++ b/configs/libretech_all_h3_it_h5_defconfig
@@ -7,9 +7,7 @@ CONFIG_DRAM_CLK=672
 CONFIG_MMC_SUNXI_SLOT_EXTRA=2
 CONFIG_SPL_SPI_SUNXI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH_XMC=y
 CONFIG_SPI=y
-CONFIG_DM_SPI=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_OHCI_HCD=y
diff --git a/configs/libretech_all_h5_cc_h5_defconfig b/configs/libretech_all_h5_cc_h5_defconfig
index 25bfe52b32..c3aa4b1061 100644
--- a/configs/libretech_all_h5_cc_h5_defconfig
+++ b/configs/libretech_all_h5_cc_h5_defconfig
@@ -7,10 +7,8 @@ CONFIG_DRAM_CLK=672
 CONFIG_MMC_SUNXI_SLOT_EXTRA=2
 CONFIG_SPL_SPI_SUNXI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH_XMC=y
 CONFIG_SUN8I_EMAC=y
 CONFIG_SPI=y
-CONFIG_DM_SPI=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_OHCI_HCD=y
diff --git a/configs/oceanic_5205_5inmfd_defconfig b/configs/oceanic_5205_5inmfd_defconfig
index 9ba115c97d..7ce63ba665 100644
--- a/configs/oceanic_5205_5inmfd_defconfig
+++ b/configs/oceanic_5205_5inmfd_defconfig
@@ -11,5 +11,6 @@ CONFIG_MMC0_CD_PIN=""
 CONFIG_SPL_SPI_SUNXI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SUN8I_EMAC=y
+CONFIG_SPI=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_OHCI_HCD=y
diff --git a/configs/orangepi_win_defconfig b/configs/orangepi_win_defconfig
index 8c2179ba8b..133755291a 100644
--- a/configs/orangepi_win_defconfig
+++ b/configs/orangepi_win_defconfig
@@ -9,5 +9,6 @@ CONFIG_SPL_SPI_SUNXI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_PHY_REALTEK=y
 CONFIG_SUN8I_EMAC=y
+CONFIG_SPI=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_OHCI_HCD=y
diff --git a/configs/pine64-lts_defconfig b/configs/pine64-lts_defconfig
index 6209e68e2d..75a77acc44 100644
--- a/configs/pine64-lts_defconfig
+++ b/configs/pine64-lts_defconfig
@@ -11,5 +11,6 @@ CONFIG_MMC_SUNXI_SLOT_EXTRA=2
 CONFIG_SPL_SPI_SUNXI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SUN8I_EMAC=y
+CONFIG_SPI=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_OHCI_HCD=y
diff --git a/configs/sopine_baseboard_defconfig b/configs/sopine_baseboard_defconfig
index 0093076dc5..982f7b0b67 100644
--- a/configs/sopine_baseboard_defconfig
+++ b/configs/sopine_baseboard_defconfig
@@ -13,5 +13,6 @@ 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
 CONFIG_USB_OHCI_HCD=y
-- 
2.25.1


  parent reply	other threads:[~2022-01-11 12:46 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-11 12:46 [PATCH 0/7] sunxi: Fix U-Boot proper SPI operation Andre Przywara
2022-01-11 12:46 ` [PATCH 1/7] sunxi: SPI: fix pinmuxing for Allwinner H6 SoCs Andre Przywara
2022-01-11 12:46 ` Andre Przywara [this message]
2022-01-24 17:02   ` [PATCH 2/7] sunxi: Kconfig: Fix up SPI configuration Andre Przywara
2022-02-24  7:26   ` Jagan Teki
2022-02-24  7:26     ` Jagan Teki
2022-01-11 12:46 ` [PATCH 3/7] env: sunxi: Define location in SPI flash Andre Przywara
2022-01-11 12:46 ` [PATCH 4/7] sunxi: use boot source for determining environment location Andre Przywara
2022-04-15 17:28   ` Chris Morgan
2022-04-20 23:33     ` Andre Przywara
2022-05-05 15:43       ` Chris Morgan
2022-01-11 12:46 ` [PATCH 5/7] env: sunxi: enable ENV_IS_IN_SPI_FLASH Andre Przywara
2022-01-11 12:46 ` [PATCH 6/7] sunxi: boards: Enable SPI flash support in U-Boot proper Andre Przywara
2022-01-11 12:46 ` [PATCH 7/7] sunxi: H6: Enable SPI0 in DT when no eMMC is used Andre Przywara
2022-01-20 13:38   ` Jagan Teki
2022-01-20 14:06     ` Andre Przywara
2022-01-20 14:36       ` Jagan Teki
2022-02-24  7:30         ` Jagan Teki
2022-02-24 11:00           ` Andre Przywara
2022-03-10 12:05 ` [PATCH 0/7] sunxi: Fix U-Boot proper SPI operation Jagan Teki

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=20220111124607.863952-3-andre.przywara@arm.com \
    --to=andre.przywara@arm.com \
    --cc=dwagenk@mailbox.org \
    --cc=hauke@hauke-m.de \
    --cc=icenowy@aosc.xyz \
    --cc=jagan@amarulasolutions.com \
    --cc=jernej.skrabec@gmail.com \
    --cc=joe.hershberger@ni.com \
    --cc=samuel@sholland.org \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=wd@denx.de \
    --cc=wens@csie.org \
    /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