On Monday 28 November 2011 15:14:40 Simon Glass wrote: > On Wed, Nov 23, 2011 at 3:40 PM, Mike Frysinger wrote: > > On Wednesday 23 November 2011 17:59:06 Simon Glass wrote: > >> + int i; > > > > size_t > > Ick. OK.
why ick ? :) > >> + for (i = 0; i < UART_COUNT; i++) { > > > > ... and then did ARRAY_SIZE(id_for_uart) ? > > > >> +void board_init_uart_f(void) > >> +{ > >> + int uart_ids = 0; /* bit mask of which UART ids to enable */ > >> + > >> +#ifdef CONFIG_TEGRA2_ENABLE_UARTA > >> + uart_ids |= UARTA; > >> +#endif > >> +#ifdef CONFIG_TEGRA2_ENABLE_UARTB > >> + uart_ids |= UARTB; > >> +#endif > >> +#ifdef CONFIG_TEGRA2_ENABLE_UARTD > >> + uart_ids |= UARTD; > >> +#endif > >> + setup_uarts(uart_ids); > >> +} > > > > we added a func in the Blackfin pinmux API where you could pass it a list > > of peripherals to mux. so you could do: > > static const unsigned pin_list[] = { > > #ifdef CONFIG_TEGRA2_ENABLE_UARTA > > UART1, > > #endif > > 0, > > }; > > pinmux_request_list(pin_list); > > > > and the list version would just walk the 0-terminated array calling > > pinmux_request() automatically > > Well yes, but funcmux isn't about pins, it's about whole functions. We > could provide a new function to enable a list of functions, but for > now there really wouldn't be any callers. UART1 is just our own number > - the callee requires a peripheral ID. the Blackfin API is given an ID that encodes both the requested function and the pin. i meant doing that instead of bit packing and unpacking ids that later get expanded. although with the pinmux framework getting merged into Linux, this is probably now a moot point. stick with whatever you have working as it'll all get thrown out once we migrate to that in u-boot :). -mike
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot