summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2016-03-22 20:10:30 +0100
committerKlaus Goger <klaus.goger@theobroma-systems.com>2016-09-18 12:38:56 +0200
commitaf0b45d8a7b103593d4c8e46222773fdef040d7e (patch)
tree22897dbcfb17b96b4cfde13b09399d45128dab33
parentc925ff29540e234ff86448eb33bee38ae16d0bc1 (diff)
sunxi: Turn satapwr on from board_init
There are 2 reasons for doing this: 1) The main reason for doing this is to move it outside of board/sunxi/ahci.c, so that it can be used on boards which use a usb<->sata chip too; 2) While doing this I realized that doing it from board_init also meant doing it much earlier. Some printf get_timer(0) calls show that the time between board_init() and scsi_init() is more then 600 ms, so we can drop the mdelay(500) While at it also drop the printf("SUNXI SCSI INIT\n") AHCI init is noisy enough by itself. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
-rw-r--r--board/sunxi/ahci.c8
-rw-r--r--board/sunxi/board.c4
2 files changed, 4 insertions, 8 deletions
diff --git a/board/sunxi/ahci.c b/board/sunxi/ahci.c
index 6d51b9b8e9..522e54ab16 100644
--- a/board/sunxi/ahci.c
+++ b/board/sunxi/ahci.c
@@ -72,14 +72,6 @@ static int sunxi_ahci_phy_init(u32 base)
void scsi_init(void)
{
- printf("SUNXI SCSI INIT\n");
-#ifdef CONFIG_SATAPWR
- gpio_request(CONFIG_SATAPWR, "satapwr");
- gpio_direction_output(CONFIG_SATAPWR, 1);
- /* Give attached sata device time to power-up to avoid link timeouts */
- mdelay(500);
-#endif
-
if (sunxi_ahci_phy_init(SUNXI_SATA_BASE) < 0)
return;
diff --git a/board/sunxi/board.c b/board/sunxi/board.c
index e16718f308..2e2a1f59bc 100644
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -90,6 +90,10 @@ int board_init(void)
if (ret)
return ret;
+#ifdef CONFIG_SATAPWR
+ gpio_request(CONFIG_SATAPWR, "satapwr");
+ gpio_direction_output(CONFIG_SATAPWR, 1);
+#endif
#ifdef CONFIG_MACPWR
gpio_request(CONFIG_MACPWR, "macpwr");
gpio_direction_output(CONFIG_MACPWR, 1);