public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/4] Make the fsl_elbc_nand driver work for both 83xx	and 85xx
Date: Tue, 7 Oct 2008 11:32:59 -0500	[thread overview]
Message-ID: <20081007163259.GA3372@loki.buserror.net> (raw)
In-Reply-To: <1221816772-23220-2-git-send-email-Jason.jin@freescale.com>

On Fri, Sep 19, 2008 at 05:32:50PM +0800, Jason Jin wrote:
> +/*
> + * Local Bus Controller Registers.
> + */
> +typedef struct lbus_bank {
> +	u32 br;			/* Base Register */
> +	u32 or;			/* Option Register */
> +} lbus_bank_t;
> +
> +typedef struct fsl_lbus {
> +	lbus_bank_t bank[8];
> +	u8 res0[0x28];
> +	u32 mar;		/* UPM Address Register */
> +	u8 res1[0x4];
> +	u32 mamr;		/* UPMA Mode Register */
> +	u32 mbmr;		/* UPMB Mode Register */
> +	u32 mcmr;		/* UPMC Mode Register */
> +	u8 res2[0x8];
> +	u32 mrtpr;		/* Memory Refresh Timer Prescaler Register */
> +	u32 mdr;		/* UPM Data Register */
> +	u8 res3[0x4];
> +	u32 lsor;		/* Special Operation Initiation Register */
> +	u32 lsdmr;		/* SDRAM Mode Register */
> +	u8 res4[0x8];
> +	u32 lurt;		/* UPM Refresh Timer */
> +	u32 lsrt;		/* SDRAM Refresh Timer */
> +	u8 res5[0x8];
> +	u32 ltesr;		/* Transfer Error Status Register */
> +	u32 ltedr;		/* Transfer Error Disable Register */
> +	u32 lteir;		/* Transfer Error Interrupt Register */
> +	u32 lteatr;		/* Transfer Error Attributes Register */
> +	u32 ltear;		/* Transfer Error Address Register */
> +	u8 res6[0xC];
> +	u32 lbcr;		/* Configuration Register */
> +	u32 lcrr;		/* Clock Ratio Register */
> +	u8 res7[0x8];
> +	u32 fmr;		/* Flash Mode Register */
> +	u32 fir;		/* Flash Instruction Register */
> +	u32 fcr;		/* Flash Command Register */
> +	u32 fbar;		/* Flash Block Addr Register */
> +	u32 fpar;		/* Flash Page Addr Register */
> +	u32 fbcr;		/* Flash Byte Count Register */
> +	u8 res8[0xF08];
> +}fsl_lbus_t;

Space after brace.

Can we put this in a header file that is shared by immap_83xx.h,
immap_85xx.h, etc., rather than duplicating it here?

>  static void fsl_elbc_ctrl_init(void)
>  {
> -	immap_t *im = (immap_t *)CFG_IMMR;
> -
>  	elbc_ctrl = kzalloc(sizeof(*elbc_ctrl), GFP_KERNEL);
>  	if (!elbc_ctrl)
>  		return;
>  
> +#ifdef CONFIG_MPC85xx
> +	elbc_ctrl->regs = (void *)CFG_MPC85xx_LBC_ADDR;
> +#else
> +	immap_t *im = (immap_t *)CFG_IMMR;
>  	elbc_ctrl->regs = &im->lbus;
> +#endif

Did you try building this on 83xx?  You'll get a type conflict warning
because you duplicated the struct.

-Scott

  parent reply	other threads:[~2008-10-07 16:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-19  9:32 [U-Boot] [PATCH 1/4] Fix the NAND size overflow issue Jason Jin
2008-09-19  9:32 ` [U-Boot] [PATCH 2/4] Make the fsl_elbc_nand driver work for both 83xx and 85xx Jason Jin
2008-09-19  9:32   ` [U-Boot] [PATCH 3/4] Enable NAND support for MPC8536DS board Jason Jin
2008-09-19  9:32     ` [U-Boot] [PATCH 4/4] Enable NAND support for MPC8572DS board Jason Jin
2008-10-07 16:32   ` Scott Wood [this message]
2008-10-08  9:45     ` [U-Boot] [PATCH 2/4] Make the fsl_elbc_nand driver work for both 83xxand 85xx Jin Zhengxiong-R64188
2008-10-08 14:58       ` Anton Vorontsov
2008-09-19 10:04 ` [U-Boot] [PATCH 1/4] Fix the NAND size overflow issue Jens Gehrlein
2008-09-23  2:20   ` Jin Zhengxiong-R64188
2008-10-14 11:27 ` Wolfgang Denk

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=20081007163259.GA3372@loki.buserror.net \
    --to=scottwood@freescale.com \
    --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