From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Warren Date: Thu, 02 Oct 2014 09:42:18 -0600 Subject: [U-Boot] [PATCH] tegra20: tamonten: Fix the early gpio init In-Reply-To: <1412262898-26349-1-git-send-email-alban.bedel@avionic-design.de> References: <1412262898-26349-1-git-send-email-alban.bedel@avionic-design.de> Message-ID: <542D725A.3010003@wwwdotorg.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 10/02/2014 09:14 AM, Alban Bedel wrote: > To set gpio during the early init we now need to use > tegra_spl_gpio_direction_output(), copied from seaboard. > > Change-Id: Id0aadb17a71b78e75e8c3f8de374102b3eab767b That shouldn't be present on upstream patches. > Signed-off-by: Alban Bedel > --- > board/avionic-design/common/tamonten.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/board/avionic-design/common/tamonten.c b/board/avionic-design/common/tamonten.c > index 9c86779..ea2425a 100644 > --- a/board/avionic-design/common/tamonten.c > +++ b/board/avionic-design/common/tamonten.c > @@ -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); > } Surely you only want to call tegra_spl_*() from SPL, and not from non-SPL code? In other words, don't you need something more like: #ifdef CONFIG_SPL_BUILD tegra_spl_gpio_direction_output(GPIO_PI4, 1); #else gpio_request(GPIO_PI4, NULL); gpio_direction_output(GPIO_PI4, 1); #endif ... although perhaps the SPL and non-SPL code should simply be separated into separate files, so that there's no need for ifdefs, and it's obvious if SPL and non-SPL code are duplicating the same work?