sunxi: Convert CONFIG_SATAPWR to Kconfig
authorMylène Josserand <mylene.josserand@free-electrons.com>
Sun, 2 Apr 2017 10:59:09 +0000 (12:59 +0200)
committerMaxime Ripard <maxime.ripard@free-electrons.com>
Thu, 20 Apr 2017 11:20:31 +0000 (13:20 +0200)
Convert the CONFIG_SATAPWR into kconfig.
Thanks to that, many SYS_EXTRA_OPTIONS can be removed from some
defconfigs.

Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
16 files changed:
board/sunxi/Kconfig
board/sunxi/board.c
configs/A10-OLinuXino-Lime_defconfig
configs/A20-OLinuXino-Lime2_defconfig
configs/A20-OLinuXino-Lime_defconfig
configs/A20-OLinuXino_MICRO_defconfig
configs/A20-Olimex-SOM-EVB_defconfig
configs/Cubieboard2_defconfig
configs/Cubieboard_defconfig
configs/Cubietruck_defconfig
configs/Itead_Ibox_A20_defconfig
configs/Lamobo_R1_defconfig
configs/Linksprite_pcDuino3_Nano_defconfig
configs/Linksprite_pcDuino3_defconfig
configs/Sinovoip_BPI_M3_defconfig
configs/orangepi_plus_defconfig

index a667c9e5c5c115dd7c33a95678888751195ecf0e..aa6b84bbbb52c6f0fe73959482c75050088266ba 100644 (file)
@@ -706,6 +706,13 @@ config VIDEO_LCD_TL059WV5C0
 
 endchoice
 
+config SATAPWR
+       string "SATA power pin"
+       default ""
+       help
+         Set the pins used to power the SATA. This takes a string in the
+         format understood by sunxi_name_to_gpio, e.g. PH1 for pin 1 of
+         port H.
 
 config GMAC_TX_DELAY
        int "GMAC Transmit Clock Delay Chain"
index b9660128e5e74535be9756a95f36b245f30e1565..8043a8dbacd1fe1427237e1ee5af76013ecc0c36 100644 (file)
@@ -80,7 +80,7 @@ DECLARE_GLOBAL_DATA_PTR;
 /* add board specific code here */
 int board_init(void)
 {
-       __maybe_unused int id_pfr1, ret;
+       __maybe_unused int id_pfr1, ret, satapwr_pin;
 
        gd->bd->bi_boot_params = (PHYS_SDRAM_0 + 0x100);
 
@@ -118,8 +118,9 @@ int board_init(void)
                return ret;
 
 #ifdef CONFIG_SATAPWR
-       gpio_request(CONFIG_SATAPWR, "satapwr");
-       gpio_direction_output(CONFIG_SATAPWR, 1);
+       satapwr_pin = sunxi_name_to_gpio(CONFIG_SATAPWR);
+       gpio_request(satapwr_pin, "satapwr");
+       gpio_direction_output(satapwr_pin, 1);
 #endif
 #ifdef CONFIG_MACPWR
        gpio_request(CONFIG_MACPWR, "macpwr");
index 967a3d442be47e5d4a089689befc41508ede9985..50cd9e167480edbbe434674a81b33c7c174f9fdd 100644 (file)
@@ -5,10 +5,10 @@ CONFIG_DRAM_CLK=480
 CONFIG_DRAM_EMR1=4
 CONFIG_SYS_CLK_FREQ=912000000
 CONFIG_MMC0_CD_PIN="PH1"
+CONFIG_SATAPWR="PC3"
 CONFIG_DEFAULT_DEVICE_TREE="sun4i-a10-olinuxino-lime"
 CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="SATAPWR=SUNXI_GPC(3)"
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
 # CONFIG_CMD_IMLS is not set
index 0c9c7943f98192d4d5f32d78c8c05f3bf11fff03..427b7c313a0a867a89b835f103bd8976841b1156 100644 (file)
@@ -5,10 +5,10 @@ CONFIG_DRAM_CLK=384
 CONFIG_MMC0_CD_PIN="PH1"
 CONFIG_USB0_VBUS_PIN="PC17"
 CONFIG_USB0_VBUS_DET="PH5"
+CONFIG_SATAPWR="PC3"
 CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-olinuxino-lime2"
 CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="SATAPWR=SUNXI_GPC(3)"
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
 # CONFIG_CMD_IMLS is not set
index d83fc2b4031d3c1ded4d4e8b0f57022f5fedd9a8..285f1ac85b518b4eecb79b25bbef7f5731434066 100644 (file)
@@ -3,10 +3,10 @@ CONFIG_ARCH_SUNXI=y
 CONFIG_MACH_SUN7I=y
 CONFIG_DRAM_CLK=384
 CONFIG_MMC0_CD_PIN="PH1"
+CONFIG_SATAPWR="PC3"
 CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-olinuxino-lime"
 CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="SATAPWR=SUNXI_GPC(3)"
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
 # CONFIG_CMD_IMLS is not set
index c25556bdac7a9efcbb54779735a7fb2b2fae0c03..4aab6409d2f1c7976528eeab3085d1578d7fc613 100644 (file)
@@ -6,10 +6,10 @@ CONFIG_MMC0_CD_PIN="PH1"
 CONFIG_MMC3_CD_PIN="PH11"
 CONFIG_MMC_SUNXI_SLOT_EXTRA=3
 CONFIG_VIDEO_VGA=y
+CONFIG_SATAPWR="PB8"
 CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-olinuxino-micro"
 CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="SATAPWR=SUNXI_GPB(8)"
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
 # CONFIG_CMD_IMLS is not set
index ce658ca984f637b2cddf3ec09e60bab1689934fc..6c87648d4f7bf70ab357277b272165efb3ecaba4 100644 (file)
@@ -8,10 +8,10 @@ CONFIG_MMC3_PINS="PH"
 CONFIG_MMC_SUNXI_SLOT_EXTRA=3
 CONFIG_USB0_VBUS_PIN="PB9"
 CONFIG_USB0_VBUS_DET="PH5"
+CONFIG_SATAPWR="PC3"
 CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-olimex-som-evb"
 CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="SATAPWR=SUNXI_GPC(3)"
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
 # CONFIG_CMD_IMLS is not set
index 8968623ec5140cfc8a65844d760592f1b2e74760..02c503f672a2d3046256acf9b14f7c2d1367e673 100644 (file)
@@ -3,10 +3,10 @@ CONFIG_ARCH_SUNXI=y
 CONFIG_MACH_SUN7I=y
 CONFIG_DRAM_CLK=480
 CONFIG_MMC0_CD_PIN="PH1"
+CONFIG_SATAPWR="PB8"
 CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-cubieboard2"
 CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="SATAPWR=SUNXI_GPB(8)"
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
 # CONFIG_CMD_IMLS is not set
index 78fd4a211bcf5fd43916b137b5dd25c1db17b597..a8e9c988d5efca180eb6a1802860ffb474b6758e 100644 (file)
@@ -3,10 +3,10 @@ CONFIG_ARCH_SUNXI=y
 CONFIG_MACH_SUN4I=y
 CONFIG_DRAM_CLK=480
 CONFIG_MMC0_CD_PIN="PH1"
+CONFIG_SATAPWR="PB8"
 CONFIG_DEFAULT_DEVICE_TREE="sun4i-a10-cubieboard"
 CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="SATAPWR=SUNXI_GPB(8)"
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
 # CONFIG_CMD_IMLS is not set
index 9f2e994f71b4d4e3c765e3185016e08396e95b16..f9d56c8f9d8027b79cf542357685a8d7772de351 100644 (file)
@@ -7,11 +7,11 @@ CONFIG_USB0_VBUS_PIN="PH17"
 CONFIG_USB0_VBUS_DET="PH22"
 CONFIG_USB0_ID_DET="PH19"
 CONFIG_VIDEO_VGA=y
+CONFIG_SATAPWR="PH12"
 CONFIG_GMAC_TX_DELAY=1
 CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-cubietruck"
 CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="SATAPWR=SUNXI_GPH(12)"
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
 # CONFIG_CMD_IMLS is not set
index bba0c5973b868642cabde43c6a0954d14bdf620d..4bae19f2fae8c30fe34230f70af01cfff8b4e856 100644 (file)
@@ -3,10 +3,10 @@ CONFIG_ARCH_SUNXI=y
 CONFIG_MACH_SUN7I=y
 CONFIG_DRAM_CLK=480
 CONFIG_MMC0_CD_PIN="PH1"
+CONFIG_SATAPWR="PB8"
 CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-itead-ibox"
 CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="SATAPWR=SUNXI_GPB(8)"
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
 # CONFIG_CMD_IMLS is not set
index 61a9316e7ad3434e9fe066746bf4d37623e8aa3d..38eea97000c16dbf37050f3969e85fd7dcb7387f 100644 (file)
@@ -3,11 +3,12 @@ CONFIG_ARCH_SUNXI=y
 CONFIG_MACH_SUN7I=y
 CONFIG_DRAM_CLK=432
 CONFIG_MMC0_CD_PIN="PH10"
+CONFIG_SATAPWR="PB3"
 CONFIG_GMAC_TX_DELAY=4
 CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-lamobo-r1"
 CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="MACPWR=SUNXI_GPH(23),SATAPWR=SUNXI_GPB(3)"
+CONFIG_SYS_EXTRA_OPTIONS="MACPWR=SUNXI_GPH(23)"
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
 # CONFIG_CMD_IMLS is not set
index 38adfc0f28fad15441c5b9918ec18c47c682d3c1..80416cb7b19228e8964ad8b6defa13160ee0c63b 100644 (file)
@@ -4,11 +4,11 @@ CONFIG_MACH_SUN7I=y
 CONFIG_DRAM_CLK=408
 CONFIG_DRAM_ZQ=122
 CONFIG_USB1_VBUS_PIN="PH11"
+CONFIG_SATAPWR="PH2"
 CONFIG_GMAC_TX_DELAY=3
 CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-pcduino3-nano"
 CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="SATAPWR=SUNXI_GPH(2)"
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
 # CONFIG_CMD_IMLS is not set
index 8e8455eee45c074cdf1fa931abd830b2d0ff6f1f..b9f89a013ed71e52ce4cae6c4d4951f87ecbf9bc 100644 (file)
@@ -3,10 +3,10 @@ CONFIG_ARCH_SUNXI=y
 CONFIG_MACH_SUN7I=y
 CONFIG_DRAM_CLK=480
 CONFIG_DRAM_ZQ=122
+CONFIG_SATAPWR="PH2"
 CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-pcduino3"
 CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="SATAPWR=SUNXI_GPH(2)"
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
 # CONFIG_CMD_IMLS is not set
index aec3f7d4bba8c74be3172d42ee97564c8678d06a..45eadcb44312c585bacb1c45fbf0b836ee193ef3 100644 (file)
@@ -11,9 +11,9 @@ CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT"
 CONFIG_USB0_ID_DET="PH11"
 CONFIG_USB1_VBUS_PIN="PD24"
 CONFIG_AXP_GPIO=y
+CONFIG_SATAPWR="PD25"
 CONFIG_DEFAULT_DEVICE_TREE="sun8i-a83t-sinovoip-bpi-m3"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="SATAPWR=SUNXI_GPD(25)"
 CONFIG_CONSOLE_MUX=y
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
index fbaa5322e84edf2f970ec71aab1a49effcf50006..a14c7c75f0858d986592665ac27982abd594b91e 100644 (file)
@@ -6,9 +6,10 @@ CONFIG_DRAM_ZQ=3881979
 CONFIG_DRAM_ODT_EN=y
 CONFIG_MMC_SUNXI_SLOT_EXTRA=2
 CONFIG_USB1_VBUS_PIN="PG13"
+CONFIG_SATAPWR="PG11"
 CONFIG_DEFAULT_DEVICE_TREE="sun8i-h3-orangepi-plus"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="SATAPWR=SUNXI_GPG(11),MACPWR=SUNXI_GPD(6)"
+CONFIG_SYS_EXTRA_OPTIONS="MACPWR=SUNXI_GPD(6)"
 CONFIG_CONSOLE_MUX=y
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y