From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Warren Date: Fri, 25 May 2012 10:24:50 -0600 Subject: [U-Boot] [PATCH v2 4/7] tegra: Allow boards to perform early GPIO setup In-Reply-To: <1337953588-20696-4-git-send-email-thierry.reding@avionic-design.de> References: <1337953588-20696-1-git-send-email-thierry.reding@avionic-design.de> <1337953588-20696-4-git-send-email-thierry.reding@avionic-design.de> Message-ID: <4FBFB252.9000301@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 05/25/2012 07:46 AM, Thierry Reding wrote: > The new gpio_early_init() function, which does nothing by default, can > be overridden by boards to configure GPIOs at an early stage. > diff --git a/board/nvidia/common/board.c b/board/nvidia/common/board.c > int board_early_init_f(void) > { > board_init_uart_f(); > > /* Initialize periph GPIOs */ > + gpio_early_init(); > #ifdef CONFIG_SPI_UART_SWITCH > gpio_early_init_uart(); > #else I assert that all early GPIO initialization should be reworked to use this new gpio_early_init(). In other words, now that there's a single generic gpio_early_init(), we should remove the following code right after it: #ifdef CONFIG_SPI_UART_SWITCH gpio_early_init_uart(); #else gpio_config_uart(); #endif and any boards that need to do any of that (which is just Seaboard I think) should do that from an implementation of the new generic gpio_early_init() in their board file. That way, common code won't have to know about crap like the SPI/UART muxing on Seaboard. That said, this need not be part of this patch or even this series, so I don't mean to nak this patch with these comments. And actually, I'd be all for ripping out all the SPI support on Seaboard and all related code anyway...