Skip to contentSkip to conversation

tegra20: tamonten: Fix the early gpio init

PATCH New Alban Bedel 3 participants 3 messages Feb 24, 2015

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 tegra20: tamonten: Fix the early gpio init

As the GPIO driver isn't ready when gpio_early_init() is called the normal GPIO API can't be used. Fix this like on seaboard by using the lower level function tegra_spl_gpio_direction_output().

---
v2: Updated the log message to better describe the problem

---
 board/avionic-design/common/tamonten.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
board/avionic-design/common/tamonten.c +3 -1
index 9c86779..ea2425a 100644
@@ -23,8 +23,10 @@
 #ifdef CONFIG_BOARD_EARLY_INIT_F
 void gpio_early_init(void)
 {
+#ifndef CONFIG_SPL_BUILD
 	gpio_request(GPIO_PI4, NULL);
-	gpio_direction_output(GPIO_PI4, 1);
+#endif
+	tegra_spl_gpio_direction_output(GPIO_PI4, 1);
 }
 #endif
 
Signature · 1 line
2.3.0
#1 lore raw

PATCH v2 1/1 tegra20: tamonten: Fix the early gpio init

+Tom Rini

Hi,

Quoted 28 lines · Alban Bedel

As the GPIO driver isn't ready when gpio_early_init() is called the normal GPIO API can't be used. Fix this like on seaboard by using the lower level function tegra_spl_gpio_direction_output().

---
v2: Updated the log message to better describe the problem

---
 board/avionic-design/common/tamonten.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
board/avionic-design/common/tamonten.c +3 -2
index 9c86779..ea2425a 100644
@@ -23,8 +23,10 @@
 #ifdef CONFIG_BOARD_EARLY_INIT_F
 void gpio_early_init(void)
 {
+#ifndef CONFIG_SPL_BUILD
        gpio_request(GPIO_PI4, NULL);
-       gpio_direction_output(GPIO_PI4, 1);
+#endif
+       tegra_spl_gpio_direction_output(GPIO_PI4, 1);
 }
 #endif
 
--
Quoted 2 lines

2.3.0

From here:

http://lists.denx.de/pipermail/u-boot/2014-October/190492.html

Believe it or not we have still not pulled in the SPL series, but you can test with it (u-boot-dm/spl-working).

I am waiting for Masahiro's kconfig change to go in and then I think I can go ahead.

Regards,
Simon

#2 lore raw

PATCH v2 1/1 tegra20: tamonten: Fix the early gpio init

In reply to Alban Bedel
Quoted 3 lines · Alban Bedel

As the GPIO driver isn't ready when gpio_early_init() is called the normal GPIO API can't be used. Fix this like on seaboard by using the lower level function tegra_spl_gpio_direction_output().

This seems to match what Seaboard does, so it seems like a fine fix for now.