[U-Boot] [PATCH 6/7] Convert CONFIG_DEFAULT_SPI_* to Kconfig
Patrick Delaunay
patrick.delaunay at st.com
Wed Feb 27 14:20:37 UTC 2019
This converts the following to Kconfig:
CONFIG_DEFAULT_SPI_BUS
CONFIG_DEFAULT_SPI_MODE
Signed-off-by: Patrick Delaunay <patrick.delaunay at st.com>
---
cmd/Kconfig | 12 +++++++++++-
cmd/spi.c | 7 -------
configs/bg0900_defconfig | 1 +
configs/ls1012aqds_qspi_defconfig | 3 +++
configs/ls1012aqds_tfa_SECURE_BOOT_defconfig | 2 ++
configs/ls1012aqds_tfa_defconfig | 2 ++
configs/mx28evk_auart_console_defconfig | 1 +
configs/mx28evk_defconfig | 1 +
configs/mx28evk_nand_defconfig | 1 +
configs/mx28evk_spi_defconfig | 1 +
configs/mx31pdk_defconfig | 2 ++
include/configs/bg0900.h | 7 -------
include/configs/cl-som-am57x.h | 1 -
include/configs/ls1012aqds.h | 2 --
include/configs/mx28evk.h | 6 ------
include/configs/mx31pdk.h | 3 ---
scripts/config_whitelist.txt | 2 --
17 files changed, 25 insertions(+), 29 deletions(-)
diff --git a/cmd/Kconfig b/cmd/Kconfig
index 3ea42e4..fbc1b6f 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -1030,10 +1030,20 @@ config CMD_SF_TEST
everything is working properly.
config CMD_SPI
- bool "sspi"
+ bool "sspi - Command to access spi device"
help
SPI utility command.
+config DEFAULT_SPI_BUS
+ int "default spi bus used by sspi command"
+ depends on CMD_SPI
+ default 0
+
+config DEFAULT_SPI_MODE
+ hex "default spi mode used by sspi command (see include/spi.h)"
+ depends on CMD_SPI
+ default 0
+
config CMD_TSI148
bool "tsi148 - Command to access tsi148 device"
help
diff --git a/cmd/spi.c b/cmd/spi.c
index 9a2edcf..75226fd 100644
--- a/cmd/spi.c
+++ b/cmd/spi.c
@@ -22,13 +22,6 @@
# define MAX_SPI_BYTES 32 /* Maximum number of bytes we can handle */
#endif
-#ifndef CONFIG_DEFAULT_SPI_BUS
-# define CONFIG_DEFAULT_SPI_BUS 0
-#endif
-#ifndef CONFIG_DEFAULT_SPI_MODE
-# define CONFIG_DEFAULT_SPI_MODE SPI_MODE_0
-#endif
-
/*
* Values from last command.
*/
diff --git a/configs/bg0900_defconfig b/configs/bg0900_defconfig
index a8b5f86..2c4d3e3 100644
--- a/configs/bg0900_defconfig
+++ b/configs/bg0900_defconfig
@@ -23,6 +23,7 @@ CONFIG_CMD_GPIO=y
CONFIG_CMD_NAND_TRIMFFS=y
CONFIG_CMD_SF=y
CONFIG_CMD_SPI=y
+CONFIG_DEFAULT_SPI_BUS=2
CONFIG_CMD_DHCP=y
CONFIG_CMD_MII=y
CONFIG_CMD_PING=y
diff --git a/configs/ls1012aqds_qspi_defconfig b/configs/ls1012aqds_qspi_defconfig
index 1bf9343..d2c3eea 100644
--- a/configs/ls1012aqds_qspi_defconfig
+++ b/configs/ls1012aqds_qspi_defconfig
@@ -27,7 +27,10 @@ CONFIG_CMD_I2C=y
CONFIG_CMD_MMC=y
CONFIG_CMD_PCI=y
CONFIG_CMD_SF=y
+CONFIG_CMD_SPI=y
+CONFIG_DEFAULT_SPI_BUS=1
CONFIG_CMD_USB=y
+CONFIG_DEFAULT_SPI_BUS=1
# CONFIG_CMD_SETEXPR is not set
CONFIG_CMD_CACHE=y
CONFIG_CMD_DATE=y
diff --git a/configs/ls1012aqds_tfa_SECURE_BOOT_defconfig b/configs/ls1012aqds_tfa_SECURE_BOOT_defconfig
index 747fa3d..9a6139e 100644
--- a/configs/ls1012aqds_tfa_SECURE_BOOT_defconfig
+++ b/configs/ls1012aqds_tfa_SECURE_BOOT_defconfig
@@ -27,6 +27,8 @@ CONFIG_CMD_I2C=y
CONFIG_CMD_MMC=y
CONFIG_CMD_PCI=y
CONFIG_CMD_SF=y
+CONFIG_CMD_SPI=y
+CONFIG_DEFAULT_SPI_BUS=1
CONFIG_CMD_USB=y
# CONFIG_CMD_SETEXPR is not set
CONFIG_CMD_CACHE=y
diff --git a/configs/ls1012aqds_tfa_defconfig b/configs/ls1012aqds_tfa_defconfig
index a41757d..d18d40a 100644
--- a/configs/ls1012aqds_tfa_defconfig
+++ b/configs/ls1012aqds_tfa_defconfig
@@ -27,6 +27,8 @@ CONFIG_CMD_I2C=y
CONFIG_CMD_MMC=y
CONFIG_CMD_PCI=y
CONFIG_CMD_SF=y
+CONFIG_CMD_SPI=y
+CONFIG_DEFAULT_SPI_BUS=1
CONFIG_CMD_USB=y
# CONFIG_CMD_SETEXPR is not set
CONFIG_CMD_CACHE=y
diff --git a/configs/mx28evk_auart_console_defconfig b/configs/mx28evk_auart_console_defconfig
index beb10c4..c54b933 100644
--- a/configs/mx28evk_auart_console_defconfig
+++ b/configs/mx28evk_auart_console_defconfig
@@ -23,6 +23,7 @@ CONFIG_CMD_MMC=y
CONFIG_CMD_NAND_TRIMFFS=y
CONFIG_CMD_SF=y
CONFIG_CMD_SPI=y
+CONFIG_DEFAULT_SPI_BUS=2
CONFIG_CMD_USB=y
CONFIG_CMD_DHCP=y
CONFIG_CMD_MII=y
diff --git a/configs/mx28evk_defconfig b/configs/mx28evk_defconfig
index be1feb3..187467d 100644
--- a/configs/mx28evk_defconfig
+++ b/configs/mx28evk_defconfig
@@ -23,6 +23,7 @@ CONFIG_CMD_MMC=y
CONFIG_CMD_NAND_TRIMFFS=y
CONFIG_CMD_SF=y
CONFIG_CMD_SPI=y
+CONFIG_DEFAULT_SPI_BUS=2
CONFIG_CMD_USB=y
CONFIG_CMD_DHCP=y
CONFIG_CMD_MII=y
diff --git a/configs/mx28evk_nand_defconfig b/configs/mx28evk_nand_defconfig
index 61e3586..7d891e7 100644
--- a/configs/mx28evk_nand_defconfig
+++ b/configs/mx28evk_nand_defconfig
@@ -22,6 +22,7 @@ CONFIG_CMD_MMC=y
CONFIG_CMD_NAND_TRIMFFS=y
CONFIG_CMD_SF=y
CONFIG_CMD_SPI=y
+CONFIG_DEFAULT_SPI_BUS=2
CONFIG_CMD_USB=y
CONFIG_CMD_DHCP=y
CONFIG_CMD_MII=y
diff --git a/configs/mx28evk_spi_defconfig b/configs/mx28evk_spi_defconfig
index 3198baf..cb5b1b3 100644
--- a/configs/mx28evk_spi_defconfig
+++ b/configs/mx28evk_spi_defconfig
@@ -22,6 +22,7 @@ CONFIG_CMD_MMC=y
CONFIG_CMD_NAND_TRIMFFS=y
CONFIG_CMD_SF=y
CONFIG_CMD_SPI=y
+CONFIG_DEFAULT_SPI_BUS=2
CONFIG_CMD_USB=y
CONFIG_CMD_DHCP=y
CONFIG_CMD_MII=y
diff --git a/configs/mx31pdk_defconfig b/configs/mx31pdk_defconfig
index c6dcb45..2267818 100644
--- a/configs/mx31pdk_defconfig
+++ b/configs/mx31pdk_defconfig
@@ -13,6 +13,8 @@ CONFIG_SPL_NAND_SUPPORT=y
# CONFIG_AUTO_COMPLETE is not set
CONFIG_CMD_BOOTZ=y
CONFIG_CMD_SPI=y
+CONFIG_DEFAULT_SPI_BUS=1
+CONFIG_DEFAULT_SPI_MODE=4
# CONFIG_CMD_SETEXPR is not set
CONFIG_CMD_DHCP=y
CONFIG_CMD_MII=y
diff --git a/include/configs/bg0900.h b/include/configs/bg0900.h
index 32b975f..0c3d54a 100644
--- a/include/configs/bg0900.h
+++ b/include/configs/bg0900.h
@@ -19,11 +19,6 @@
#define CONFIG_FEC_MXC
#endif
-/* SPI */
-#ifdef CONFIG_CMD_SPI
-#define CONFIG_DEFAULT_SPI_BUS 2
-#define CONFIG_DEFAULT_SPI_MODE SPI_MODE_0
-
/* SPI FLASH */
#ifdef CONFIG_CMD_SF
#define CONFIG_ENV_SPI_BUS 2
@@ -32,8 +27,6 @@
#define CONFIG_ENV_SPI_MODE SPI_MODE_0
#endif
-#endif
-
/* Boot Linux */
#define CONFIG_BOOTFILE "uImage"
#define CONFIG_BOOTCOMMAND "bootm"
diff --git a/include/configs/cl-som-am57x.h b/include/configs/cl-som-am57x.h
index c9e80c2..687a9e7 100644
--- a/include/configs/cl-som-am57x.h
+++ b/include/configs/cl-som-am57x.h
@@ -27,7 +27,6 @@
/* SPI Flash support */
#define CONFIG_TI_SPI_MMAP
-#define CONFIG_DEFAULT_SPI_MODE SPI_MODE_3
/* SPI SPL defines */
/* Offsets: 0K - SPL1, 64K - SPL2, 128K - SPL3, 192K - SPL4, 256K - U-Boot */
diff --git a/include/configs/ls1012aqds.h b/include/configs/ls1012aqds.h
index aac782d..fb0d1ba 100644
--- a/include/configs/ls1012aqds.h
+++ b/include/configs/ls1012aqds.h
@@ -74,9 +74,7 @@
/* DSPI */
#define CONFIG_FSL_DSPI1
-#define CONFIG_DEFAULT_SPI_BUS 1
-#define CONFIG_CMD_SPI
#define MMAP_DSPI DSPI1_BASE_ADDR
#define CONFIG_SYS_DSPI_CTAR0 1
diff --git a/include/configs/mx28evk.h b/include/configs/mx28evk.h
index 82ac6cc..a078e3a 100644
--- a/include/configs/mx28evk.h
+++ b/include/configs/mx28evk.h
@@ -74,12 +74,6 @@
#define CONFIG_USB_MAX_CONTROLLER_COUNT 1
#endif
-/* SPI */
-#ifdef CONFIG_CMD_SPI
-#define CONFIG_DEFAULT_SPI_BUS 2
-#define CONFIG_DEFAULT_SPI_MODE SPI_MODE_0
-#endif
-
/* Framebuffer support */
#ifdef CONFIG_VIDEO
#define CONFIG_VIDEO_LOGO
diff --git a/include/configs/mx31pdk.h b/include/configs/mx31pdk.h
index 4765764..993d131 100644
--- a/include/configs/mx31pdk.h
+++ b/include/configs/mx31pdk.h
@@ -43,9 +43,6 @@
#define CONFIG_MXC_UART
#define CONFIG_MXC_UART_BASE UART1_BASE
-#define CONFIG_DEFAULT_SPI_BUS 1
-#define CONFIG_DEFAULT_SPI_MODE (SPI_MODE_0 | SPI_CS_HIGH)
-
/* PMIC Controller */
#define CONFIG_POWER
#define CONFIG_POWER_SPI
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index c2cc6fc..080bdf5 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -340,8 +340,6 @@ CONFIG_DEEP_SLEEP
CONFIG_DEFAULT
CONFIG_DEFAULT_CONSOLE
CONFIG_DEFAULT_IMMR
-CONFIG_DEFAULT_SPI_BUS
-CONFIG_DEFAULT_SPI_MODE
CONFIG_DEF_HWCONFIG
CONFIG_DELAY_ENVIRONMENT
CONFIG_DESIGNWARE_ETH
--
2.7.4
More information about the U-Boot
mailing list