All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC PATCH 5/8] arm, davinci: Replace pinmuxing in da850_lowlevel.c
Date: Wed, 16 Nov 2011 07:49:58 +0100	[thread overview]
Message-ID: <4EC35D16.10301@denx.de> (raw)
In-Reply-To: <1321353452-28843-6-git-send-email-christian.riesch@omicron.at>

Hello Christian,

Christian Riesch wrote:
> This patch replaces the pinmuxing functions from
> arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c by those of
> arch/arm/cpu/arm926ejs/davinci/pinmux.c
> 
> Signed-off-by: Christian Riesch <christian.riesch@omicron.at>
> Cc: Heiko Schocher <hs@denx.de>
> Cc: Sandeep Paulraj <s-paulraj@ti.com>
> ---
>  arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c |   34 +++++++++--------------
>  1 files changed, 13 insertions(+), 21 deletions(-)
> 
> diff --git a/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c b/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c
> index c7ec70f..8dd897b 100644
> --- a/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c
> +++ b/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c
> @@ -30,6 +30,7 @@
>  #include <asm/arch/ddr2_defs.h>
>  #include <asm/arch/emif_defs.h>
>  #include <asm/arch/pll_defs.h>
> +#include <asm/arch/davinci_misc.h>
>  
>  void da850_waitloop(unsigned long loopcnt)
>  {
> @@ -248,6 +249,16 @@ void board_gpio_init(void)
>  	return;
>  }
>  
> +/* UART pin muxer settings */
> +static const struct pinmux_config uart_pins[] = {
> +#if CONFIG_SYS_NS16550_COM1 == DAVINCI_UART2_BASE
> +	{ pinmux(0), 4, 6 },
> +	{ pinmux(0), 4, 7 },
> +	{ pinmux(4), 2, 4 },
> +	{ pinmux(4), 2, 5 }
> +#endif
> +};
> +
>  int arch_cpu_init(void)
>  {
>  	/* Unlock kick registers */
> @@ -257,27 +268,8 @@ int arch_cpu_init(void)
>  	dv_maskbits(&davinci_syscfg_regs->suspsrc,
>  		CONFIG_SYS_DA850_SYSCFG_SUSPSRC);
>  
> -	/* Setup Pinmux */
> -	da850_pinmux_ctl(0, 0xFFFFFFFF, CONFIG_SYS_DA850_PINMUX0);
> -	da850_pinmux_ctl(1, 0xFFFFFFFF, CONFIG_SYS_DA850_PINMUX1);
> -	da850_pinmux_ctl(2, 0xFFFFFFFF, CONFIG_SYS_DA850_PINMUX2);
> -	da850_pinmux_ctl(3, 0xFFFFFFFF, CONFIG_SYS_DA850_PINMUX3);
> -	da850_pinmux_ctl(4, 0xFFFFFFFF, CONFIG_SYS_DA850_PINMUX4);
> -	da850_pinmux_ctl(5, 0xFFFFFFFF, CONFIG_SYS_DA850_PINMUX5);
> -	da850_pinmux_ctl(6, 0xFFFFFFFF, CONFIG_SYS_DA850_PINMUX6);
> -	da850_pinmux_ctl(7, 0xFFFFFFFF, CONFIG_SYS_DA850_PINMUX7);
> -	da850_pinmux_ctl(8, 0xFFFFFFFF, CONFIG_SYS_DA850_PINMUX8);
> -	da850_pinmux_ctl(9, 0xFFFFFFFF, CONFIG_SYS_DA850_PINMUX9);
> -	da850_pinmux_ctl(10, 0xFFFFFFFF, CONFIG_SYS_DA850_PINMUX10);
> -	da850_pinmux_ctl(11, 0xFFFFFFFF, CONFIG_SYS_DA850_PINMUX11);
> -	da850_pinmux_ctl(12, 0xFFFFFFFF, CONFIG_SYS_DA850_PINMUX12);
> -	da850_pinmux_ctl(13, 0xFFFFFFFF, CONFIG_SYS_DA850_PINMUX13);
> -	da850_pinmux_ctl(14, 0xFFFFFFFF, CONFIG_SYS_DA850_PINMUX14);
> -	da850_pinmux_ctl(15, 0xFFFFFFFF, CONFIG_SYS_DA850_PINMUX15);
> -	da850_pinmux_ctl(16, 0xFFFFFFFF, CONFIG_SYS_DA850_PINMUX16);
> -	da850_pinmux_ctl(17, 0xFFFFFFFF, CONFIG_SYS_DA850_PINMUX17);
> -	da850_pinmux_ctl(18, 0xFFFFFFFF, CONFIG_SYS_DA850_PINMUX18);
> -	da850_pinmux_ctl(19, 0xFFFFFFFF, CONFIG_SYS_DA850_PINMUX19);
> +	/* setup serial port */
> +	davinci_configure_pin_mux(uart_pins, ARRAY_SIZE(uart_pins));

Why only the uart pins? We could use here something like "board_pins"
and initialize here all pins for the board?

I reworked this for the enbw_cmc board too, and removed also the
CONFIG_SYS_DA850_PINMUX* defines complete ... but I am not really
happy with it. Why?

We have for example on the am1808 19 * 8 = 152 pins to setup up

If using the CONFIG_SYS_DA850_PINMUX* defines we have 19 register-
writes and have setup them all (And you must think about all
your pins, if we use such a struct, not defined pins are in
default state ... which is good or bad ...)

With using davinci_configure_pin_mux() we have 152 * (read, write
and some logic operations) ... and I have to code a "static const
struct pinmux_config board_pins" with 152 lines in the code ...

What do others think?

bye,
Heiko
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

  reply	other threads:[~2011-11-16  6:49 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-15 10:37 [U-Boot] [RFC PATCH 0/8] da850evm: Add SPL support for booting from SPI flash Christian Riesch
2011-11-15 10:37 ` [U-Boot] [RFC PATCH 1/8] arm, davinci: Move pinmux functions from board to arch tree Christian Riesch
2011-11-16  6:38   ` Heiko Schocher
2011-11-15 10:37 ` [U-Boot] [RFC PATCH 2/8] arm, davinci: Fix clear_bss for zero length bss Christian Riesch
2011-11-15 10:37 ` [U-Boot] [RFC PATCH 3/8] arm, davinci: Add SPL support for DA850 SoCs Christian Riesch
2011-11-16  6:35   ` Heiko Schocher
2011-11-16  7:13     ` Christian Riesch
2011-11-16  7:35       ` Heiko Schocher
2011-11-15 10:37 ` [U-Boot] [RFC PATCH 4/8] arm: printf() is not available in the SPL Christian Riesch
2011-11-15 17:50   ` Tom Rini
2011-11-16  7:37     ` Christian Riesch
2011-11-16 14:18       ` Tom Rini
2011-11-15 10:37 ` [U-Boot] [RFC PATCH 5/8] arm, davinci: Replace pinmuxing in da850_lowlevel.c Christian Riesch
2011-11-16  6:49   ` Heiko Schocher [this message]
2011-11-18  8:22     ` Christian Riesch
2011-11-18  8:24     ` Christian Riesch
2011-11-18  8:35     ` Christian Riesch
2011-11-18 10:09       ` Heiko Schocher
2011-11-15 10:37 ` [U-Boot] [RFC PATCH 6/8] da850evm: Add a basic SPL for SPI boot Christian Riesch
2011-11-15 10:37 ` [U-Boot] [RFC PATCH 7/8] mkimage: Fix variable length header support Christian Riesch
2011-11-15 10:37 ` [U-Boot] [RFC PATCH 8/8] arm, davinci: Add support for generating AIS images to the Makefile Christian Riesch

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=4EC35D16.10301@denx.de \
    --to=hs@denx.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.