public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 4/6] tegra: Add support for UART init in cpu board.c
Date: Mon, 28 Nov 2011 18:06:36 -0500	[thread overview]
Message-ID: <201111281806.37062.vapier@gentoo.org> (raw)
In-Reply-To: <CAPnjgZ0xCgrWrwm2XZTNReviFnz4knc-o26UuXb3Wx5FPw38Nw@mail.gmail.com>

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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20111128/4aeeb14f/attachment.pgp>

  reply	other threads:[~2011-11-28 23:06 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-23 22:59 [U-Boot] [PATCH 0/6] Introduce function mux library Simon Glass
2011-11-23 22:59 ` [U-Boot] [PATCH 1/6] tegra: Move cpu_init_cp15() to arch_cpu_init() Simon Glass
2011-11-23 23:34   ` Mike Frysinger
2011-11-28 19:00     ` Simon Glass
2011-11-28 18:12   ` Stephen Warren
2011-11-23 22:59 ` [U-Boot] [PATCH 2/6] tegra: Move clock_early_init() " Simon Glass
2011-11-28 18:12   ` Stephen Warren
2011-11-23 22:59 ` [U-Boot] [PATCH 3/6] tegra: Add a function mux feature Simon Glass
2011-11-23 23:36   ` Mike Frysinger
2011-11-28 18:17   ` Stephen Warren
2011-11-28 19:19     ` Simon Glass
2011-11-28 19:42       ` Stephen Warren
2011-11-28 22:57         ` Simon Glass
2011-11-23 22:59 ` [U-Boot] [PATCH 4/6] tegra: Add support for UART init in cpu board.c Simon Glass
2011-11-23 23:40   ` Mike Frysinger
2011-11-28 20:14     ` Simon Glass
2011-11-28 23:06       ` Mike Frysinger [this message]
2011-11-29  0:40         ` Simon Glass
2011-11-23 22:59 ` [U-Boot] [PATCH 5/6] tegra: Move boards over to use arch-level board UART function Simon Glass
2011-11-23 22:59 ` [U-Boot] [PATCH 6/6] tegra: Fix build error in plutux, medcom Simon Glass
2011-11-23 23:42   ` Mike Frysinger
2011-11-24 20:04   ` Thierry Reding
2011-11-28 18:18   ` Stephen Warren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201111281806.37062.vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox