Hi, On Thu, Sep 27, 2012 at 3:32 PM, Stephen Warren <swar...@wwwdotorg.org> wrote: > On 09/27/2012 03:52 PM, Lucas Stach wrote: >> The prototypes used in board files were all scattered out, which lead to >> code duplication between SPL and normal U-Boot and some prototypes not >> actually >> being used. Consolidate this in a common board header. > >> This will allow to push down the calling of the pinmux functions into the >> respective drivers and this way cut down on complexity from the common board >> code. > > I don't think that (calling pinmux from drivers) would be a good idea. > The entire pinmux should be set up globally when the system boots in > order to avoid conflicts part-way through a change, and to avoid > duplicating pinmux calls into every single driver. Unless a particular > driver actively needs to switch between different pinmux configurations > at run-time (e.g. an I2C bus mux that uses pinmux to do the muxing).
Well I'm not so keen on this approach. Ultimately we want to be able to start a driver (and set up its pinmux) only if it is needed during boot. The idea behind funcmux is that it is a single line call from a driver or board to select the required setting, so the overhead is small - and we know that for most peripherals there are only a small number of options. I can't predict where we might end up with fdt-based pinmux, but it seems to me that global pinmux should be a board/implementer option, not something required by the use of Tegra. Just my 2c worth. > > That said, this change to simplify all the #includes is probably > reasonable. One comment below. > >> diff --git a/arch/arm/include/asm/arch-tegra/board.h >> b/arch/arm/include/asm/arch-tegra/board.h > >> -/* Setup UARTs for the board according to the selected config */ >> +/* Set up pinmux to make UART usable */ >> +void gpio_config_uart(void); /* CONFIG_SPI_UART_SWITCH */ >> +void gpio_early_init_uart(void); /*!CONFIG_SPI_UART_SWITCH */ >> + >> +/* Set up early UART output */ >> void board_init_uart_f(void); >> >> +/* Set up any early GPIOs the board might need for proper operation */ >> +void gpio_early_init(void); /* overrideable GPIO config */ > > I think we should just rip out all the CONFIG_SPI_UART_SWITCH stuff. > It's only there to support one board with a completely broken HW design. > Still, that could happen in a separate patch after this though. Yes I agree the seaboard is broken, but this is an upstream board and is in fact the only one I have to test with. Could we perhaps delay ripping this out for a little while longer? Regards, Simon > _______________________________________________ > U-Boot mailing list > U-Boot@lists.denx.de > http://lists.denx.de/mailman/listinfo/u-boot _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot