All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [U-Boot Users][PATCH] ADS5121 IO Pin Configuration
Date: Sun, 04 May 2008 00:58:42 +0200	[thread overview]
Message-ID: <20080503225842.62AC4248A6@gemini.denx.de> (raw)
In-Reply-To: Your message of "Sat, 03 May 2008 17:15:52 EDT." <200805031715483.SM04088@cw4mb41>

In message <200805031715483.SM04088@cw4mb41> you wrote:
> Adds configurable IO Pin initialization for ADS5121 and consolidates
> existing IO pin initialization.
> 
> Signed-off-by: Martha J Marx <mmarx@si...>
> ---
>  board/ads5121/ads5121.c   |   10 +--
>  cpu/mpc512x/Makefile      |    2 +-
>  cpu/mpc512x/fec.c         |   15 ----
>  cpu/mpc512x/iopin.c       |   72 ++++++++++++++++
>  cpu/mpc512x/iopin.h       |  200
> +++++++++++++++++++++++++++++++++++++++++++++
^^^^^^^^^^^^^^^^^^^^^^^

Patch again corrupted due to line wrapping.

> +	/* initialize function mux & slew rate IO inter alia on IO Pins
> */
^^^^^^^^^^^^^^^^^^^^^
Lines wrapped.

> +	iopin_initialize();
>  
> -	/* change the slew rate on all pata pins to max */
> -	reg = (unsigned long *) &(im->io_ctrl.regs[PATA_CE1_IDX]);
> -	for (i = 0; i < 9; i++)
> -		reg[i] |= 0x00000003;
>  	return 0;
>  }
>  #ifdef CONFIG_MISC_INIT_R
> diff --git a/cpu/mpc512x/Makefile b/cpu/mpc512x/Makefile
> index 2be35b2..8ba8ae8 100644
> --- a/cpu/mpc512x/Makefile
> +++ b/cpu/mpc512x/Makefile
> @@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk
>  LIB	= $(obj)lib$(CPU).a
>  
>  START	= start.o
> -COBJS	= traps.o cpu.o cpu_init.o speed.o interrupts.o serial.o fec.o i2c.o
> +COBJS	= traps.o cpu.o cpu_init.o speed.o interrupts.o serial.o fec.o i2c.o
> iopin.o
^^^^^^^^^^^^^^^^^^^^^
Lines wrapped.

Also, please keep lisys sorted, and mind the maximum line length.

> diff --git a/cpu/mpc512x/iopin.c b/cpu/mpc512x/iopin.c
> new file mode 100644
> index 0000000..e2b536b
> --- /dev/null
> +++ b/cpu/mpc512x/iopin.c
> @@ -0,0 +1,72 @@
> +/*
> + * mpc512x I/O pin/pad initialization
> + */
> +#include <common.h>
> +#include <linux/types.h>
> +#include "iopin.h"

Copyright and license note missing.

> +/*
> + * IO PAD TYPES for all types fmux is used to select the funtion and ds
> sets the slew rate
^^^^^^^^^^^^^^^^^^^^^
Lines wrapped (many more lines following).

+ } ioregs_init[] = {
+#ifdef CONFIG_ADS5121
+/* FUNC1=FEC_RX_DV Sets Next 3 to FEC pads 	*/
+	{IOCTL_SPDIF_TXCLK, 	3,  0, 1, 0, 0, 0, 0, 3},
+/* Set highest Slew on 9 PATA pins		*/
+	{IOCTL_PATA_CE1, 	9,  1, 0, 0, 0, 0, 0, 3},
+/* FUNC1=FEC_COL Sets Next 15 to FEC pads 	*/
+	{IOCTL_PSC0_0, 		15, 0, 1, 0, 0, 0, 0, 3},
+/* FUNC1=SPDIF_TXCLK				*/
+	{IOCTL_LPC_CS1, 	1,  0, 1, 0, 0, 0, 1, 3},
+/* FUNC2=SPDIF_TX and sets Next pin to SPDIF_RX	*/
+	{IOCTL_I2C1_SCL, 	2,  0, 2, 0, 0, 0, 1, 3},
+/* FUNC2=DIU CLK				*/
+	{IOCTL_PSC6_0, 		1,  0, 2, 0, 0, 0, 1, 3},
+/* FUNC2=DIU_HSYNC 				*/
+	{IOCTL_PSC6_1, 		1,  0, 2, 0, 0, 0, 0, 3},
+/* FUNC2=DIUVSYNC Sets Next 26 to DIU Pads	*/
+	{IOCTL_PSC6_4, 		26, 0, 2, 0, 0, 0, 0, 3}
+#endif

No. Please avoid such board specific #ifdef'ed initializers in common
code. Please move this board specific data into board specific files.

> diff --git a/cpu/mpc512x/iopin.h b/cpu/mpc512x/iopin.h
> new file mode 100644
> index 0000000..5ef107d
> --- /dev/null
> +++ b/cpu/mpc512x/iopin.h
> @@ -0,0 +1,200 @@
> +/*
> + * mpc512x I/O pin/pad initialization
> + */

Copyright and license note missing.

> diff --git a/include/configs/ads5121.h b/include/configs/ads5121.h
> index 5f82855..04b2a96 100644
> --- a/include/configs/ads5121.h
> +++ b/include/configs/ads5121.h
> @@ -27,6 +27,7 @@
>  #ifndef __CONFIG_H
>  #define __CONFIG_H
>  
> +#define CONFIG_ADS5121 1

When moving the board specific date out of the common file above, this
#define will probably not be needed then, either.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The reasonable man adapts himself to the world; the unreasonable  one
persists  in  trying  to  adapt  the  world to himself. Therefore all
progress depends on the unreasonable man."      - George Bernard Shaw

      parent reply	other threads:[~2008-05-03 22:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-03 21:15 [U-Boot-Users] [U-Boot Users][PATCH] ADS5121 IO Pin Configuration Martha J Marx
2008-05-03 22:23 ` Jean-Christophe PLAGNIOL-VILLARD
2008-05-03 22:58 ` Wolfgang Denk [this message]

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=20080503225842.62AC4248A6@gemini.denx.de \
    --to=wd@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.