Re: [U-Boot] [PATCH] ppc4xx: Read pipeline depth set to 4 for PPC440SP/SPE, PPC405EX, PPC460EX/GT/SX processors

2008-08-12 Thread Wolfgang Denk
Dear Stefan Roese,

In message <[EMAIL PROTECTED]> you wrote:
>
> > > +/* PLB4 CrossBar Arbiter Core supported across PPC4xx families */
> > > +#if defined(CONFIG_440EP) || defined(CONFIG_440EPX) || \
> > > +defined(CONFIG_440GR) || defined(CONFIG_440GRX) || \
> > > +defined(CONFIG_440SP) || defined(CONFIG_440SPE) || \
> > > +defined(CONFIG_460EX) || defined(CONFIG_460GT)  || \
> > > +defined(CONFIG_460SX) || defined(CONFIG_405EX)
^
...
> > Here you move 44x specific code from a 44x specific header file into a
> > 4xx generic header file which requires you to add a 44x specific
> > #ifdef's.
> 
> These defines are also used on the 405EX (and possibly future 405 variants as 
> well). It makes sense to move them to ppc4xx.h so we don't have to duplicate 
> those defines in 2 headers. This has been a big problem in the past with the 
> ppc405.h and ppc440.h headers.

You are right, I missed that single 405 there.

May I please ask to sort the list, then?

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: [EMAIL PROTECTED]
Let's say the docs present a simplified view of reality...:-)
  - Larry Wall in  <[EMAIL PROTECTED]>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] ppc4xx: Read pipeline depth set to 4 for PPC440SP/SPE, PPC405EX, PPC460EX/GT/SX processors

2008-08-12 Thread Stefan Roese
On Wednesday 13 August 2008, Wolfgang Denk wrote:
> > From: Prodyut Hazarika <[EMAIL PROTECTED]>
> >
> > Signed-off-by: Prodyut Hazarika <[EMAIL PROTECTED]>
> > Acked-by: Feng Kan <[EMAIL PROTECTED]>
> > ---
>
> It would be nice if the commit messages contained at least a minimal
> explanation of the reasons for the changes.

Yes, the original comment from Prodyut is gone. Please add it again.



> > */ diff --git a/include/ppc4xx.h b/include/ppc4xx.h
> > index c71da60..154956e 100644
> > --- a/include/ppc4xx.h
> > +++ b/include/ppc4xx.h
> > @@ -46,6 +46,61 @@
> >  #define CONFIG_SDRAM_PPC4xx_IBM_DDR2   /* IBM DDR(2) controller */
> >  #endif
> >
> > +/* PLB4 CrossBar Arbiter Core supported across PPC4xx families */
> > +#if defined(CONFIG_440EP) || defined(CONFIG_440EPX) || \
> > +defined(CONFIG_440GR) || defined(CONFIG_440GRX) || \
> > +defined(CONFIG_440SP) || defined(CONFIG_440SPE) || \
> > +defined(CONFIG_460EX) || defined(CONFIG_460GT)  || \
> > +defined(CONFIG_460SX) || defined(CONFIG_405EX)
> > +
> > +#define PLB_ARBITER_BASE   0x80
> > +
> > +#define plb0_revid(PLB_ARBITER_BASE+ 0x00)
> > +#define plb0_acr  (PLB_ARBITER_BASE+ 0x01)
> > +#define   plb0_acr_ppm_mask 0xF000
> > +#define   plb0_acr_ppm_fixed0x
> > +#define   plb0_acr_ppm_fair 0xD000
> > +#define   plb0_acr_hbu_mask 0x0800
> > +#define   plb0_acr_hbu_disabled 0x
> > +#define   plb0_acr_hbu_enabled  0x0800
> > +#define   plb0_acr_rdp_mask 0x0600
> > +#define   plb0_acr_rdp_disabled 0x
> > +#define   plb0_acr_rdp_2deep0x0200
> > +#define   plb0_acr_rdp_3deep0x0400
> > +#define   plb0_acr_rdp_4deep0x0600
> > +#define   plb0_acr_wrp_mask 0x0100
> > +#define   plb0_acr_wrp_disabled 0x
> > +#define   plb0_acr_wrp_2deep0x0100
> > +
> > +#define plb0_besrl(PLB_ARBITER_BASE+ 0x02)
> > +#define plb0_besrh(PLB_ARBITER_BASE+ 0x03)
> > +#define plb0_bearl(PLB_ARBITER_BASE+ 0x04)
> > +#define plb0_bearh(PLB_ARBITER_BASE+ 0x05)
> > +#define plb0_ccr  (PLB_ARBITER_BASE+ 0x08)
> > +
> > +#define plb1_acr  (PLB_ARBITER_BASE+ 0x09)
> > +#define   plb1_acr_ppm_mask 0xF000
> > +#define   plb1_acr_ppm_fixed0x
> > +#define   plb1_acr_ppm_fair 0xD000
> > +#define   plb1_acr_hbu_mask 0x0800
> > +#define   plb1_acr_hbu_disabled 0x
> > +#define   plb1_acr_hbu_enabled  0x0800
> > +#define   plb1_acr_rdp_mask 0x0600
> > +#define   plb1_acr_rdp_disabled 0x
> > +#define   plb1_acr_rdp_2deep0x0200
> > +#define   plb1_acr_rdp_3deep0x0400
> > +#define   plb1_acr_rdp_4deep0x0600
> > +#define   plb1_acr_wrp_mask 0x0100
> > +#define   plb1_acr_wrp_disabled 0x
> > +#define   plb1_acr_wrp_2deep0x0100
> > +
> > +#define plb1_besrl(PLB_ARBITER_BASE+ 0x0A)
> > +#define plb1_besrh(PLB_ARBITER_BASE+ 0x0B)
> > +#define plb1_bearl(PLB_ARBITER_BASE+ 0x0C)
> > +#define plb1_bearh(PLB_ARBITER_BASE+ 0x0D)
> > +
> > +#endif /* 440EP/EPX 440GR/GRX 440SP/SPE 460EX/GT/SX 405EX*/
> > +
>
> Here you move 44x specific code from a 44x specific header file into a
> 4xx generic header file which requires you to add a 44x specific
> #ifdef's.

These defines are also used on the 405EX (and possibly future 405 variants as 
well). It makes sense to move them to ppc4xx.h so we don't have to duplicate 
those defines in 2 headers. This has been a big problem in the past with the 
ppc405.h and ppc440.h headers.

Best regards,
Stefan

=
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: [EMAIL PROTECTED]
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] ppc4xx: Read pipeline depth set to 4 for PPC440SP/SPE, PPC405EX, PPC460EX/GT/SX processors

2008-08-12 Thread Wolfgang Denk
Dear Feng Kan,

in message <[EMAIL PROTECTED]> you wrote:
> From: Prodyut Hazarika <[EMAIL PROTECTED]>
> 
> Signed-off-by: Prodyut Hazarika <[EMAIL PROTECTED]>
> Acked-by: Feng Kan <[EMAIL PROTECTED]>
> ---

It would be nice if the commit messages contained at least a minimal
explanation of the reasons for the changes.

> diff --git a/include/asm-ppc/ppc4xx-sdram.h b/include/asm-ppc/ppc4xx-sdram.h
> index df787b3..d2e3b42 100644
> --- a/include/asm-ppc/ppc4xx-sdram.h
> +++ b/include/asm-ppc/ppc4xx-sdram.h
> @@ -259,23 +259,39 @@
>  /*
>   * Memory queue defines
>   */
> -#define SDRAMQ_DCR_BASE  0x040
> -
> -#define SDRAM_R0BAS  (SDRAMQ_DCR_BASE+0x0)   /* rank 0 base address & size  
> */
> -#define SDRAM_R1BAS  (SDRAMQ_DCR_BASE+0x1)   /* rank 1 base address & size  
> */
> -#define SDRAM_R2BAS  (SDRAMQ_DCR_BASE+0x2)   /* rank 2 base address & size  
> */
> -#define SDRAM_R3BAS  (SDRAMQ_DCR_BASE+0x3)   /* rank 3 base address & size  
> */
> -#define SDRAM_CONF1HB(SDRAMQ_DCR_BASE+0x5)   /* configuration 1 HB   
>*/
> -#define SDRAM_ERRSTATHB  (SDRAMQ_DCR_BASE+0x7)   /* error status HB  
>*/
> -#define SDRAM_ERRADDUHB  (SDRAMQ_DCR_BASE+0x8)   /* error address upper 
> 32 HB   */
> -#define SDRAM_ERRADDLHB  (SDRAMQ_DCR_BASE+0x9)   /* error address lower 
> 32 HB   */
> -#define SDRAM_PLBADDULL  (SDRAMQ_DCR_BASE+0xA)   /* PLB base address 
> upper 32 LL */
> -#define SDRAM_CONF1LL(SDRAMQ_DCR_BASE+0xB)   /* configuration 1 LL   
>*/
> -#define SDRAM_ERRSTATLL  (SDRAMQ_DCR_BASE+0xC)   /* error status LL  
>*/
> -#define SDRAM_ERRADDULL  (SDRAMQ_DCR_BASE+0xD)   /* error address upper 
> 32 LL   */
> -#define SDRAM_ERRADDLLL  (SDRAMQ_DCR_BASE+0xE)   /* error address lower 
> 32 LL   */
> -#define SDRAM_CONFPATHB  (SDRAMQ_DCR_BASE+0xF)   /* configuration 
> between paths */
> -#define SDRAM_PLBADDUHB  (SDRAMQ_DCR_BASE+0x10)  /* PLB base address 
> upper 32 LL */
> +#define SDRAMQ_DCR_BASE 0x040
> +
> +#define SDRAM_R0BAS (SDRAMQ_DCR_BASE+0x0)   /* rank 0 base address & 
> size  */
> +#define SDRAM_R1BAS (SDRAMQ_DCR_BASE+0x1)   /* rank 1 base address & 
> size  */
> +#define SDRAM_R2BAS (SDRAMQ_DCR_BASE+0x2)   /* rank 2 base address & 
> size  */
> +#define SDRAM_R3BAS (SDRAMQ_DCR_BASE+0x3)   /* rank 3 base address & 
> size  */
> +#define SDRAM_CONF1HB   (SDRAMQ_DCR_BASE+0x5)   /* configuration 1 HB
>   */
> +#define SDRAM_CONF1HB_AAFR   0x8000 /* Address Ack on First 
> Request - Bit 0 */
> +#define SDRAM_CONF1HB_PRPD   0x0008 /* PLB Read pipeline Disable 
> - Bit 12 */
> +#define SDRAM_CONF1HB_PWPD   0x0004 /* PLB Write pipeline 
> Disable - Bit 13 */
> +#define SDRAM_CONF1HB_PRW0x0002 /* PLB Read Wait - Bit 14 */
> +#define SDRAM_CONF1HB_RPEN   0x0800 /* Read Passing Enable - Bit 
> 20 */
> +#define SDRAM_CONF1HB_RFTE   0x0400 /* Read Flow Through Enable 
> - Bit 21 */
> +
> +#define SDRAM_ERRSTATHB (SDRAMQ_DCR_BASE+0x7)   /* error status HB   
>   */
> +#define SDRAM_ERRADDUHB (SDRAMQ_DCR_BASE+0x8)   /* error address upper 32 HB 
>   */
> +#define SDRAM_ERRADDLHB (SDRAMQ_DCR_BASE+0x9)   /* error address lower 32 HB 
>   */
> +#define SDRAM_PLBADDULL (SDRAMQ_DCR_BASE+0xA)   /* PLB base address upper 32 
> LL */
> +#define SDRAM_CONF1LL   (SDRAMQ_DCR_BASE+0xB)   /* configuration 1 LL
>   */
> +#define SDRAM_CONF1LL_AAFR   0x8000 /* Address Ack on First 
> Request - Bit 0 */
> +#define SDRAM_CONF1LL_PRPD   0x0008 /* PLB Read pipeline Disable 
> - Bit 12 */
> +#define SDRAM_CONF1LL_PWPD   0x0004 /* PLB Write pipeline 
> Disable - Bit 13 */
> +#define SDRAM_CONF1LL_PRW0x0002 /* PLB Read Wait - Bit 14 */
> +#define SDRAM_CONF1LL_RPEN   0x0800 /* Read Passing Enable - Bit 
> 20 */
> +#define SDRAM_CONF1LL_RFTE   0x0400 /* Read Flow Through Enable 
> - Bit 21 */
> +
> +#define SDRAM_ERRSTATLL (SDRAMQ_DCR_BASE+0xC)   /* error status LL   
>   */
> +#define SDRAM_ERRADDULL (SDRAMQ_DCR_BASE+0xD)   /* error address upper 32 LL 
>   */
> +#define SDRAM_ERRADDLLL (SDRAMQ_DCR_BASE+0xE)   /* error address lower 32 LL 
>   */
> +#define SDRAM_CONFPATHB (SDRAMQ_DCR_BASE+0xF)   /* configuration between 
> paths */
> +#define SDRAM_CONFPATHB_TPEN  0x0800/* Transaction Passing 
> Enable - Bit 4 */
> +
> +#define SDRAM_PLBADDUHB (SDRAMQ_DCR_BASE+0x10)  /* PLB base address upper 32 
> LL */
 

This change seems to be completely unrelated to above described
changes, so if it was a valid modification, it would have to be split
off into a separate commit.

But then, you are changing good TAB chanracters that  were  used  for
vertical  alignment  into spaces. This is incorrect - please read the
Coding Style requirements.

Please do not do this.

NAK.


>  #if !defined(CONFIG_405EX)
>  /*
> diff --git a/include/ppc440.h b/include/ppc440

Re: [U-Boot] [RFC][PATCH 00/15] bootm refactoring

2008-08-12 Thread Jerry Van Baren
Hi Kumar,

I'm on the road this week, so my ability to review code this week is 
suboptimal.  Having said that, this looks good!

Kumar Gala wrote:
> [PATCH 01/15] Update linux bootm to support ePAPR client interface
> [PATCH 02/15] add ability to disable ft_board_setup as part of bootm
> 
> possibly drop this patch if the boots method is acceptable

I don't follow what this remark is saying.

Is there a reason scripting in the "fdt boardsetup" command, eliminating 
the need to call ft_board_setup() as part of the bootm command chain?

> [PATCH 03/15] Clean up usage of icache_disable/dcache_disable
> [PATCH 04/15] fdt: added the ability to set initrd start/end via chosen 
> command
> [PATCH 05/15] fdt: fdt addr w/o any args reports back the current working 
> address
> [PATCH 06/15] bootm: refactor entry point code
> [PATCH 07/15] bootm: refactor ramdisk locating code
> [PATCH 08/15] bootm: refactor fdt locating and relocation code
> [PATCH 09/15] bootm: Set working fdt address as part of the bootm flow
> [PATCH 10/15] bootm: move lmb into the bootm_headers_t structure
> [PATCH 11/15] bootm: refactor image detection and os load steps
> [PATCH 12/15] fdt: refactor fdt resize code
> [PATCH 13/15] fdt: refactor initrd related code
> [PATCH 14/15] fdt: Added resize command
> [PATCH 15/15] boots: start of sub commands
> 
> I believe all the patches except 15/15 should be in a reasonable state
> for u-boot-testing.  I need to add an 'interrupt enable/disable' command
> but with a small hack I'm able to mimic the bootm command on ppc by:
> 
>   boots start   

Per my previous comment: boots is already taken.

>   boots load_os   /* hacked to disable interrupts */
>   boots prep_os
>   boots initrd_relocate
>   boots fdt_relocate
>   fdt chosen $initrd_start $initrd_end
>   fdt boardsetup
>   boots jump

Would "bootm go" be better than "bootm jump"?  I'm thinking we have a 
"go" command, so "bootm go" sounds better, more symmetric, to me.  Maybe 
I'm painting the bikeshed?

> Right now 15/15 is focused on only PPC w/Linux.  If this looks acceptable
> I'll split 15/15 into proper patches an add support for the other ARCHes
> and OSes.
> 
> - k

Thanks for working this,
gvb
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [WIP][PATCH 09/11] bootm: refactor image detection and os load steps

2008-08-12 Thread Jerry Van Baren
Kumar Gala wrote:
> Created a bootm_start() that handles the parsing and detection of all the
> images that will be used by the bootm command (OS, ramdisk, fdt). As part
> of this we now tract all the relevant image offsets in the bootm_headers_t

Pedantic: s/tract/track/

Best regards,
gvb
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [WIP][PATCH 00/11] bootm refactoring

2008-08-12 Thread Jerry Van Baren
Kumar Gala wrote:
> On Aug 12, 2008, at 6:15 PM, Wolfgang Denk wrote:
> 
>> Dear Kumar Gala,
>>
>> In message > [EMAIL PROTECTED]> you wrote:
>>> I'm adding a "boots" command that implements sub commands.  Once I
>> I saw it. Actually I don't like it. Why didn't you stick with the
>> original plan to implement subcommands as part of bootm ?
> 
> Can you be more precise about what you dont like.  Just the new  
> command, how its implemented, or something else?  Also, what plan did  
> we agree on?
> 
> I choose a new command because of my concern about how to distinguish  
> the sub-command from a FIT identifier.  But it looks like that might  
> not be an issue.

Hi Kumar,

The command "boots" is already taken.
$ grep loads common/*.c
[snip]
common/cmd_load.c:  "loads   - load S-Record file over serial line\n",

Best regards,
gvb
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/3] Add proper SPD definitions for DDR1/2/3

2008-08-12 Thread Kumar Gala

On Aug 13, 2008, at 12:00 AM, Kumar Gala wrote:

> From: James Yang <[EMAIL PROTECTED]>
>
> Also added a few helper functions for DDR1 & DDR2 to print SPD info  
> and
> verify the checksum.
>
> Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
> ---
> common/Makefile   |1 +
> common/ddr_spd.c  |  519  
> +
> include/ddr_spd.h |  249 +
> 3 files changed, 769 insertions(+), 0 deletions(-)
> create mode 100644 common/ddr_spd.c
> create mode 100644 include/ddr_spd.h

I've updated these first three patches.. once these look good I can  
deal with the line issues in the others.

- k
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/3] Add proper SPD definitions for DDR1/2/3

2008-08-12 Thread Kumar Gala
From: James Yang <[EMAIL PROTECTED]>

Also added a few helper functions for DDR1 & DDR2 to print SPD info and
verify the checksum.

Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
---
 common/Makefile   |1 +
 common/ddr_spd.c  |  519 +
 include/ddr_spd.h |  249 +
 3 files changed, 769 insertions(+), 0 deletions(-)
 create mode 100644 common/ddr_spd.c
 create mode 100644 include/ddr_spd.h

diff --git a/common/Makefile b/common/Makefile
index 4287108..3ea4abf 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -144,6 +144,7 @@ COBJS-y += cmd_mac.o
 COBJS-$(CONFIG_CMD_MFSL) += cmd_mfsl.o
 COBJS-$(CONFIG_MP) += cmd_mp.o
 COBJS-$(CONFIG_CMD_SF) += cmd_sf.o
+COBJS-$(CONFIG_DDR_SPD) += ddr_spd.o
 
 COBJS  := $(COBJS-y)
 SRCS   := $(AOBJS:.o=.S) $(COBJS:.o=.c)
diff --git a/common/ddr_spd.c b/common/ddr_spd.c
new file mode 100644
index 000..03cbe1d
--- /dev/null
+++ b/common/ddr_spd.c
@@ -0,0 +1,519 @@
+/*
+ * Copyright 2008 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * Version 2 as published by the Free Software Foundation.
+ */
+
+#include 
+#include 
+
+void
+ddr1_spd_dump(const ddr1_spd_eeprom_t *spd)
+{
+   unsigned int i;
+
+   printf("%-3d: %02x %s\n",
+  0, spd->info_size,
+  " spd->info_size,   *  0 # bytes written into serial memory *");
+   printf("%-3d: %02x %s\n",
+  1, spd->chip_size,
+  " spd->chip_size,   *  1 Total # bytes of SPD memory device *");
+   printf("%-3d: %02x %s\n",
+  2, spd->mem_type,
+  " spd->mem_type,*  2 Fundamental memory type *");
+   printf("%-3d: %02x %s\n",
+  3, spd->nrow_addr,
+  " spd->nrow_addr,   *  3 # of Row Addresses on this assembly *");
+   printf("%-3d: %02x %s\n",
+  4, spd->ncol_addr,
+  " spd->ncol_addr,   *  4 # of Column Addrs on this assembly *");
+   printf("%-3d: %02x %s\n",
+  5, spd->nrows,
+  " spd->nrows*  5 # of DIMM Banks *");
+   printf("%-3d: %02x %s\n",
+  6, spd->dataw_lsb,
+  " spd->dataw_lsb,   *  6 Data Width lsb of this assembly *");
+   printf("%-3d: %02x %s\n",
+  7, spd->dataw_msb,
+  " spd->dataw_msb,   *  7 Data Width msb of this assembly *");
+   printf("%-3d: %02x %s\n",
+  8, spd->voltage,
+  " spd->voltage, *  8 Voltage intf std of this assembly *");
+   printf("%-3d: %02x %s\n",
+  9, spd->clk_cycle,
+  " spd->clk_cycle,   *  9 SDRAM Cycle time at CL=X *");
+   printf("%-3d: %02x %s\n",
+  10, spd->clk_access,
+  " spd->clk_access,  * 10 SDRAM Access from Clock at CL=X *");
+   printf("%-3d: %02x %s\n",
+  11, spd->config,
+  " spd->config,  * 11 DIMM Configuration type *");
+   printf("%-3d: %02x %s\n",
+  12, spd->refresh,
+  " spd->refresh, * 12 Refresh Rate/Type *");
+   printf("%-3d: %02x %s\n",
+  13, spd->primw,
+  " spd->primw,   * 13 Primary SDRAM Width *");
+   printf("%-3d: %02x %s\n",
+  14, spd->ecw,
+  " spd->ecw, * 14 Error Checking SDRAM width *");
+   printf("%-3d: %02x %s\n",
+  15, spd->min_delay,
+  " spd->min_delay,   * 15 Back to Back Random Access *");
+   printf("%-3d: %02x %s\n",
+  16, spd->burstl,
+  " spd->burstl,  * 16 Burst Lengths Supported *");
+   printf("%-3d: %02x %s\n",
+  17, spd->nbanks,
+  " spd->nbanks,  * 17 # of Banks on Each SDRAM Device *");
+   printf("%-3d: %02x %s\n",
+  18, spd->cas_lat,
+  " spd->cas_lat, * 18 CAS# Latencies Supported *");
+   printf("%-3d: %02x %s\n",
+  19, spd->cs_lat,
+  " spd->cs_lat,  * 19 Chip Select Latency *");
+   printf("%-3d: %02x %s\n",
+  20, spd->write_lat,
+  " spd->write_lat,   * 20 Write Latency/Recovery *");
+   printf("%-3d: %02x %s\n",
+  21, spd->mod_attr,
+  " spd->mod_attr,* 21 SDRAM Module Attributes *");
+   printf("%-3d: %02x %s\n",
+  22, spd->dev_attr,
+  " spd->dev_attr,* 22 SDRAM Device Attributes *");
+   printf("%-3d: %02x %s\n",
+  23, spd->clk_cycle2,
+  " spd->clk_cycle2,  * 23 Min SDRAM Cycle time at CL=X-1 *");
+   printf("%-3d: %02x %s\n",
+  24, spd->clk_access2,
+  " spd->clk_access2, * 24 SDRAM Access from Clock at CL=X-1 *");
+   printf("%-3d: %02x %s\n",
+ 

[U-Boot] [PATCH 3/3] FSL DDR: Add interactive DDR config support

2008-08-12 Thread Kumar Gala
Provide a mechanism to allow interactive configuration of DDR params.  This
is useful when trying to test various DDR settings to determine optimal
configuration values for a given board.

Signed-off-by: James Yang <[EMAIL PROTECTED]>
Signed-off-by: Jon Loeliger <[EMAIL PROTECTED]>
Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
---
 cpu/mpc8xxx/Makefile  |1 +
 cpu/mpc8xxx/fsl_ddr_interactive.c | 1272 +
 cpu/mpc8xxx/fsl_ddr_sdram.c   |   10 +
 cpu/mpc8xxx/fsl_ddr_sdram.h   |3 +
 4 files changed, 1286 insertions(+), 0 deletions(-)
 create mode 100644 cpu/mpc8xxx/fsl_ddr_interactive.c

diff --git a/cpu/mpc8xxx/Makefile b/cpu/mpc8xxx/Makefile
index 258668c..9edb1ec 100644
--- a/cpu/mpc8xxx/Makefile
+++ b/cpu/mpc8xxx/Makefile
@@ -10,6 +10,7 @@ include $(TOPDIR)/config.mk
 
 LIB= $(obj)libmpc8xxx.a
 
+COBJS-$(CONFIG_FSL_DDR_INTERACTIVE)+= fsl_ddr_interactive.o
 COBJS-$(CONFIG_FSL_DDR1)   += fsl_ddr_sdram.o fsl_ddr_ctrl.o
 COBJS-$(CONFIG_FSL_DDR1)   += fsl_ddr1.o
 
diff --git a/cpu/mpc8xxx/fsl_ddr_interactive.c 
b/cpu/mpc8xxx/fsl_ddr_interactive.c
new file mode 100644
index 000..2c914cc
--- /dev/null
+++ b/cpu/mpc8xxx/fsl_ddr_interactive.c
@@ -0,0 +1,1272 @@
+/*
+ * Copyright 2008 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * Version 2 as published by the Free Software Foundation.
+ */
+
+/*
+ * Generic driver for Freescale DDR/DDR2/DDR3 memory controller.
+ * Based on code from spd_sdram.c
+ * Author: James Yang [at freescale.com]
+ */
+
+#include 
+#include 
+
+#include "fsl_ddr_sdram.h"
+/*
+ * Option parameter Structures
+ */
+typedef struct {
+   const char *option_name;
+   unsigned long long *pointer;
+} options_strings_ulonglong_t;
+
+typedef struct {
+   const char *option_name;
+   unsigned int *pointer;
+} options_strings_uint_t;
+
+
+extern int do_reset(void *cmdtp, int flag, int argc, char *argv[]);
+
+/*
+ * interactive prompt
+ */
+
+static int is_a_num_char(const char c)
+{
+   return c >= '0' && c <= '9';
+}
+
+static unsigned int picos_to_mhz(unsigned int picos)
+{
+   return 100 / picos;
+}
+
+static int
+handle_uint_option_table(options_strings_uint_t *table,
+int table_size,
+const char *opt,
+const char *val)
+{
+   unsigned int i;
+   unsigned int value;
+
+   for (i = 0; i < table_size; i++) {
+   if (strcmp(table[i].option_name, opt) == 0) {
+   value = simple_strtoul(val, NULL, 0);
+   *table[i].pointer = value;
+   return 1;
+   }
+   }
+
+   return 0;
+}
+
+static int
+handle_ull_option_table(options_strings_ulonglong_t *table,
+   int table_size,
+   const char *opt,
+   const char *val)
+{
+   unsigned int i;
+   unsigned long long value;
+
+   for (i = 0; i < table_size; i++) {
+   if (strcmp(table[i].option_name, opt) == 0) {
+   value = simple_strtoull(val, NULL, 0);
+   *table[i].pointer = value;
+   return 1;
+   }
+   }
+
+   return 0;
+}
+
+static void
+fsl_ddr_sdram_generic_edit(void *pdata,
+  void *pend,
+  unsigned int element_size,
+  unsigned int element_num,
+  unsigned int value)
+{
+   char *pcdata = (char *)pdata;   /* BIG ENDIAN ONLY */
+
+   pcdata += element_num * element_size;
+   if ((pcdata + element_size) > (char *) pend) {
+   debug("trying to write past end of data\n");
+   return;
+   }
+
+   switch (element_size) {
+   case 1:
+   asm volatile ("stb %0,0(%1)" : : "r" (value) , "b" (pcdata));
+   break;
+   case 2:
+   asm volatile ("sth %0,0(%1)" : : "r" (value) , "b" (pcdata));
+   break;
+   case 4:
+   asm volatile ("stw %0,0(%1)" : : "r" (value) , "b" (pcdata));
+   break;
+   default:
+   debug("unexpected element size %u\n", element_size);
+   break;
+   }
+}
+
+static void
+fsl_ddr_sdram_spd_edit(fsl_ddr_sdram_info_t *pinfo,
+  unsigned int ctrl_num,
+  unsigned int dimm_num,
+  unsigned int element_num,
+  unsigned int value)
+{
+   generic_spd_eeprom_t *pspd;
+
+   pspd = &(pinfo->spd_installed_dimms[ctrl_num][dimm_num]);
+   fsl_ddr_sdram_generic_edit(pspd, pspd + 1,
+  sizeof(char), element_num, value);
+}
+
+static void
+lowest_common_dimm_parameters_edit(fsl_ddr_sdram_info_t *pinfo,
+ 

[U-Boot] [PATCH] ppc4xx: Read pipeline depth set to 4 for PPC440SP/SPE, PPC405EX, PPC460EX/GT/SX processors

2008-08-12 Thread fkan
From: Prodyut Hazarika <[EMAIL PROTECTED]>

Signed-off-by: Prodyut Hazarika <[EMAIL PROTECTED]>
Acked-by: Feng Kan <[EMAIL PROTECTED]>
---
 cpu/ppc4xx/44x_spd_ddr2.c  |   27 ---
 cpu/ppc4xx/cpu_init.c  |   16 +++-
 include/asm-ppc/ppc4xx-sdram.h |   48 +++---
 include/ppc440.h   |   47 --
 include/ppc4xx.h   |   55 
 5 files changed, 125 insertions(+), 68 deletions(-)

diff --git a/cpu/ppc4xx/44x_spd_ddr2.c b/cpu/ppc4xx/44x_spd_ddr2.c
index 1c36324..0431754 100644
--- a/cpu/ppc4xx/44x_spd_ddr2.c
+++ b/cpu/ppc4xx/44x_spd_ddr2.c
@@ -2172,6 +2172,11 @@ static void program_memory_queue(unsigned long 
*dimm_populated,
unsigned long i;
unsigned long bank_0_populated = 0;
phys_size_t total_size = 0;
+#if defined(CONFIG_440SP) || defined(CONFIG_440SPE) || \
+defined(CONFIG_460EX) || defined(CONFIG_460GT) || \
+defined(CONFIG_460SX)
+   unsigned long val;
+#endif
 
/*--
 * Reset the rank_base_address.
@@ -2249,17 +2254,31 @@ static void program_memory_queue(unsigned long 
*dimm_populated,
}
}
 
-#if defined(CONFIG_460EX) || defined(CONFIG_460GT)
+#if defined(CONFIG_440SP) || defined(CONFIG_440SPE) || \
+defined(CONFIG_460EX) || defined(CONFIG_460GT) || \
+defined(CONFIG_460SX)
+
/*
-* Enable high bandwidth access on 460EX/GT.
-* This should/could probably be done on other
-* PPC's too, like 440SPe.
+* Enable high bandwidth access 
 * This is currently not used, but with this setup
 * it is possible to use it later on in e.g. the Linux
 * EMAC driver for performance gain.
 */
mtdcr(SDRAM_PLBADDULL, 0x); /* MQ0_BAUL */
mtdcr(SDRAM_PLBADDUHB, 0x0008); /* MQ0_BAUH */
+
+   /*
+* Set optimal value for Memory Queue HB/LL Configuration registers
+*/
+
+   val = (mfdcr(SDRAM_CONF1HB) | SDRAM_CONF1HB_AAFR | SDRAM_CONF1HB_RPEN | 
SDRAM_CONF1HB_RFTE);
+   mtdcr(SDRAM_CONF1HB, val); 
+
+   val = (mfdcr(SDRAM_CONF1LL) | SDRAM_CONF1LL_AAFR | SDRAM_CONF1LL_RPEN | 
SDRAM_CONF1LL_RFTE);
+   mtdcr(SDRAM_CONF1LL, val); 
+
+   val = (mfdcr(SDRAM_CONFPATHB) | SDRAM_CONFPATHB_TPEN);
+   mtdcr(SDRAM_CONFPATHB, val);
 #endif
 }
 
diff --git a/cpu/ppc4xx/cpu_init.c b/cpu/ppc4xx/cpu_init.c
index e2d0402..c7c429e 100644
--- a/cpu/ppc4xx/cpu_init.c
+++ b/cpu/ppc4xx/cpu_init.c
@@ -138,7 +138,9 @@ void reconfigure_pll(u32 new_cpu_freq)
 void
 cpu_init_f (void)
 {
-#if defined(CONFIG_WATCHDOG) || defined(CONFIG_440GX) || defined(CONFIG_460EX)
+#if defined(CONFIG_WATCHDOG) || defined(CONFIG_440GX) || defined(CONFIG_460EX) 
|| \
+defined(CONFIG_440SP) || defined(CONFIG_440SPE) || defined(CONFIG_405EX)   
|| \
+defined(CONFIG_460GT) || defined(CONFIG_460SX)
u32 val;
 #endif
 
@@ -301,6 +303,18 @@ cpu_init_f (void)
val |= 0x400;
mtsdr(SDR0_USB2HOST_CFG, val);
 #endif /* CONFIG_460EX */
+
+#if defined(CONFIG_440SP) || defined(CONFIG_440SPE) || \
+defined(CONFIG_460EX) || defined(CONFIG_460GT)  || \
+defined(CONFIG_405EX) || defined(CONFIG_460SX)
+   /*
+* Set PLB4 arbiter (Segment 0 and 1) to 4 deep pipeline read 
+*/
+   val = (mfdcr(plb0_acr) & ~plb0_acr_rdp_mask) | plb0_acr_rdp_4deep;
+   mtdcr(plb0_acr, val);
+   val = (mfdcr(plb1_acr) & ~plb1_acr_rdp_mask) | plb1_acr_rdp_4deep;
+   mtdcr(plb1_acr, val);
+#endif /* CONFIG_440SP/SPE || CONFIG_460EX/GT || CONFIG_405EX */
 }
 
 /*
diff --git a/include/asm-ppc/ppc4xx-sdram.h b/include/asm-ppc/ppc4xx-sdram.h
index df787b3..d2e3b42 100644
--- a/include/asm-ppc/ppc4xx-sdram.h
+++ b/include/asm-ppc/ppc4xx-sdram.h
@@ -259,23 +259,39 @@
 /*
  * Memory queue defines
  */
-#define SDRAMQ_DCR_BASE0x040
-
-#define SDRAM_R0BAS(SDRAMQ_DCR_BASE+0x0)   /* rank 0 base address & size  
*/
-#define SDRAM_R1BAS(SDRAMQ_DCR_BASE+0x1)   /* rank 1 base address & size  
*/
-#define SDRAM_R2BAS(SDRAMQ_DCR_BASE+0x2)   /* rank 2 base address & size  
*/
-#define SDRAM_R3BAS(SDRAMQ_DCR_BASE+0x3)   /* rank 3 base address & size  
*/
-#define SDRAM_CONF1HB  (SDRAMQ_DCR_BASE+0x5)   /* configuration 1 HB  
*/
-#define SDRAM_ERRSTATHB(SDRAMQ_DCR_BASE+0x7)   /* error status HB  
   */
-#define SDRAM_ERRADDUHB(SDRAMQ_DCR_BASE+0x8)   /* error address upper 
32 HB   */
-#define SDRAM_ERRADDLHB(SDRAMQ_DCR_BASE+0x9)   /* error address lower 
32 HB   */
-#define SDRAM_PLBADDULL(SDRAMQ_DCR_BASE+0xA)   /* PLB base address 
upper 32 LL */
-#define SDRAM_CONF1LL  (SDRAMQ_DCR_BASE+0xB)   /* configuration 1 LL  
*/
-#define SDRAM_ERRSTATLL(SDRAMQ_DCR_BASE+0xC)   /* error status LL  
   */
-#define SDRAM_ERRADDULL(SDRAMQ_DCR_

[U-Boot] [ppc4xx] Please pull git://www.denx.de/git/u-boot-ppc4xx.git

2008-08-12 Thread Stefan Roese
The following changes since commit cd82919e6c8a73b363a26f34b734923844e52d1c:
  Wolfgang Denk (1):
Coding style cleanup, update CHANGELOG, prepare release

are available in the git repository at:

  git://www.denx.de/git/u-boot-ppc4xx.git master

Feng Kan (3):
  ppc4xx: Add initial 460SX defines for the cpu/ppc4xx directory.
  ppc4xx: Add initial 460SX reference board (redwood) config file and 
defines.
  ppc4xx: Initial framework of the AMCC PPC460SX redwood reference board.

Grant Erickson (5):
  PPC4xx: Correct SDRAM_MCSTAT for PPC405EX(r)
  ppc4xx: Add SDR0_SRST Mnemonics for the 405EX(r)
  ppc4xx: Add AMCC/IBM DDR2 SDRAM ECC Field Mnemonics
  ppc4xx: Add Mnemonics for AMCC/IBM DDR2 SDRAM Controller
  ppc4xx: Add MII mode support to the EMAC RGMII Bridge

Ricardo Ribalda Delgado (2):
  ppc4xx: CPU PPC440x5 on Virtex5 FX
  ppc4xx: ML507 Board Support

Stefan Roese (12):
  ppc4xx: Fix merge problems in 44x_spd_ddr2.c
  ppc4xx: Consolidate PPC4xx EBC defines
  ppc4xx: Consolidate PPC4xx UIC defines
  ppc4xx: Consolidate PPC4xx UIC defines
  ppc4xx: Rework 440GX UIC handling
  ppc4xx: Cleanup Katmai & Yucca PCIe register usage
  ppc4xx: Continue cleanup of ppc440.h
  ppc4xx: Add 460SX UIC defines
  ppc4xx: Some Rewood cleanups (coding style, leading white spaces)
  ppc4xx: Fix small korat merge problem
  ppc4xx: Fix compile warning in 44x_spd_ddr2.c
  ppc4xx: Minor coding style cleanup of Xilinx Virtex5 ml507 support

 CREDITS |5 +
 MAINTAINERS |7 +
 MAKEALL |2 +
 Makefile|6 +
 board/amcc/katmai/katmai.c  |   72 +---
 board/amcc/ocotea/ocotea.c  |   50 +-
 board/amcc/redwood/Makefile |   50 ++
 board/amcc/redwood/config.mk|   42 ++
 board/amcc/redwood/init.S   |   77 +++
 board/amcc/redwood/redwood.c|  456 ++
 board/amcc/redwood/redwood.h|   50 ++
 board/amcc/redwood/u-boot.lds   |  147 +
 board/amcc/sequoia/sequoia.c|5 +-
 board/amcc/taishan/taishan.c|   50 +-
 board/amcc/yucca/yucca.c|   62 +--
 board/korat/korat.c |4 +-
 board/prodrive/alpr/alpr.c  |   50 +-
 board/sandburst/karef/karef.c   |   50 +-
 board/sandburst/metrobox/metrobox.c |   50 +-
 board/xilinx/ml507/Makefile |   58 ++
 board/xilinx/ml507/config.mk|   24 +
 board/xilinx/ml507/init.S   |   47 ++
 board/xilinx/ml507/ml507.c  |   46 ++
 board/xilinx/ml507/u-boot.lds   |  130 
 board/xilinx/ml507/xparameters.h|   34 ++
 board/xpedite1k/xpedite1k.c |   50 +-
 common/cmd_reginfo.c|5 +-
 cpu/ppc4xx/44x_spd_ddr2.c   |  276 --
 cpu/ppc4xx/4xx_enet.c   |  492 ++--
 cpu/ppc4xx/4xx_uart.c   |2 +-
 cpu/ppc4xx/Makefile |   13 +-
 cpu/ppc4xx/cpu.c|   41 ++
 cpu/ppc4xx/cpu_init.c   |   15 +-
 cpu/ppc4xx/interrupts.c |  237 +---
 cpu/ppc4xx/iop480_uart.c|1 -
 cpu/ppc4xx/speed.c  |9 +-
 cpu/ppc4xx/start.S  |   19 +-
 cpu/ppc4xx/uic.c|  180 ++
 cpu/ppc4xx/usbdev.c |4 +-
 cpu/ppc4xx/xilinx_irq.c |  100 
 include/asm-ppc/interrupt.h |   36 ++
 include/asm-ppc/ppc4xx-ebc.h|  156 +
 include/asm-ppc/ppc4xx-intvec.h |  474 ---
 include/asm-ppc/ppc4xx-sdram.h  |  338 +--
 include/asm-ppc/ppc4xx-uic.h|  316 ++
 include/asm-ppc/processor.h |6 +
 include/asm-ppc/xilinx_irq.h|   36 ++
 include/configs/HH405.h |2 +-
 include/configs/katmai.h|1 -
 include/configs/kilauea.h   |  146 -
 include/configs/makalu.h|1 +
 include/configs/ml507.h |  116 
 include/configs/redwood.h   |  186 ++
 include/ppc405.h|  397 ++
 include/ppc440.h| 1112 +--
 include/ppc4xx.h|7 +-
 include/ppc4xx_enet.h   |   16 +-
 57 files changed, 3399 insertions(+), 2965 deletions(-)
 create mode 100644 board/amcc/redwood/Makefile
 create mode 100644 board/amcc/redwood/config.mk
 create mode 100644 board/amcc/redwood/init.S
 create mode 100644 board/amcc/redwood/redwood.c
 create mode 100644 board/amcc/redwood/redwood.h
 create mode 100644 board/amcc/redwood/u-boot.lds
 create mode 100644 board/xilinx/ml507/Makefile
 create mode 100644 board/xilinx/ml507/config.mk
 create mode 100644 board/xilinx/ml507/init.S
 create mode 100644 board/xilinx/ml507/ml507.c
 create mode 100644 board/xilinx/ml507/u-boot.lds
 create mode 100644 board/xilinx/ml507/xparameters.h
 create m

Re: [U-Boot] [WIP][PATCH 00/11] bootm refactoring

2008-08-12 Thread Kumar Gala

On Aug 12, 2008, at 6:15 PM, Wolfgang Denk wrote:

> Dear Kumar Gala,
>
> In message  [EMAIL PROTECTED]> you wrote:
>>
>> I'm adding a "boots" command that implements sub commands.  Once I
>
> I saw it. Actually I don't like it. Why didn't you stick with the
> original plan to implement subcommands as part of bootm ?

Can you be more precise about what you dont like.  Just the new  
command, how its implemented, or something else?  Also, what plan did  
we agree on?

I choose a new command because of my concern about how to distinguish  
the sub-command from a FIT identifier.  But it looks like that might  
not be an issue.

Its easy enough to fold the boots subcommands into bootm.  Is there  
something else that needs to be done?

- k
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] U-Boot and UBI

2008-08-12 Thread Kyungmin Park
Hi,

On Tue, Aug 12, 2008 at 8:11 PM, Stefan Roese <[EMAIL PROTECTED]> wrote:
> On Tuesday 12 August 2008, Kyungmin Park wrote:
>> > On Monday 11 August 2008, Kyungmin Park wrote:
>> >> Actually the Samsung implemented the UBI support on U-boot already and
>> >> has used it internally. The big difference is the code base. It's
>> >> based on kernel UBI code. Yes it's not fit well to u-boot ecosystem so
>> >> it created the ubi wrapper for u-boot.
>> >
>> > And how does NAND/OneNAND booting with UBI support fit into this? I
>> > assume that you have some size restrictions for the IPL/SPL on your
>> > platforms as well.
>>
>> It's not yet covered. it's TODO
>
> I see.
>

Yes, we should make a u-boot within one block size since flash only
guarantees the first one block as bad block free. e.g., exactly
(128KiB - 2KiB) size if OneNAND case.
For this, we need to code or size optimization.
If this is solved, we can use flash as bad block free device with UBI.

Also there are some issues related with ubi partitioning.

It's just rough ideas. For make a system as reasonable it creates two
UBI devices, one for boot-loader and another for kernel. If we make
only one UBI device, we should read whole flash blocks to read kernel.
but it's not reasonable.

1. UBI image for bootloader.
boot params (rw), kernel(ro), [Optional] initrd (ro)

Even though it has r/w area, we regards it as static volume for
performance since boot params almost read only. I think If UBI has
only static volumes we can optimize it more. we don't need to mirror
layout volume. no wear leveling and so on. For this, of course, we
need special handling for boot params.

2. UBI image for kernel.
rootfs(ro/rw), datafs(rw), and others(??)

Feel free, you make it for your purposes.

Thank you,
Kyungmin Park
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Pull request: nand-flash

2008-08-12 Thread Jean-Christophe PLAGNIOL-VILLARD
On 11:37 Tue 12 Aug , Scott Wood wrote:
> These patches are from the testing/mtd-2.6.22.1 branch of
> u-boot-nand-flash.
> 
> Note that this is a significant change to the NAND subsystem (importing a
> newer upstream version) that affects the driver interface.  If your board
> has NAND, please test.
> 
> The following changes since commit cd82919e6c8a73b363a26f34b734923844e52d1c:
>   Wolfgang Denk (1):
> Coding style cleanup, update CHANGELOG, prepare release
> 
> are available in the git repository at:
> 
>   git://www.denx.de/git/u-boot-nand-flash.git master

With this patchset, a lot of arm board are broken

nand.c: In function 'at91cap9adk_nand_hwcontrol':
nand.c:47: error: 'NAND_CTL_SETCLE' undeclared (first use in this
function)
nand.c:47: error: (Each undeclared identifier is reported only once
nand.c:47: error: for each function it appears in.)
nand.c:50: error: 'NAND_CTL_SETALE' undeclared (first use in this
function)
nand.c:53: error: 'NAND_CTL_CLRNCE' undeclared (first use in this
function)
nand.c:56: error: 'NAND_CTL_SETNCE' undeclared (first use in this
function)
nand.c: In function 'board_nand_init':
nand.c:65: error: 'struct nand_chip' has no member named 'eccmode'
nand.c:69: error: incompatible types in assignment
make[1]: *** [nand.o] Error 1

Configuring for apollon board...
onenand_base.c: In function 'onenand_bufferram_offset':
onenand_base.c:331: error: 'struct mtd_info' has no member named
'oobblock'
onenand_base.c: In function 'onenand_read_ecc':
onenand_base.c:541: error: 'struct mtd_info' has no member named
'oobblock'
onenand_base.c:543: error: 'struct mtd_info' has no member named
'oobblock'
onenand_base.c:544: error: 'struct mtd_info' has no member named
'oobblock'
onenand_base.c:545: error: 'struct mtd_info' has no member named
'oobblock'
onenand_base.c:549: error: 'struct mtd_info' has no member named
'oobblock'
onenand_base.c: In function 'onenand_read_oob':
onenand_base.c:664: error: 'struct mtd_info' has no member named
'oobblock'
onenand_base.c: In function 'onenand_write_ecc':
onenand_base.c:749: error: 'struct mtd_info' has no member named
'oobblock'
onenand_base.c:749: error: 'struct mtd_info' has no member named
'oobblock'
onenand_base.c:760: error: 'struct mtd_info' has no member named
'oobblock'
onenand_base.c:762: error: 'struct mtd_info' has no member named
'oobblock'
onenand_base.c:768: error: 'struct mtd_info' has no member named
'oobblock'
onenand_base.c: In function 'onenand_probe':
onenand_base.c:1212: error: 'struct mtd_info' has no member named
'oobblock'
onenand_base.c:1214: error: 'struct mtd_info' has no member named
'oobblock'
onenand_base.c:1216: error: 'struct mtd_info' has no member named
'oobblock'
onenand_base.c:1219: error: 'struct mtd_info' has no member named
'oobblock'
onenand_base.c:1221: error: 'struct mtd_info' has no member named
'oobblock'
onenand_base.c:1243: error: 'struct mtd_info' has no member named
'read_ecc'
onenand_base.c:1244: error: 'struct mtd_info' has no member named
'write_ecc'
onenand_base.c:1245: warning: assignment from incompatible pointer type
onenand_base.c:1246: warning: assignment from incompatible pointer type
make[1]: *** [onenand_base.o] Error 1

etc...

what do we do?

Best Regards,
J.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [WIP][PATCH 00/11] bootm refactoring

2008-08-12 Thread Wolfgang Denk
Dear Kumar Gala,

In message <[EMAIL PROTECTED]> you wrote:
> 
> I'm adding a "boots" command that implements sub commands.  Once I  

I saw it. Actually I don't like it. Why didn't you stick with the
original plan to implement subcommands as part of bootm ?

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: [EMAIL PROTECTED]
There are three things I always forget. Names, faces -  the  third  I
can't remember. - Italo Svevo
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] Change CFG_ENV_SIZE to CFG_ENV_SECT_SIZE for SPI sector erase

2008-08-12 Thread Tsi-Chung Liew
From: TsiChung Liew <[EMAIL PROTECTED]>

The CFG_ENV_SIZE is not suitable used for SPI flash erase
sector size.

Signed-off-by: TsiChung Liew <[EMAIL PROTECTED]>
---
 common/env_sf.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/common/env_sf.c b/common/env_sf.c
index d641a9a..0a0626e 100644
--- a/common/env_sf.c
+++ b/common/env_sf.c
@@ -69,7 +69,7 @@ int saveenv(void)
}
 
puts("Erasing SPI flash...");
-   if (spi_flash_erase(env_flash, CFG_ENV_OFFSET, CFG_ENV_SIZE))
+   if (spi_flash_erase(env_flash, CFG_ENV_OFFSET, CFG_ENV_SECT_SIZE))
return 1;
 
puts("Writing to SPI flash...");
-- 
1.5.6.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] ColdFire: Move m5272c3 from board to board/freescale

2008-08-12 Thread Tsi-Chung Liew
From: TsiChung Liew <[EMAIL PROTECTED]>

Signed-off-by: TsiChung Liew <[EMAIL PROTECTED]>
---
 Makefile   |2 +-
 board/freescale/m5272c3/Makefile   |   44 
 board/freescale/m5272c3/config.mk  |   25 +++
 board/freescale/m5272c3/flash.c|  378 
 board/freescale/m5272c3/m5272c3.c  |   51 +
 board/freescale/m5272c3/mii.c  |  303 +
 board/freescale/m5272c3/u-boot.lds |  143 ++
 board/m5272c3/Makefile |   44 
 board/m5272c3/config.mk|   25 ---
 board/m5272c3/flash.c  |  378 
 board/m5272c3/m5272c3.c|   51 -
 board/m5272c3/mii.c|  303 -
 board/m5272c3/u-boot.lds   |  143 --
 13 files changed, 945 insertions(+), 945 deletions(-)
 create mode 100644 board/freescale/m5272c3/Makefile
 create mode 100644 board/freescale/m5272c3/config.mk
 create mode 100644 board/freescale/m5272c3/flash.c
 create mode 100644 board/freescale/m5272c3/m5272c3.c
 create mode 100644 board/freescale/m5272c3/mii.c
 create mode 100644 board/freescale/m5272c3/u-boot.lds
 delete mode 100644 board/m5272c3/Makefile
 delete mode 100644 board/m5272c3/config.mk
 delete mode 100644 board/m5272c3/flash.c
 delete mode 100644 board/m5272c3/m5272c3.c
 delete mode 100644 board/m5272c3/mii.c
 delete mode 100644 board/m5272c3/u-boot.lds

diff --git a/Makefile b/Makefile
index 171fdd9..865edf5 100644
--- a/Makefile
+++ b/Makefile
@@ -1864,7 +1864,7 @@ M5271EVB_config : unconfig
@$(MKCONFIG) $(@:_config=) m68k mcf52x2 m5271evb freescale
 
 M5272C3_config :   unconfig
-   @$(MKCONFIG) $(@:_config=) m68k mcf52x2 m5272c3
+   @$(MKCONFIG) $(@:_config=) m68k mcf52x2 m5272c3 freescale
 
 M5275EVB_config :  unconfig
@$(MKCONFIG) $(@:_config=) m68k mcf52x2 m5275evb freescale
diff --git a/board/freescale/m5272c3/Makefile b/board/freescale/m5272c3/Makefile
new file mode 100644
index 000..be704b7
--- /dev/null
+++ b/board/freescale/m5272c3/Makefile
@@ -0,0 +1,44 @@
+#
+# (C) Copyright 2000-2006
+# Wolfgang Denk, DENX Software Engineering, [EMAIL PROTECTED]
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).a
+
+COBJS  = $(BOARD).o flash.o mii.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(obj).depend $(OBJS)
+   $(AR) $(ARFLAGS) $@ $(OBJS)
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/freescale/m5272c3/config.mk 
b/board/freescale/m5272c3/config.mk
new file mode 100644
index 000..ccb2cf7
--- /dev/null
+++ b/board/freescale/m5272c3/config.mk
@@ -0,0 +1,25 @@
+#
+# (C) Copyright 2000-2003
+# Wolfgang Denk, DENX Software Engineering, [EMAIL PROTECTED]
+# Coldfire contribution by Bernhard Kuhn <[EMAIL PROTECTED]>
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+TEXT_BASE = 0xffe0
diff --git a/board/freescale/m5272c3/flash.c b/board/freescale/m5272c3/flash.c
new file mode 100644
index 000..ea0b1fd
--- /dev/null
+++ b/board/freescale/m5272c3/flash.c
@@ -0,0 +1,378 @@
+/*
+ * (C) Copyright 2000

[U-Boot] [PATCH] ColdFire: Move m5282evb from board to board/freescale

2008-08-12 Thread Tsi-Chung Liew
From: TsiChung Liew <[EMAIL PROTECTED]>

Signed-off-by: TsiChung Liew <[EMAIL PROTECTED]>
---
 Makefile|2 +-
 board/freescale/m5282evb/Makefile   |   44 +
 board/freescale/m5282evb/config.mk  |   25 +++
 board/freescale/m5282evb/m5282evb.c |   93 +++
 board/freescale/m5282evb/mii.c  |  304 +++
 board/freescale/m5282evb/u-boot.lds |  142 
 board/m5282evb/Makefile |   44 -
 board/m5282evb/config.mk|   25 ---
 board/m5282evb/m5282evb.c   |   93 ---
 board/m5282evb/mii.c|  304 ---
 board/m5282evb/u-boot.lds   |  142 
 11 files changed, 609 insertions(+), 609 deletions(-)
 create mode 100644 board/freescale/m5282evb/Makefile
 create mode 100644 board/freescale/m5282evb/config.mk
 create mode 100644 board/freescale/m5282evb/m5282evb.c
 create mode 100644 board/freescale/m5282evb/mii.c
 create mode 100644 board/freescale/m5282evb/u-boot.lds
 delete mode 100644 board/m5282evb/Makefile
 delete mode 100644 board/m5282evb/config.mk
 delete mode 100644 board/m5282evb/m5282evb.c
 delete mode 100644 board/m5282evb/mii.c
 delete mode 100644 board/m5282evb/u-boot.lds

diff --git a/Makefile b/Makefile
index 865edf5..a4e6e0d 100644
--- a/Makefile
+++ b/Makefile
@@ -1870,7 +1870,7 @@ M5275EVB_config : unconfig
@$(MKCONFIG) $(@:_config=) m68k mcf52x2 m5275evb freescale
 
 M5282EVB_config :  unconfig
-   @$(MKCONFIG) $(@:_config=) m68k mcf52x2 m5282evb
+   @$(MKCONFIG) $(@:_config=) m68k mcf52x2 m5282evb freescale
 
 M5329AFEE_config \
 M5329BFEE_config : unconfig
diff --git a/board/freescale/m5282evb/Makefile 
b/board/freescale/m5282evb/Makefile
new file mode 100644
index 000..2ec71ee
--- /dev/null
+++ b/board/freescale/m5282evb/Makefile
@@ -0,0 +1,44 @@
+#
+# (C) Copyright 2000-2006
+# Wolfgang Denk, DENX Software Engineering, [EMAIL PROTECTED]
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).a
+
+COBJS  = $(BOARD).o mii.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(obj).depend $(OBJS)
+   $(AR) $(ARFLAGS) $@ $(OBJS)
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/freescale/m5282evb/config.mk 
b/board/freescale/m5282evb/config.mk
new file mode 100644
index 000..0aa2361
--- /dev/null
+++ b/board/freescale/m5282evb/config.mk
@@ -0,0 +1,25 @@
+#
+# (C) Copyright 2000-2003
+# Wolfgang Denk, DENX Software Engineering, [EMAIL PROTECTED]
+# Coldfire contribution by Bernhard Kuhn <[EMAIL PROTECTED]>
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+TEXT_BASE = 0xFFE0
diff --git a/board/freescale/m5282evb/m5282evb.c 
b/board/freescale/m5282evb/m5282evb.c
new file mode 100644
index 000..50e5e77
--- /dev/null
+++ b/board/freescale/m5282evb/m5282evb.c
@@ -0,0 +1,93 @@
+/*
+ * (C) Copyright 2000-2003
+ * Wolfgang Denk, DENX Software Engineering, [EMAIL PROTECTED]
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under th

[U-Boot] [PATCH] ColdFire: Move m5271evb from board to board/freescale

2008-08-12 Thread Tsi-Chung Liew
From: TsiChung Liew <[EMAIL PROTECTED]>

Signed-off-by: TsiChung Liew <[EMAIL PROTECTED]>
---
 Makefile|2 +-
 board/freescale/m5271evb/Makefile   |   44 +
 board/freescale/m5271evb/config.mk  |   25 +++
 board/freescale/m5271evb/m5271evb.c |  123 ++
 board/freescale/m5271evb/mii.c  |  303 +++
 board/freescale/m5271evb/u-boot.lds |  144 +
 board/m5271evb/Makefile |   44 -
 board/m5271evb/config.mk|   25 ---
 board/m5271evb/m5271evb.c   |  123 --
 board/m5271evb/mii.c|  303 ---
 board/m5271evb/u-boot.lds   |  144 -
 11 files changed, 640 insertions(+), 640 deletions(-)
 create mode 100644 board/freescale/m5271evb/Makefile
 create mode 100644 board/freescale/m5271evb/config.mk
 create mode 100644 board/freescale/m5271evb/m5271evb.c
 create mode 100644 board/freescale/m5271evb/mii.c
 create mode 100644 board/freescale/m5271evb/u-boot.lds
 delete mode 100644 board/m5271evb/Makefile
 delete mode 100644 board/m5271evb/config.mk
 delete mode 100644 board/m5271evb/m5271evb.c
 delete mode 100644 board/m5271evb/mii.c
 delete mode 100644 board/m5271evb/u-boot.lds

diff --git a/Makefile b/Makefile
index 3b99d7a..171fdd9 100644
--- a/Makefile
+++ b/Makefile
@@ -1861,7 +1861,7 @@ idmr_config : unconfig
@$(MKCONFIG) $(@:_config=) m68k mcf52x2 idmr
 
 M5271EVB_config :  unconfig
-   @$(MKCONFIG) $(@:_config=) m68k mcf52x2 m5271evb
+   @$(MKCONFIG) $(@:_config=) m68k mcf52x2 m5271evb freescale
 
 M5272C3_config :   unconfig
@$(MKCONFIG) $(@:_config=) m68k mcf52x2 m5272c3
diff --git a/board/freescale/m5271evb/Makefile 
b/board/freescale/m5271evb/Makefile
new file mode 100644
index 000..2ec71ee
--- /dev/null
+++ b/board/freescale/m5271evb/Makefile
@@ -0,0 +1,44 @@
+#
+# (C) Copyright 2000-2006
+# Wolfgang Denk, DENX Software Engineering, [EMAIL PROTECTED]
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).a
+
+COBJS  = $(BOARD).o mii.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(obj).depend $(OBJS)
+   $(AR) $(ARFLAGS) $@ $(OBJS)
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/freescale/m5271evb/config.mk 
b/board/freescale/m5271evb/config.mk
new file mode 100644
index 000..9a7af7c
--- /dev/null
+++ b/board/freescale/m5271evb/config.mk
@@ -0,0 +1,25 @@
+#
+# (C) Copyright 2000-2006
+# Wolfgang Denk, DENX Software Engineering, [EMAIL PROTECTED]
+# Coldfire contribution by Bernhard Kuhn <[EMAIL PROTECTED]>
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+TEXT_BASE = 0xffe0
diff --git a/board/freescale/m5271evb/m5271evb.c 
b/board/freescale/m5271evb/m5271evb.c
new file mode 100644
index 000..e089d5f
--- /dev/null
+++ b/board/freescale/m5271evb/m5271evb.c
@@ -0,0 +1,123 @@
+/*
+ * (C) Copyright 2000-2006
+ * Wolfgang Denk, DENX Software Engineering, [EMAIL PROTECTED]
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you ca

[U-Boot] [PATCH] ColdFire: Raise M5253EVBE uart baudrate to 115200 bps

2008-08-12 Thread Tsi-Chung Liew
From: TsiChung Liew <[EMAIL PROTECTED]>

Signed-off-by: TsiChung Liew <[EMAIL PROTECTED]>
---
 include/configs/M5253EVBE.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/configs/M5253EVBE.h b/include/configs/M5253EVBE.h
index f5e1b64..5653a39 100644
--- a/include/configs/M5253EVBE.h
+++ b/include/configs/M5253EVBE.h
@@ -32,7 +32,7 @@
 
 #define CONFIG_MCFUART
 #define CFG_UART_PORT  (0)
-#define CONFIG_BAUDRATE19200
+#define CONFIG_BAUDRATE115200
 #define CFG_BAUDRATE_TABLE { 9600 , 19200 , 38400 , 57600, 115200 }
 
 #undef CONFIG_WATCHDOG /* disable watchdog */
-- 
1.5.6.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] ColdFire: Fix M5253EVB dram bring up issue

2008-08-12 Thread Tsi-Chung Liew
From: TsiChung Liew <[EMAIL PROTECTED]>

Signed-off-by: TsiChung Liew <[EMAIL PROTECTED]>
---
 board/freescale/m5253evbe/m5253evbe.c |   13 +
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/board/freescale/m5253evbe/m5253evbe.c 
b/board/freescale/m5253evbe/m5253evbe.c
index f80a47c..f3b1efd 100644
--- a/board/freescale/m5253evbe/m5253evbe.c
+++ b/board/freescale/m5253evbe/m5253evbe.c
@@ -36,8 +36,6 @@ int checkboard(void)
 
 phys_size_t initdram(int board_type)
 {
-   int i;
-
/*
 * Check to see if the SDRAM has already been initialized
 * by a run control tool
@@ -50,21 +48,27 @@ phys_size_t initdram(int board_type)
 
/* Initialize DRAM Control Register: DCR */
mbar_writeShort(MCFSIM_DCR, (0x8400 | RC));
+   asm("nop");
 
-   mbar_writeLong(MCFSIM_DACR0, 0x3224);
+   mbar_writeLong(MCFSIM_DACR0, 0x2320);
+   asm("nop");
 
/* Initialize DMR0 */
dramsize = ((CFG_SDRAM_SIZE << 20) - 1) & 0xFFFC;
mbar_writeLong(MCFSIM_DMR0, dramsize | 1);
+   asm("nop");
 
-   mbar_writeLong(MCFSIM_DACR0, 0x322c);
+   mbar_writeLong(MCFSIM_DACR0, 0x2328);
+   asm("nop");
 
/* Write to this block to initiate precharge */
*(u32 *) (CFG_SDRAM_BASE) = 0xa5a5a5a5;
+   asm("nop");
 
/* Set RE bit in DACR */
mbar_writeLong(MCFSIM_DACR0,
   mbar_readLong(MCFSIM_DACR0) | 0x8000);
+   asm("nop");
 
/* Wait for at least 8 auto refresh cycles to occur */
udelay(500);
@@ -72,6 +76,7 @@ phys_size_t initdram(int board_type)
/* Finish the configuration by issuing the MRS */
mbar_writeLong(MCFSIM_DACR0,
   mbar_readLong(MCFSIM_DACR0) | 0x0040);
+   asm("nop");
 
*(u32 *) (CFG_SDRAM_BASE + 0x800) = 0xa5a5a5a5;
}
-- 
1.5.6.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 13/13] drivers/mtd/nand_legacy: Move conditional compilation to Makefile

2008-08-12 Thread Jean-Christophe PLAGNIOL-VILLARD
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <[EMAIL PROTECTED]>
---
 drivers/mtd/nand_legacy/Makefile  |5 -
 drivers/mtd/nand_legacy/nand_legacy.c |5 -
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/mtd/nand_legacy/Makefile b/drivers/mtd/nand_legacy/Makefile
index 4e29c36..a1a9cc9 100644
--- a/drivers/mtd/nand_legacy/Makefile
+++ b/drivers/mtd/nand_legacy/Makefile
@@ -25,8 +25,11 @@ include $(TOPDIR)/config.mk
 
 LIB:= $(obj)libnand_legacy.a
 
-COBJS  := nand_legacy.o
+ifdef CONFIG_CMD_NAND
+COBJS-$(CONFIG_NAND_LEGACY):= nand_legacy.o
+endif
 
+COBJS  := $(COBJS-y)
 SRCS   := $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS))
 
diff --git a/drivers/mtd/nand_legacy/nand_legacy.c 
b/drivers/mtd/nand_legacy/nand_legacy.c
index 8f7dc39..bf5565a 100644
--- a/drivers/mtd/nand_legacy/nand_legacy.c
+++ b/drivers/mtd/nand_legacy/nand_legacy.c
@@ -14,9 +14,6 @@
 #include 
 #include 
 #include 
-
-#if defined(CONFIG_CMD_NAND) && defined(CONFIG_NAND_LEGACY)
-
 #include 
 #include 
 #include 
@@ -1608,5 +1605,3 @@ int read_jffs2_nand(size_t start, size_t len,
start, len, retlen, buf);
 }
 #endif /* CONFIG_JFFS2_NAND */
-
-#endif
-- 
1.5.6.2

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 11/13] drivers/mtd/onenand: Move conditional compilation to Makefile

2008-08-12 Thread Jean-Christophe PLAGNIOL-VILLARD
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <[EMAIL PROTECTED]>
---
 drivers/mtd/onenand/Makefile|3 ++-
 drivers/mtd/onenand/onenand_base.c  |5 -
 drivers/mtd/onenand/onenand_bbt.c   |5 -
 drivers/mtd/onenand/onenand_uboot.c |5 -
 4 files changed, 2 insertions(+), 16 deletions(-)

diff --git a/drivers/mtd/onenand/Makefile b/drivers/mtd/onenand/Makefile
index 92074b2..1d35a57 100644
--- a/drivers/mtd/onenand/Makefile
+++ b/drivers/mtd/onenand/Makefile
@@ -25,8 +25,9 @@ include $(TOPDIR)/config.mk
 
 LIB:= $(obj)libonenand.a
 
-COBJS  := onenand_uboot.o onenand_base.o onenand_bbt.o
+COBJS-$(CONFIG_CMD_ONENAND):= onenand_uboot.o onenand_base.o onenand_bbt.o
 
+COBJS  := $(COBJS-y)
 SRCS   := $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS))
 
diff --git a/drivers/mtd/onenand/onenand_base.c 
b/drivers/mtd/onenand/onenand_base.c
index ded1706..7c9438b 100644
--- a/drivers/mtd/onenand/onenand_base.c
+++ b/drivers/mtd/onenand/onenand_base.c
@@ -10,9 +10,6 @@
  */
 
 #include 
-
-#ifdef CONFIG_CMD_ONENAND
-
 #include 
 #include 
 #include 
@@ -1304,5 +1301,3 @@ int onenand_scan(struct mtd_info *mtd, int maxchips)
 void onenand_release(struct mtd_info *mtd)
 {
 }
-
-#endif /* CONFIG_CMD_ONENAND */
diff --git a/drivers/mtd/onenand/onenand_bbt.c 
b/drivers/mtd/onenand/onenand_bbt.c
index 87344ab..0abaa1a 100644
--- a/drivers/mtd/onenand/onenand_bbt.c
+++ b/drivers/mtd/onenand/onenand_bbt.c
@@ -15,9 +15,6 @@
  */
 
 #include 
-
-#ifdef CONFIG_CMD_ONENAND
-
 #include 
 #include 
 #include 
@@ -261,5 +258,3 @@ int onenand_default_bbt(struct mtd_info *mtd)
 
return onenand_scan_bbt(mtd, bbm->badblock_pattern);
 }
-
-#endif /* CFG_CMD_ONENAND */
diff --git a/drivers/mtd/onenand/onenand_uboot.c 
b/drivers/mtd/onenand/onenand_uboot.c
index bd7466a..d614450 100644
--- a/drivers/mtd/onenand/onenand_uboot.c
+++ b/drivers/mtd/onenand/onenand_uboot.c
@@ -14,9 +14,6 @@
  */
 
 #include 
-
-#ifdef CONFIG_CMD_ONENAND
-
 #include 
 #include 
 #include 
@@ -37,5 +34,3 @@ void onenand_init(void)
puts("OneNAND: ");
print_size(onenand_mtd.size, "\n");
 }
-
-#endif /* CONFIG_CMD_ONENAND */
-- 
1.5.6.2

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 08/13] drivers/pci: Move conditional compilation to Makefile

2008-08-12 Thread Jean-Christophe PLAGNIOL-VILLARD
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <[EMAIL PROTECTED]>
---
 drivers/pci/Makefile|   10 --
 drivers/pci/fsl_pci_init.c  |4 
 drivers/pci/pci.c   |4 
 drivers/pci/pci_auto.c  |4 
 drivers/pci/pci_indirect.c  |2 --
 drivers/pci/tsi108_pci.c|4 
 drivers/pci/w83c553f.c  |4 
 include/configs/BAB7xx.h|2 +-
 include/configs/HIDDEN_DRAGON.h |2 +-
 include/configs/Sandpoint8240.h |2 +-
 include/configs/Sandpoint8245.h |2 +-
 11 files changed, 8 insertions(+), 32 deletions(-)

diff --git a/drivers/pci/Makefile b/drivers/pci/Makefile
index dec93b9..bffb1eb 100644
--- a/drivers/pci/Makefile
+++ b/drivers/pci/Makefile
@@ -25,15 +25,13 @@ include $(TOPDIR)/config.mk
 
 LIB:= $(obj)libpci.a
 
-COBJS-y += fsl_pci_init.o
-COBJS-y += pci.o
-COBJS-y += pci_auto.o
-COBJS-y += pci_indirect.o
-COBJS-y += tsi108_pci.o
-COBJS-y += w83c553f.o
+COBJS-$(CONFIG_FSL_PCI_INIT) += fsl_pci_init.o
+COBJS-$(CONFIG_PCI) += pci.o pci_auto.o pci_indirect.o
 COBJS-$(CONFIG_SH4_PCI) += pci_sh4.o
 COBJS-$(CONFIG_SH7751_PCI) +=pci_sh7751.o
 COBJS-$(CONFIG_SH7780_PCI) +=pci_sh7780.o
+COBJS-$(CONFIG_TSI108_PCI) += tsi108_pci.o
+COBJS-$(CONFIG_WINBOND_83C553) += w83c553f.o
 
 COBJS  := $(COBJS-y)
 SRCS   := $(COBJS:.o=.c)
diff --git a/drivers/pci/fsl_pci_init.c b/drivers/pci/fsl_pci_init.c
index a7afa90..bb2813f 100644
--- a/drivers/pci/fsl_pci_init.c
+++ b/drivers/pci/fsl_pci_init.c
@@ -18,8 +18,6 @@
 
 #include 
 
-#ifdef CONFIG_FSL_PCI_INIT
-
 /*
  * PCI/PCIE Controller initialization for mpc85xx/mpc86xx soc's
  *
@@ -197,5 +195,3 @@ fsl_pci_init(struct pci_controller *hose)
pci_hose_write_config_word(hose, dev, PCI_SEC_STATUS, 0x);
}
 }
-
-#endif /* CONFIG_FSL_PCI */
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 16180cb..b5eea89 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -30,8 +30,6 @@
 
 #include 
 
-#ifdef CONFIG_PCI
-
 #include 
 #include 
 #include 
@@ -544,5 +542,3 @@ void pci_init(void)
/* now call board specific pci_init()... */
pci_init_board();
 }
-
-#endif /* CONFIG_PCI */
diff --git a/drivers/pci/pci_auto.c b/drivers/pci/pci_auto.c
index eb69593..2acf9bf 100644
--- a/drivers/pci/pci_auto.c
+++ b/drivers/pci/pci_auto.c
@@ -15,8 +15,6 @@
 
 #include 
 
-#ifdef CONFIG_PCI
-
 #include 
 
 #undef DEBUG
@@ -408,5 +406,3 @@ int pciauto_config_device(struct pci_controller *hose, 
pci_dev_t dev)
 
return sub_bus;
 }
-
-#endif /* CONFIG_PCI */
diff --git a/drivers/pci/pci_indirect.c b/drivers/pci/pci_indirect.c
index 55517a8..ab51f8d 100644
--- a/drivers/pci/pci_indirect.c
+++ b/drivers/pci/pci_indirect.c
@@ -11,7 +11,6 @@
 
 #include 
 
-#ifdef CONFIG_PCI
 #if (!defined(__I386__) && !defined(CONFIG_IXDP425))
 
 #include 
@@ -135,4 +134,3 @@ void pci_setup_indirect(struct pci_controller* hose, u32 
cfg_addr, u32 cfg_data)
 }
 
 #endif /* !__I386__ && !CONFIG_IXDP425 */
-#endif /* CONFIG_PCI */
diff --git a/drivers/pci/tsi108_pci.c b/drivers/pci/tsi108_pci.c
index 4f02cb8..edd614f 100644
--- a/drivers/pci/tsi108_pci.c
+++ b/drivers/pci/tsi108_pci.c
@@ -27,8 +27,6 @@
 
 #include 
 
-#ifdef CONFIG_TSI108_PCI
-
 #include 
 #include 
 #include 
@@ -182,5 +180,3 @@ void ft_pci_setup(void *blob, bd_t *bd)
}
 }
 #endif /* CONFIG_OF_LIBFDT */
-
-#endif /* CONFIG_TSI108_PCI */
diff --git a/drivers/pci/w83c553f.c b/drivers/pci/w83c553f.c
index 9ea08a2..d7355a4 100644
--- a/drivers/pci/w83c553f.c
+++ b/drivers/pci/w83c553f.c
@@ -30,8 +30,6 @@
 #include 
 #include 
 
-#ifdef CFG_WINBOND_83C553
-
 #include 
 #include 
 
@@ -222,5 +220,3 @@ void initialise_dma(void)
out8(W83C553F_DMA1 + W83C553F_DMA1_CS, 0x00);
out16(W83C553F_DMA2 + W83C553F_DMA2_CS, 0x);
 }
-
-#endif /* CFG_WINBOND_83C553 */
diff --git a/include/configs/BAB7xx.h b/include/configs/BAB7xx.h
index 799ce38..26a1a2d 100644
--- a/include/configs/BAB7xx.h
+++ b/include/configs/BAB7xx.h
@@ -338,7 +338,7 @@ extern unsigned char   scsi_sym53c8xx_ccf;
 /*
  * Winbond Configuration
  */
-#define CFG_WINBOND_83C553  1   /* has a winbond 
bridge */
+#define CONFIG_WINBOND_83C553  1   /* has a winbond 
bridge */
 #define CFG_USE_WINBOND_IDE 0   /* use winbond 83c553 
internal ide */
 #define CFG_WINBOND_ISA_CFG_ADDR0x80005800  /* pci-isa bridge 
config addr */
 #define CFG_WINBOND_IDE_CFG_ADDR0x80005900  /* ide config addr */
diff --git a/include/configs/HIDDEN_DRAGON.h b/include/configs/HIDDEN_DRAGON.h
index fea1f6c..5deb84d 100644
--- a/include/configs/HIDDEN_DRAGON.h
+++ b/include/configs/HIDDEN_DRAGON.h
@@ -201,7 +201,7 @@
  */
 
 
-#define CFG_WINBOND_83C553 1   /*has a winbond bridge  
*/
+#define CONFIG_WINBOND_83C553  1   /*has a winbond bridge  
*/
 #define CFG_USE_WINBOND_IDE0   /*use winbond 83c553 in

[U-Boot] [PATCH 02/13] serial: move CFG_SCIF_CONSOLE to CONFIG_SCIF_CONSOLE

2008-08-12 Thread Jean-Christophe PLAGNIOL-VILLARD
move also conditional compilation to Makefile

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <[EMAIL PROTECTED]>
---
 drivers/serial/Makefile |2 +-
 drivers/serial/serial_sh.c  |4 
 include/configs/MigoR.h |2 +-
 include/configs/mpr2.h  |2 +-
 include/configs/ms7720se.h  |2 +-
 include/configs/ms7722se.h  |2 +-
 include/configs/ms7750se.h  |2 +-
 include/configs/r2dplus.h   |2 +-
 include/configs/r7780mp.h   |2 +-
 include/configs/sh7763rdp.h |2 +-
 10 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
index de6fbab..3716974 100644
--- a/drivers/serial/Makefile
+++ b/drivers/serial/Makefile
@@ -35,7 +35,7 @@ COBJS-$(CONFIG_MAX3100_SERIAL) += serial_max3100.o
 COBJS-y += serial_pl010.o
 COBJS-y += serial_pl011.o
 COBJS-$(CONFIG_XILINX_UARTLITE) += serial_xuartlite.o
-COBJS-y += serial_sh.o
+COBJS-$(CONFIG_SCIF_CONSOLE) += serial_sh.o
 COBJS-$(CONFIG_USB_TTY) += usbtty.o
 
 COBJS  := $(COBJS-y)
diff --git a/drivers/serial/serial_sh.c b/drivers/serial/serial_sh.c
index 0801ac4..2b9eeed 100644
--- a/drivers/serial/serial_sh.c
+++ b/drivers/serial/serial_sh.c
@@ -20,8 +20,6 @@
 #include 
 #include 
 
-#ifdef CFG_SCIF_CONSOLE
-
 #if defined (CONFIG_CONS_SCIF0)
 #define SCIF_BASE  SCIF0_BASE
 #elif defined (CONFIG_CONS_SCIF1)
@@ -215,5 +213,3 @@ int serial_getc(void)
 
return ch;
 }
-
-#endif /* CFG_SCIF_CONSOLE */
diff --git a/include/configs/MigoR.h b/include/configs/MigoR.h
index fa0e5db..ffa9b54 100644
--- a/include/configs/MigoR.h
+++ b/include/configs/MigoR.h
@@ -67,7 +67,7 @@
 #define CFG_BAUDRATE_TABLE { 115200 }  /* List of legal baudrate 
settings for this board */
 
 /* SCIF */
-#define CFG_SCIF_CONSOLE   1
+#define CONFIG_SCIF_CONSOLE1
 #define CONFIG_CONS_SCIF0  1
 #undef  CFG_CONSOLE_INFO_QUIET /* Suppress display of console
   information 
at boot */
diff --git a/include/configs/mpr2.h b/include/configs/mpr2.h
index 0fc0b97..2598b34 100644
--- a/include/configs/mpr2.h
+++ b/include/configs/mpr2.h
@@ -86,7 +86,7 @@
 #define CFG_HZ (CONFIG_SYS_CLK_FREQ / TMU_CLK_DIVIDER)
 
 /* UART */
-#define CFG_SCIF_CONSOLE   1
+#define CONFIG_SCIF_CONSOLE1
 #define CONFIG_CONS_SCIF0  1
 
 #endif /* __MPR2_H */
diff --git a/include/configs/ms7720se.h b/include/configs/ms7720se.h
index 5e79a27..dc0af15 100644
--- a/include/configs/ms7720se.h
+++ b/include/configs/ms7720se.h
@@ -63,7 +63,7 @@
 #define CFG_BAUDRATE_TABLE { 115200 }
 
 /* SCIF */
-#define CFG_SCIF_CONSOLE   1
+#define CONFIG_SCIF_CONSOLE1
 #define CONFIG_CONS_SCIF0  1
 
 #define CFG_MEMTEST_START  MS7720SE_SDRAM_BASE
diff --git a/include/configs/ms7722se.h b/include/configs/ms7722se.h
index 7298e55..910a44e 100644
--- a/include/configs/ms7722se.h
+++ b/include/configs/ms7722se.h
@@ -62,7 +62,7 @@
 #define CFG_BAUDRATE_TABLE { 115200 }  /* List of legal baudrate 
settings for this board */
 
 /* SCIF */
-#define CFG_SCIF_CONSOLE   1
+#define CONFIG_SCIF_CONSOLE1
 #define CONFIG_CONS_SCIF0  1
 #undef  CFG_CONSOLE_INFO_QUIET /* Suppress display of console 
information at boot */
 #undef  CFG_CONSOLE_OVERWRITE_ROUTINE
diff --git a/include/configs/ms7750se.h b/include/configs/ms7750se.h
index 3000c77..bee0aab 100644
--- a/include/configs/ms7750se.h
+++ b/include/configs/ms7750se.h
@@ -42,7 +42,7 @@
 #define CONFIG_CMD_FLASH
 #define CONFIG_CMD_ENV
 
-#define CFG_SCIF_CONSOLE   1
+#define CONFIG_SCIF_CONSOLE1
 #define CONFIG_BAUDRATE38400
 #define CONFIG_CONS_SCIF1  1
 #define BOARD_LATE_INIT1
diff --git a/include/configs/r2dplus.h b/include/configs/r2dplus.h
index e269336..414e8dc 100644
--- a/include/configs/r2dplus.h
+++ b/include/configs/r2dplus.h
@@ -26,7 +26,7 @@
 #define CONFIG_DOS_PARTITION
 
 /* SCIF */
-#define CFG_SCIF_CONSOLE   1
+#define CONFIG_SCIF_CONSOLE1
 #define CONFIG_BAUDRATE115200
 #define CONFIG_CONS_SCIF1  1
 #define BOARD_LATE_INIT1
diff --git a/include/configs/r7780mp.h b/include/configs/r7780mp.h
index 4c82c5a..0b08f18 100644
--- a/include/configs/r7780mp.h
+++ b/include/configs/r7780mp.h
@@ -49,7 +49,7 @@
 #define CONFIG_CMD_EXT2
 #define CONFIG_DOS_PARTITION
 
-#define CFG_SCIF_CONSOLE   1
+#define CONFIG_SCIF_CONSOLE1
 #define CONFIG_BAUDRATE115200
 #define CONFIG_CONS_SCIF0  1
 
diff --git a/include/configs/sh7763rdp.h b/include/configs/sh7763rdp.h
index 5a65663..4723634 100644
--- a/include/configs/sh7763rdp.h
+++ b/include/configs/sh7763rdp.h
@@ -52,7 +52,7 @@
 #undef  CONFIG_SHOW_BOOT_PROGRESS
 
 /* SCIF */
-#define CFG_SCIF_CONSOLE1
+#define CONFIG_SCIF_CONSOLE1
 #define CONFIG_BAUDRATE 115200
 #define CONFIG_CONS_SCIF2  1
 
-- 
1.5.6.2


[U-Boot] [PATCH 12/13] drivers/mtd/nand: Move conditional compilation to Makefile

2008-08-12 Thread Jean-Christophe PLAGNIOL-VILLARD
rename CFG_NAND_LEGACY to CONFIG_NAND_LEGACY

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <[EMAIL PROTECTED]>
---
 board/delta/nand.c|2 +-
 board/esd/common/auto_update.c|   12 ++--
 board/netta/netta.c   |2 +-
 common/cmd_jffs2.c|   12 ++--
 common/cmd_nand.c |6 +++---
 cpu/arm920t/s3c24x0/nand.c|2 +-
 cpu/arm926ejs/davinci/nand.c  |2 +-
 cpu/ppc4xx/ndfc.c |2 +-
 doc/README.nand   |2 +-
 drivers/mtd/nand/Makefile |   10 +++---
 drivers/mtd/nand/diskonchip.c |2 +-
 drivers/mtd/nand/fsl_upm.c|3 ---
 drivers/mtd/nand/nand.c   |5 -
 drivers/mtd/nand/nand_base.c  |5 -
 drivers/mtd/nand/nand_bbt.c   |5 -
 drivers/mtd/nand/nand_ecc.c   |4 
 drivers/mtd/nand/nand_ids.c   |4 
 drivers/mtd/nand/nand_util.c  |5 -
 drivers/mtd/nand_legacy/nand_legacy.c |2 +-
 fs/jffs2/jffs2_1pass.c|6 +++---
 fs/jffs2/jffs2_nand_1pass.c   |2 +-
 include/configs/BMW.h |2 +-
 include/configs/CPU87.h   |2 +-
 include/configs/GEN860T.h |2 +-
 include/configs/IDS8247.h |2 +-
 include/configs/MIP405.h  |2 +-
 include/configs/NETPHONE.h|2 +-
 include/configs/NETTA.h   |2 +-
 include/configs/NETTA2.h  |2 +-
 include/configs/NETVIA.h  |2 +-
 include/configs/PCIPPC2.h |2 +-
 include/configs/PCIPPC6.h |2 +-
 include/configs/PIP405.h  |2 +-
 include/configs/PM520.h   |2 +-
 include/configs/PM826.h   |2 +-
 include/configs/PM828.h   |2 +-
 include/configs/SXNI855T.h|2 +-
 include/configs/TQM85xx.h |2 +-
 include/configs/VCMA9.h   |2 +-
 include/configs/at91rm9200dk.h|2 +-
 include/configs/delta.h   |2 +-
 include/configs/omap2420h4.h  |2 +-
 include/configs/stxxtc.h  |2 +-
 include/configs/svm_sc8xx.h   |2 +-
 include/linux/mtd/nand_ids.h  |2 +-
 include/linux/mtd/nand_legacy.h   |2 +-
 include/nand.h|4 ++--
 lib_generic/crc32.c   |2 +-
 48 files changed, 62 insertions(+), 89 deletions(-)

diff --git a/board/delta/nand.c b/board/delta/nand.c
index b007b09..4ce78a1 100644
--- a/board/delta/nand.c
+++ b/board/delta/nand.c
@@ -23,7 +23,7 @@
 #include 
 
 #if defined(CONFIG_CMD_NAND)
-#if !defined(CFG_NAND_LEGACY)
+#if !defined(CONFIG_NAND_LEGACY)
 
 #include 
 #include 
diff --git a/board/esd/common/auto_update.c b/board/esd/common/auto_update.c
index 7e6eea0..a1e0ce5 100644
--- a/board/esd/common/auto_update.c
+++ b/board/esd/common/auto_update.c
@@ -27,7 +27,7 @@
 #include 
 #include 
 #include 
-#if defined(CFG_NAND_LEGACY)
+#if defined(CONFIG_NAND_LEGACY)
 #include 
 #endif
 #include 
@@ -58,7 +58,7 @@ extern int flash_sect_erase(ulong, ulong);
 extern int flash_sect_protect (int, ulong, ulong);
 extern int flash_write (char *, ulong, ulong);
 
-#if defined(CONFIG_CMD_NAND) && defined(CFG_NAND_LEGACY)
+#if defined(CONFIG_CMD_NAND) && defined(CONFIG_NAND_LEGACY)
 /* references to names in cmd_nand.c */
 #define NANDRW_READ0x01
 #define NANDRW_WRITE   0x00
@@ -158,7 +158,7 @@ int au_do_update(int i, long sz)
int off, rc;
uint nbytes;
int k;
-#if defined(CONFIG_CMD_NAND) && defined(CFG_NAND_LEGACY)
+#if defined(CONFIG_CMD_NAND) && defined(CONFIG_NAND_LEGACY)
int total;
 #endif
 
@@ -241,7 +241,7 @@ int au_do_update(int i, long sz)
debug ("flash_sect_erase(%lx, %lx);\n", start, end);
flash_sect_erase (start, end);
} else {
-#if defined(CONFIG_CMD_NAND) && defined(CFG_NAND_LEGACY)
+#if defined(CONFIG_CMD_NAND) && defined(CONFIG_NAND_LEGACY)
printf ("Updating NAND FLASH with image %s\n",
au_image[i].name);
debug ("nand_legacy_erase(%lx, %lx);\n", start, end);
@@ -273,7 +273,7 @@ int au_do_update(int i, long sz)
rc = flash_write ((char *)addr, start,
  (nbytes + 1) & ~1);
} else {
-#if defined(CONFIG_CMD_NAND) && defined(CFG_NAND_LEGACY)
+#if defined(CONFIG_CMD_NAND) && defined(CONFIG_NAND_LEGACY)
debug ("nand_legacy_rw(%p, %lx, %x)\n",
   addr, start, nbytes);
rc = nand_legacy_rw (nand_dev_desc,
@@ -298,7 +298,7 @@ int au_do_update(int i, long sz)
rc = crc32 (0, (uchar *)(start + off),
 

[U-Boot] [PATCH 07/13] drivers/misc: Move conditional compilation to Makefile

2008-08-12 Thread Jean-Christophe PLAGNIOL-VILLARD
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <[EMAIL PROTECTED]>
---
 drivers/misc/Makefile   |6 +++---
 drivers/misc/ali512x.c  |5 -
 drivers/misc/ns87308.c  |4 
 drivers/misc/status_led.c   |4 
 drivers/serial/serial.c |4 ++--
 include/configs/BAB7xx.h|2 +-
 include/configs/HIDDEN_DRAGON.h |2 +-
 include/configs/Sandpoint8240.h |2 +-
 include/configs/Sandpoint8245.h |2 +-
 9 files changed, 9 insertions(+), 22 deletions(-)

diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
index fe8d3d8..01e0f39 100644
--- a/drivers/misc/Makefile
+++ b/drivers/misc/Makefile
@@ -25,10 +25,10 @@ include $(TOPDIR)/config.mk
 
 LIB:= $(obj)libmisc.a
 
-COBJS-y += ali512x.o
-COBJS-y += ns87308.o
-COBJS-y += status_led.o
+COBJS-$(CONFIG_ALI152X) += ali512x.o
 COBJS-$(CONFIG_FSL_LAW) += fsl_law.o
+COBJS-$(CONFIG_NS87308) += ns87308.o
+COBJS-$(CONFIG_STATUS_LED) += status_led.o
 
 COBJS  := $(COBJS-y)
 SRCS   := $(COBJS:.o=.c)
diff --git a/drivers/misc/ali512x.c b/drivers/misc/ali512x.c
index 90b45d9..d6a2c1f 100644
--- a/drivers/misc/ali512x.c
+++ b/drivers/misc/ali512x.c
@@ -32,8 +32,6 @@
 
 #include 
 
-#ifdef CONFIG_ALI152X
-
 #include 
 #include 
 #include 
@@ -418,6 +416,3 @@ int ali512x_cio_in(int pin)
 
return data & bit;
 }
-
-
-#endif
diff --git a/drivers/misc/ns87308.c b/drivers/misc/ns87308.c
index cf4d359..6642c2e 100644
--- a/drivers/misc/ns87308.c
+++ b/drivers/misc/ns87308.c
@@ -23,8 +23,6 @@
 
 #include 
 
-#ifdef CFG_NS87308
-
 #include 
 
 void initialise_ns87308 (void)
@@ -117,5 +115,3 @@ void initialise_ns87308 (void)
PNP_PGCS_CSLINE_CONF(2, CFG_NS87308_CS2_CONF);
 #endif
 }
-
-#endif
diff --git a/drivers/misc/status_led.c b/drivers/misc/status_led.c
index ddb6c22..4ba3e18 100644
--- a/drivers/misc/status_led.c
+++ b/drivers/misc/status_led.c
@@ -35,8 +35,6 @@
 
 /* - */
 
-#ifdef CONFIG_STATUS_LED
-
 typedef struct {
led_id_t mask;
int state;
@@ -127,5 +125,3 @@ void status_led_set (int led, int state)
}
__led_set (ld->mask, state);
 }
-
-#endif /* CONFIG_STATUS_LED */
diff --git a/drivers/serial/serial.c b/drivers/serial/serial.c
index 8bbfcf9..b361eef 100644
--- a/drivers/serial/serial.c
+++ b/drivers/serial/serial.c
@@ -26,7 +26,7 @@
 #ifdef CFG_NS16550_SERIAL
 
 #include 
-#ifdef CFG_NS87308
+#ifdef CONFIG_NS87308
 #include 
 #endif
 
@@ -159,7 +159,7 @@ int serial_init (void)
 {
int clock_divisor;
 
-#ifdef CFG_NS87308
+#ifdef CONFIG_NS87308
initialise_ns87308();
 #endif
 
diff --git a/include/configs/BAB7xx.h b/include/configs/BAB7xx.h
index 8ec70aa..799ce38 100644
--- a/include/configs/BAB7xx.h
+++ b/include/configs/BAB7xx.h
@@ -346,7 +346,7 @@ extern unsigned char   scsi_sym53c8xx_ccf;
 /*
  * NS87308 Configuration
  */
-#define CFG_NS87308/* Nat Semi super-io cntr on ISA bus */
+#define CONFIG_NS87308/* Nat Semi super-io cntr on ISA bus 
*/
 #define CFG_NS87308_BADDR_101
 #define CFG_NS87308_DEVS(CFG_NS87308_UART1   | \
 CFG_NS87308_UART2   | \
diff --git a/include/configs/HIDDEN_DRAGON.h b/include/configs/HIDDEN_DRAGON.h
index 26dd954..fea1f6c 100644
--- a/include/configs/HIDDEN_DRAGON.h
+++ b/include/configs/HIDDEN_DRAGON.h
@@ -214,7 +214,7 @@
 /*
  * NS87308 Configuration
  */
-#define CFG_NS87308/* Nat Semi super-io controller on ISA 
bus */
+#define CONFIG_NS87308 /* Nat Semi super-io controller on ISA 
bus */
 
 #define CFG_NS87308_BADDR_10   1
 
diff --git a/include/configs/Sandpoint8240.h b/include/configs/Sandpoint8240.h
index 5bbe3c5..c5a57d3 100644
--- a/include/configs/Sandpoint8240.h
+++ b/include/configs/Sandpoint8240.h
@@ -246,7 +246,7 @@
 /*
  * NS87308 Configuration
  */
-#define CFG_NS87308/* Nat Semi super-io controller on ISA 
bus */
+#define CONFIG_NS87308 /* Nat Semi super-io controller on ISA 
bus */
 
 #define CFG_NS87308_BADDR_10   1
 
diff --git a/include/configs/Sandpoint8245.h b/include/configs/Sandpoint8245.h
index a08451e..5685314 100644
--- a/include/configs/Sandpoint8245.h
+++ b/include/configs/Sandpoint8245.h
@@ -214,7 +214,7 @@
 /*
  * NS87308 Configuration
  */
-#define CFG_NS87308/* Nat Semi super-io controller on ISA 
bus */
+#define CONFIG_NS87308 /* Nat Semi super-io controller on ISA 
bus */
 
 #define CFG_NS87308_BADDR_10   1
 
-- 
1.5.6.2

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 09/13] drivers/qe: Move conditional compilation to Makefile

2008-08-12 Thread Jean-Christophe PLAGNIOL-VILLARD
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <[EMAIL PROTECTED]>
---
 drivers/qe/Makefile  |3 ++-
 drivers/qe/qe.c  |3 ---
 drivers/qe/uccf.c|2 --
 drivers/qe/uec.c |5 -
 drivers/qe/uec_phy.c |3 ---
 5 files changed, 2 insertions(+), 14 deletions(-)

diff --git a/drivers/qe/Makefile b/drivers/qe/Makefile
index 45a2fff..18fe9ce 100644
--- a/drivers/qe/Makefile
+++ b/drivers/qe/Makefile
@@ -25,8 +25,9 @@ include $(TOPDIR)/config.mk
 LIB:= $(obj)qe.a
 
 COBJS-$(CONFIG_OF_LIBFDT) += fdt.o
-COBJS  := qe.o uccf.o uec.o uec_phy.o $(COBJS-y)
+COBJS-$(CONFIG_QE) += qe.o uccf.o uec.o uec_phy.o
 
+COBJS  := $(COBJS-y)
 SRCS   := $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS))
 
diff --git a/drivers/qe/qe.c b/drivers/qe/qe.c
index 7b6ecd7..e914d01 100644
--- a/drivers/qe/qe.c
+++ b/drivers/qe/qe.c
@@ -27,7 +27,6 @@
 #include "asm/immap_qe.h"
 #include "qe.h"
 
-#if defined(CONFIG_QE)
 qe_map_t   *qe_immr = NULL;
 static qe_snum_t   snums[QE_NUM_OF_SNUM];
 
@@ -466,5 +465,3 @@ U_BOOT_CMD(
"fw  [] - Upload firmware binary at address  to "
"the QE,\n\twith optional length  verification.\n"
);
-
-#endif /* CONFIG_QE */
diff --git a/drivers/qe/uccf.c b/drivers/qe/uccf.c
index 4a327ab..7f6337b 100644
--- a/drivers/qe/uccf.c
+++ b/drivers/qe/uccf.c
@@ -28,7 +28,6 @@
 #include "qe.h"
 #include "uccf.h"
 
-#if defined(CONFIG_QE)
 void ucc_fast_transmit_on_demand(ucc_fast_private_t *uccf)
 {
out_be16(&uccf->uf_regs->utodr, UCC_FAST_TOD);
@@ -401,4 +400,3 @@ int ucc_fast_init(ucc_fast_info_t *uf_info, 
ucc_fast_private_t  **uccf_ret)
*uccf_ret = uccf;
return 0;
 }
-#endif /* CONFIG_QE */
diff --git a/drivers/qe/uec.c b/drivers/qe/uec.c
index ba89247..344c649 100644
--- a/drivers/qe/uec.c
+++ b/drivers/qe/uec.c
@@ -31,8 +31,6 @@
 #include "uec_phy.h"
 #include "miiphy.h"
 
-#if defined(CONFIG_QE)
-
 #ifdef CONFIG_UEC_ETH1
 static uec_info_t eth1_uec_info = {
.uf_info= {
@@ -1406,6 +1404,3 @@ int uec_initialize(int index)
 
return 1;
 }
-
-
-#endif /* CONFIG_QE */
diff --git a/drivers/qe/uec_phy.c b/drivers/qe/uec_phy.c
index 423ba78..186922e 100644
--- a/drivers/qe/uec_phy.c
+++ b/drivers/qe/uec_phy.c
@@ -26,8 +26,6 @@
 #include "uec_phy.h"
 #include "miiphy.h"
 
-#if defined(CONFIG_QE)
-
 #define ugphy_printk(format, arg...)  \
printf(format "\n", ## arg)
 
@@ -677,4 +675,3 @@ void change_phy_interface_mode (struct eth_device *dev, 
enet_interface_e mode)
marvell_phy_interface_mode (dev, mode);
 #endif
 }
-#endif /* CONFIG_QE */
-- 
1.5.6.2

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 03/13] serial: move CFG_NS9750_UART to CONFIG_NS9750_UART

2008-08-12 Thread Jean-Christophe PLAGNIOL-VILLARD
move also conditional compilation to Makefile

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <[EMAIL PROTECTED]>
---
 drivers/serial/Makefile|2 +-
 drivers/serial/ns9750_serial.c |4 
 include/configs/ns9750dev.h|2 +-
 3 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
index 3716974..2384735 100644
--- a/drivers/serial/Makefile
+++ b/drivers/serial/Makefile
@@ -27,7 +27,7 @@ LIB   := $(obj)libserial.a
 
 COBJS-$(CONFIG_ATMEL_USART) += atmel_usart.o
 COBJS-$(CONFIG_MCFUART) += mcfuart.o
-COBJS-y += ns9750_serial.o
+COBJS-$(CONFIG_NS9750_UART) += ns9750_serial.o
 COBJS-y += ns16550.o
 COBJS-$(CONFIG_DRIVER_S3C4510_UART) += s3c4510b_uart.o
 COBJS-y += serial.o
diff --git a/drivers/serial/ns9750_serial.c b/drivers/serial/ns9750_serial.c
index 02c0d39..e9645a0 100644
--- a/drivers/serial/ns9750_serial.c
+++ b/drivers/serial/ns9750_serial.c
@@ -28,8 +28,6 @@
 
 #include 
 
-#ifdef CFG_NS9750_UART
-
 #include "ns9750_bbus.h"   /* for GPIOs */
 #include "ns9750_ser.h"/* for serial configuration */
 
@@ -210,5 +208,3 @@ static unsigned int calcRxCharGapRegister( void )
 {
return NS9750_SER_RX_CHAR_TIMER_TRUN;
 }
-
-#endif /* CFG_NS9750_UART */
diff --git a/include/configs/ns9750dev.h b/include/configs/ns9750dev.h
index f30cb46..746a56e 100644
--- a/include/configs/ns9750dev.h
+++ b/include/configs/ns9750dev.h
@@ -56,7 +56,7 @@
 /*
  * Hardware drivers
  */
-#define CFG_NS9750_UART1   /* use on-chip UART */
+#define CONFIG_NS9750_UART 1   /* use on-chip UART */
 #define CONFIG_DRIVER_NS9750_ETHERNET  1   /* use on-chip ethernet */
 
 /*
-- 
1.5.6.2

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 01/13] common: Move conditional compilation to Makefile

2008-08-12 Thread Jean-Christophe PLAGNIOL-VILLARD
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <[EMAIL PROTECTED]>
---
 common/ACEX1K.c  |4 
 common/Makefile  |   42 +++---
 common/altera.c  |4 
 common/bedbug.c  |4 
 common/cmd_onenand.c |4 
 common/cyclon2.c |4 
 common/docecc.c  |4 
 common/fpga.c|4 
 common/lcd.c |4 
 common/lynxkdi.c |3 ---
 common/miiphybb.c|5 -
 common/soft_i2c.c|5 -
 common/soft_spi.c|4 
 common/spartan2.c|4 
 common/spartan3.c|4 
 common/stratixII.c   |4 
 common/usb.c |4 
 common/usb_kbd.c |5 -
 common/usb_storage.c |7 ---
 common/virtex2.c |3 ---
 common/xilinx.c  |4 
 21 files changed, 23 insertions(+), 103 deletions(-)

diff --git a/common/ACEX1K.c b/common/ACEX1K.c
index 76dc166..53677b8 100644
--- a/common/ACEX1K.c
+++ b/common/ACEX1K.c
@@ -28,8 +28,6 @@
 #include /* core U-Boot definitions */
 #include /* ACEX device family */
 
-#if defined(CONFIG_FPGA) && defined(CONFIG_FPGA_ALTERA) && 
defined(CONFIG_FPGA_ACEX1K)
-
 /* Define FPGA_DEBUG to get debug printf's */
 #ifdef FPGA_DEBUG
 #define PRINTF(fmt,args...)printf (fmt ,##args)
@@ -362,5 +360,3 @@ static int ACEX1K_ps_reloc (Altera_desc * desc, ulong 
reloc_offset)
return ret_val;
 
 }
-
-#endif /* CONFIG_FPGA && CONFIG_FPGA_ALTERA && CONFIG_FPGA_ACEX1K */
diff --git a/common/Makefile b/common/Makefile
index ecf755f..c2b381b 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -28,9 +28,7 @@ LIB   = $(obj)libcommon.a
 AOBJS  =
 
 COBJS-y += main.o
-COBJS-y += ACEX1K.o
-COBJS-y += altera.o
-COBJS-y += bedbug.o
+COBJS-$(CONFIG_CMD_BEDBUG) += bedbug.o
 COBJS-y += circbuf.o
 COBJS-$(CONFIG_CMD_AMBAPP) += cmd_ambapp.o
 COBJS-y += cmd_autoscript.o
@@ -64,7 +62,18 @@ COBJS-$(CONFIG_OF_LIBFDT) += cmd_fdt.o fdt_support.o
 COBJS-$(CONFIG_CMD_FDOS) += cmd_fdos.o
 COBJS-$(CONFIG_CMD_FLASH) += cmd_flash.o
 ifdef CONFIG_FPGA
+COBJS-y += fpga.o
 COBJS-$(CONFIG_CMD_FPGA) += cmd_fpga.o
+COBJS-$(CONFIG_FPGA_SPARTAN2) += spartan2.o
+COBJS-$(CONFIG_FPGA_SPARTAN3) += spartan3.o
+COBJS-$(CONFIG_FPGA_VIRTEX2) += virtex2.o
+COBJS-$(CONFIG_FPGA_XILINX) += xilinx.o
+ifdef CONFIG_FPGA_ALTERA
+COBJS-y += altera.o
+COBJS-$(CONFIG_FPGA_ACEX1K) += ACEX1K.o
+COBJS-$(CONFIG_FPGA_CYCLON2) += cyclon2.o
+COBJS-$(CONFIG_FPGA_STRATIX_II) += stratixII.o
+endif
 endif
 COBJS-$(CONFIG_CMD_I2C) += cmd_i2c.o
 COBJS-$(CONFIG_CMD_IDE) += cmd_ide.o
@@ -80,7 +89,7 @@ COBJS-$(CONFIG_CMD_MMC) += cmd_mmc.o
 COBJS-y += cmd_nand.o
 COBJS-$(CONFIG_CMD_NET) += cmd_net.o
 COBJS-y += cmd_nvedit.o
-COBJS-y += cmd_onenand.o
+COBJS-$(CONFIG_CMD_ONENAND) += cmd_onenand.o
 COBJS-$(CONFIG_CMD_OTP) += cmd_otp.o
 ifdef CONFIG_PCI
 COBJS-$(CONFIG_CMD_PCI) += cmd_pci.o
@@ -102,11 +111,9 @@ COBJS-$(CONFIG_YAFFS2) += cmd_yaffs2.o
 COBJS-y += cmd_vfd.o
 COBJS-y += command.o
 COBJS-y += console.o
-COBJS-y += cyclon2.o
-COBJS-y += stratixII.o
 COBJS-y += devices.o
 COBJS-y += dlmalloc.o
-COBJS-y += docecc.o
+COBJS-$(CONFIG_CMD_DOC) += docecc.o
 COBJS-y += environment.o
 COBJS-y += env_common.o
 COBJS-y += env_nand.o
@@ -119,26 +126,23 @@ COBJS-y += env_nvram.o
 COBJS-y += env_nowhere.o
 COBJS-y += exports.o
 COBJS-y += flash.o
-COBJS-y += fpga.o
 COBJS-y += hush.o
 COBJS-y += kgdb.o
-COBJS-y += lcd.o
+COBJS-$(CONFIG_LCD) += lcd.o
 COBJS-y += lists.o
-COBJS-y += lynxkdi.o
+COBJS-$(CONFIG_LYNXKDI) += lynxkdi.o
 COBJS-y += memsize.o
-COBJS-y += miiphybb.o
+COBJS-$(CONFIG_BITBANGMII) += miiphybb.o
 COBJS-y += miiphyutil.o
 COBJS-y += s_record.o
 COBJS-y += serial.o
-COBJS-y += soft_i2c.o
-COBJS-y += soft_spi.o
-COBJS-y += spartan2.o
-COBJS-y += spartan3.o
+COBJS-$(CONFIG_SOFT_I2C) += soft_i2c.o
+COBJS-$(CONFIG_SOFT_SPI) += soft_spi.o
+ifdef CONFIG_CMD_USB
 COBJS-y += usb.o
-COBJS-y += usb_kbd.o
-COBJS-y += usb_storage.o
-COBJS-y += virtex2.o
-COBJS-y += xilinx.o
+COBJS-$(CONFIG_USB_STORAGE) += usb_storage.o
+endif
+COBJS-$(CONFIG_USB_KEYBOARD) += usb_kbd.o
 COBJS-y += crc16.o
 COBJS-y += xyzModem.o
 COBJS-y += cmd_mac.o
diff --git a/common/altera.c b/common/altera.c
index a2b5967..09dc0b2 100644
--- a/common/altera.c
+++ b/common/altera.c
@@ -41,8 +41,6 @@
 #define PRINTF(fmt,args...)
 #endif
 
-#if defined(CONFIG_FPGA) && defined(CONFIG_FPGA_ALTERA)
-
 /* Local Static Functions */
 static int altera_validate (Altera_desc * desc, const char *fn);
 
@@ -283,5 +281,3 @@ static int altera_validate (Altera_desc * desc, const char 
*fn)
 }
 
 /* - */
-
-#endif /* CONFIG_FPGA & CONFIG_FPGA_ALTERA */
diff --git a/common/bedbug.c b/common/bedbug.c
index 3bf1fc3..60109cf 100644
--- a/common/bedbug.c
+++ b/common/bedbug.c
@@ -2,8 +2,6 @@
 
 #include 
 
-#if defined(CONFIG_CMD_BEDBUG)
-
 #include 
 #include 
 #include 
@@ -1252,5 +1250,3 @@ int find_next_address (unsigned char 

[U-Boot] [PATCH 04/13] drivers/block: Move conditional compilation to Makefile

2008-08-12 Thread Jean-Christophe PLAGNIOL-VILLARD
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <[EMAIL PROTECTED]>
---
 drivers/block/Makefile  |   10 +-
 drivers/block/ahci.c|3 ---
 drivers/block/ata_piix.c|4 
 drivers/block/sil680.c  |5 +
 drivers/block/sym53c8xx.c   |5 -
 drivers/block/systemace.c   |3 ---
 include/configs/sc520_cdp.h |2 +-
 7 files changed, 7 insertions(+), 25 deletions(-)

diff --git a/drivers/block/Makefile b/drivers/block/Makefile
index a09cd2a..642582b 100644
--- a/drivers/block/Makefile
+++ b/drivers/block/Makefile
@@ -25,14 +25,14 @@ include $(TOPDIR)/config.mk
 
 LIB:= $(obj)libblock.a
 
-COBJS-y += ahci.o
-COBJS-y += ata_piix.o
+COBJS-$(CONFIG_SCSI_AHCI) += ahci.o
+COBJS-$(CONFIG_ATA_PIIX) += ata_piix.o
 COBJS-$(CONFIG_FSL_SATA) += fsl_sata.o
 COBJS-$(CONFIG_LIBATA) += libata.o
 COBJS-$(CONFIG_SATA_SIL3114) += sata_sil3114.o
-COBJS-y += sil680.o
-COBJS-y += sym53c8xx.o
-COBJS-y += systemace.o
+COBJS-$(CONFIG_IDE_SIL680) += sil680.o
+COBJS-$(CONFIG_SCSI_SYM53C8XX) += sym53c8xx.o
+COBJS-$(CONFIG_SYSTEMACE) += systemace.o
 
 COBJS  := $(COBJS-y)
 SRCS   := $(COBJS:.o=.c)
diff --git a/drivers/block/ahci.c b/drivers/block/ahci.c
index 3d82c62..52fd108 100644
--- a/drivers/block/ahci.c
+++ b/drivers/block/ahci.c
@@ -26,8 +26,6 @@
  */
 #include 
 
-#ifdef CONFIG_SCSI_AHCI
-
 #include 
 #include 
 #include 
@@ -700,4 +698,3 @@ void scsi_print_error(ccb * pccb)
 {
/*The ahci error info can be read in the ahci driver*/
 }
-#endif
diff --git a/drivers/block/ata_piix.c b/drivers/block/ata_piix.c
index 441a4dc..4c26b36 100644
--- a/drivers/block/ata_piix.c
+++ b/drivers/block/ata_piix.c
@@ -35,8 +35,6 @@
 #include 
 #include 
 
-#ifdef CFG_ATA_PIIX/*ata_piix driver */
-
 extern block_dev_desc_t sata_dev_desc[CFG_SATA_MAX_DEVICE];
 extern int curr_device;
 
@@ -756,5 +754,3 @@ int scan_sata(int dev)
 {
return 0;
 }
-
-#endif
diff --git a/drivers/block/sil680.c b/drivers/block/sil680.c
index a6143df..052c3d3 100644
--- a/drivers/block/sil680.c
+++ b/drivers/block/sil680.c
@@ -27,7 +27,7 @@
  * The following parameters must be defined in the configuration file
  * of the target board:
  *
- * #define CFG_IDE_SIL680
+ * #define CONFIG_IDE_SIL680
  *
  * #define CONFIG_PCI_PNP
  * NOTE it may also be necessary to define this if the default of 8 is
@@ -54,7 +54,6 @@
  */
 
 #include 
-#if defined(CFG_IDE_SIL680)
 #include 
 #include 
 #include 
@@ -106,5 +105,3 @@ int ide_preinit (void)
 void ide_set_reset (int flag) {
return;
 }
-
-#endif /* CFG_IDE_SIL680 */
diff --git a/drivers/block/sym53c8xx.c b/drivers/block/sym53c8xx.c
index b880435..44e998b 100644
--- a/drivers/block/sym53c8xx.c
+++ b/drivers/block/sym53c8xx.c
@@ -35,8 +35,6 @@
 
 #include 
 
-#ifdef CONFIG_SCSI_SYM53C8XX
-
 #include 
 #include 
 #include 
@@ -870,6 +868,3 @@ void scsi_chip_init(void)
 #endif
 }
 #endif
-
-
-#endif /* CONFIG_SCSI_SYM53C8XX */
diff --git a/drivers/block/systemace.c b/drivers/block/systemace.c
index 7d82c27..dfaab52 100644
--- a/drivers/block/systemace.c
+++ b/drivers/block/systemace.c
@@ -44,8 +44,6 @@
 #include 
 #include 
 
-#ifdef CONFIG_SYSTEMACE
-
 /*
  * The ace_readw and writew functions read/write 16bit words, but the
  * offset value is the BYTE offset as most used in the Xilinx
@@ -255,4 +253,3 @@ static unsigned long systemace_read(int dev, unsigned long 
start,
 
return blkcnt;
 }
-#endif /* CONFIG_SYSTEMACE */
diff --git a/include/configs/sc520_cdp.h b/include/configs/sc520_cdp.h
index 0e830b8..e29655e 100644
--- a/include/configs/sc520_cdp.h
+++ b/include/configs/sc520_cdp.h
@@ -178,7 +178,7 @@
 #define CFG_SATA_MAXBUS 2   /*Max Sata buses supported */
 #define CFG_SATA_DEVS_PER_BUS   2  /*Max no. of devices per bus/port */
 #define CFG_SATA_MAX_DEVICE (CFG_SATA_MAXBUS* CFG_SATA_DEVS_PER_BUS)
-#define CFG_ATA_PIIX1   /*Supports ata_piix driver */
+#define CONFIG_ATA_PIIX1   /*Supports ata_piix driver */
 
 /
  * DISK Partition support
-- 
1.5.6.2

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 06/13] drivers/input: Move conditional compilation to Makefile

2008-08-12 Thread Jean-Christophe PLAGNIOL-VILLARD
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <[EMAIL PROTECTED]>
---
 drivers/input/Makefile   |8 +---
 drivers/input/i8042.c|4 
 drivers/input/keyboard.c |4 
 drivers/input/pc_keyb.c  |4 
 drivers/input/ps2mult.c  |4 
 drivers/input/ps2ser.c   |4 
 6 files changed, 5 insertions(+), 23 deletions(-)

diff --git a/drivers/input/Makefile b/drivers/input/Makefile
index 2933cb6..9a14407 100644
--- a/drivers/input/Makefile
+++ b/drivers/input/Makefile
@@ -25,9 +25,11 @@ include $(TOPDIR)/config.mk
 
 LIB:= $(obj)libinput.a
 
-COBJS-y += i8042.o
-COBJS-y += keyboard.o
-COBJS-y += pc_keyb.o ps2ser.o ps2mult.o
+COBJS-$(CONFIG_I8042_KBD) += i8042.o
+ifdef CONFIG_PS2KBD
+COBJS-y += keyboard.o pc_keyb.o
+COBJS-$(CONFIG_PS2MULT) += ps2mult.o ps2ser.o
+endif
 
 COBJS  := $(COBJS-y)
 SRCS   := $(COBJS:.o=.c)
diff --git a/drivers/input/i8042.c b/drivers/input/i8042.c
index 22c2a4e..d152768 100644
--- a/drivers/input/i8042.c
+++ b/drivers/input/i8042.c
@@ -27,8 +27,6 @@
 
 #include 
 
-#ifdef CONFIG_I8042_KBD
-
 #ifdef CONFIG_USE_CPCIDVI
 extern u8  gt_cpcidvi_in8(u32 offset);
 extern void gt_cpcidvi_out8(u32 offset, u8 data);
@@ -670,5 +668,3 @@ static int kbd_reset (void)
 
 return 0;
 }
-
-#endif /* CONFIG_I8042_KBD */
diff --git a/drivers/input/keyboard.c b/drivers/input/keyboard.c
index 54182a7..a634d76 100644
--- a/drivers/input/keyboard.c
+++ b/drivers/input/keyboard.c
@@ -11,8 +11,6 @@
 
 #include 
 
-#ifdef CONFIG_PS2KBD
-
 #include 
 #include 
 
@@ -301,5 +299,3 @@ int kbd_init (void)
}
return error;
 }
-
-#endif /* CONFIG_PS2KBD */
diff --git a/drivers/input/pc_keyb.c b/drivers/input/pc_keyb.c
index 33e7c5f..25ad3e4 100644
--- a/drivers/input/pc_keyb.c
+++ b/drivers/input/pc_keyb.c
@@ -13,8 +13,6 @@
 
 #include 
 
-#ifdef CONFIG_PS2KBD
-
 #include 
 #include 
 
@@ -252,5 +250,3 @@ void pckbd_leds(unsigned char leds)
kbd_send_data(KBD_CMD_SET_LEDS);
kbd_send_data(leds);
 }
-
-#endif /* CONFIG_PS2KBD */
diff --git a/drivers/input/ps2mult.c b/drivers/input/ps2mult.c
index 9515a0f..ecd5853 100644
--- a/drivers/input/ps2mult.c
+++ b/drivers/input/ps2mult.c
@@ -16,8 +16,6 @@
 
 #include 
 
-#ifdef CONFIG_PS2MULT
-
 #include 
 #include 
 #include 
@@ -462,5 +460,3 @@ int ps2mult_request_irq(void (*handler)(void *))
 
return 0;
 }
-
-#endif /* CONFIG_PS2MULT */
diff --git a/drivers/input/ps2ser.c b/drivers/input/ps2ser.c
index c1741ea..480ffa2 100644
--- a/drivers/input/ps2ser.c
+++ b/drivers/input/ps2ser.c
@@ -15,8 +15,6 @@
 
 #include 
 
-#ifdef CONFIG_PS2SERIAL
-
 #include 
 #include 
 #include 
@@ -326,5 +324,3 @@ static void ps2ser_interrupt(void *dev_id)
ps2mult_callback(atomic_read(&ps2buf_cnt));
}
 }
-
-#endif /* CONFIG_PS2SERIAL */
-- 
1.5.6.2

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 05/13] drivers/dma: Move conditional compilation to Makefile

2008-08-12 Thread Jean-Christophe PLAGNIOL-VILLARD
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <[EMAIL PROTECTED]>
---
 drivers/dma/MCD_dmaApi.c|3 ---
 drivers/dma/MCD_tasks.c |4 
 drivers/dma/MCD_tasksInit.c |4 
 drivers/dma/Makefile|2 +-
 4 files changed, 1 insertions(+), 12 deletions(-)

diff --git a/drivers/dma/MCD_dmaApi.c b/drivers/dma/MCD_dmaApi.c
index b0062b7..5c95651 100644
--- a/drivers/dma/MCD_dmaApi.c
+++ b/drivers/dma/MCD_dmaApi.c
@@ -24,8 +24,6 @@
 
 #include 
 
-#ifdef CONFIG_FSLDMAFEC
-
 #include 
 #include 
 #include 
@@ -1023,4 +1021,3 @@ static void MCD_memcpy(int *dest, int *src, u32 size)
for (i = 0; i < size; i += sizeof(int), dest++, src++)
*dest = *src;
 }
-#endif /* CONFIG_FSLDMAFEC */
diff --git a/drivers/dma/MCD_tasks.c b/drivers/dma/MCD_tasks.c
index 06a2d53..4f6e346 100644
--- a/drivers/dma/MCD_tasks.c
+++ b/drivers/dma/MCD_tasks.c
@@ -24,8 +24,6 @@
 
 #include 
 
-#ifdef CONFIG_FSLDMAFEC
-
 #include 
 
 u32 MCD_varTab0[];
@@ -2430,5 +2428,3 @@ u32 MCD_ENetXmit_TDT[] = {
 #ifdef MCD_INCLUDE_EU
 MCD_bufDesc MCD_singleBufDescs[NCHANNELS];
 #endif
-
-#endif  /* CONFIG_FSLDMAFEC */
diff --git a/drivers/dma/MCD_tasksInit.c b/drivers/dma/MCD_tasksInit.c
index cf567db..2f19875 100644
--- a/drivers/dma/MCD_tasksInit.c
+++ b/drivers/dma/MCD_tasksInit.c
@@ -28,8 +28,6 @@
  * Do not edit!
  */
 
-#ifdef CONFIG_FSLDMAFEC
-
 #include 
 
 extern dmaRegs *MCD_dmaBar;
@@ -242,5 +240,3 @@ void MCD_startDmaENetXmit(char *bDBase, char *currBD, char 
*xmitFifoPtr,
/* Set the task's Enable bit in its Task Control Register */
MCD_dmaBar->taskControl[channel] |= (u16) 0x8000;
 }
-
-#endif /* CONFIG_FSLDMAFEC */
diff --git a/drivers/dma/Makefile b/drivers/dma/Makefile
index 7e17360..cf29efa 100644
--- a/drivers/dma/Makefile
+++ b/drivers/dma/Makefile
@@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk
 
 LIB:= $(obj)libdma.a
 
-COBJS-y += MCD_tasksInit.o MCD_dmaApi.o MCD_tasks.o
+COBJS-$(CONFIG_FSLDMAFEC) += MCD_tasksInit.o MCD_dmaApi.o MCD_tasks.o
 
 COBJS  := $(COBJS-y)
 SRCS   := $(COBJS:.o=.c)
-- 
1.5.6.2

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] ColdFire: Multiple fixes for M5282EVB

2008-08-12 Thread Tsi-Chung Liew
From: TsiChung Liew <[EMAIL PROTECTED]>

Incorrect CFG_HZ value, change 100 to 1000.
Rename #waring to #warning. RAMBAR1 uses twice
in start.S, rename the later to FLASHBAR. Insert
nop for DRAM setup. And, env_offset in linker file.

Signed-off-by: TsiChung Liew <[EMAIL PROTECTED]>
---
 board/freescale/m5282evb/m5282evb.c |7 +++
 board/freescale/m5282evb/u-boot.lds |3 +--
 cpu/mcf52x2/cpu_init.c  |2 +-
 cpu/mcf52x2/start.S |2 +-
 include/configs/M5282EVB.h  |4 ++--
 5 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/board/freescale/m5282evb/m5282evb.c 
b/board/freescale/m5282evb/m5282evb.c
index 50e5e77..31d6923 100644
--- a/board/freescale/m5282evb/m5282evb.c
+++ b/board/freescale/m5282evb/m5282evb.c
@@ -51,6 +51,7 @@ phys_size_t initdram (int board_type)
MCFSDRAMC_DCR = (0
| MCFSDRAMC_DCR_RTIM_6
| MCFSDRAMC_DCR_RC((15 * dramclk)>>4));
+   asm("nop");
 
/* Initialize DACR0 */
MCFSDRAMC_DACR0 = (0
@@ -58,14 +59,17 @@ phys_size_t initdram (int board_type)
| MCFSDRAMC_DACR_CASL(1)
| MCFSDRAMC_DACR_CBM(3)
| MCFSDRAMC_DACR_PS_32);
+   asm("nop");
 
/* Initialize DMR0 */
MCFSDRAMC_DMR0 = (0
| ((dramsize - 1) & 0xFFFC)
| MCFSDRAMC_DMR_V);
+   asm("nop");
 
/* Set IP (bit 3) in DACR */
MCFSDRAMC_DACR0 |= MCFSDRAMC_DACR_IP;
+   asm("nop");
 
/* Wait 30ns to allow banks to precharge */
for (i = 0; i < 5; i++) {
@@ -74,9 +78,11 @@ phys_size_t initdram (int board_type)
 
/* Write to this block to initiate precharge */
*(u32 *)(CFG_SDRAM_BASE) = 0xA5A59696;
+   asm("nop");
 
/* Set RE (bit 15) in DACR */
MCFSDRAMC_DACR0 |= MCFSDRAMC_DACR_RE;
+   asm("nop");
 
/* Wait for at least 8 auto refresh cycles to occur */
for (i = 0; i < 2000; i++) {
@@ -85,6 +91,7 @@ phys_size_t initdram (int board_type)
 
/* Finish the configuration by issuing the IMRS. */
MCFSDRAMC_DACR0 |= MCFSDRAMC_DACR_IMRS;
+   asm("nop");
 
/* Write to the SDRAM Mode Register */
*(u32 *)(CFG_SDRAM_BASE + 0x400) = 0xA5A59696;
diff --git a/board/freescale/m5282evb/u-boot.lds 
b/board/freescale/m5282evb/u-boot.lds
index dd2666b..96fde65 100644
--- a/board/freescale/m5282evb/u-boot.lds
+++ b/board/freescale/m5282evb/u-boot.lds
@@ -60,9 +60,8 @@ SECTIONS
 lib_generic/string.o   (.text)
 lib_generic/vsprintf.o (.text)
 lib_generic/crc32.o(.text)
-lib_generic/zlib.o (.text)
 
-/*. = env_offset; */
+. = env_offset;
 common/environment.o(.text)
 
 *(.text)
diff --git a/cpu/mcf52x2/cpu_init.c b/cpu/mcf52x2/cpu_init.c
index 344bcee..3cacb55 100644
--- a/cpu/mcf52x2/cpu_init.c
+++ b/cpu/mcf52x2/cpu_init.c
@@ -442,7 +442,7 @@ void cpu_init_f(void)
MCFCSM_CSMR0 = MCFCSM_CSMR_BAM(CFG_CS0_SIZE - 1) | MCFCSM_CSMR_V;
 #endif
 #else
-#waring "Chip Select 0 are not initialized/used"
+#warning "Chip Select 0 are not initialized/used"
 #endif
 
 #if defined(CFG_CS1_BASE) & defined(CFG_CS1_SIZE) & \
diff --git a/cpu/mcf52x2/start.S b/cpu/mcf52x2/start.S
index a054904..2e8ecfb 100644
--- a/cpu/mcf52x2/start.S
+++ b/cpu/mcf52x2/start.S
@@ -166,7 +166,7 @@ _after_flashbar_copy:
 #else
/* Setup code to initialize FLASHBAR, if start from external Memory */
move.l  #(CFG_INT_FLASH_BASE + CFG_INT_FLASH_ENABLE), %d0
-   movec   %d0, %RAMBAR1
+   movec   %d0, %FLASHBAR
 #endif /* (TEXT_BASE == CFG_INT_FLASH_BASE) */
 
 #endif
diff --git a/include/configs/M5282EVB.h b/include/configs/M5282EVB.h
index df46ee4..d05bc70 100644
--- a/include/configs/M5282EVB.h
+++ b/include/configs/M5282EVB.h
@@ -104,7 +104,7 @@
 #  define CONFIG_OVERWRITE_ETHADDR_ONCE
 #endif /* CONFIG_MCFFEC */
 
-#define CONFIG_HOSTNAMEM5272C3
+#define CONFIG_HOSTNAMEM5282EVB
 #define CONFIG_EXTRA_ENV_SETTINGS  \
"netdev=eth0\0" \
"loadaddr=1\0"  \
@@ -134,7 +134,7 @@
 #define CFG_MEMTEST_START  0x400
 #define CFG_MEMTEST_END0x38
 
-#define CFG_HZ 100
+#define CFG_HZ 1000
 #defineCFG_CLK 6400
 
 /* PLL Configuration: Ext Clock * 6 (see table 9-4 of MCF user manual) */
-- 
1.5.6.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] ColdFire: Fix FEC transmit issue for MCF5282

2008-08-12 Thread Tsi-Chung Liew
From: TsiChung Liew <[EMAIL PROTECTED]>

Signed-off-by: TsiChung Liew <[EMAIL PROTECTED]>
---
 drivers/net/mcffec.c |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mcffec.c b/drivers/net/mcffec.c
index 58ed5e3..5218ab6 100644
--- a/drivers/net/mcffec.c
+++ b/drivers/net/mcffec.c
@@ -168,10 +168,11 @@ int fec_send(struct eth_device *dev, volatile void 
*packet, int length)
/* Activate transmit Buffer Descriptor polling */
fecp->tdar = 0x0100;/* Descriptor polling active*/
 
-   /* FEC fix for MCF5275, FEC unable to initial transmit data packet.
+   /*
+* FEC fix for MCF5275, FEC unable to initial transmit data packet.
 * A nop will ensure the descriptor polling active completed.
 */
-#ifdef CONFIG_M5275
+#if defined(CONFIG_M5275) || defined(CONFIG_M5282)
__asm__ ("nop");
 #endif
 
-- 
1.5.6.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] ColdFire: Implement SBF feature for M5445EVB

2008-08-12 Thread Tsi-Chung Liew
From: TsiChung Liew <[EMAIL PROTECTED]>

Signed-off-by: TsiChung Liew <[EMAIL PROTECTED]>
---
 Makefile  |   16 ++-
 board/freescale/m54455evb/m54455evb.c |   14 ++-
 board/freescale/m54455evb/u-boot.stm  |  136 +
 cpu/mcf5445x/cpu_init.c   |2 +
 cpu/mcf5445x/speed.c  |   67 ++---
 cpu/mcf5445x/start.S  |  258 -
 include/configs/M54455EVB.h   |   92 ++--
 7 files changed, 539 insertions(+), 46 deletions(-)
 create mode 100644 board/freescale/m54455evb/u-boot.stm

diff --git a/Makefile b/Makefile
index 89746a2..4fa235e 100644
--- a/Makefile
+++ b/Makefile
@@ -1898,7 +1898,8 @@ M54455EVB_intel_config \
 M54455EVB_a33_config \
 M54455EVB_a66_config \
 M54455EVB_i33_config \
-M54455EVB_i66_config : unconfig
+M54455EVB_i66_config \
+M54455EVB_stm33_config :   unconfig
@case "$@" in \
M54455EVB_config)   FLASH=ATMEL; FREQ=;; \
M54455EVB_atmel_config) FLASH=ATMEL; FREQ=;; \
@@ -1907,18 +1908,27 @@ M54455EVB_i66_config :  unconfig
M54455EVB_a66_config)   FLASH=ATMEL; FREQ=;; \
M54455EVB_i33_config)   FLASH=INTEL; FREQ=;; \
M54455EVB_i66_config)   FLASH=INTEL; FREQ=;; \
+   M54455EVB_stm33_config) FLASH=STMICRO; FREQ=;; \
esac; \
if [ "$${FLASH}" = "INTEL" ] ; then \
-   echo "#undef CFG_ATMEL_BOOT" >> $(obj)include/config.h ; \
+   echo "#define CFG_INTEL_BOOT" >> $(obj)include/config.h ; \
echo "TEXT_BASE = 0x" > 
$(obj)board/freescale/m54455evb/config.tmp ; \
cp $(obj)board/freescale/m54455evb/u-boot.int 
$(obj)board/freescale/m54455evb/u-boot.lds ; \
$(XECHO) "... with INTEL boot..." ; \
-   else \
+   fi; \
+   if [ "$${FLASH}" = "ATMEL" ] ; then \
echo "#define CFG_ATMEL_BOOT"   >> $(obj)include/config.h ; \
echo "TEXT_BASE = 0x0400" > 
$(obj)board/freescale/m54455evb/config.tmp ; \
cp $(obj)board/freescale/m54455evb/u-boot.atm 
$(obj)board/freescale/m54455evb/u-boot.lds ; \
$(XECHO) "... with ATMEL boot..." ; \
fi; \
+   if [ "$${FLASH}" = "STMICRO" ] ; then \
+   echo "#define CONFIG_CF_SBF">> $(obj)include/config.h ; \
+   echo "#define CFG_STMICRO_BOOT" >> $(obj)include/config.h ; \
+   echo "TEXT_BASE = 0x4FE0" > 
$(obj)board/freescale/m54455evb/config.tmp ; \
+   cp $(obj)board/freescale/m54455evb/u-boot.stm 
$(obj)board/freescale/m54455evb/u-boot.lds ; \
+   $(XECHO) "... with ST Micro boot..." ; \
+   fi; \
echo "#define CFG_INPUT_CLKSRC $${FREQ}" >> $(obj)include/config.h ; \
$(XECHO) "... with $${FREQ}Hz input clock"
@$(MKCONFIG) -a M54455EVB m68k mcf5445x m54455evb freescale
diff --git a/board/freescale/m54455evb/m54455evb.c 
b/board/freescale/m54455evb/m54455evb.c
index 3c7b350..4f02121 100644
--- a/board/freescale/m54455evb/m54455evb.c
+++ b/board/freescale/m54455evb/m54455evb.c
@@ -39,9 +39,17 @@ int checkboard(void)
 
 phys_size_t initdram(int board_type)
 {
+   u32 dramsize;
+#ifdef CONFIG_CF_SBF
+   /*
+* Serial Boot: The dram is already initialized in start.S
+* only require to return DRAM size
+*/
+   dramsize = CFG_SDRAM_SIZE * 0x10 >> 1;
+#else
volatile sdramc_t *sdram = (volatile sdramc_t *)(MMAP_SDRAM);
volatile gpio_t *gpio = (volatile gpio_t *)(MMAP_GPIO);
-   u32 dramsize, i;
+   u32 i;
 
dramsize = CFG_SDRAM_SIZE * 0x10 >> 1;
 
@@ -51,7 +59,7 @@ phys_size_t initdram(int board_type)
}
i--;
 
-   gpio->mscr_sdram = 0xAA;
+   gpio->mscr_sdram = CFG_SDRAM_DRV_STRENGTH;
 
sdram->sdcs0 = (CFG_SDRAM_BASE | i);
sdram->sdcs1 = (CFG_SDRAM_BASE1 | i);
@@ -80,7 +88,7 @@ phys_size_t initdram(int board_type)
sdram->sdcr = (CFG_SDRAM_CTRL & ~0x8000) | 0x1c00;
 
udelay(100);
-
+#endif
return (dramsize << 1);
 };
 
diff --git a/board/freescale/m54455evb/u-boot.stm 
b/board/freescale/m54455evb/u-boot.stm
new file mode 100644
index 000..3dd9a6b
--- /dev/null
+++ b/board/freescale/m54455evb/u-boot.stm
@@ -0,0 +1,136 @@
+/*
+ * (C) Copyright 2000
+ * Wolfgang Denk, DENX Software Engineering, [EMAIL PROTECTED]
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+

[U-Boot] [PATCH] ColdFire: Add M54451EVB platform support for MCF5445x

2008-08-12 Thread Tsi-Chung Liew
From: TsiChung Liew <[EMAIL PROTECTED]>

Signed-off-by: TsiChung Liew <[EMAIL PROTECTED]>
---
 MAKEALL   |1 +
 Makefile  |   24 +++
 board/freescale/m54451evb/Makefile|   44 
 board/freescale/m54451evb/config.mk   |   27 +++
 board/freescale/m54451evb/m54451evb.c |  108 ++
 board/freescale/m54451evb/mii.c   |  303 
 board/freescale/m54451evb/u-boot.spa  |  143 ++
 board/freescale/m54451evb/u-boot.stm  |  149 ++
 include/asm-m68k/immap.h  |6 +-
 include/configs/M54451EVB.h   |  350 +
 10 files changed, 1153 insertions(+), 2 deletions(-)
 create mode 100644 board/freescale/m54451evb/Makefile
 create mode 100644 board/freescale/m54451evb/config.mk
 create mode 100644 board/freescale/m54451evb/m54451evb.c
 create mode 100644 board/freescale/m54451evb/mii.c
 create mode 100644 board/freescale/m54451evb/u-boot.spa
 create mode 100644 board/freescale/m54451evb/u-boot.stm
 create mode 100644 include/configs/M54451EVB.h

diff --git a/MAKEALL b/MAKEALL
index 535d28a..33302ae 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -699,6 +699,7 @@ LIST_coldfire=" \
M5282EVB\
M5329AFEE   \
M5373EVB\
+   M54451EVB   \
M54455EVB   \
M5475AFE\
M5485AFE\
diff --git a/Makefile b/Makefile
index 4fa235e..3b99d7a 100644
--- a/Makefile
+++ b/Makefile
@@ -1892,6 +1892,30 @@ M5373EVB_config :unconfig
fi
@$(MKCONFIG) -a M5373EVB m68k mcf532x m5373evb freescale
 
+M54451EVB_config \
+M54451EVB_spansion_config \
+M54451EVB_stmicro_config : unconfig
+   @case "$@" in \
+   M54451EVB_config)   FLASH=SPANSION;; \
+   M54451EVB_spansion_config)  FLASH=SPANSION;; \
+   M54451EVB_stmicro_config)   FLASH=STMICRO;; \
+   esac; \
+   if [ "$${FLASH}" = "SPANSION" ] ; then \
+   echo "#define CFG_SPANSION_BOOT">> 
$(obj)include/config.h ; \
+   echo "TEXT_BASE = 0x" > 
$(obj)board/freescale/m54451evb/config.tmp ; \
+   cp $(obj)board/freescale/m54451evb/u-boot.spa 
$(obj)board/freescale/m54451evb/u-boot.lds ; \
+   $(XECHO) "... with SPANSION boot..." ; \
+   fi; \
+   if [ "$${FLASH}" = "STMICRO" ] ; then \
+   echo "#define CONFIG_CF_SBF">> $(obj)include/config.h ; \
+   echo "#define CFG_STMICRO_BOOT" >> $(obj)include/config.h ; \
+   echo "TEXT_BASE = 0x47E0" > 
$(obj)board/freescale/m54451evb/config.tmp ; \
+   cp $(obj)board/freescale/m54451evb/u-boot.stm 
$(obj)board/freescale/m54451evb/u-boot.lds ; \
+   $(XECHO) "... with ST Micro boot..." ; \
+   fi; \
+   echo "#define CFG_INPUT_CLKSRC 2400" >> $(obj)include/config.h ;
+   @$(MKCONFIG) -a M54451EVB m68k mcf5445x m54451evb freescale
+
 M54455EVB_config \
 M54455EVB_atmel_config \
 M54455EVB_intel_config \
diff --git a/board/freescale/m54451evb/Makefile 
b/board/freescale/m54451evb/Makefile
new file mode 100644
index 000..74c2528
--- /dev/null
+++ b/board/freescale/m54451evb/Makefile
@@ -0,0 +1,44 @@
+#
+# (C) Copyright 2000-2003
+# Wolfgang Denk, DENX Software Engineering, [EMAIL PROTECTED]
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).a
+
+COBJS  = $(BOARD).o mii.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(obj).depend $(OBJS)
+   $(AR) $(ARFLAGS) $@ $(OBJS)
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/freescale/m54451evb/config.mk 
b/board/freescale/m54451evb/config.mk
new file mode 100644
index 000..b42fcc9
--- /dev/null
+++ b/board/freescale/m54451evb/config.mk
@@ -0,0 +1,27 @@
+#
+# (C) Copyright 2

[U-Boot] [PATCH] ColdFire: Add Serial Flash support for M54455EVB

2008-08-12 Thread Tsi-Chung Liew
From: TsiChung Liew <[EMAIL PROTECTED]>

Signed-off-by: TsiChung Liew <[EMAIL PROTECTED]>
---
 include/configs/M54455EVB.h |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/include/configs/M54455EVB.h b/include/configs/M54455EVB.h
index b7b5da0..e68b26e 100644
--- a/include/configs/M54455EVB.h
+++ b/include/configs/M54455EVB.h
@@ -77,6 +77,7 @@
 #define CONFIG_CMD_PING
 #define CONFIG_CMD_REGINFO
 #define CONFIG_CMD_SPI
+#define CONFIG_CMD_SF
 
 #undef CONFIG_CMD_LOADB
 #undef CONFIG_CMD_LOADS
@@ -205,6 +206,9 @@
 #define CFG_SER_FLASH_BASE 0x0100
 #define CFG_SBFHDR_SIZE0x13
 #ifdef CONFIG_CMD_SPI
+#  define CONFIG_SPI_FLASH
+#  define CONFIG_SPI_FLASH_STMICRO
+
 #  define CFG_DSPI_DCTAR0  (DSPI_DCTAR_TRSZ(7) | \
 DSPI_DCTAR_CPOL | \
 DSPI_DCTAR_CPHA | \
-- 
1.5.6.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] ColdFire: Add M5253DEMO platform support for MCF5253

2008-08-12 Thread Tsi-Chung Liew
From: TsiChung Liew <[EMAIL PROTECTED]>

Signed-off-by: TsiChung Liew <[EMAIL PROTECTED]>
---
 MAINTAINERS   |1 +
 MAKEALL   |1 +
 Makefile  |3 +
 board/freescale/m5253demo/Makefile|   44 +++
 board/freescale/m5253demo/config.mk   |   25 ++
 board/freescale/m5253demo/flash.c |  467 +
 board/freescale/m5253demo/m5253demo.c |  140 ++
 board/freescale/m5253demo/u-boot.lds  |  144 ++
 include/configs/M5253DEMO.h   |  252 ++
 9 files changed, 1077 insertions(+), 0 deletions(-)
 create mode 100644 board/freescale/m5253demo/Makefile
 create mode 100644 board/freescale/m5253demo/config.mk
 create mode 100644 board/freescale/m5253demo/flash.c
 create mode 100644 board/freescale/m5253demo/m5253demo.c
 create mode 100644 board/freescale/m5253demo/u-boot.lds
 create mode 100644 include/configs/M5253DEMO.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 777d141..10ad5ec 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -691,6 +691,7 @@ TsiChung Liew <[EMAIL PROTECTED]>
 
M52277EVB   mcf5227x
M5235EVBmcf52x2
+   M5253DEMO   mcf52x2
M5329EVBmcf532x
M5373EVBmcf532x
M54455EVB   mcf5445x
diff --git a/MAKEALL b/MAKEALL
index ee83cca..535d28a 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -691,6 +691,7 @@ LIST_coldfire=" \
M52277EVB   \
M5235EVB\
M5249EVB\
+   M5253DEMO   \
M5253EVBE   \
M5271EVB\
M5272C3 \
diff --git a/Makefile b/Makefile
index 082b08e..89746a2 100644
--- a/Makefile
+++ b/Makefile
@@ -1836,6 +1836,9 @@ M5235EVB_Flash32_config:  unconfig
 M5249EVB_config :  unconfig
@$(MKCONFIG) $(@:_config=) m68k mcf52x2 m5249evb freescale
 
+M5253DEMO_config : unconfig
+   @$(MKCONFIG) $(@:_config=) m68k mcf52x2 m5253demo freescale
+
 M5253EVBE_config : unconfig
@$(MKCONFIG) $(@:_config=) m68k mcf52x2 m5253evbe freescale
 
diff --git a/board/freescale/m5253demo/Makefile 
b/board/freescale/m5253demo/Makefile
new file mode 100644
index 000..cf07cf4
--- /dev/null
+++ b/board/freescale/m5253demo/Makefile
@@ -0,0 +1,44 @@
+#
+# (C) Copyright 2000-2006
+# Wolfgang Denk, DENX Software Engineering, [EMAIL PROTECTED]
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).a
+
+COBJS  = $(BOARD).o flash.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(obj).depend $(OBJS)
+   $(AR) $(ARFLAGS) $@ $(OBJS)
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/freescale/m5253demo/config.mk 
b/board/freescale/m5253demo/config.mk
new file mode 100644
index 000..fa66b75
--- /dev/null
+++ b/board/freescale/m5253demo/config.mk
@@ -0,0 +1,25 @@
+#
+# (C) Copyright 2000-2003
+# Wolfgang Denk, DENX Software Engineering, [EMAIL PROTECTED]
+# Coldfire contribution by Bernhard Kuhn <[EMAIL PROTECTED]>
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+TEXT_BASE

[U-Boot] [PATCH] ColdFire: Add SSPI feature for MCF5445x

2008-08-12 Thread Tsi-Chung Liew
From: TsiChung Liew <[EMAIL PROTECTED]>

Signed-off-by: TsiChung Liew <[EMAIL PROTECTED]>
---
 cpu/mcf5445x/dspi.c |  178 +--
 include/configs/M54455EVB.h |   16 -
 lib_m68k/board.c|   17 
 3 files changed, 204 insertions(+), 7 deletions(-)

diff --git a/cpu/mcf5445x/dspi.c b/cpu/mcf5445x/dspi.c
index 44d8505..959d6bd 100644
--- a/cpu/mcf5445x/dspi.c
+++ b/cpu/mcf5445x/dspi.c
@@ -27,9 +27,11 @@
 
 #include 
 #include 
+#include 
 
 #if defined(CONFIG_CF_DSPI)
 #include 
+
 void dspi_init(void)
 {
volatile gpio_t *gpio = (gpio_t *) MMAP_GPIO;
@@ -45,11 +47,30 @@ void dspi_init(void)
DSPI_DMCR_CSIS2 | DSPI_DMCR_CSIS1 | DSPI_DMCR_CSIS0 |
DSPI_DMCR_CRXF | DSPI_DMCR_CTXF;
 
-   dspi->dctar0 = DSPI_DCTAR_TRSZ(7) | DSPI_DCTAR_CPOL | DSPI_DCTAR_CPHA |
-   DSPI_DCTAR_PCSSCK_1CLK | DSPI_DCTAR_PASC(0) |
-   DSPI_DCTAR_PDT(0) | DSPI_DCTAR_CSSCK(0) |
-   DSPI_DCTAR_ASC(0) | DSPI_DCTAR_PBR(0) |
-   DSPI_DCTAR_DT(1) | DSPI_DCTAR_BR(1);
+#ifdef CFG_DSPI_DCTAR0
+   dspi->dctar0 = CFG_DSPI_DCTAR0;
+#endif
+#ifdef CFG_DSPI_DCTAR1
+   dspi->dctar1 = CFG_DSPI_DCTAR1;
+#endif
+#ifdef CFG_DSPI_DCTAR2
+   dspi->dctar2 = CFG_DSPI_DCTAR2;
+#endif
+#ifdef CFG_DSPI_DCTAR3
+   dspi->dctar3 = CFG_DSPI_DCTAR3;
+#endif
+#ifdef CFG_DSPI_DCTAR4
+   dspi->dctar4 = CFG_DSPI_DCTAR4;
+#endif
+#ifdef CFG_DSPI_DCTAR5
+   dspi->dctar5 = CFG_DSPI_DCTAR5;
+#endif
+#ifdef CFG_DSPI_DCTAR6
+   dspi->dctar6 = CFG_DSPI_DCTAR6;
+#endif
+#ifdef CFG_DSPI_DCTAR7
+   dspi->dctar7 = CFG_DSPI_DCTAR7;
+#endif
 }
 
 void dspi_tx(int chipsel, u8 attrib, u16 data)
@@ -70,4 +91,149 @@ u16 dspi_rx(void)
return (dspi->drfr & 0x);
 }
 
-#endif /* CONFIG_HARD_SPI */
+#if defined(CONFIG_CMD_SPI)
+void spi_init_f(void)
+{
+}
+
+void spi_init_r(void)
+{
+}
+
+void spi_init(void)
+{
+   dspi_init();
+}
+
+struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
+ unsigned int max_hz, unsigned int mode)
+{
+   struct spi_slave *slave;
+
+   slave = malloc(sizeof(struct spi_slave));
+   if (!slave)
+   return NULL;
+
+   slave->bus = bus;
+   slave->cs = cs;
+
+   return slave;
+}
+
+void spi_free_slave(struct spi_slave *slave)
+{
+   free(slave);
+}
+
+int spi_claim_bus(struct spi_slave *slave)
+{
+   return 0;
+}
+
+void spi_release_bus(struct spi_slave *slave)
+{
+}
+
+int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *dout,
+void *din, unsigned long flags)
+{
+   static int bWrite = 0;
+   u8 *spi_rd, *spi_wr;
+   int len = bitlen >> 3;
+
+   spi_rd = (u8 *) din;
+   spi_wr = (u8 *) dout;
+
+   /* command handling */
+   if (((len == 4) || (len == 1) || (len == 5)) && (dout != NULL)) {
+   switch (*spi_wr) {
+   case 0x02:  /* Page Prog */
+   bWrite = 1;
+   dspi_tx(slave->cs, 0x80, spi_wr[0]);
+   dspi_rx();
+   dspi_tx(slave->cs, 0x80, spi_wr[1]);
+   dspi_rx();
+   dspi_tx(slave->cs, 0x80, spi_wr[2]);
+   dspi_rx();
+   dspi_tx(slave->cs, 0x80, spi_wr[3]);
+   dspi_rx();
+   return 0;
+   case 0x05:  /* Read Status */
+   if (len == 4)
+   if ((spi_wr[1] == 0xFF) && (spi_wr[2] == 0xFF)
+   && (spi_wr[3] == 0xFF)) {
+   dspi_tx(slave->cs, 0x80, *spi_wr);
+   dspi_rx();
+   }
+   return 0;
+   case 0x06:  /* WREN */
+   dspi_tx(slave->cs, 0x00, *spi_wr);
+   dspi_rx();
+   return 0;
+   case 0x0B:  /* Fast read */
+   if ((len == 5) && (spi_wr[4] == 0)) {
+   dspi_tx(slave->cs, 0x80, spi_wr[0]);
+   dspi_rx();
+   dspi_tx(slave->cs, 0x80, spi_wr[1]);
+   dspi_rx();
+   dspi_tx(slave->cs, 0x80, spi_wr[2]);
+   dspi_rx();
+   dspi_tx(slave->cs, 0x80, spi_wr[3]);
+   dspi_rx();
+   dspi_tx(slave->cs, 0x80, spi_wr[4]);
+   dspi_rx();
+   }
+   return 0;
+   case 0x9F:  /* RDID */
+   dspi_tx(slave->cs, 0x80, *spi_wr);
+   dspi_rx();
+   return 0;
+   case 0xD8:  /* Sector er

[U-Boot] [PATCH] ColdFire: Use CFI Flash driver for M54455EVB

2008-08-12 Thread Tsi-Chung Liew
From: TsiChung Liew <[EMAIL PROTECTED]>

Remove non-common flash driver in
board/freescale/m54455evb/flash.c. The non-cfi flash will
use CONFIG_FLASH_CFI_LEGACY to configure the flash
attribute.

Signed-off-by: TsiChung Liew <[EMAIL PROTECTED]>
---
 board/freescale/m54455evb/Makefile|4 +-
 board/freescale/m54455evb/flash.c | 1287 -
 board/freescale/m54455evb/m54455evb.c |   50 ++
 include/configs/M54455EVB.h   |   45 +-
 4 files changed, 58 insertions(+), 1328 deletions(-)
 delete mode 100644 board/freescale/m54455evb/flash.c

diff --git a/board/freescale/m54455evb/Makefile 
b/board/freescale/m54455evb/Makefile
index ca9a772..74c2528 100644
--- a/board/freescale/m54455evb/Makefile
+++ b/board/freescale/m54455evb/Makefile
@@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk
 
 LIB= $(obj)lib$(BOARD).a
 
-COBJS  = $(BOARD).o flash.o mii.o
+COBJS  = $(BOARD).o mii.o
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS))
@@ -41,4 +41,4 @@ include $(SRCTREE)/rules.mk
 
 sinclude $(obj).depend
 
-#
\ No newline at end of file
+#
diff --git a/board/freescale/m54455evb/flash.c 
b/board/freescale/m54455evb/flash.c
deleted file mode 100644
index 6b50e8d..000
--- a/board/freescale/m54455evb/flash.c
+++ /dev/null
@@ -1,1287 +0,0 @@
-/*
- * (C) Copyright 2000-2003
- * Wolfgang Denk, DENX Software Engineering, [EMAIL PROTECTED]
- *
- * Copyright (C) 2004-2007 Freescale Semiconductor, Inc.
- * TsiChung Liew ([EMAIL PROTECTED])
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-#include 
-
-#include 
-
-#ifndef CFG_FLASH_CFI
-typedef unsigned char FLASH_PORT_WIDTH;
-typedef volatile unsigned char FLASH_PORT_WIDTHV;
-
-#define FPW FLASH_PORT_WIDTH
-#define FPWVFLASH_PORT_WIDTHV
-
-#define CFG_FLASH_CFI_WIDTHFLASH_CFI_8BIT
-#define CFG_FLASH_NONCFI_WIDTH FLASH_CFI_8BIT
-
-/* Intel-compatible flash commands */
-#define INTEL_PROGRAM   0x00100010
-#define INTEL_ERASE 0x00200020
-#define INTEL_WRSETUP  0x00400040
-#define INTEL_CLEAR 0x00500050
-#define INTEL_LOCKBIT   0x00600060
-#define INTEL_PROTECT   0x00010001
-#define INTEL_STATUS0x00700070
-#define INTEL_READID0x00900090
-#define INTEL_CFIQRY   0x00980098
-#define INTEL_SUSERASE 0x00B000B0
-#define INTEL_PROTPROG 0x00C000C0
-#define INTEL_CONFIRM   0x00D000D0
-#define INTEL_WRBLK0x00e800e8
-#define INTEL_RESET 0x00FF00FF
-
-/* Intel-compatible flash status bits */
-#define INTEL_FINISHED  0x00800080
-#define INTEL_OK0x00800080
-#define INTEL_ERASESUS  0x00600060
-#define INTEL_WSM_SUS   (INTEL_FINISHED | INTEL_ERASESUS)
-
-/* 28F160C3B CFI Data offset - This could vary */
-#define INTEL_CFI_MFG  0x00/* Manufacturer ID */
-#define INTEL_CFI_PART 0x01/* Product ID */
-#define INTEL_CFI_LOCK  0x02   /* */
-#define INTEL_CFI_TWPRG 0x1F   /* Typical Single Word Program Timeout 2^n us */
-#define INTEL_CFI_MBUFW 0x20   /* Typical Max Buffer Write Timeout 2^n us */
-#define INTEL_CFI_TERB 0x21/* Typical Block Erase Timeout 2^n ms */
-#define INTEL_CFI_MWPRG 0x23   /* Maximum Word program timeout 2^n us */
-#define INTEL_CFI_MERB  0x25   /* Maximum Block Erase Timeout 2^n s */
-#define INTEL_CFI_SIZE 0x27/* Device size 2^n bytes */
-#define INTEL_CFI_CAP  0x28
-#define INTEL_CFI_WRBUF0x2A
-#define INTEL_CFI_BANK 0x2C/* Number of Bank */
-#define INTEL_CFI_BLK1A0x2D/* Number of Blocks */
-#define INTEL_CFI_BLK1B0x2E/* Number of Blocks */
-#define INTEL_CFI_SZ1A 0x2F/* Block Region Size */
-#define INTEL_CFI_SZ1B 0x30
-#define INTEL_CFI_BLK2A0x31
-#define INTEL_CFI_BLK2B0x32
-#define INTEL_CFI_SZ2A 0x33
-#define INTEL_CFI_SZ2B 0x34
-
-#define FLASH_CYCLE10x0555
-#define FLASH_CYCLE20x0aaa
-
-#define WR_BLOCK0x20
-
-/* not in the flash.h yet */
-#define FLASH_28F64P30T0x00B9  /* Intel 28F64P30T   (  64M)
*/
-#define FLASH_28F64P30B0x00BA  /* Intel 28F64P30B   (  64M)
*/
-#define FLASH_28F128P30T   0x0

Re: [U-Boot] [00/13] Move conditional compilation to Makefile

2008-08-12 Thread Jean-Christophe PLAGNIOL-VILLARD
On 23:32 Tue 12 Aug , Jean-Christophe PLAGNIOL-VILLARD wrote:
> Hi,
> 
>   This the first series of patch to Move conditional compilation
>   to Makefile.
> 
>   It will introduce the following major change of MACRO
> 
>   rename CFG_FLASH_CFI_DRIVER to CONFIG_FLASH_CFI_DRIVER
>   rename CFG_NAND_LEGACY to CONFIG_NAND_LEGACY
>   rename CFG_NS9750_UART to CONFIG_NS9750_UART
>   rename move CFG_SCIF_CONSOLE to CONFIG_SCIF_CONSOLE

The patchset is applied to 
git://git.denx.de/u-boot-arm.git branch Makefile

Best Regards,
J.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [00/13] Move conditional compilation to Makefile

2008-08-12 Thread Jean-Christophe PLAGNIOL-VILLARD
Hi,

This the first series of patch to Move conditional compilation
to Makefile.

It will introduce the following major change of MACRO

rename CFG_FLASH_CFI_DRIVER to CONFIG_FLASH_CFI_DRIVER
rename CFG_NAND_LEGACY to CONFIG_NAND_LEGACY
rename CFG_NS9750_UART to CONFIG_NS9750_UART
rename move CFG_SCIF_CONSOLE to CONFIG_SCIF_CONSOLE

Best Regards,
J.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] Add command to enable/disable interrupts

2008-08-12 Thread Kumar Gala

Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
---

This is part of my bootm work, but clearly the patch is standalone.

- k

 common/Makefile  |1 +
 common/cmd_irq.c |   50 ++
 2 files changed, 51 insertions(+), 0 deletions(-)
 create mode 100644 common/cmd_irq.c

diff --git a/common/Makefile b/common/Makefile
index 4287108..ca838ff 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -69,6 +69,7 @@ endif
 COBJS-$(CONFIG_CMD_I2C) += cmd_i2c.o
 COBJS-$(CONFIG_CMD_IDE) += cmd_ide.o
 COBJS-$(CONFIG_CMD_IMMAP) += cmd_immap.o
+COBJS-$(CONFIG_CMD_IRQ) += cmd_irq.o
 COBJS-$(CONFIG_CMD_ITEST) += cmd_itest.o
 COBJS-$(CONFIG_CMD_JFFS2) += cmd_jffs2.o
 COBJS-y += cmd_load.o
diff --git a/common/cmd_irq.c b/common/cmd_irq.c
new file mode 100644
index 000..04914c6
--- /dev/null
+++ b/common/cmd_irq.c
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2008 Freescale Semiconductor, Inc.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include 
+#include 
+#include 
+
+int do_interrupts(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+{
+
+   if (argc != 2) {
+   printf ("Usage:\n%s\n", cmdtp->usage);
+   return 1;
+   }
+
+   /* on */
+   if (strncmp(argv[1], "on", 2) == 0) {
+   enable_interrupts();
+   } else {
+   disable_interrupts();
+   }
+
+   return 0;
+}
+
+U_BOOT_CMD(
+   interrupts, 5, 0, do_interrupts,
+   "interrupts - enable or disable interrupts\n",
+   "[on, off]\n"
+   "- enable or disable interrupts\n"
+);
-- 
1.5.5.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] Change CFG_ENV_SIZE to CFG_ENV_SECT_SIZE for SPI sector erase

2008-08-12 Thread Tsi-Chung Liew
From: TsiChung Liew <[EMAIL PROTECTED]>

The CFG_ENV_SIZE is not suitable used for SPI flash erase
sector size if CFG_ENV_SIZE is less than CFG_ENV_SECT_SIZE.
Add condition check if CFG_ENV_SIZE is larger than
CFG_ENV_SECT_SIZE, calculate the right number of sectors for
erasing.

Signed-off-by: TsiChung Liew <[EMAIL PROTECTED]>
---
 common/env_sf.c |   10 +-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/common/env_sf.c b/common/env_sf.c
index d641a9a..9077d78 100644
--- a/common/env_sf.c
+++ b/common/env_sf.c
@@ -63,13 +63,21 @@ uchar env_get_char_spec(int index)
 
 int saveenv(void)
 {
+   u32 sector = 1;
+
if (!env_flash) {
puts("Environment SPI flash not initialized\n");
return 1;
}
 
+   if (CFG_ENV_SIZE > CFG_ENV_SECT_SIZE) {
+   sector = CFG_ENV_SIZE / CFG_ENV_SECT_SIZE;
+   if (CFG_ENV_SIZE % CFG_ENV_SECT_SIZE)
+   sector++;
+   }
+
puts("Erasing SPI flash...");
-   if (spi_flash_erase(env_flash, CFG_ENV_OFFSET, CFG_ENV_SIZE))
+   if (spi_flash_erase(env_flash, CFG_ENV_OFFSET, sector * 
CFG_ENV_SECT_SIZE))
return 1;
 
puts("Writing to SPI flash...");
-- 
1.5.6.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC][PATCH 09/15] bootm: Set working fdt address as part of the bootm flow

2008-08-12 Thread Kumar Gala
Set the fdt working address so "fdt FOO" commands can be used as part
of the bootm flow.

Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
---
 common/cmd_bootm.c|9 +
 common/cmd_fdt.c  |5 +
 common/image.c|1 +
 include/fdt_support.h |2 ++
 4 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index 918ea98..c5dbf76 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -44,6 +44,13 @@
 #include 
 #endif
 
+#if defined(CONFIG_OF_LIBFDT)
+#include 
+#include 
+#include 
+#endif
+
+
 DECLARE_GLOBAL_DATA_PTR;
 
 extern int gunzip (void *dst, int dstlen, unsigned char *src, unsigned long 
*lenp);
@@ -267,6 +274,8 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char 
*argv[])
puts ("Could not find a valid device tree\n");
return 1;
}
+
+   set_working_fdt_addr(images.ft_addr);
 #endif
}
 
diff --git a/common/cmd_fdt.c b/common/cmd_fdt.c
index c129993..b397a21 100644
--- a/common/cmd_fdt.c
+++ b/common/cmd_fdt.c
@@ -50,6 +50,11 @@ static int fdt_print(const char *pathp, char *prop, int 
depth);
  */
 struct fdt_header *working_fdt;
 
+void set_working_fdt_addr(void *addr)
+{
+   working_fdt = addr;
+}
+
 /*
  * Flattened Device Tree command, see the help for parameter definitions.
  */
diff --git a/common/image.c b/common/image.c
index e7cb57c..60e1c9d 100644
--- a/common/image.c
+++ b/common/image.c
@@ -1245,6 +1245,7 @@ int boot_relocate_fdt (struct lmb *lmb, ulong 
bootmap_base,
*of_size = of_len;
}
 
+   set_working_fdt_addr(*of_flat_tree);
return 0;
 
 error:
diff --git a/include/fdt_support.h b/include/fdt_support.h
index a7c6326..761f85c 100644
--- a/include/fdt_support.h
+++ b/include/fdt_support.h
@@ -68,5 +68,7 @@ void ft_cpu_setup(void *blob, bd_t *bd);
 void ft_pci_setup(void *blob, bd_t *bd);
 #endif
 
+void set_working_fdt_addr(void *addr);
+
 #endif /* ifdef CONFIG_OF_LIBFDT */
 #endif /* ifndef __FDT_SUPPORT_H */
-- 
1.5.5.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC][PATCH 08/15] bootm: refactor fdt locating and relocation code

2008-08-12 Thread Kumar Gala
Move the code that handles finding a device tree blob and relocating
it (if needed) into common code so all arch's have access to it.

Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
---
 common/cmd_bootm.c |   10 +
 common/image.c |  502 
 include/image.h|   13 ++
 lib_ppc/bootm.c|  492 +--
 4 files changed, 533 insertions(+), 484 deletions(-)

diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index 56236b9..918ea98 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -258,6 +258,16 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char 
*argv[])
puts ("Ramdisk image is corrupt\n");
return 1;
}
+
+#if defined(CONFIG_OF_LIBFDT)
+   /* find flattened device tree */
+   ret = boot_get_fdt (cmdtp, flag, argc, argv,
+   &images, &images.ft_addr, &images.ft_len);
+   if (ret) {
+   puts ("Could not find a valid device tree\n");
+   return 1;
+   }
+#endif
}
 
image_start = (ulong)os_hdr;
diff --git a/common/image.c b/common/image.c
index 6d2ce32..e7cb57c 100644
--- a/common/image.c
+++ b/common/image.c
@@ -1070,6 +1070,508 @@ error:
return -1;
 }
 
+#ifdef CONFIG_OF_LIBFDT
+static void fdt_error (const char *msg)
+{
+   puts ("ERROR: ");
+   puts (msg);
+   puts (" - must RESET the board to recover.\n");
+}
+
+static image_header_t *image_get_fdt (ulong fdt_addr)
+{
+   image_header_t *fdt_hdr = (image_header_t *)fdt_addr;
+
+   image_print_contents (fdt_hdr);
+
+   puts ("   Verifying Checksum ... ");
+   if (!image_check_hcrc (fdt_hdr)) {
+   fdt_error ("fdt header checksum invalid");
+   return NULL;
+   }
+
+   if (!image_check_dcrc (fdt_hdr)) {
+   fdt_error ("fdt checksum invalid");
+   return NULL;
+   }
+   puts ("OK\n");
+
+   if (!image_check_type (fdt_hdr, IH_TYPE_FLATDT)) {
+   fdt_error ("uImage is not a fdt");
+   return NULL;
+   }
+   if (image_get_comp (fdt_hdr) != IH_COMP_NONE) {
+   fdt_error ("uImage is compressed");
+   return NULL;
+   }
+   if (fdt_check_header ((char *)image_get_data (fdt_hdr)) != 0) {
+   fdt_error ("uImage data is not a fdt");
+   return NULL;
+   }
+   return fdt_hdr;
+}
+
+/**
+ * fit_check_fdt - verify FIT format FDT subimage
+ * @fit_hdr: pointer to the FIT  header
+ * fdt_noffset: FDT subimage node offset within FIT image
+ * @verify: data CRC verification flag
+ *
+ * fit_check_fdt() verifies integrity of the FDT subimage and from
+ * specified FIT image.
+ *
+ * returns:
+ * 1, on success
+ * 0, on failure
+ */
+#if defined(CONFIG_FIT)
+static int fit_check_fdt (const void *fit, int fdt_noffset, int verify)
+{
+   fit_image_print (fit, fdt_noffset, "   ");
+
+   if (verify) {
+   puts ("   Verifying Hash Integrity ... ");
+   if (!fit_image_check_hashes (fit, fdt_noffset)) {
+   fdt_error ("Bad Data Hash");
+   return 0;
+   }
+   puts ("OK\n");
+   }
+
+   if (!fit_image_check_type (fit, fdt_noffset, IH_TYPE_FLATDT)) {
+   fdt_error ("Not a FDT image");
+   return 0;
+   }
+
+   if (!fit_image_check_comp (fit, fdt_noffset, IH_COMP_NONE)) {
+   fdt_error ("FDT image is compressed");
+   return 0;
+   }
+
+   return 1;
+}
+#endif /* CONFIG_FIT */
+
+#ifndef CFG_FDT_PAD
+#define CFG_FDT_PAD 0x3000
+#endif
+
+/**
+ * boot_relocate_fdt - relocate flat device tree
+ * @lmb: pointer to lmb handle, will be used for memory mgmt
+ * @bootmap_base: base address of the bootmap region
+ * @of_flat_tree: pointer to a char* variable, will hold fdt start address
+ * @of_size: pointer to a ulong variable, will hold fdt length
+ *
+ * boot_relocate_fdt() determines if the of_flat_tree address is within
+ * the bootmap and if not relocates it into that region
+ *
+ * of_flat_tree and of_size are set to final (after relocation) values
+ *
+ * returns:
+ *  0 - success
+ *  1 - failure
+ */
+int boot_relocate_fdt (struct lmb *lmb, ulong bootmap_base,
+   char **of_flat_tree, ulong *of_size)
+{
+   char*fdt_blob = *of_flat_tree;
+   ulong   relocate = 0;
+   ulong   of_len = 0;
+
+   /* nothing to do */
+   if (*of_size == 0)
+   return 0;
+
+   if (fdt_check_header (fdt_blob) != 0) {
+   fdt_error ("image is not a fdt");
+   goto error;
+   }
+
+#ifndef CFG_NO_FLASH
+   /* move the blob if it is in flash (set relocate) */
+   if (addr2info ((ulong)fdt_blob) != NULL)
+   relocate = 1;
+#en

[U-Boot] [RFC][PATCH 07/15] bootm: refactor ramdisk locating code

2008-08-12 Thread Kumar Gala
Move determing if we have a ramdisk and where its located into the common
code.  Keep track of the ramdisk start and end in the bootm_headers_t image
struct.

Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
---
 common/cmd_bootm.c |   38 ++
 include/image.h|2 ++
 lib_arm/bootm.c|   10 ++
 lib_avr32/bootm.c  |   12 +++-
 lib_i386/bootm.c   |8 +---
 lib_m68k/bootm.c   |   12 +++-
 lib_mips/bootm.c   |   12 +++-
 lib_ppc/bootm.c|   16 +---
 lib_sparc/bootm.c  |   17 +++--
 9 files changed, 60 insertions(+), 67 deletions(-)

diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index 3f63b84..56236b9 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -116,6 +116,33 @@ void __board_lmb_reserve(struct lmb *lmb)
 }
 void board_lmb_reserve(struct lmb *lmb) __attribute__((weak, 
alias("__board_lmb_reserve")));
 
+#if defined(__ARM__)
+  #define IH_INITRD_ARCH IH_ARCH_ARM
+#elif defined(__avr32__)
+  #define IH_INITRD_ARCH IH_ARCH_AVR32
+#elif defined(__bfin__)
+  #define IH_INITRD_ARCH IH_ARCH_BLACKFIN
+#elif defined(__I386__)
+  #define IH_INITRD_ARCH IH_ARCH_I386
+#elif defined(__M68K__)
+  #define IH_INITRD_ARCH IH_ARCH_M68K
+#elif defined(__microblaze__)
+  #define IH_INITRD_ARCH IH_ARCH_MICROBLAZE
+#elif defined(__mips__)
+  #define IH_INITRD_ARCH IH_ARCH_MIPS
+#elif defined(__nios__)
+  #define IH_INITRD_ARCH IH_ARCH_NIOS
+#elif defined(__nios2__)
+  #define IH_INITRD_ARCH IH_ARCH_NIOS2
+#elif defined(__PPC__)
+  #define IH_INITRD_ARCH IH_ARCH_PPC
+#elif defined(__sh__)
+  #define IH_INITRD_ARCH IH_ARCH_SH
+#elif defined(__sparc__)
+  #define IH_INITRD_ARCH IH_ARCH_SPARC
+#else
+# error Unknown CPU type
+#endif
 
 /***/
 /* bootm - boot application image from image in memory */
@@ -133,6 +160,7 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char 
*argv[])
ulong   load_start, load_end;
ulong   mem_start;
phys_size_t mem_size;
+   int ret;
 
struct lmb lmb;
 
@@ -222,6 +250,16 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char 
*argv[])
return 1;
}
 
+   if (os == IH_OS_LINUX) {
+   /* find ramdisk */
+   ret = boot_get_ramdisk (argc, argv, &images, IH_INITRD_ARCH,
+   &images.rd_start, &images.rd_end);
+   if (ret) {
+   puts ("Ramdisk image is corrupt\n");
+   return 1;
+   }
+   }
+
image_start = (ulong)os_hdr;
load_end = 0;
type_name = genimg_get_type_name (type);
diff --git a/include/image.h b/include/image.h
index e16c253..b8577a0 100644
--- a/include/image.h
+++ b/include/image.h
@@ -221,6 +221,8 @@ typedef struct bootm_headers {
 
ulong   ep; /* entry point of OS */
 
+   ulong   rd_start, rd_end;/* ramdisk start/end */
+
int verify; /* getenv("verify")[0] != 'n' */
struct lmb  *lmb;   /* for memory mgmt */
 } bootm_headers_t;
diff --git a/lib_arm/bootm.c b/lib_arm/bootm.c
index 5660a50..f9f702f 100644
--- a/lib_arm/bootm.c
+++ b/lib_arm/bootm.c
@@ -61,7 +61,6 @@ extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, 
char *argv[]);
 void do_bootm_linux (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
 bootm_headers_t *images)
 {
-   ulong   initrd_start, initrd_end;
bd_t*bd = gd->bd;
char*s;
int machid = bd->bi_arch_number;
@@ -80,11 +79,6 @@ void do_bootm_linux (cmd_tbl_t *cmdtp, int flag, int argc, 
char *argv[],
printf ("Using machid 0x%x from environment\n", machid);
}
 
-   ret = boot_get_ramdisk (argc, argv, images, IH_ARCH_ARM,
-   &initrd_start, &initrd_end);
-   if (ret)
-   goto error;
-
show_boot_progress (15);
 
debug ("## Transferring control to Linux (at address %08lx) ...\n",
@@ -111,8 +105,8 @@ void do_bootm_linux (cmd_tbl_t *cmdtp, int flag, int argc, 
char *argv[],
setup_commandline_tag (bd, commandline);
 #endif
 #ifdef CONFIG_INITRD_TAG
-   if (initrd_start && initrd_end)
-   setup_initrd_tag (bd, initrd_start, initrd_end);
+   if (images->rd_start && images->rd_end)
+   setup_initrd_tag (bd, images->rd_start, images->rd_end);
 #endif
 #if defined (CONFIG_VFD) || defined (CONFIG_LCD)
setup_videolfb_tag ((gd_t *) gd);
diff --git a/lib_avr32/bootm.c b/lib_avr32/bootm.c
index 7beab99..762701f 100644
--- a/lib_avr32/bootm.c
+++ b/lib_avr32/bootm.c
@@ -176,7 +176,6 @@ static void setup_end_tag(struct tag *params)
 void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
bootm_headers_t *images)
 {
-   ulong   initrd_start, initrd_end;
 

[U-Boot] [RFC][PATCH 06/15] bootm: refactor entry point code

2008-08-12 Thread Kumar Gala
Move entry point code out of each arch and into common code.  Keep
the entry point in the bootm_headers_t images struct.

Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
---
 common/cmd_bootm.c |   31 ++-
 include/image.h|2 ++
 lib_arm/bootm.c|   19 +--
 lib_avr32/bootm.c  |   19 +--
 lib_blackfin/bootm.c   |   19 +--
 lib_m68k/bootm.c   |   19 +--
 lib_microblaze/bootm.c |   19 +--
 lib_mips/bootm.c   |   18 +-
 lib_nios2/bootm.c  |   20 +---
 lib_ppc/bootm.c|   22 +++---
 lib_sh/bootm.c |   19 +--
 lib_sparc/bootm.c  |   12 ++--
 12 files changed, 37 insertions(+), 182 deletions(-)

diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index 0b14b06..3f63b84 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -205,6 +205,23 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char 
*argv[])
return 1;
}
 
+   /* find kernel entry point */
+   if (images.legacy_hdr_valid) {
+   images.ep = image_get_ep (&images.legacy_hdr_os_copy);
+#if defined(CONFIG_FIT)
+   } else if (images.fit_uname_os) {
+   ret = fit_image_get_entry (images.fit_hdr_os,
+   images.fit_noffset_os, &images.ep);
+   if (ret) {
+   puts ("Can't get entry point property!\n");
+   return 1;
+   }
+#endif
+   } else {
+   puts ("Could not find kernel entry point!\n");
+   return 1;
+   }
+
image_start = (ulong)os_hdr;
load_end = 0;
type_name = genimg_get_type_name (type);
@@ -942,7 +959,7 @@ static void do_bootm_netbsd (cmd_tbl_t *cmdtp, int flag,
cmdline = "";
}
 
-   loader = (void (*)(bd_t *, image_header_t *, char *, char 
*))image_get_ep (hdr);
+   loader = (void (*)(bd_t *, image_header_t *, char *, char *))images->ep;
 
printf ("## Transferring control to NetBSD stage-2 loader (at address 
%08lx) ...\n",
(ulong)loader);
@@ -981,7 +998,6 @@ static void do_bootm_rtems (cmd_tbl_t *cmdtp, int flag,
   int argc, char *argv[],
   bootm_headers_t *images)
 {
-   image_header_t *hdr = &images->legacy_hdr_os_copy;
void (*entry_point)(bd_t *);
 
 #if defined(CONFIG_FIT)
@@ -991,7 +1007,7 @@ static void do_bootm_rtems (cmd_tbl_t *cmdtp, int flag,
}
 #endif
 
-   entry_point = (void (*)(bd_t *))image_get_ep (hdr);
+   entry_point = (void (*)(bd_t *))images->ep;
 
printf ("## Transferring control to RTEMS (at address %08lx) ...\n",
(ulong)entry_point);
@@ -1011,7 +1027,6 @@ static void do_bootm_vxworks (cmd_tbl_t *cmdtp, int flag,
 bootm_headers_t *images)
 {
char str[80];
-   image_header_t *hdr = &images->legacy_hdr_os_copy;
 
 #if defined(CONFIG_FIT)
if (!images->legacy_hdr_valid) {
@@ -1020,7 +1035,7 @@ static void do_bootm_vxworks (cmd_tbl_t *cmdtp, int flag,
}
 #endif
 
-   sprintf(str, "%x", image_get_ep (hdr)); /* write entry-point into 
string */
+   sprintf(str, "%lx", images->ep); /* write entry-point into string */
setenv("loadaddr", str);
do_bootvx(cmdtp, 0, 0, NULL);
 }
@@ -1031,7 +1046,6 @@ static void do_bootm_qnxelf(cmd_tbl_t *cmdtp, int flag,
 {
char *local_args[2];
char str[16];
-   image_header_t *hdr = &images->legacy_hdr_os_copy;
 
 #if defined(CONFIG_FIT)
if (!images->legacy_hdr_valid) {
@@ -1040,7 +1054,7 @@ static void do_bootm_qnxelf(cmd_tbl_t *cmdtp, int flag,
}
 #endif
 
-   sprintf(str, "%x", image_get_ep (hdr)); /* write entry-point into 
string */
+   sprintf(str, "%lx", images->ep); /* write entry-point into string */
local_args[0] = argv[0];
local_args[1] = str;/* and provide it via the arguments */
do_bootelf(cmdtp, 0, 2, local_args);
@@ -1058,7 +1072,6 @@ static void do_bootm_artos (cmd_tbl_t *cmdtp, int flag,
int i, j, nxt, len, envno, envsz;
bd_t *kbd;
void (*entry)(bd_t *bd, char *cmdline, char **fwenv, ulong top);
-   image_header_t *hdr = &images->legacy_hdr_os_copy;
 
 #if defined(CONFIG_FIT)
if (!images->legacy_hdr_valid) {
@@ -1133,7 +1146,7 @@ static void do_bootm_artos (cmd_tbl_t *cmdtp, int flag,
}
*ss++ = NULL;   /* terminate */
 
-   entry = (void (*)(bd_t *, char *, char **, ulong))image_get_ep (hdr);
+   entry = (void (*)(bd_t *, char *, char **, ulong))images->ep;
(*entry) (kbd, cmdline, fwenv, top);
 }
 #endif
diff --git a/include/image.h b/include/image.h
index 4b9c582..e16c253 100644
--- a/include/image.h
+++ b/include/image.h
@@ -219,6 +219,8 @@ typedef struct bootm_headers {
 

[U-Boot] [RFC][PATCH 05/15] fdt: fdt addr w/o any args reports back the current working address

2008-08-12 Thread Kumar Gala
Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
---
 common/cmd_fdt.c |8 
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/common/cmd_fdt.c b/common/cmd_fdt.c
index 436fec9..c129993 100644
--- a/common/cmd_fdt.c
+++ b/common/cmd_fdt.c
@@ -67,6 +67,14 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char 
*argv[])
/*
 * Set the address [and length] of the fdt.
 */
+   if (argc == 2) {
+   if (!fdt_valid()) {
+   return 1;
+   }
+   printf("The address of the fdt is %p\n", working_fdt);
+   return 0;
+   }
+
working_fdt = (struct fdt_header *)simple_strtoul(argv[2], 
NULL, 16);
 
if (!fdt_valid()) {
-- 
1.5.5.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC][PATCH 01/15] Update linux bootm to support ePAPR client interface

2008-08-12 Thread Kumar Gala
the ePAPR spec has some subtle differences from the current device tree
based boot interface to the powerpc linux kernel.  The powerpc linux kernel
currently ignores the differences that ePAPR specifies.

Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
---
 lib_ppc/bootm.c |   33 +++--
 1 files changed, 23 insertions(+), 10 deletions(-)

diff --git a/lib_ppc/bootm.c b/lib_ppc/bootm.c
index cbe5592..e83c860 100644
--- a/lib_ppc/bootm.c
+++ b/lib_ppc/bootm.c
@@ -80,7 +80,8 @@ do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char 
*argv[],
ulong   cmd_start, cmd_end, bootmap_base;
bd_t*kbd;
ulong   ep = 0;
-   void(*kernel)(bd_t *, ulong, ulong, ulong, ulong);
+   void(*kernel)(bd_t *, ulong r4, ulong r5, ulong r6,
+ ulong r7, ulong r8, ulong r9);
int ret;
ulong   of_size = 0;
struct lmb *lmb = images->lmb;
@@ -166,8 +167,8 @@ do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char 
*argv[],
puts ("Could not find kernel entry point!\n");
goto error;
}
-   kernel = (void (*)(bd_t *, ulong, ulong, ulong, ulong))ep;
-
+   kernel = (void (*)(bd_t *, ulong, ulong, ulong,
+  ulong, ulong, ulong))ep;
/* find ramdisk */
ret = boot_get_ramdisk (argc, argv, images, IH_ARCH_PPC,
&rd_data_start, &rd_data_end);
@@ -282,14 +283,23 @@ do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char 
*argv[],
if (of_flat_tree) { /* device tree; boot new style */
/*
 * Linux Kernel Parameters (passing device tree):
-*   r3: pointer to the fdt, followed by the board info data
-*   r4: physical pointer to the kernel itself
-*   r5: NULL
-*   r6: NULL
-*   r7: NULL
+*   r3: pointer to the fdt
+*   r4: 0
+*   r5: 0
+*   r6: epapr magic
+*   r7: size of IMA in bytes
+*   r8: 0
+*   r9: 0
 */
+#if defined(CONFIG_85xx) || defined(CONFIG_440)
+ #define EPAPR_MAGIC   (0x45504150)
+#else
+ #define EPAPR_MAGIC   (0x65504150)
+#endif
+
debug ("   Booting using OF flat tree...\n");
-   (*kernel) ((bd_t *)of_flat_tree, (ulong)kernel, 0, 0, 0);
+   (*kernel) ((bd_t *)of_flat_tree, 0, 0, EPAPR_MAGIC,
+  CFG_BOOTMAPSZ, 0, 0);
/* does not return */
} else
 #endif
@@ -301,9 +311,12 @@ do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char 
*argv[],
 *   r5: initrd_end - unused if r4 is 0
 *   r6: Start of command line string
 *   r7: End   of command line string
+*   r8: 0
+*   r9: 0
 */
debug ("   Booting using board info...\n");
-   (*kernel) (kbd, initrd_start, initrd_end, cmd_start, cmd_end);
+   (*kernel) (kbd, initrd_start, initrd_end,
+  cmd_start, cmd_end, 0, 0);
/* does not return */
}
return ;
-- 
1.5.5.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC][PATCH 04/15] fdt: added the ability to set initrd start/end via chosen command

2008-08-12 Thread Kumar Gala
Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
---
 common/cmd_fdt.c |   21 +
 1 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/common/cmd_fdt.c b/common/cmd_fdt.c
index d3b19dd..436fec9 100644
--- a/common/cmd_fdt.c
+++ b/common/cmd_fdt.c
@@ -417,9 +417,21 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char 
*argv[])
ft_board_setup(working_fdt, gd->bd);
 #endif
/* Create a chosen node */
-   else if (argv[1][0] == 'c')
-   fdt_chosen(working_fdt, 0, 0, 1);
-   else {
+   else if (argv[1][0] == 'c') {
+   unsigned long initrd_start = 0, initrd_end = 0;
+
+   if ((argc != 2) && (argc != 4)) {
+   printf ("Usage:\n%s\n", cmdtp->usage);
+   return 1;
+   }
+
+   if (argc == 4) {
+   initrd_start = simple_strtoul(argv[2], NULL, 16);
+   initrd_end = simple_strtoul(argv[3], NULL, 16);
+   }
+
+   fdt_chosen(working_fdt, initrd_start, initrd_end, 1);
+   } else {
/* Unrecognized command */
printf ("Usage:\n%s\n", cmdtp->usage);
return 1;
@@ -798,7 +810,8 @@ U_BOOT_CMD(
"fdt rsvmem print- Show current mem reserves\n"
"fdt rsvmem add  - Add a mem reserve\n"
"fdt rsvmem delete- Delete a mem reserves\n"
-   "fdt chosen - Add/update the /chosen branch in the tree\n"
+   "fdt chosen [ ]  - Add/update the /chosen branch in 
the tree\n"
+   "/ - initrd 
start/end addr\n"
"NOTE: If the path or property you are setting/printing has a '#' 
character\n"
" or spaces, you MUST escape it with a \\ character or quote it 
with \".\n"
 );
-- 
1.5.5.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC][PATCH 03/15] Clean up usage of icache_disable/dcache_disable

2008-08-12 Thread Kumar Gala
There is no point in disabling the icache on 7xx/74xx/86xx parts and not
also flushing the icache.  All callers of invalidate_l1_instruction_cache()
call icache_disable() right after.  Make it so icache_disable() calls
invalidate_l1_instruction_cache() for us.

Also, dcache_disable() already calls dcache_flush() so there is no point
in the explicit calls of dcache_flush().

Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
---
 board/Marvell/db64360/db64360.c   |5 -
 board/Marvell/db64460/db64460.c   |5 -
 board/esd/cpci750/cpci750.c   |4 
 board/freescale/mpc7448hpc2/mpc7448hpc2.c |2 --
 board/prodrive/p3mx/p3mx.c|2 --
 common/cmd_bootm.c|2 --
 cpu/74xx_7xx/cache.S  |4 
 cpu/mpc86xx/cache.S   |4 
 8 files changed, 8 insertions(+), 20 deletions(-)

diff --git a/board/Marvell/db64360/db64360.c b/board/Marvell/db64360/db64360.c
index a2ab2d7..2a810a6 100644
--- a/board/Marvell/db64360/db64360.c
+++ b/board/Marvell/db64360/db64360.c
@@ -51,9 +51,6 @@
 #define DP(x)
 #endif
 
-extern void flush_data_cache (void);
-extern void invalidate_l1_instruction_cache (void);
-
 /* - */
 
 /* this is the current GT register space location */
@@ -930,7 +927,5 @@ void board_prebootm_init ()
my_remap_gt_regs_bootm (CFG_GT_REGS, BRIDGE_REG_BASE_BOOTM);
 
icache_disable ();
-   invalidate_l1_instruction_cache ();
-   flush_data_cache ();
dcache_disable ();
 }
diff --git a/board/Marvell/db64460/db64460.c b/board/Marvell/db64460/db64460.c
index a4abf8d..1ae898d 100644
--- a/board/Marvell/db64460/db64460.c
+++ b/board/Marvell/db64460/db64460.c
@@ -51,9 +51,6 @@
 #define DP(x)
 #endif
 
-extern void flush_data_cache (void);
-extern void invalidate_l1_instruction_cache (void);
-
 /* - */
 
 /* this is the current GT register space location */
@@ -930,7 +927,5 @@ void board_prebootm_init ()
my_remap_gt_regs_bootm (CFG_GT_REGS, BRIDGE_REG_BASE_BOOTM);
 
icache_disable ();
-   invalidate_l1_instruction_cache ();
-   flush_data_cache ();
dcache_disable ();
 }
diff --git a/board/esd/cpci750/cpci750.c b/board/esd/cpci750/cpci750.c
index 298aa6a..5ab76c6 100644
--- a/board/esd/cpci750/cpci750.c
+++ b/board/esd/cpci750/cpci750.c
@@ -120,8 +120,6 @@ static char show_config_tab[][15] = {{"PCI0DLL_2 "},  
/* 31 */
 {"DRAMPLL_NDiv_1"},  /* 01 */
 {"DRAMPLL_NDiv_0"}}; /* 00 */
 
-extern void flush_data_cache (void);
-extern void invalidate_l1_instruction_cache (void);
 extern flash_info_t flash_info[];
 
 /* - */
@@ -961,8 +959,6 @@ void board_prebootm_init ()
my_remap_gt_regs_bootm (CFG_GT_REGS, CFG_DFL_GT_REGS);
 
icache_disable ();
-   invalidate_l1_instruction_cache ();
-   flush_data_cache ();
dcache_disable ();
 }
 
diff --git a/board/freescale/mpc7448hpc2/mpc7448hpc2.c 
b/board/freescale/mpc7448hpc2/mpc7448hpc2.c
index b3d83cc..6f74c31 100644
--- a/board/freescale/mpc7448hpc2/mpc7448hpc2.c
+++ b/board/freescale/mpc7448hpc2/mpc7448hpc2.c
@@ -37,8 +37,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-extern void flush_data_cache (void);
-extern void invalidate_l1_instruction_cache (void);
 extern void tsi108_init_f (void);
 
 int display_mem_map (void);
diff --git a/board/prodrive/p3mx/p3mx.c b/board/prodrive/p3mx/p3mx.c
index d54ddaf..69d7c9b 100644
--- a/board/prodrive/p3mx/p3mx.c
+++ b/board/prodrive/p3mx/p3mx.c
@@ -62,8 +62,6 @@ DECLARE_GLOBAL_DATA_PTR;
 #define DP(x)
 #endif
 
-extern void flush_data_cache (void);
-extern void invalidate_l1_instruction_cache (void);
 extern flash_info_t flash_info[];
 
 /* - */
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index 5295969..0b14b06 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -236,8 +236,6 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char 
*argv[])
 * bios emulation, so turn them off again
 */
icache_disable();
-   invalidate_l1_instruction_cache();
-   flush_data_cache();
dcache_disable();
 #endif
 
diff --git a/cpu/74xx_7xx/cache.S b/cpu/74xx_7xx/cache.S
index 3a745cb..eac4544 100644
--- a/cpu/74xx_7xx/cache.S
+++ b/cpu/74xx_7xx/cache.S
@@ -245,6 +245,10 @@ _GLOBAL(icache_enable)
  * Disable L1 Instruction cache
  */
 _GLOBAL(icache_disable)
+   mflrr4
+   bl  invalidate_l1_instruction_cache /* uses r3 */
+   sync
+   mtlrr4
mfspr   r3, HID0
li  r5, 0
ori r5, r5, HID0_ICE
diff --git a/cpu/mpc86xx/cache.S b/cpu/mpc86xx/cache.S
index 2e4ea02..80ff688 100644
-

[U-Boot] [RFC][PATCH 02/15] add ability to disable ft_board_setup as part of bootm

2008-08-12 Thread Kumar Gala
if the environment variable 'no_ft_board_setup' is set we skip
doing the ft_board_setup().

Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
---
 lib_ppc/bootm.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/lib_ppc/bootm.c b/lib_ppc/bootm.c
index e83c860..3cb17bf 100644
--- a/lib_ppc/bootm.c
+++ b/lib_ppc/bootm.c
@@ -193,7 +193,8 @@ do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char 
*argv[],
}
 #ifdef CONFIG_OF_BOARD_SETUP
/* Call the board-specific fixup routine */
-   ft_board_setup(of_flat_tree, gd->bd);
+   if (!getenv("no_ft_board_setup"))
+   ft_board_setup(of_flat_tree, gd->bd);
 #endif
}
 
-- 
1.5.5.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC][PATCH 00/15] bootm refactoring

2008-08-12 Thread Kumar Gala
[PATCH 01/15] Update linux bootm to support ePAPR client interface
[PATCH 02/15] add ability to disable ft_board_setup as part of bootm

possibly drop this patch if the boots method is acceptable

[PATCH 03/15] Clean up usage of icache_disable/dcache_disable
[PATCH 04/15] fdt: added the ability to set initrd start/end via chosen command
[PATCH 05/15] fdt: fdt addr w/o any args reports back the current working 
address
[PATCH 06/15] bootm: refactor entry point code
[PATCH 07/15] bootm: refactor ramdisk locating code
[PATCH 08/15] bootm: refactor fdt locating and relocation code
[PATCH 09/15] bootm: Set working fdt address as part of the bootm flow
[PATCH 10/15] bootm: move lmb into the bootm_headers_t structure
[PATCH 11/15] bootm: refactor image detection and os load steps
[PATCH 12/15] fdt: refactor fdt resize code
[PATCH 13/15] fdt: refactor initrd related code
[PATCH 14/15] fdt: Added resize command
[PATCH 15/15] boots: start of sub commands

I believe all the patches except 15/15 should be in a reasonable state
for u-boot-testing.  I need to add an 'interrupt enable/disable' command
but with a small hack I'm able to mimic the bootm command on ppc by:

boots start   
boots load_os   /* hacked to disable interrupts */
boots prep_os
boots initrd_relocate
boots fdt_relocate
fdt chosen $initrd_start $initrd_end
fdt boardsetup
boots jump

Right now 15/15 is focused on only PPC w/Linux.  If this looks acceptable
I'll split 15/15 into proper patches an add support for the other ARCHes
and OSes.

- k
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Change CFG_ENV_SIZE to CFG_ENV_SECT_SIZE for SPI sector erase

2008-08-12 Thread Liew Tsi Chung
Wolfgang,

You're right. Can't ignore the chance that CFG_ENV_SIZE might be
larger than CFG_ENV_SECT_SIZE, although both are defined in platform
configuration file.

I will send out the patch again with condition check.

[/snip]
u32 sector = 1;

...
if (CFG_ENV_SIZE > CFG_ENV_SECT_SIZE) {
sector = CFG_ENV_SIZE / CFG_ENV_SECT_SIZE;
if (CFG_ENV_SIZE % CFG_ENV_SECT_SIZE)
sector++;
}

if (spi_flash_erase(env_flash, CFG_ENV_OFFSET, sector *
CFG_ENV_SECT_SIZE))
...
if (spi_flash_write(env_flash, CFG_ENV_OFFSET, CFG_ENV_SIZE,
env_ptr))
...

Regards,
TsiChung


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 12, 2008 3:05 PM
To: Liew Tsi Chung
Cc: U-Boot; Rigby John
Subject: Re: [PATCH] Change CFG_ENV_SIZE to CFG_ENV_SECT_SIZE for SPI
sector erase

Dear Tsi-Chung Liew,

In message
<[EMAIL PROTECTED]> you
wrote:
> From: TsiChung Liew <[EMAIL PROTECTED]>
> 
> The CFG_ENV_SIZE is not suitable used for SPI flash erase sector size.
> 
> Signed-off-by: TsiChung Liew <[EMAIL PROTECTED]>
> ---
>  common/env_sf.c |2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/common/env_sf.c b/common/env_sf.c index d641a9a..0a0626e 
> 100644
> --- a/common/env_sf.c
> +++ b/common/env_sf.c
> @@ -69,7 +69,7 @@ int saveenv(void)
>   }
>  
>   puts("Erasing SPI flash...");
> - if (spi_flash_erase(env_flash, CFG_ENV_OFFSET, CFG_ENV_SIZE))
> + if (spi_flash_erase(env_flash, CFG_ENV_OFFSET,
CFG_ENV_SECT_SIZE))

Is it always guaranteed that CFG_ENV_SIZE <= CFG_ENV_SECT_SIZE ?

Otherwise several sectors might need to be erased...

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: [EMAIL PROTECTED]
Due to lack of disk space, this fortune database has been discontinued.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [WIP][PATCH 00/11] bootm refactoring

2008-08-12 Thread Kumar Gala

On Aug 12, 2008, at 3:12 PM, Wolfgang Denk wrote:

> Dear Kumar Gala,
>
> In message <[EMAIL PROTECTED] 
> > you wrote:
>> This patch set is a refactoring of the bootm functionality to get it
>> ready for the sub-command functionality.  Its a WIP but I wanted to  
>> get
>> some early feedback to see if this is the right direction.
>>
>> We do see some reduction of the arch specific code which is pretty  
>> nice.
>
> What is the level of being "WIP"ish? Is this code still just intended
> for review, or does it compile, or does it actually run on any systems
> yet?
>
> I mean, what should we do with  it  -  review,  create  a  branch  in
> u-boot-testing for it, anything else ?

It compiles and runs.  I was hoping for feedback if the direction is  
acceptable.

I'm adding a "boots" command that implements sub commands.  Once I  
have a version of that working on PPC & Linux I'll post it and want to  
make sure the approach is acceptable before converting ALL other ARCHs  
and other OSes to match.

- k
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [WIP][PATCH 00/11] bootm refactoring

2008-08-12 Thread Wolfgang Denk
Dear Kumar Gala,

In message <[EMAIL PROTECTED]> you wrote:
> This patch set is a refactoring of the bootm functionality to get it
> ready for the sub-command functionality.  Its a WIP but I wanted to get
> some early feedback to see if this is the right direction.
> 
> We do see some reduction of the arch specific code which is pretty nice.

What is the level of being "WIP"ish? Is this code still just intended
for review, or does it compile, or does it actually run on any systems
yet?

I mean, what should we do with  it  -  review,  create  a  branch  in
u-boot-testing for it, anything else ?
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Change CFG_ENV_SIZE to CFG_ENV_SECT_SIZE for SPI sector erase

2008-08-12 Thread Wolfgang Denk
Dear Tsi-Chung Liew,

In message <[EMAIL PROTECTED]> you wrote:
> From: TsiChung Liew <[EMAIL PROTECTED]>
> 
> The CFG_ENV_SIZE is not suitable used for SPI flash erase
> sector size.
> 
> Signed-off-by: TsiChung Liew <[EMAIL PROTECTED]>
> ---
>  common/env_sf.c |2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/common/env_sf.c b/common/env_sf.c
> index d641a9a..0a0626e 100644
> --- a/common/env_sf.c
> +++ b/common/env_sf.c
> @@ -69,7 +69,7 @@ int saveenv(void)
>   }
>  
>   puts("Erasing SPI flash...");
> - if (spi_flash_erase(env_flash, CFG_ENV_OFFSET, CFG_ENV_SIZE))
> + if (spi_flash_erase(env_flash, CFG_ENV_OFFSET, CFG_ENV_SECT_SIZE))

Is it always guaranteed that CFG_ENV_SIZE <= CFG_ENV_SECT_SIZE ?

Otherwise several sectors might need to be erased...

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: [EMAIL PROTECTED]
Due to lack of disk space, this fortune database has been discontinued.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] AT91 Pull Request

2008-08-12 Thread Wolfgang Denk
Dear Jean-Christophe PLAGNIOL-VILLARD,

In message <[EMAIL PROTECTED]> you wrote:
> Hi Wolfgang
> please pull
> The following changes since commit cd82919e6c8a73b363a26f34b734923844e52d1c:
>   Wolfgang Denk (1):
> Coding style cleanup, update CHANGELOG, prepare release
> 
> are available in the git repository at:
> 
>   git://git.denx.de/u-boot-at91.git master
> 
> Jean-Christophe PLAGNIOL-VILLARD (1):
>   at91: move arch-at91sam9 to arch-at91
> 
>  Makefile   |   10 +-
>  cpu/arm926ejs/{at91sam9 => at91}/Makefile  |0 
>  cpu/arm926ejs/{at91sam9 => at91}/config.mk |2 +-
>  cpu/arm926ejs/{at91sam9 => at91}/ether.c   |0 
>  cpu/arm926ejs/{at91sam9 => at91}/lowlevel_init.S   |0 
>  cpu/arm926ejs/{at91sam9 => at91}/spi.c |0 
>  cpu/arm926ejs/{at91sam9 => at91}/timer.c   |0 
>  cpu/arm926ejs/{at91sam9 => at91}/u-boot.lds|0 
>  cpu/arm926ejs/{at91sam9 => at91}/usb.c |0 
>  .../{arch-at91sam9 => arch-at91}/at91_pio.h|0 
>  .../{arch-at91sam9 => arch-at91}/at91_pit.h|0 
>  .../{arch-at91sam9 => arch-at91}/at91_pmc.h|0 
>  .../{arch-at91sam9 => arch-at91}/at91_rstc.h   |0 
>  .../{arch-at91sam9 => arch-at91}/at91_spi.h|0 
>  .../{arch-at91sam9 => arch-at91}/at91cap9.h|0 
>  .../{arch-at91sam9 => arch-at91}/at91cap9_matrix.h |0 
>  .../{arch-at91sam9 => arch-at91}/at91sam9260.h |0 
>  .../at91sam9260_matrix.h   |0 
>  .../{arch-at91sam9 => arch-at91}/at91sam9261.h |0 
>  .../at91sam9261_matrix.h   |0 
>  .../{arch-at91sam9 => arch-at91}/at91sam9263.h |0 
>  .../at91sam9263_matrix.h   |0 
>  .../{arch-at91sam9 => arch-at91}/at91sam9_smc.h|0 
>  .../{arch-at91sam9 => arch-at91}/at91sam9rl.h  |0 
>  .../at91sam9rl_matrix.h|0 
>  include/asm-arm/{arch-at91sam9 => arch-at91}/clk.h |0 
>  .../asm-arm/{arch-at91sam9 => arch-at91}/gpio.h|0 
>  .../{arch-at91sam9 => arch-at91}/hardware.h|0 
>  include/asm-arm/{arch-at91sam9 => arch-at91}/io.h  |0 
>  .../{arch-at91sam9 => arch-at91}/memory-map.h  |0 
>  30 files changed, 6 insertions(+), 6 deletions(-)
>  rename cpu/arm926ejs/{at91sam9 => at91}/Makefile (100%)
>  rename cpu/arm926ejs/{at91sam9 => at91}/config.mk (62%)
>  rename cpu/arm926ejs/{at91sam9 => at91}/ether.c (100%)
>  rename cpu/arm926ejs/{at91sam9 => at91}/lowlevel_init.S (100%)
>  rename cpu/arm926ejs/{at91sam9 => at91}/spi.c (100%)
>  rename cpu/arm926ejs/{at91sam9 => at91}/timer.c (100%)
>  rename cpu/arm926ejs/{at91sam9 => at91}/u-boot.lds (100%)
>  rename cpu/arm926ejs/{at91sam9 => at91}/usb.c (100%)
>  rename include/asm-arm/{arch-at91sam9 => arch-at91}/at91_pio.h (100%)
>  rename include/asm-arm/{arch-at91sam9 => arch-at91}/at91_pit.h (100%)
>  rename include/asm-arm/{arch-at91sam9 => arch-at91}/at91_pmc.h (100%)
>  rename include/asm-arm/{arch-at91sam9 => arch-at91}/at91_rstc.h (100%)
>  rename include/asm-arm/{arch-at91sam9 => arch-at91}/at91_spi.h (100%)
>  rename include/asm-arm/{arch-at91sam9 => arch-at91}/at91cap9.h (100%)
>  rename include/asm-arm/{arch-at91sam9 => arch-at91}/at91cap9_matrix.h (100%)
>  rename include/asm-arm/{arch-at91sam9 => arch-at91}/at91sam9260.h (100%)
>  rename include/asm-arm/{arch-at91sam9 => arch-at91}/at91sam9260_matrix.h 
> (100%)
>  rename include/asm-arm/{arch-at91sam9 => arch-at91}/at91sam9261.h (100%)
>  rename include/asm-arm/{arch-at91sam9 => arch-at91}/at91sam9261_matrix.h 
> (100%)
>  rename include/asm-arm/{arch-at91sam9 => arch-at91}/at91sam9263.h (100%)
>  rename include/asm-arm/{arch-at91sam9 => arch-at91}/at91sam9263_matrix.h 
> (100%)
>  rename include/asm-arm/{arch-at91sam9 => arch-at91}/at91sam9_smc.h (100%)
>  rename include/asm-arm/{arch-at91sam9 => arch-at91}/at91sam9rl.h (100%)
>  rename include/asm-arm/{arch-at91sam9 => arch-at91}/at91sam9rl_matrix.h 
> (100%)
>  rename include/asm-arm/{arch-at91sam9 => arch-at91}/clk.h (100%)
>  rename include/asm-arm/{arch-at91sam9 => arch-at91}/gpio.h (100%)
>  rename include/asm-arm/{arch-at91sam9 => arch-at91}/hardware.h (100%)
>  rename include/asm-arm/{arch-at91sam9 => arch-at91}/io.h (100%)
>  rename include/asm-arm/{arch-at91sam9 => arch-at91}/memory-map.h (100%)

Done. Thanks.

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: [EMAIL PROTECTED]
Every program has at least one bug and can be shortened by  at  least
one instruction - from which, by induction, one can deduce that every
program can be reduced to one instruction which doesn't work.
___
U-Boot mailing list
U-Boot@

Re: [U-Boot] Pull request: nand-flash

2008-08-12 Thread Wolfgang Denk
Dear Scott Wood,

In message <[EMAIL PROTECTED]> you wrote:
> These patches are from the testing/mtd-2.6.22.1 branch of
> u-boot-nand-flash.
> 
> Note that this is a significant change to the NAND subsystem (importing a
> newer upstream version) that affects the driver interface.  If your board
> has NAND, please test.
> 
> The following changes since commit cd82919e6c8a73b363a26f34b734923844e52d1c:
>   Wolfgang Denk (1):
> Coding style cleanup, update CHANGELOG, prepare release
> 
> are available in the git repository at:
> 
>   git://www.denx.de/git/u-boot-nand-flash.git master
> 
> Anton Vorontsov (2):
>   fsl_elbc_nand: workaround for hangs during nand write
>   nand: fsl_upm: convert to updated MTD NAND infrastructure
> 
> Fathi BOUDRA (1):
>   OneNAND: Fill in MTD function pointers for OneNAND.
> 
> Guennadi Liakhovetski (2):
>   NAND: Do not write or read a whole block if it is larger than the 
> environment
>   nand_spl: Support page-aligned read in nand_load, use chipselect
> 
> Ilya Yanok (1):
>   NAND: Scan bad blocks lazily.
> 
> Marcel Ziswiler (1):
>   NAND: chip->state does not always get set.
> 
> Scott Wood (8):
>   Don't panic if a controller driver does ecc its own way.
>   Freescale eLBC FCM NAND driver
>   fsl_elbc_nand: Hard-code the FBAR/FPAR split.
>   NAND: Always skip blocks on read/write/boot.
>   NAND read/write fix
>   mpc8313erdb: Enable NAND in config.
>   NAND boot: MPC8313ERDB support
>   NAND boot: Update large page support for current API.
> 
> Sergey Kubushyn (1):
>   NAND: Davinci driver updates
> 
> Stefan Roese (5):
>   NAND: Change nand_wait_ready() to not call nand_wait()
>   NAND: Update 4xx NDFC driver to match updated nand subsystem
>   NAND: Update nand_spl driver to match updated nand subsystem
>   NAND: Fix compilation warning and small coding style issue
>   NAND: Make NAND driver less verbose per default
> 
> William Juul (10):
>   Update MTD to that of Linux 2.6.22.1
>   Remove white space at end.
>   Fixing coding style issues
>   Whitespace cleanup and marking broken code.
>   YAFFS2 import
>   Incorporate yaffs2 into U-boot
>   Create symlinks from yaffs2/direct to yaffs2
>   Clean out unneeded files
>   moving files from yaffs2/direct/ to yaffs2/ and deleting all symlinks
>   make nand dump and nand dump.oob work
> 
>  Makefile|   13 +-
>  board/bf537-stamp/nand.c|   43 +-
>  board/dave/PPChameleonEVB/nand.c|   49 +-
>  board/delta/nand.c  |   41 +-
>  board/esd/common/esd405ep_nand.c|   42 +-
>  board/freescale/m5329evb/nand.c |   42 +-
>  board/freescale/mpc8313erdb/config.mk   |6 +
>  board/freescale/mpc8313erdb/mpc8313erdb.c   |   32 +
>  board/freescale/mpc8313erdb/sdram.c |5 +-
>  board/nc650/nand.c  |   78 +-
>  board/netstar/nand.c|   20 +-
>  board/prodrive/alpr/nand.c  |   57 +-
>  board/prodrive/pdnb3/nand.c |   53 +-
>  board/sc3/sc3nand.c |   44 +-
>  board/tqc/tqm8272/tqm8272.c |   34 +-
>  board/zylonite/nand.c   |   39 +-
>  common/Makefile |1 +
>  common/cmd_doc.c|9 +
>  common/cmd_nand.c   |  253 +-
>  common/cmd_onenand.c|2 +-
>  common/cmd_yaffs2.c |  215 +
>  common/env_nand.c   |   18 +-
>  cpu/arm926ejs/davinci/nand.c|   58 +-
>  cpu/mpc83xx/nand_init.c |  112 +
>  cpu/mpc83xx/start.S |  152 +-
>  cpu/ppc4xx/ndfc.c   |  112 +-
>  doc/README.nand |   37 +-
>  drivers/mtd/nand/Makefile   |1 +
>  drivers/mtd/nand/diskonchip.c   |  546 +-
>  drivers/mtd/nand/fsl_elbc_nand.c|  767 +++
>  drivers/mtd/nand/fsl_upm.c  |   68 +-
>  drivers/mtd/nand/nand_base.c| 3503 ++-
>  drivers/mtd/nand/nand_bbt.c |  549 ++-
>  drivers/mtd/nand/nand_ecc.c |   21 +-
>  drivers/mtd/nand/nand_ids.c |   91 +-
>  drivers/mtd/nand/nand_util.c|  723 +--
>  drivers/mtd/onenand/onenand_base.c  |   24 +-
>  fs/Makefile |2 +-
>  fs/yaffs2/Makefile  |   56 +
>  fs/yaffs2/README-linux  |  201 +
>  fs/yaffs2/devextras.h   |  275 +
>  fs/yaffs2/yaffs_checkptrw.c |  

Re: [U-Boot] [PATCH 14/14] FSL DDR: Convert MPC8548CDS to new DDR code.

2008-08-12 Thread Wolfgang Denk
Dear Kumar Gala,

In message <[EMAIL PROTECTED]> you wrote:
> From: Jon Loeliger <[EMAIL PROTECTED]>
> 
> Signed-off-by: Jon Loeliger <[EMAIL PROTECTED]>
> Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
> ---
>  board/freescale/mpc8548cds/Makefile |1 +
>  board/freescale/mpc8548cds/ddr.c|  268 
> +++
>  board/freescale/mpc8548cds/mpc8548cds.c |   12 ++-
>  include/configs/MPC8548CDS.h|   49 +--
>  4 files changed, 318 insertions(+), 12 deletions(-)
>  create mode 100644 board/freescale/mpc8548cds/ddr.c

Another question: maybe there should be a README that describes the
features of this code?

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: [EMAIL PROTECTED]
Carelessly planned projects take three times longer to complete  than
expected.  Carefully  planned  projects  take  four  times  longer to
complete than expected, mostly  because  the  planners  expect  their
planning to reduce the time it takes.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 14/14] FSL DDR: Convert MPC8548CDS to new DDR code.

2008-08-12 Thread Wolfgang Denk
Dear Kumar Gala,

In message <[EMAIL PROTECTED]> you wrote:
> From: Jon Loeliger <[EMAIL PROTECTED]>
> 
> Signed-off-by: Jon Loeliger <[EMAIL PROTECTED]>
> Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
> ---
>  board/freescale/mpc8548cds/Makefile |1 +
>  board/freescale/mpc8548cds/ddr.c|  268 
> +++
>  board/freescale/mpc8548cds/mpc8548cds.c |   12 ++-
>  include/configs/MPC8548CDS.h|   49 +--
>  4 files changed, 318 insertions(+), 12 deletions(-)
>  create mode 100644 board/freescale/mpc8548cds/ddr.c

What about converting all the other, non-FSL boards?

Does it  make  sense?  Is  there  any  recommendation  to  the  board
maintainers about conditions when such a conversion is recommended or
should not be done?

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: [EMAIL PROTECTED]
If at first you don't succeed, you are running about average.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 03/14] FSL DDR: Add interactive DDR config support

2008-08-12 Thread Wolfgang Denk
Dear Kumar Gala,

In message <[EMAIL PROTECTED]> you wrote:
> Provide a mechanism to allow interactive configuration of DDR params.  This
> is useful when trying to test various DDR settings to determine optimal
> configuration values for a given board.
> 
> Signed-off-by: James Yang <[EMAIL PROTECTED]>
> Signed-off-by: Jon Loeliger <[EMAIL PROTECTED]>
> Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
> ---
>  cpu/mpc8xxx/Makefile  |1 +
>  cpu/mpc8xxx/fsl_ddr_interactive.c | 1280 
> +
>  cpu/mpc8xxx/fsl_ddr_sdram.c   |   10 +
>  cpu/mpc8xxx/fsl_ddr_sdram.h   |3 +
>  4 files changed, 1294 insertions(+), 0 deletions(-)
>  create mode 100644 cpu/mpc8xxx/fsl_ddr_interactive.c

Maximum line length exceeded.


Please also check the remaining parts of this patch series.


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: [EMAIL PROTECTED]
The one who says it cannot be done should never interrupt the one who
is doing it.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 01/14] Add proper SPD definitions for DDR1/2/3

2008-08-12 Thread Wolfgang Denk
Dear Kumar Gala,

In message <[EMAIL PROTECTED]> you wrote:
> From: James Yang <[EMAIL PROTECTED]>
> 
> Also added a few helper functions for DDR1 & DDR2 to print SPD info and
> verify the checksum.
> 
> Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
> ---
>  common/Makefile   |1 +
>  common/ddr_spd.c  |  498 
> +
>  include/ddr_spd.h |  249 ++
>  3 files changed, 748 insertions(+), 0 deletions(-)
>  create mode 100644 common/ddr_spd.c
>  create mode 100644 include/ddr_spd.h

Maximum line length exceeded!

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: [EMAIL PROTECTED]
Unix is supported by IBM, like a hanging man is supported by rope.
- Don Libes & Sandy Ressler: _Life With Unix_
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 02/14] FSL DDR: Rewrite the FSL mpc8xxx DDR controller setup code.

2008-08-12 Thread Wolfgang Denk
Dear Kumar Gala,

In message <[EMAIL PROTECTED]> you wrote:
> 
> Signed-off-by: James Yang <[EMAIL PROTECTED]>
> Signed-off-by: Jon Loeliger <[EMAIL PROTECTED]>
> Signed-off-by: Becky Bruce <[EMAIL PROTECTED]>
> Signed-off-by: Ed Swarthout <[EMAIL PROTECTED]>
> Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
> ---
>  cpu/mpc85xx/Makefile   |9 +
>  cpu/mpc86xx/Makefile   |4 +
>  cpu/mpc8xxx/Makefile   |   30 +
>  cpu/mpc8xxx/common_timing_params.h |   54 +
>  cpu/mpc8xxx/ddr2_dimm_params.h |   99 ++
>  cpu/mpc8xxx/fsl_ddr1.c |  383 ++
>  cpu/mpc8xxx/fsl_ddr2.c |  384 ++
>  cpu/mpc8xxx/fsl_ddr_sdram.c| 2537 
> 

My comments will focus on this file - this is a monster of a file.

...
> + /*
> +  * Find maximum tCKmin_X_ps to find slowest DIMM.
> +  */
> + tCKmin_X_ps = max(tCKmin_X_ps, dimm_params[i].tCKmin_X_ps);
> +
> + /*
> +  * Find minimum tCKmax_ps to find fastest slow speed,
> +  * i.e., this is the slowest the whole system can go.
> +  */
> + tCKmax_ps = min(tCKmax_ps, dimm_params[i].tCKmax_ps);
> +
> + /*
> +  * Find maximum tCKmax_ps to find slowest slow speed,
> +  * i.e., this is the slowest any dimm can go.
> +  */
> + tCKmax_max_ps = max(tCKmax_max_ps, dimm_params[i].tCKmax_ps);
> +
> + /*
> +  * Find maximum tRCD_ps to find slowest ras-to-cas delay.
> +  */
> + tRCD_ps = max(tRCD_ps, dimm_params[i].tRCD_ps);
> +
> + /*
> +  * Find maximum tRP_ps to find slowest row precharge time.
> +  */
> + tRP_ps = max(tRP_ps, dimm_params[i].tRP_ps);

This goes on for hundrets of lines.

Please change ALL such single-line comments into one-liners.

Also:

> +
> + /*
> +  * Find maximum tRAS_ps to find slowest active to
> +  * precharge time.
> +  */
> + tRAS_ps = max(tRAS_ps, dimm_params[i].tRAS_ps);
> +
> + /*
> +  * Find maximum tWR_ps to find slowest write recovery time.
> +  */
> + tWR_ps = max(tWR_ps, dimm_params[i].tWR_ps);
> +
> + /*
> +  * Find maximum tWTR_ps to find slowest write-to-read
> +  * command delay.
> +  */
> + tWTR_ps = max(tWTR_ps, dimm_params[i].tWTR_ps);
> +
> + /*
> +  * Find maximum tRFC_ps to find slowest auto-refresh to
> +  * active/auto refresh command period.
> +  */
> + tRFC_ps = max(tRFC_ps, dimm_params[i].tRFC_ps);
> +
> + /*
> +  * Find maximum tRRD_ps to find slowest row active to
> +  * row active delay.
> +  */
> + tRRD_ps = max(tRRD_ps, dimm_params[i].tRRD_ps);
> +
> + /*
> +  * Find maximum tRC_ps to find slowest
> +  * active/auto-refresh time.
> +  */
> + tRC_ps = max(tRC_ps, dimm_params[i].tRC_ps);
> +
> + /*
> +  * Find maximum refresh_rate_ps to find slowest refresh time.
> +  */
> + refresh_rate_ps = max(refresh_rate_ps,
> +   dimm_params[i].refresh_rate_ps);
> +
> + /*
> +  * Find maximum tIS_ps to find slowest.
> +  */
> + tIS_ps = max(tIS_ps, dimm_params[i].tIS_ps);
> +
> + /*
> +  * Find maximum tIH_ps to find slowest.
> +  */
> + tIH_ps = max(tIH_ps, dimm_params[i].tIH_ps);
> +
> + /*
> +  * Find maximum tDS_ps to find slowest.
> +  */
> + tDS_ps = max(tDS_ps, dimm_params[i].tDS_ps);
> +
> + /*
> +  * Find maximum tDH_ps to find slowest.
> +  */
> + tDH_ps = max(tDH_ps, dimm_params[i].tDH_ps);
> +
> + /*
> +  * Find maximum tRTP_ps to find slowest.
> +  */
> + tRTP_ps = max(tRTP_ps, dimm_params[i].tRTP_ps);
> +
> +  *
> +  * FIXME: is finding the slowest value the correct
> +  * strategy for this parameter?
> +  */
> + tDQSQ_max_ps = max(tDQSQ_max_ps, dimm_params[i].tDQSQ_max_ps);
> +
> + /*
> +  * Find maximum tQHS_ps to find slowest.
> +  */
> + tQHS_ps = max(tQHS_ps, dimm_params[i].tQHS_ps);

Do we really need a  "find  maximum  FOO  to  find  slowest"  (what?)
comment  for  each and every of these similar lines? A single comment
at the beginning of the block should do.

> + /* CHECKME: */
> + if (!outpdimm->all_DIMMs_registered
> + && !outpdimm->all_DIMMs_unbuffered) {
> + printf("ERROR:

Re: [U-Boot] NAND: bad block in whole chip

2008-08-12 Thread Scott Wood
Alemao wrote:
> Hi all,
> 
> Im trying to use my NAND flash at MPC8360E-RDK based board.
> But it seems that the whole chip is bad blocked.
> Dont know if Im missing something... below some outputs:

Odds are that something is broken in the NAND driver, and you're reading 
garbage.

> Any help/suggestions welcome.
> 
> 
> Im using U-Boot-1.1.4 with NAND and FSL_UPM drivers from U-Boot-1.3.3

Try using the latest u-boot.

-Scott
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] NAND: bad block in whole chip

2008-08-12 Thread Alemao
Hi all,

Im trying to use my NAND flash at MPC8360E-RDK based board.
But it seems that the whole chip is bad blocked.
Dont know if Im missing something... below some outputs:

=> nand info

Device 0: NAND 64MiB 3,3V 8-bit, sector size 16 KiB

=> nand bad
 
 4000
.
.
.
 03ff4000
 03ff8000
 03ffc000
=> nand erase clean

NAND erase: device 0 whole chip
Skipping bad block at  0x
Skipping bad block at  0x4000
.
.
.
Skipping bad block at  0x03ff8000
Skipping bad block at  0x03ffc000

OK
=>

I read that any block that contains bytes != 0xff in the OOB is
marked as "factory bad" block.

At nand_block_bad() function (drivers/nand/nand_base.c) I saw the
implementation of the statment above.

---
this->cmdfunc (mtd, NAND_CMD_READOOB, this->badblockpos, page);

if (this->read_byte(mtd) != 0xff) res = 1;
---


So I did some dumps in NAND:


=> nand dump 0x4000
Page 0x4000 dump:
.
.
.
OOB:
   00 00 00 00 00 00 00 00
   00 00 00 00 00 00 00 00

=> nand dump 0x03ff8000
Page 03ff8000 dump:
.
.
.
OOB:
   81 81 81 01 81 81 81 81
   81 81 81 81 81 81 81 81


All dumps had OOB != 0xff

I also tried to write only 1 byte... no success:

=> tftpboot 0x0200 kernel_blob.img
=> nand write.jffs2 0x0200 0x0 0x1
  .
  .
  .
Bad block at 0x201 in erase block from 0x201 will be skipped
writing NAND page at offset 0x2014000 failed
Data did not fit into device, due to bad blocks
 1 bytes written: ERROR
=>


Any help/suggestions welcome.


Im using U-Boot-1.1.4 with NAND and FSL_UPM drivers from U-Boot-1.3.3

Cheers,

--
Alemao
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] AT91 Pull Request

2008-08-12 Thread Jean-Christophe PLAGNIOL-VILLARD
Hi Wolfgang
please pull
The following changes since commit cd82919e6c8a73b363a26f34b734923844e52d1c:
  Wolfgang Denk (1):
Coding style cleanup, update CHANGELOG, prepare release

are available in the git repository at:

  git://git.denx.de/u-boot-at91.git master

Jean-Christophe PLAGNIOL-VILLARD (1):
  at91: move arch-at91sam9 to arch-at91

 Makefile   |   10 +-
 cpu/arm926ejs/{at91sam9 => at91}/Makefile  |0 
 cpu/arm926ejs/{at91sam9 => at91}/config.mk |2 +-
 cpu/arm926ejs/{at91sam9 => at91}/ether.c   |0 
 cpu/arm926ejs/{at91sam9 => at91}/lowlevel_init.S   |0 
 cpu/arm926ejs/{at91sam9 => at91}/spi.c |0 
 cpu/arm926ejs/{at91sam9 => at91}/timer.c   |0 
 cpu/arm926ejs/{at91sam9 => at91}/u-boot.lds|0 
 cpu/arm926ejs/{at91sam9 => at91}/usb.c |0 
 .../{arch-at91sam9 => arch-at91}/at91_pio.h|0 
 .../{arch-at91sam9 => arch-at91}/at91_pit.h|0 
 .../{arch-at91sam9 => arch-at91}/at91_pmc.h|0 
 .../{arch-at91sam9 => arch-at91}/at91_rstc.h   |0 
 .../{arch-at91sam9 => arch-at91}/at91_spi.h|0 
 .../{arch-at91sam9 => arch-at91}/at91cap9.h|0 
 .../{arch-at91sam9 => arch-at91}/at91cap9_matrix.h |0 
 .../{arch-at91sam9 => arch-at91}/at91sam9260.h |0 
 .../at91sam9260_matrix.h   |0 
 .../{arch-at91sam9 => arch-at91}/at91sam9261.h |0 
 .../at91sam9261_matrix.h   |0 
 .../{arch-at91sam9 => arch-at91}/at91sam9263.h |0 
 .../at91sam9263_matrix.h   |0 
 .../{arch-at91sam9 => arch-at91}/at91sam9_smc.h|0 
 .../{arch-at91sam9 => arch-at91}/at91sam9rl.h  |0 
 .../at91sam9rl_matrix.h|0 
 include/asm-arm/{arch-at91sam9 => arch-at91}/clk.h |0 
 .../asm-arm/{arch-at91sam9 => arch-at91}/gpio.h|0 
 .../{arch-at91sam9 => arch-at91}/hardware.h|0 
 include/asm-arm/{arch-at91sam9 => arch-at91}/io.h  |0 
 .../{arch-at91sam9 => arch-at91}/memory-map.h  |0 
 30 files changed, 6 insertions(+), 6 deletions(-)
 rename cpu/arm926ejs/{at91sam9 => at91}/Makefile (100%)
 rename cpu/arm926ejs/{at91sam9 => at91}/config.mk (62%)
 rename cpu/arm926ejs/{at91sam9 => at91}/ether.c (100%)
 rename cpu/arm926ejs/{at91sam9 => at91}/lowlevel_init.S (100%)
 rename cpu/arm926ejs/{at91sam9 => at91}/spi.c (100%)
 rename cpu/arm926ejs/{at91sam9 => at91}/timer.c (100%)
 rename cpu/arm926ejs/{at91sam9 => at91}/u-boot.lds (100%)
 rename cpu/arm926ejs/{at91sam9 => at91}/usb.c (100%)
 rename include/asm-arm/{arch-at91sam9 => arch-at91}/at91_pio.h (100%)
 rename include/asm-arm/{arch-at91sam9 => arch-at91}/at91_pit.h (100%)
 rename include/asm-arm/{arch-at91sam9 => arch-at91}/at91_pmc.h (100%)
 rename include/asm-arm/{arch-at91sam9 => arch-at91}/at91_rstc.h (100%)
 rename include/asm-arm/{arch-at91sam9 => arch-at91}/at91_spi.h (100%)
 rename include/asm-arm/{arch-at91sam9 => arch-at91}/at91cap9.h (100%)
 rename include/asm-arm/{arch-at91sam9 => arch-at91}/at91cap9_matrix.h (100%)
 rename include/asm-arm/{arch-at91sam9 => arch-at91}/at91sam9260.h (100%)
 rename include/asm-arm/{arch-at91sam9 => arch-at91}/at91sam9260_matrix.h (100%)
 rename include/asm-arm/{arch-at91sam9 => arch-at91}/at91sam9261.h (100%)
 rename include/asm-arm/{arch-at91sam9 => arch-at91}/at91sam9261_matrix.h (100%)
 rename include/asm-arm/{arch-at91sam9 => arch-at91}/at91sam9263.h (100%)
 rename include/asm-arm/{arch-at91sam9 => arch-at91}/at91sam9263_matrix.h (100%)
 rename include/asm-arm/{arch-at91sam9 => arch-at91}/at91sam9_smc.h (100%)
 rename include/asm-arm/{arch-at91sam9 => arch-at91}/at91sam9rl.h (100%)
 rename include/asm-arm/{arch-at91sam9 => arch-at91}/at91sam9rl_matrix.h (100%)
 rename include/asm-arm/{arch-at91sam9 => arch-at91}/clk.h (100%)
 rename include/asm-arm/{arch-at91sam9 => arch-at91}/gpio.h (100%)
 rename include/asm-arm/{arch-at91sam9 => arch-at91}/hardware.h (100%)
 rename include/asm-arm/{arch-at91sam9 => arch-at91}/io.h (100%)
 rename include/asm-arm/{arch-at91sam9 => arch-at91}/memory-map.h (100%)

Best Regards,
J.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/3] mpc85xx: Add support for the MPC8572DS reference board

2008-08-12 Thread Scott Wood
Kumar Gala wrote:
>> Couldn't we use arrays for this sort of thing?
> 
> this is historic in how the immap is defined for these parts.  As patch 
> is welcome to do such cleanup.  I don't think it should hold up acceptance.

Neither do I; it just stood out as I glanced over the patch and I felt 
compelled to grumble. :-)

-Scott
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Pull request: nand-flash

2008-08-12 Thread Scott Wood
These patches are from the testing/mtd-2.6.22.1 branch of
u-boot-nand-flash.

Note that this is a significant change to the NAND subsystem (importing a
newer upstream version) that affects the driver interface.  If your board
has NAND, please test.

The following changes since commit cd82919e6c8a73b363a26f34b734923844e52d1c:
  Wolfgang Denk (1):
Coding style cleanup, update CHANGELOG, prepare release

are available in the git repository at:

  git://www.denx.de/git/u-boot-nand-flash.git master

Anton Vorontsov (2):
  fsl_elbc_nand: workaround for hangs during nand write
  nand: fsl_upm: convert to updated MTD NAND infrastructure

Fathi BOUDRA (1):
  OneNAND: Fill in MTD function pointers for OneNAND.

Guennadi Liakhovetski (2):
  NAND: Do not write or read a whole block if it is larger than the 
environment
  nand_spl: Support page-aligned read in nand_load, use chipselect

Ilya Yanok (1):
  NAND: Scan bad blocks lazily.

Marcel Ziswiler (1):
  NAND: chip->state does not always get set.

Scott Wood (8):
  Don't panic if a controller driver does ecc its own way.
  Freescale eLBC FCM NAND driver
  fsl_elbc_nand: Hard-code the FBAR/FPAR split.
  NAND: Always skip blocks on read/write/boot.
  NAND read/write fix
  mpc8313erdb: Enable NAND in config.
  NAND boot: MPC8313ERDB support
  NAND boot: Update large page support for current API.

Sergey Kubushyn (1):
  NAND: Davinci driver updates

Stefan Roese (5):
  NAND: Change nand_wait_ready() to not call nand_wait()
  NAND: Update 4xx NDFC driver to match updated nand subsystem
  NAND: Update nand_spl driver to match updated nand subsystem
  NAND: Fix compilation warning and small coding style issue
  NAND: Make NAND driver less verbose per default

William Juul (10):
  Update MTD to that of Linux 2.6.22.1
  Remove white space at end.
  Fixing coding style issues
  Whitespace cleanup and marking broken code.
  YAFFS2 import
  Incorporate yaffs2 into U-boot
  Create symlinks from yaffs2/direct to yaffs2
  Clean out unneeded files
  moving files from yaffs2/direct/ to yaffs2/ and deleting all symlinks
  make nand dump and nand dump.oob work

 Makefile|   13 +-
 board/bf537-stamp/nand.c|   43 +-
 board/dave/PPChameleonEVB/nand.c|   49 +-
 board/delta/nand.c  |   41 +-
 board/esd/common/esd405ep_nand.c|   42 +-
 board/freescale/m5329evb/nand.c |   42 +-
 board/freescale/mpc8313erdb/config.mk   |6 +
 board/freescale/mpc8313erdb/mpc8313erdb.c   |   32 +
 board/freescale/mpc8313erdb/sdram.c |5 +-
 board/nc650/nand.c  |   78 +-
 board/netstar/nand.c|   20 +-
 board/prodrive/alpr/nand.c  |   57 +-
 board/prodrive/pdnb3/nand.c |   53 +-
 board/sc3/sc3nand.c |   44 +-
 board/tqc/tqm8272/tqm8272.c |   34 +-
 board/zylonite/nand.c   |   39 +-
 common/Makefile |1 +
 common/cmd_doc.c|9 +
 common/cmd_nand.c   |  253 +-
 common/cmd_onenand.c|2 +-
 common/cmd_yaffs2.c |  215 +
 common/env_nand.c   |   18 +-
 cpu/arm926ejs/davinci/nand.c|   58 +-
 cpu/mpc83xx/nand_init.c |  112 +
 cpu/mpc83xx/start.S |  152 +-
 cpu/ppc4xx/ndfc.c   |  112 +-
 doc/README.nand |   37 +-
 drivers/mtd/nand/Makefile   |1 +
 drivers/mtd/nand/diskonchip.c   |  546 +-
 drivers/mtd/nand/fsl_elbc_nand.c|  767 +++
 drivers/mtd/nand/fsl_upm.c  |   68 +-
 drivers/mtd/nand/nand_base.c| 3503 ++-
 drivers/mtd/nand/nand_bbt.c |  549 ++-
 drivers/mtd/nand/nand_ecc.c |   21 +-
 drivers/mtd/nand/nand_ids.c |   91 +-
 drivers/mtd/nand/nand_util.c|  723 +--
 drivers/mtd/onenand/onenand_base.c  |   24 +-
 fs/Makefile |2 +-
 fs/yaffs2/Makefile  |   56 +
 fs/yaffs2/README-linux  |  201 +
 fs/yaffs2/devextras.h   |  275 +
 fs/yaffs2/yaffs_checkptrw.c |  405 ++
 fs/yaffs2/yaffs_checkptrw.h |   35 +
 fs/yaffs2/yaffs_ecc.c   |  333 +
 fs/yaffs2/yaffs_ecc.h   |   44 +
 fs/yaffs2/yaffs_flashif.h   |   31 +
 fs/yaffs2/yaffs_guts.c

Re: [U-Boot] [PATCH 1/3] mpc85xx: Add support for the MPC8572DS reference board

2008-08-12 Thread Kumar Gala

On Aug 12, 2008, at 11:23 AM, Scott Wood wrote:

> Kumar Gala wrote:
>> +for (i = 0; i < CONFIG_CHIP_SELECTS_PER_CTRL; i++) {
>> +unsigned int bnds = 0;
>> +unsigned int config = 0;
>> +unsigned int config_2 = 0;
>> +unsigned int *pbnds = NULL;
>> +unsigned int *pconfig = NULL;
>> +unsigned int *pconfig_2 = NULL;
>> +
>> +if (i == 0) {
>> +bnds = ddr->cs0_bnds;
>> +config   = ddr->cs0_config;
>> +config_2 = ddr->cs0_config_2;
>> +pbnds= (unsigned int *)&ddr->cs0_bnds;
>> +pconfig  = (unsigned int *)&ddr->cs0_config;
>> +pconfig_2= (unsigned int *)&ddr->cs0_config_2;
>> +
>> +} else if (i == 1) {
>> +bnds = ddr->cs1_bnds;
>> +config   = ddr->cs1_config;
>> +config_2 = ddr->cs1_config_2;
>> +pbnds= (unsigned int *)&ddr->cs1_bnds;
>> +pconfig  = (unsigned int *)&ddr->cs1_config;
>> +pconfig_2= (unsigned int *)&ddr->cs1_config_2;
>> +
>> +} else if (i == 2) {
>> +bnds = ddr->cs2_bnds;
>> +config   = ddr->cs2_config;
>> +config_2 = ddr->cs2_config_2;
>> +pbnds= (unsigned int *)&ddr->cs2_bnds;
>> +pconfig  = (unsigned int *)&ddr->cs2_config;
>> +pconfig_2= (unsigned int *)&ddr->cs2_config_2;
>> +
>> +} else if (i == 3) {
>> +bnds = ddr->cs3_bnds;
>> +config   = ddr->cs3_config;
>> +config_2 = ddr->cs3_config_2;
>> +pbnds= (unsigned int *) &ddr->cs3_bnds;
>> +pconfig  = (unsigned int *) &ddr->cs3_config;
>> +pconfig_2= (unsigned int *) &ddr->cs3_config_2;
>> +
>> +} else {
>> +/*
>> + * FIXME what happens if CONFIG_CHIP_SELECTS_PER_CTRL > 
>> 4
>> + */
>> +}
>> +
>> +printf("cs%u_bnds   = %08X\t%p\n", i, bnds, pbnds);
>> +printf("cs%u_config = %08X\t%p\n", i, config, pconfig);
>> +printf("cs%u_config_2   = %08X\t%p\n",
>> +   i, config_2, pconfig_2);
>> +}
>
> Couldn't we use arrays for this sort of thing?

this is historic in how the immap is defined for these parts.  As  
patch is welcome to do such cleanup.  I don't think it should hold up  
acceptance.

- k
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/3] mpc85xx: Add support for the MPC8572DS reference board

2008-08-12 Thread Scott Wood
Kumar Gala wrote:
> + for (i = 0; i < CONFIG_CHIP_SELECTS_PER_CTRL; i++) {
> + unsigned int bnds = 0;
> + unsigned int config = 0;
> + unsigned int config_2 = 0;
> + unsigned int *pbnds = NULL;
> + unsigned int *pconfig = NULL;
> + unsigned int *pconfig_2 = NULL;
> +
> + if (i == 0) {
> + bnds = ddr->cs0_bnds;
> + config   = ddr->cs0_config;
> + config_2 = ddr->cs0_config_2;
> + pbnds= (unsigned int *)&ddr->cs0_bnds;
> + pconfig  = (unsigned int *)&ddr->cs0_config;
> + pconfig_2= (unsigned int *)&ddr->cs0_config_2;
> +
> + } else if (i == 1) {
> + bnds = ddr->cs1_bnds;
> + config   = ddr->cs1_config;
> + config_2 = ddr->cs1_config_2;
> + pbnds= (unsigned int *)&ddr->cs1_bnds;
> + pconfig  = (unsigned int *)&ddr->cs1_config;
> + pconfig_2= (unsigned int *)&ddr->cs1_config_2;
> +
> + } else if (i == 2) {
> + bnds = ddr->cs2_bnds;
> + config   = ddr->cs2_config;
> + config_2 = ddr->cs2_config_2;
> + pbnds= (unsigned int *)&ddr->cs2_bnds;
> + pconfig  = (unsigned int *)&ddr->cs2_config;
> + pconfig_2= (unsigned int *)&ddr->cs2_config_2;
> +
> + } else if (i == 3) {
> + bnds = ddr->cs3_bnds;
> + config   = ddr->cs3_config;
> + config_2 = ddr->cs3_config_2;
> + pbnds= (unsigned int *) &ddr->cs3_bnds;
> + pconfig  = (unsigned int *) &ddr->cs3_config;
> + pconfig_2= (unsigned int *) &ddr->cs3_config_2;
> +
> + } else {
> + /*
> +  * FIXME what happens if CONFIG_CHIP_SELECTS_PER_CTRL > 
> 4
> +  */
> + }
> +
> + printf("cs%u_bnds   = %08X\t%p\n", i, bnds, pbnds);
> + printf("cs%u_config = %08X\t%p\n", i, config, pconfig);
> + printf("cs%u_config_2   = %08X\t%p\n",
> +i, config_2, pconfig_2);
> + }

Couldn't we use arrays for this sort of thing?

-Scott
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/3] mpc85xx: Add support for the MPC8572DS reference board

2008-08-12 Thread Kumar Gala
Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
---
 MAKEALL   |1 +
 Makefile  |3 +
 board/freescale/mpc8572ds/Makefile|   54 +++
 board/freescale/mpc8572ds/config.mk   |   32 ++
 board/freescale/mpc8572ds/ddr.c   |  344 +++
 board/freescale/mpc8572ds/law.c   |   41 +++
 board/freescale/mpc8572ds/mpc8572ds.c |  573 +++
 board/freescale/mpc8572ds/tlb.c   |   85 +
 board/freescale/mpc8572ds/u-boot.lds  |  145 
 cpu/mpc85xx/cpu.c |2 +-
 cpu/mpc85xx/pci.c |2 +-
 include/configs/MPC8572DS.h   |  600 +
 12 files changed, 1880 insertions(+), 2 deletions(-)
 create mode 100644 board/freescale/mpc8572ds/Makefile
 create mode 100644 board/freescale/mpc8572ds/config.mk
 create mode 100644 board/freescale/mpc8572ds/ddr.c
 create mode 100644 board/freescale/mpc8572ds/law.c
 create mode 100644 board/freescale/mpc8572ds/mpc8572ds.c
 create mode 100644 board/freescale/mpc8572ds/tlb.c
 create mode 100644 board/freescale/mpc8572ds/u-boot.lds
 create mode 100644 include/configs/MPC8572DS.h

diff --git a/MAKEALL b/MAKEALL
index ee83cca..2112936 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -352,6 +352,7 @@ LIST_85xx=" \
MPC8555CDS  \
MPC8560ADS  \
MPC8568MDS  \
+   MPC8572DS   \
PM854   \
PM856   \
sbc8540 \
diff --git a/Makefile b/Makefile
index 138dffb..52b658a 100644
--- a/Makefile
+++ b/Makefile
@@ -2197,6 +2197,9 @@ MPC8555CDS_config:unconfig
 MPC8568MDS_config: unconfig
@$(MKCONFIG) $(@:_config=) ppc mpc85xx mpc8568mds freescale
 
+MPC8572DS_config:   unconfig
+   @$(MKCONFIG) $(@:_config=) ppc mpc85xx mpc8572ds freescale
+
 PM854_config:  unconfig
@$(MKCONFIG) $(@:_config=) ppc mpc85xx pm854
 
diff --git a/board/freescale/mpc8572ds/Makefile 
b/board/freescale/mpc8572ds/Makefile
new file mode 100644
index 000..3e82bbf
--- /dev/null
+++ b/board/freescale/mpc8572ds/Makefile
@@ -0,0 +1,54 @@
+#
+# Copyright 2007 Freescale Semiconductor, Inc.
+# (C) Copyright 2001-2006
+# Wolfgang Denk, DENX Software Engineering, [EMAIL PROTECTED]
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).a
+
+COBJS-y+= $(BOARD).o
+COBJS-y+= ddr.o
+COBJS-y+= law.o
+COBJS-y+= tlb.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS-y))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(obj).depend $(OBJS) $(SOBJS)
+   $(AR) $(ARFLAGS) $@ $(OBJS)
+
+clean:
+   rm -f $(OBJS) $(SOBJS)
+
+distclean: clean
+   rm -f $(LIB) core *.bak .depend
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/freescale/mpc8572ds/config.mk 
b/board/freescale/mpc8572ds/config.mk
new file mode 100644
index 000..5b32186
--- /dev/null
+++ b/board/freescale/mpc8572ds/config.mk
@@ -0,0 +1,32 @@
+#
+# Copyright 2007-2008 Freescale Semiconductor, Inc.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+#
+# mpc8572ds board
+#
+ifndef TEXT_BASE
+TEXT_BASE = 0xeff8
+endif
+
+PLATFORM_CPPFLAGS += -DCONFIG_E5

[U-Boot] [PATCH 2/3] mpc85xx: Add support for the MPC8536

2008-08-12 Thread Kumar Gala
The MPC8536 Adds SDHC and SATA controllers to the PQ3 family.  We
also have SERDES init code for the 8536.

Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
Signed-off-by: Srikanth Srinivasan <[EMAIL PROTECTED]>
Signed-off-by: Dejan Minic <[EMAIL PROTECTED]>
Signed-off-by: Jason Jin <[EMAIL PROTECTED]>
Signed-off-by: Dave Liu <[EMAIL PROTECTED]>
---
 cpu/mpc85xx/Makefile  |1 +
 cpu/mpc85xx/cpu.c |8 ++-
 cpu/mpc85xx/cpu_init.c|7 ++
 cpu/mpc85xx/mpc8536_serdes.c  |  180 +
 cpu/mpc85xx/speed.c   |4 +
 drivers/misc/fsl_law.c|2 +-
 include/asm-ppc/global_data.h |6 +-
 include/asm-ppc/immap_85xx.h  |   11 +++
 include/asm-ppc/processor.h   |2 +
 include/pci_ids.h |2 +
 10 files changed, 218 insertions(+), 5 deletions(-)
 create mode 100644 cpu/mpc85xx/mpc8536_serdes.c

diff --git a/cpu/mpc85xx/Makefile b/cpu/mpc85xx/Makefile
index d51a6dd..ba1f159 100644
--- a/cpu/mpc85xx/Makefile
+++ b/cpu/mpc85xx/Makefile
@@ -42,6 +42,7 @@ endif
 endif
 endif
 
+COBJS-$(CONFIG_MPC8536) += mpc8536_serdes.o
 COBJS  = traps.o cpu.o cpu_init.o speed.o interrupts.o tlb.o \
  pci.o serial_scc.o commproc.o ether_fcc.o qe_io.o \
  $(COBJS-y)
diff --git a/cpu/mpc85xx/cpu.c b/cpu/mpc85xx/cpu.c
index 5c2231d..2fe3cea 100644
--- a/cpu/mpc85xx/cpu.c
+++ b/cpu/mpc85xx/cpu.c
@@ -36,6 +36,8 @@ DECLARE_GLOBAL_DATA_PTR;
 struct cpu_type cpu_type_list [] = {
CPU_TYPE_ENTRY(8533, 8533),
CPU_TYPE_ENTRY(8533, 8533_E),
+   CPU_TYPE_ENTRY(8536, 8536),
+   CPU_TYPE_ENTRY(8536, 8536_E),
CPU_TYPE_ENTRY(8540, 8540),
CPU_TYPE_ENTRY(8541, 8541),
CPU_TYPE_ENTRY(8541, 8541_E),
@@ -89,6 +91,9 @@ int checkcpu (void)
svr = get_svr();
ver = SVR_SOC_VER(svr);
major = SVR_MAJ(svr);
+#ifdef CONFIG_MPC8536
+   major &= 0x7; /* the msb of this nibble is a mfg code */
+#endif
minor = SVR_MIN(svr);
 
puts("CPU:   ");
@@ -154,7 +159,8 @@ int checkcpu (void)
 #endif
clkdiv = lcrr & 0x0f;
if (clkdiv == 2 || clkdiv == 4 || clkdiv == 8) {
-#if defined(CONFIG_MPC8548) || defined(CONFIG_MPC8544) || 
defined(CONFIG_MPC8572)
+#if defined(CONFIG_MPC8548) || defined(CONFIG_MPC8544) || \
+defined(CONFIG_MPC8572) || defined(CONFIG_MPC8536)
/*
 * Yes, the entire PQ38 family use the same
 * bit-representation for twice the clock divider values.
diff --git a/cpu/mpc85xx/cpu_init.c b/cpu/mpc85xx/cpu_init.c
index 4feb751..783c5ba 100644
--- a/cpu/mpc85xx/cpu_init.c
+++ b/cpu/mpc85xx/cpu_init.c
@@ -37,6 +37,10 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#ifdef CONFIG_MPC8536
+extern void fsl_serdes_init(void);
+#endif
+
 #ifdef CONFIG_QE
 extern qe_iop_conf_t qe_iop_conf_tab[];
 extern void qe_config_iopin(u8 port, u8 pin, int dir,
@@ -240,6 +244,9 @@ void cpu_init_f (void)
/* Config QE ioports */
config_qe_ioports();
 #endif
+#if defined(CONFIG_MPC8536)
+   fsl_serdes_init();
+#endif
 
 }
 
diff --git a/cpu/mpc85xx/mpc8536_serdes.c b/cpu/mpc85xx/mpc8536_serdes.c
new file mode 100644
index 000..ae091e6
--- /dev/null
+++ b/cpu/mpc85xx/mpc8536_serdes.c
@@ -0,0 +1,180 @@
+/*
+ * Copyright (C) 2008 Freescale Semicondutor, Inc. All rights reserved.
+ * Dave Liu <[EMAIL PROTECTED]>
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+
+#include 
+#include 
+#include 
+#include 
+
+/* PORDEVSR register */
+#define GUTS_PORDEVSR_OFFS 0xc
+#define GUTS_PORDEVSR_SERDES2_IO_SEL   0x3800
+#define GUTS_PORDEVSR_SERDES2_IO_SEL_SHIFT 27
+
+/* SerDes CR0 register */
+#defineFSL_SRDSCR0_OFFS0x0
+#define FSL_SRDSCR0_TXEQA_MASK 0x7000
+#define FSL_SRDSCR0_TXEQA_SGMII0x4000
+#define FSL_SRDSCR0_TXEQA_SATA 0x1000
+#define FSL_SRDSCR0_TXEQE_MASK 0x0700
+#define FSL_SRDSCR0_TXEQE_SGMII0x0400
+#define FSL_SRDSCR0_TXEQE_SATA 0x0100
+
+/* SerDes CR1 register */
+#define FSL_SRDSCR1_OFFS   0x4
+#define FSL_SRDSCR1_LANEA_MASK 0x8020
+#define FSL_SRDSCR1_LANEA_OFF  0x8020
+#define FSL_SRDSCR1_LANEE_MASK 0x0802
+#define FSL_SRDSCR1_LANEE_OFF  0x0802
+
+/* SerDes CR2 register */
+#define FSL_SRDSCR2_OFFS   0x8
+#define FSL_SRDSCR2_EICA_MASK  0x1f00
+#define FSL_SRDSCR2_EICA_SGMII 0x0400
+#define FSL_SRDSCR2_EICA_SATA  0x1400
+#define FSL_SRDSCR2_EICE_MASK  0x001f
+#define FSL_SRDSCR2_EICE_SGMII 0x0004
+#define FSL_SRDSCR2_EICE_SATA  0x0014
+
+/* SerDes CR3 register */
+#define FSL_SRDSCR3_OFFS   0xc
+#define FSL_SRDSCR3_LANEA_MASK 0x3f000700
+#define FSL_SRDSCR3_LANEA_SGMII0x
+#define FSL_SRDSCR3_LANEA_SATA 0x15000500
+#define FSL_SRDSCR3_LANEE_MASK

[U-Boot] [PATCH 14/14] FSL DDR: Convert MPC8548CDS to new DDR code.

2008-08-12 Thread Kumar Gala
From: Jon Loeliger <[EMAIL PROTECTED]>

Signed-off-by: Jon Loeliger <[EMAIL PROTECTED]>
Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
---
 board/freescale/mpc8548cds/Makefile |1 +
 board/freescale/mpc8548cds/ddr.c|  268 +++
 board/freescale/mpc8548cds/mpc8548cds.c |   12 ++-
 include/configs/MPC8548CDS.h|   49 +--
 4 files changed, 318 insertions(+), 12 deletions(-)
 create mode 100644 board/freescale/mpc8548cds/ddr.c

diff --git a/board/freescale/mpc8548cds/Makefile 
b/board/freescale/mpc8548cds/Makefile
index 98f1530..c19a527 100644
--- a/board/freescale/mpc8548cds/Makefile
+++ b/board/freescale/mpc8548cds/Makefile
@@ -27,6 +27,7 @@ include $(TOPDIR)/config.mk
 LIB= $(obj)lib$(BOARD).a
 
 COBJS-y+= $(BOARD).o
+COBJS-y+= ddr.o
 COBJS-y+= law.o
 COBJS-y+= tlb.o
 
diff --git a/board/freescale/mpc8548cds/ddr.c b/board/freescale/mpc8548cds/ddr.c
new file mode 100644
index 000..6e2fd03
--- /dev/null
+++ b/board/freescale/mpc8548cds/ddr.c
@@ -0,0 +1,268 @@
+/*
+ * Copyright 2008 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * Version 2 as published by the Free Software Foundation.
+ */
+
+#include 
+#include 
+
+#include <../cpu/mpc8xxx/fsl_ddr_sdram.h>
+
+#define SDRAM_TYPE_DDR12
+#define SDRAM_TYPE_DDR23
+
+
+static void
+get_spd(ddr2_spd_eeprom_t *spd, unsigned char i2c_address)
+{
+   i2c_read(i2c_address, 0, 1, (uchar *)spd, sizeof(ddr2_spd_eeprom_t));
+}
+
+
+unsigned int
+fsl_ddr_sdram_get_mem_data_rate(void)
+{
+   return get_ddr_freq(0);
+}
+
+
+void
+fsl_ddr_sdram_get_spd(ddr2_spd_eeprom_t *ctrl_dimms_spd,
+ unsigned int ctrl_num)
+{
+   unsigned int i;
+
+   if (ctrl_num) {
+   printf("%s unexpected ctrl_num = %u\n", __FUNCTION__, ctrl_num);
+   return;
+   }
+
+   for (i = 0; i < CONFIG_DIMM_SLOTS_PER_CTLR; i++) {
+   get_spd(&(ctrl_dimms_spd[i]), SPD_EEPROM_ADDRESS1);
+   }
+}
+
+
+void
+fsl_ddr_sdram_dump_memctl_regs(unsigned int ctrl_num)
+{
+   unsigned int i;
+   volatile ccsr_ddr_t *ddr = (void *)CFG_MPC85xx_DDR_ADDR;
+
+   for (i = 0; i < CONFIG_CHIP_SELECTS_PER_CTRL; i++) {
+   unsigned int bnds = 0;
+   unsigned int config = 0;
+   unsigned int *pbnds = NULL;
+   unsigned int *pconfig = NULL;
+
+   if (i == 0) {
+   bnds = ddr->cs0_bnds;
+   config   = ddr->cs0_config;
+   pbnds= (unsigned int *)&ddr->cs0_bnds;
+   pconfig  = (unsigned int *)&ddr->cs0_config;
+
+   } else if (i == 1) {
+   bnds = ddr->cs1_bnds;
+   config   = ddr->cs1_config;
+   pbnds= (unsigned int *)&ddr->cs1_bnds;
+   pconfig  = (unsigned int *)&ddr->cs1_config;
+
+   } else if (i == 2) {
+   bnds = ddr->cs2_bnds;
+   config   = ddr->cs2_config;
+   pbnds= (unsigned int *)&ddr->cs2_bnds;
+   pconfig  = (unsigned int *)&ddr->cs2_config;
+
+   } else if (i == 3) {
+   bnds = ddr->cs3_bnds;
+   config   = ddr->cs3_config;
+   pbnds= (unsigned int *) &ddr->cs3_bnds;
+   pconfig  = (unsigned int *) &ddr->cs3_config;
+
+   } else {
+   /*
+* FIXME what happens if CONFIG_CHIP_SELECTS_PER_CTRL > 
4
+*/
+   }
+
+   printf("cs%u_bnds   = %08X\t%p\n", i, bnds, pbnds);
+   printf("cs%u_config = %08X\t%p\n", i, config, pconfig);
+   }
+
+   /*
+* Due to inconsistencies between immap_85xx.h and immap_86xx.h,
+* you will have to modify the structure member names by hand
+* between architectures.
+*/
+   printf("timing_cfg_3   = %08X\t%p\n",
+  ddr->timing_cfg_3, &ddr->timing_cfg_3);
+   printf("timing_cfg_0   = %08X\t%p\n",
+  ddr->timing_cfg_0, &ddr->timing_cfg_0);
+   printf("timing_cfg_1   = %08X\t%p\n",
+  ddr->timing_cfg_1, &ddr->timing_cfg_1);
+   printf("timing_cfg_2   = %08X\t%p\n",
+  ddr->timing_cfg_2, &ddr->timing_cfg_2);
+   printf("ddr_sdram_cfg  = %08X\t%p\n",
+  ddr->sdram_cfg, &ddr->sdram_cfg);
+   printf("ddr_sdram_cfg_2= %08X\t%p\n",
+  ddr->sdram_cfg_2, &ddr->sdram_cfg_2);
+   printf("ddr_sdram_mode = %08X\t%p\n",
+   ddr->sdram_mode, &ddr->sdram_mode);
+   printf("ddr_sdram_mode_2   = %08X\t%p\n",
+   ddr->sdram_mode_2, &ddr->sdram_mode

[U-Boot] [PATCH 13/14] FSL DDR: Convert MPC8568MDS to new DDR code.

2008-08-12 Thread Kumar Gala
From: Jon Loeliger <[EMAIL PROTECTED]>

Signed-off-by: Jon Loeliger <[EMAIL PROTECTED]>
Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
---
 board/freescale/mpc8568mds/Makefile |   14 +-
 board/freescale/mpc8568mds/ddr.c|  268 +++
 board/freescale/mpc8568mds/mpc8568mds.c |   12 ++-
 include/configs/MPC8568MDS.h|   49 +--
 4 files changed, 326 insertions(+), 17 deletions(-)
 create mode 100644 board/freescale/mpc8568mds/ddr.c

diff --git a/board/freescale/mpc8568mds/Makefile 
b/board/freescale/mpc8568mds/Makefile
index ecdc4d3..d499fb3 100644
--- a/board/freescale/mpc8568mds/Makefile
+++ b/board/freescale/mpc8568mds/Makefile
@@ -26,11 +26,15 @@ include $(TOPDIR)/config.mk
 
 LIB= $(obj)lib$(BOARD).a
 
-COBJS  := $(BOARD).o bcsr.o law.o tlb.o
-
-SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(COBJS))
-SOBJS  := $(addprefix $(obj),$(SOBJS))
+COBJS-y+= $(BOARD).o
+COBJS-y+= bcsr.o
+COBJS-y+= ddr.o
+COBJS-y+= law.o
+COBJS-y+= tlb.o
+
+SRCS   := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS-y))
+SOBJS  := $(addprefix $(obj),$(SOBJS-y))
 
 $(LIB):$(obj).depend $(OBJS) $(SOBJS)
$(AR) $(ARFLAGS) $@ $(OBJS)
diff --git a/board/freescale/mpc8568mds/ddr.c b/board/freescale/mpc8568mds/ddr.c
new file mode 100644
index 000..cb083f8
--- /dev/null
+++ b/board/freescale/mpc8568mds/ddr.c
@@ -0,0 +1,268 @@
+/*
+ * Copyright 2008 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * Version 2 as published by the Free Software Foundation.
+ */
+
+#include 
+#include 
+
+#include <../cpu/mpc8xxx/fsl_ddr_sdram.h>
+
+#define SDRAM_TYPE_DDR12
+#define SDRAM_TYPE_DDR23
+
+
+static void
+get_spd(ddr2_spd_eeprom_t *spd, unsigned char i2c_address)
+{
+   i2c_read(i2c_address, 0, 1, (uchar *)spd, sizeof(ddr2_spd_eeprom_t));
+}
+
+
+unsigned int
+fsl_ddr_sdram_get_mem_data_rate(void)
+{
+   return get_ddr_freq(0);
+}
+
+
+void
+fsl_ddr_sdram_get_spd(ddr2_spd_eeprom_t *ctrl_dimms_spd,
+ unsigned int ctrl_num)
+{
+   unsigned int i;
+
+   if (ctrl_num) {
+   printf("%s unexpected ctrl_num = %u\n", __FUNCTION__, ctrl_num);
+   return;
+   }
+
+   for (i = 0; i < CONFIG_DIMM_SLOTS_PER_CTLR; i++) {
+   get_spd(&(ctrl_dimms_spd[i]), SPD_EEPROM_ADDRESS1);
+   }
+}
+
+
+void
+fsl_ddr_sdram_dump_memctl_regs(unsigned int ctrl_num)
+{
+   unsigned int i;
+   volatile ccsr_ddr_t *ddr = (void *)CFG_MPC85xx_DDR_ADDR;
+
+   for (i = 0; i < CONFIG_CHIP_SELECTS_PER_CTRL; i++) {
+   unsigned int bnds = 0;
+   unsigned int config = 0;
+   unsigned int *pbnds = NULL;
+   unsigned int *pconfig = NULL;
+
+   if (i == 0) {
+   bnds = ddr->cs0_bnds;
+   config   = ddr->cs0_config;
+   pbnds= (unsigned int *)&ddr->cs0_bnds;
+   pconfig  = (unsigned int *)&ddr->cs0_config;
+
+   } else if (i == 1) {
+   bnds = ddr->cs1_bnds;
+   config   = ddr->cs1_config;
+   pbnds= (unsigned int *)&ddr->cs1_bnds;
+   pconfig  = (unsigned int *)&ddr->cs1_config;
+
+   } else if (i == 2) {
+   bnds = ddr->cs2_bnds;
+   config   = ddr->cs2_config;
+   pbnds= (unsigned int *)&ddr->cs2_bnds;
+   pconfig  = (unsigned int *)&ddr->cs2_config;
+
+   } else if (i == 3) {
+   bnds = ddr->cs3_bnds;
+   config   = ddr->cs3_config;
+   pbnds= (unsigned int *) &ddr->cs3_bnds;
+   pconfig  = (unsigned int *) &ddr->cs3_config;
+
+   } else {
+   /*
+* FIXME what happens if CONFIG_CHIP_SELECTS_PER_CTRL > 
4
+*/
+   }
+
+   printf("cs%u_bnds   = %08X\t%p\n", i, bnds, pbnds);
+   printf("cs%u_config = %08X\t%p\n", i, config, pconfig);
+   }
+
+   /*
+* Due to inconsistencies between immap_85xx.h and immap_86xx.h,
+* you will have to modify the structure member names by hand
+* between architectures.
+*/
+   printf("timing_cfg_3   = %08X\t%p\n",
+  ddr->timing_cfg_3, &ddr->timing_cfg_3);
+   printf("timing_cfg_0   = %08X\t%p\n",
+  ddr->timing_cfg_0, &ddr->timing_cfg_0);
+   printf("timing_cfg_1   = %08X\t%p\n",
+  ddr->timing_cfg_1, &ddr->timing_cfg_1);
+   printf("timing_cfg_2   = %08X\t%p\n",
+  ddr->timing_cfg_2, &ddr->timing_cfg_

[U-Boot] [PATCH 12/14] FSL DDR: Convert MPC8541CDS to new DDR code.

2008-08-12 Thread Kumar Gala
From: Jon Loeliger <[EMAIL PROTECTED]>

Signed-off-by: Jon Loeliger <[EMAIL PROTECTED]>
Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
---
 board/freescale/mpc8541cds/Makefile |1 +
 board/freescale/mpc8541cds/ddr.c|  317 +++
 board/freescale/mpc8541cds/mpc8541cds.c |   10 +-
 include/configs/MPC8541CDS.h|   44 -
 4 files changed, 362 insertions(+), 10 deletions(-)
 create mode 100644 board/freescale/mpc8541cds/ddr.c

diff --git a/board/freescale/mpc8541cds/Makefile 
b/board/freescale/mpc8541cds/Makefile
index 98f1530..c19a527 100644
--- a/board/freescale/mpc8541cds/Makefile
+++ b/board/freescale/mpc8541cds/Makefile
@@ -27,6 +27,7 @@ include $(TOPDIR)/config.mk
 LIB= $(obj)lib$(BOARD).a
 
 COBJS-y+= $(BOARD).o
+COBJS-y+= ddr.o
 COBJS-y+= law.o
 COBJS-y+= tlb.o
 
diff --git a/board/freescale/mpc8541cds/ddr.c b/board/freescale/mpc8541cds/ddr.c
new file mode 100644
index 000..452c060
--- /dev/null
+++ b/board/freescale/mpc8541cds/ddr.c
@@ -0,0 +1,317 @@
+/*
+ * Copyright 2008 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * Version 2 as published by the Free Software Foundation.
+ */
+
+#include 
+#include 
+
+#include <../cpu/mpc8xxx/fsl_ddr_sdram.h>
+
+#define SDRAM_TYPE_DDR12
+#define SDRAM_TYPE_DDR23
+#define SDRAM_TYPE_LPDDR1  6
+#define SDRAM_TYPE_DDR37
+
+
+static void
+get_spd(ddr1_spd_eeprom_t *spd, unsigned char i2c_address)
+{
+   i2c_read(i2c_address, 0, 1, (uchar *)spd, sizeof(ddr1_spd_eeprom_t));
+}
+
+
+unsigned int
+fsl_ddr_sdram_get_mem_data_rate(void)
+{
+   return get_ddr_freq(0);
+}
+
+
+void
+fsl_ddr_sdram_get_spd(ddr1_spd_eeprom_t *ctrl_dimms_spd,
+ unsigned int ctrl_num)
+{
+   unsigned int i;
+   unsigned int i2c_address = 0;
+
+   for (i = 0; i < CONFIG_DIMM_SLOTS_PER_CTLR; i++) {
+   if (ctrl_num == 0 && i == 0) {
+   i2c_address = SPD_EEPROM_ADDRESS1;
+   }
+   get_spd(&(ctrl_dimms_spd[i]), i2c_address);
+   }
+}
+
+
+void
+fsl_ddr_sdram_dump_memctl_regs(unsigned int ctrl_num)
+{
+   unsigned int i;
+   volatile ccsr_ddr_t *ddr;
+
+   if (ctrl_num == 0)
+   ddr = (void *)CFG_MPC85xx_DDR_ADDR;
+   else
+   ddr = (void *)CFG_MPC85xx_DDR2_ADDR;
+
+   for (i = 0; i < CONFIG_CHIP_SELECTS_PER_CTRL; i++) {
+   unsigned int bnds = 0;
+   unsigned int config = 0;
+   unsigned int config_2 = 0;
+   unsigned int *pbnds = NULL;
+   unsigned int *pconfig = NULL;
+   unsigned int *pconfig_2 = NULL;
+
+   if (i == 0) {
+   bnds = ddr->cs0_bnds;
+   config   = ddr->cs0_config;
+   config_2 = ddr->cs0_config_2;
+   pbnds= (unsigned int *)&ddr->cs0_bnds;
+   pconfig  = (unsigned int *)&ddr->cs0_config;
+   pconfig_2= (unsigned int *)&ddr->cs0_config_2;
+
+   } else if (i == 1) {
+   bnds = ddr->cs1_bnds;
+   config   = ddr->cs1_config;
+   config_2 = ddr->cs1_config_2;
+   pbnds= (unsigned int *)&ddr->cs1_bnds;
+   pconfig  = (unsigned int *)&ddr->cs1_config;
+   pconfig_2= (unsigned int *)&ddr->cs1_config_2;
+
+   } else if (i == 2) {
+   bnds = ddr->cs2_bnds;
+   config   = ddr->cs2_config;
+   config_2 = ddr->cs2_config_2;
+   pbnds= (unsigned int *)&ddr->cs2_bnds;
+   pconfig  = (unsigned int *)&ddr->cs2_config;
+   pconfig_2= (unsigned int *)&ddr->cs2_config_2;
+
+   } else if (i == 3) {
+   bnds = ddr->cs3_bnds;
+   config   = ddr->cs3_config;
+   config_2 = ddr->cs3_config_2;
+   pbnds= (unsigned int *) &ddr->cs3_bnds;
+   pconfig  = (unsigned int *) &ddr->cs3_config;
+   pconfig_2= (unsigned int *) &ddr->cs3_config_2;
+
+   } else {
+   /*
+* FIXME what happens if CONFIG_CHIP_SELECTS_PER_CTRL > 
4
+*/
+   }
+
+   printf("cs%u_bnds   = %08X\t%p\n", i, bnds, pbnds);
+   printf("cs%u_config = %08X\t%p\n", i, config, pconfig);
+   printf("cs%u_config_2   = %08X\t%p\n",
+  i, config_2, pconfig_2);
+   }
+
+   /*
+* Due to inconsistencies between immap_85xx.h and immap_86xx.h,
+* you will have to modify the structure member 

[U-Boot] [PATCH 11/14] FSL DDR: Convert MPC8555ADS to new DDR code.

2008-08-12 Thread Kumar Gala
From: Jon Loeliger <[EMAIL PROTECTED]>

Signed-off-by: Jon Loeliger <[EMAIL PROTECTED]>
Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
---
 board/freescale/mpc8555cds/Makefile |1 +
 board/freescale/mpc8555cds/ddr.c|  317 +++
 board/freescale/mpc8555cds/mpc8555cds.c |   12 +-
 include/configs/MPC8555CDS.h|   46 -
 4 files changed, 365 insertions(+), 11 deletions(-)
 create mode 100644 board/freescale/mpc8555cds/ddr.c

diff --git a/board/freescale/mpc8555cds/Makefile 
b/board/freescale/mpc8555cds/Makefile
index 98f1530..c19a527 100644
--- a/board/freescale/mpc8555cds/Makefile
+++ b/board/freescale/mpc8555cds/Makefile
@@ -27,6 +27,7 @@ include $(TOPDIR)/config.mk
 LIB= $(obj)lib$(BOARD).a
 
 COBJS-y+= $(BOARD).o
+COBJS-y+= ddr.o
 COBJS-y+= law.o
 COBJS-y+= tlb.o
 
diff --git a/board/freescale/mpc8555cds/ddr.c b/board/freescale/mpc8555cds/ddr.c
new file mode 100644
index 000..452c060
--- /dev/null
+++ b/board/freescale/mpc8555cds/ddr.c
@@ -0,0 +1,317 @@
+/*
+ * Copyright 2008 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * Version 2 as published by the Free Software Foundation.
+ */
+
+#include 
+#include 
+
+#include <../cpu/mpc8xxx/fsl_ddr_sdram.h>
+
+#define SDRAM_TYPE_DDR12
+#define SDRAM_TYPE_DDR23
+#define SDRAM_TYPE_LPDDR1  6
+#define SDRAM_TYPE_DDR37
+
+
+static void
+get_spd(ddr1_spd_eeprom_t *spd, unsigned char i2c_address)
+{
+   i2c_read(i2c_address, 0, 1, (uchar *)spd, sizeof(ddr1_spd_eeprom_t));
+}
+
+
+unsigned int
+fsl_ddr_sdram_get_mem_data_rate(void)
+{
+   return get_ddr_freq(0);
+}
+
+
+void
+fsl_ddr_sdram_get_spd(ddr1_spd_eeprom_t *ctrl_dimms_spd,
+ unsigned int ctrl_num)
+{
+   unsigned int i;
+   unsigned int i2c_address = 0;
+
+   for (i = 0; i < CONFIG_DIMM_SLOTS_PER_CTLR; i++) {
+   if (ctrl_num == 0 && i == 0) {
+   i2c_address = SPD_EEPROM_ADDRESS1;
+   }
+   get_spd(&(ctrl_dimms_spd[i]), i2c_address);
+   }
+}
+
+
+void
+fsl_ddr_sdram_dump_memctl_regs(unsigned int ctrl_num)
+{
+   unsigned int i;
+   volatile ccsr_ddr_t *ddr;
+
+   if (ctrl_num == 0)
+   ddr = (void *)CFG_MPC85xx_DDR_ADDR;
+   else
+   ddr = (void *)CFG_MPC85xx_DDR2_ADDR;
+
+   for (i = 0; i < CONFIG_CHIP_SELECTS_PER_CTRL; i++) {
+   unsigned int bnds = 0;
+   unsigned int config = 0;
+   unsigned int config_2 = 0;
+   unsigned int *pbnds = NULL;
+   unsigned int *pconfig = NULL;
+   unsigned int *pconfig_2 = NULL;
+
+   if (i == 0) {
+   bnds = ddr->cs0_bnds;
+   config   = ddr->cs0_config;
+   config_2 = ddr->cs0_config_2;
+   pbnds= (unsigned int *)&ddr->cs0_bnds;
+   pconfig  = (unsigned int *)&ddr->cs0_config;
+   pconfig_2= (unsigned int *)&ddr->cs0_config_2;
+
+   } else if (i == 1) {
+   bnds = ddr->cs1_bnds;
+   config   = ddr->cs1_config;
+   config_2 = ddr->cs1_config_2;
+   pbnds= (unsigned int *)&ddr->cs1_bnds;
+   pconfig  = (unsigned int *)&ddr->cs1_config;
+   pconfig_2= (unsigned int *)&ddr->cs1_config_2;
+
+   } else if (i == 2) {
+   bnds = ddr->cs2_bnds;
+   config   = ddr->cs2_config;
+   config_2 = ddr->cs2_config_2;
+   pbnds= (unsigned int *)&ddr->cs2_bnds;
+   pconfig  = (unsigned int *)&ddr->cs2_config;
+   pconfig_2= (unsigned int *)&ddr->cs2_config_2;
+
+   } else if (i == 3) {
+   bnds = ddr->cs3_bnds;
+   config   = ddr->cs3_config;
+   config_2 = ddr->cs3_config_2;
+   pbnds= (unsigned int *) &ddr->cs3_bnds;
+   pconfig  = (unsigned int *) &ddr->cs3_config;
+   pconfig_2= (unsigned int *) &ddr->cs3_config_2;
+
+   } else {
+   /*
+* FIXME what happens if CONFIG_CHIP_SELECTS_PER_CTRL > 
4
+*/
+   }
+
+   printf("cs%u_bnds   = %08X\t%p\n", i, bnds, pbnds);
+   printf("cs%u_config = %08X\t%p\n", i, config, pconfig);
+   printf("cs%u_config_2   = %08X\t%p\n",
+  i, config_2, pconfig_2);
+   }
+
+   /*
+* Due to inconsistencies between immap_85xx.h and immap_86xx.h,
+* you will have to modify the structure member 

[U-Boot] [PATCH 10/14] FSL DDR: Convert MPC8560ADS to new DDR code.

2008-08-12 Thread Kumar Gala
From: Jon Loeliger <[EMAIL PROTECTED]>

Signed-off-by: Jon Loeliger <[EMAIL PROTECTED]>
Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
---
 board/freescale/mpc8560ads/Makefile |   13 +-
 board/freescale/mpc8560ads/ddr.c|  296 +++
 board/freescale/mpc8560ads/mpc8560ads.c |   15 ++-
 include/configs/MPC8560ADS.h|   71 +---
 4 files changed, 362 insertions(+), 33 deletions(-)
 create mode 100644 board/freescale/mpc8560ads/ddr.c

diff --git a/board/freescale/mpc8560ads/Makefile 
b/board/freescale/mpc8560ads/Makefile
index 2d71cbc..67dbdeb 100644
--- a/board/freescale/mpc8560ads/Makefile
+++ b/board/freescale/mpc8560ads/Makefile
@@ -25,11 +25,14 @@ include $(TOPDIR)/config.mk
 
 LIB= $(obj)lib$(BOARD).a
 
-COBJS  := $(BOARD).o law.o tlb.o
-
-SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(COBJS))
-SOBJS  := $(addprefix $(obj),$(SOBJS))
+COBJS-y+= $(BOARD).o
+COBJS-y+= ddr.o
+COBJS-y+= law.o
+COBJS-y+= tlb.o
+
+SRCS   := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS-y))
+SOBJS  := $(addprefix $(obj),$(SOBJS-y))
 
 $(LIB):$(obj).depend $(OBJS) $(SOBJS)
$(AR) $(ARFLAGS) $@ $(OBJS)
diff --git a/board/freescale/mpc8560ads/ddr.c b/board/freescale/mpc8560ads/ddr.c
new file mode 100644
index 000..1414da9
--- /dev/null
+++ b/board/freescale/mpc8560ads/ddr.c
@@ -0,0 +1,296 @@
+/*
+ * Copyright 2008 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * Version 2 as published by the Free Software Foundation.
+ */
+
+#include 
+#include 
+
+#include <../cpu/mpc8xxx/fsl_ddr_sdram.h>
+
+#define SDRAM_TYPE_DDR12
+#define SDRAM_TYPE_DDR23
+#define SDRAM_TYPE_LPDDR1  6
+#define SDRAM_TYPE_DDR37
+
+
+static void
+get_spd(ddr1_spd_eeprom_t *spd, unsigned char i2c_address)
+{
+   i2c_read(i2c_address, 0, 1, (uchar *)spd, sizeof(ddr1_spd_eeprom_t));
+}
+
+
+unsigned int
+fsl_ddr_sdram_get_mem_data_rate(void)
+{
+   return get_ddr_freq(0);
+}
+
+
+void
+fsl_ddr_sdram_get_spd(ddr1_spd_eeprom_t *ctrl_dimms_spd,
+ unsigned int ctrl_num)
+{
+   unsigned int i;
+   unsigned int i2c_address = 0;
+
+   for (i = 0; i < CONFIG_DIMM_SLOTS_PER_CTLR; i++) {
+   if (ctrl_num == 0 && i == 0) {
+   i2c_address = SPD_EEPROM_ADDRESS1;
+   }
+   get_spd(&(ctrl_dimms_spd[i]), i2c_address);
+   }
+}
+
+
+void
+fsl_ddr_sdram_dump_memctl_regs(unsigned int ctrl_num)
+{
+   unsigned int i;
+   volatile ccsr_ddr_t *ddr;
+
+   if (ctrl_num == 0)
+   ddr = (void *)CFG_MPC85xx_DDR_ADDR;
+   else
+   ddr = (void *)CFG_MPC85xx_DDR2_ADDR;
+
+   for (i = 0; i < CONFIG_CHIP_SELECTS_PER_CTRL; i++) {
+   unsigned int bnds = 0;
+   unsigned int config = 0;
+   unsigned int config_2 = 0;
+   unsigned int *pbnds = NULL;
+   unsigned int *pconfig = NULL;
+   unsigned int *pconfig_2 = NULL;
+
+   if (i == 0) {
+   bnds = ddr->cs0_bnds;
+   config   = ddr->cs0_config;
+   config_2 = ddr->cs0_config_2;
+   pbnds= (unsigned int *)&ddr->cs0_bnds;
+   pconfig  = (unsigned int *)&ddr->cs0_config;
+   pconfig_2= (unsigned int *)&ddr->cs0_config_2;
+
+   } else if (i == 1) {
+   bnds = ddr->cs1_bnds;
+   config   = ddr->cs1_config;
+   config_2 = ddr->cs1_config_2;
+   pbnds= (unsigned int *)&ddr->cs1_bnds;
+   pconfig  = (unsigned int *)&ddr->cs1_config;
+   pconfig_2= (unsigned int *)&ddr->cs1_config_2;
+
+   } else if (i == 2) {
+   bnds = ddr->cs2_bnds;
+   config   = ddr->cs2_config;
+   config_2 = ddr->cs2_config_2;
+   pbnds= (unsigned int *)&ddr->cs2_bnds;
+   pconfig  = (unsigned int *)&ddr->cs2_config;
+   pconfig_2= (unsigned int *)&ddr->cs2_config_2;
+
+   } else if (i == 3) {
+   bnds = ddr->cs3_bnds;
+   config   = ddr->cs3_config;
+   config_2 = ddr->cs3_config_2;
+   pbnds= (unsigned int *) &ddr->cs3_bnds;
+   pconfig  = (unsigned int *) &ddr->cs3_config;
+   pconfig_2= (unsigned int *) &ddr->cs3_config_2;
+
+   } else {
+   /*
+* FIXME what happens if CONFIG_CHIP_SELECTS_PER_CTRL > 
4
+*/
+   }
+
+   printf("cs%u_bnds  

[U-Boot] [PATCH 06/14] FSL DDR: Convert MPC8641HPCN to new DDR code.

2008-08-12 Thread Kumar Gala
From: Jon Loeliger <[EMAIL PROTECTED]>

Signed-off-by: Jon Loeliger <[EMAIL PROTECTED]>
Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
---
 Makefile  |3 +
 board/freescale/mpc8641hpcn/Makefile  |8 +-
 board/freescale/mpc8641hpcn/ddr.c |  262 +
 board/freescale/mpc8641hpcn/mpc8641hpcn.c |5 +-
 cpu/mpc86xx/Makefile  |1 -
 include/configs/MPC8641HPCN.h |  117 +++--
 6 files changed, 335 insertions(+), 61 deletions(-)
 create mode 100644 board/freescale/mpc8641hpcn/ddr.c

diff --git a/Makefile b/Makefile
index 082b08e..c0c359f 100644
--- a/Makefile
+++ b/Makefile
@@ -237,6 +237,9 @@ endif
 ifeq ($(CPU),mpc85xx)
 LIBS += drivers/qe/qe.a
 endif
+ifeq ($(CPU),mpc86xx)
+LIBS += cpu/mpc8xxx/libmpc8xxx.a
+endif
 LIBS += drivers/rtc/librtc.a
 LIBS += drivers/serial/libserial.a
 LIBS += drivers/usb/libusb.a
diff --git a/board/freescale/mpc8641hpcn/Makefile 
b/board/freescale/mpc8641hpcn/Makefile
index c096e15..27d20a0 100644
--- a/board/freescale/mpc8641hpcn/Makefile
+++ b/board/freescale/mpc8641hpcn/Makefile
@@ -25,10 +25,12 @@ include $(TOPDIR)/config.mk
 
 LIB= $(obj)lib$(BOARD).a
 
-COBJS  := $(BOARD).o law.o
+COBJS-y+= $(BOARD).o
+COBJS-y+= law.o
+COBJS-y+= ddr.o
 
-SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(COBJS))
+SRCS   := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS-y))
 SOBJS  := $(addprefix $(obj),$(SOBJS))
 
 $(LIB):$(obj).depend $(OBJS) $(SOBJS)
diff --git a/board/freescale/mpc8641hpcn/ddr.c 
b/board/freescale/mpc8641hpcn/ddr.c
new file mode 100644
index 000..0116481
--- /dev/null
+++ b/board/freescale/mpc8641hpcn/ddr.c
@@ -0,0 +1,262 @@
+/*
+ * Copyright 2008 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * Version 2 as published by the Free Software Foundation.
+ */
+
+#include 
+#include 
+
+#include <../cpu/mpc8xxx/fsl_ddr_sdram.h>
+
+#define SDRAM_TYPE_DDR12
+#define SDRAM_TYPE_DDR23
+#define SDRAM_TYPE_LPDDR1  6
+#define SDRAM_TYPE_DDR37
+
+
+static void
+get_spd(ddr2_spd_eeprom_t *spd, unsigned char i2c_address)
+{
+   i2c_read(i2c_address, 0, 1, (uchar *)spd, sizeof(ddr2_spd_eeprom_t));
+}
+
+
+unsigned int
+fsl_ddr_sdram_get_mem_data_rate(void)
+{
+   return get_bus_freq(0);
+}
+
+
+void
+fsl_ddr_sdram_get_spd(ddr2_spd_eeprom_t *ctrl_dimms_spd,
+ unsigned int ctrl_num)
+{
+   unsigned int i;
+   unsigned int i2c_address = 0;
+
+   for (i = 0; i < CONFIG_DIMM_SLOTS_PER_CTLR; i++) {
+   if (ctrl_num == 0 && i == 0) {
+   i2c_address = SPD_EEPROM_ADDRESS1;
+   }
+   if (ctrl_num == 0 && i == 1) {
+   i2c_address = SPD_EEPROM_ADDRESS2;
+   }
+   if (ctrl_num == 1 && i == 0) {
+   i2c_address = SPD_EEPROM_ADDRESS3;
+   }
+   if (ctrl_num == 1 && i == 1) {
+   i2c_address = SPD_EEPROM_ADDRESS4;
+   }
+   get_spd(&(ctrl_dimms_spd[i]), i2c_address);
+   }
+}
+
+
+void
+fsl_ddr_sdram_dump_memctl_regs(unsigned int ctrl_num)
+{
+   unsigned int i;
+   volatile ccsr_ddr_t *ddr;
+
+   if (ctrl_num == 0)
+   ddr = (void *)CFG_MPC86xx_DDR_ADDR;
+   else
+   ddr = (void *)CFG_MPC86xx_DDR2_ADDR;
+
+   for (i = 0; i < CONFIG_CHIP_SELECTS_PER_CTRL; i++) {
+   unsigned int bnds = 0;
+   unsigned int config = 0;
+
+   if (i == 0) {
+   bnds = ddr->cs0_bnds;
+   config = ddr->cs0_config;
+
+   } else if (i == 1) {
+   bnds = ddr->cs1_bnds;
+   config = ddr->cs1_config;
+
+   } else if (i == 2) {
+   bnds = ddr->cs2_bnds;
+   config = ddr->cs2_config;
+
+   } else if (i == 3) {
+   bnds = ddr->cs3_bnds;
+   config = ddr->cs3_config;
+
+   } else {
+   /*
+* FIXME what happens when CONFIG_CHIP_SELECTS_PER_CTRL 
> 4
+*/
+   }
+
+   printf("cs%u_bnds   = %08X\n", i, bnds);
+   printf("cs%u_config = %08X\n", i, config);
+   }
+
+   printf("timing_cfg_3   = %08X\n", ddr->timing_cfg_3);
+   printf("timing_cfg_0   = %08X\n", ddr->timing_cfg_0);
+   printf("timing_cfg_1   = %08X\n", ddr->timing_cfg_1);
+   printf("timing_cfg_2   = %08X\n", ddr->timing_cfg_2);
+   printf("ddr_sdram_cfg  = %08X\n", ddr->sdram_cfg_1);
+   printf("ddr_sdram_cfg_2= %08X\n", ddr->sdram_cfg_2);
+   printf("ddr_sdram_mode 

[U-Boot] [PATCH 07/14] FSL DDR: Convert MPC8610HPCD to new DDR code.

2008-08-12 Thread Kumar Gala
From: Jon Loeliger <[EMAIL PROTECTED]>

Signed-off-by: Jon Loeliger <[EMAIL PROTECTED]>
Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
---
 board/freescale/mpc8610hpcd/Makefile  |   10 +-
 board/freescale/mpc8610hpcd/ddr.c |  254 +
 board/freescale/mpc8610hpcd/mpc8610hpcd.c |3 +-
 include/configs/MPC8610HPCD.h |   50 --
 4 files changed, 295 insertions(+), 22 deletions(-)
 create mode 100644 board/freescale/mpc8610hpcd/ddr.c

diff --git a/board/freescale/mpc8610hpcd/Makefile 
b/board/freescale/mpc8610hpcd/Makefile
index a457c32..dc97c33 100644
--- a/board/freescale/mpc8610hpcd/Makefile
+++ b/board/freescale/mpc8610hpcd/Makefile
@@ -23,14 +23,14 @@ include $(TOPDIR)/config.mk
 
 LIB= $(obj)lib$(BOARD).a
 
-COBJS  := $(BOARD).o law.o
+COBJS-y+= $(BOARD).o
+COBJS-y+= ddr.o
+COBJS-y+= law.o
 
 COBJS-${CONFIG_FSL_DIU_FB} += mpc8610hpcd_diu.o
 
-COBJS  += ${COBJS-y}
-
-SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(COBJS))
+SRCS   := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS-y))
 SOBJS  := $(addprefix $(obj),$(SOBJS))
 
 $(LIB):$(obj).depend $(OBJS) $(SOBJS)
diff --git a/board/freescale/mpc8610hpcd/ddr.c 
b/board/freescale/mpc8610hpcd/ddr.c
new file mode 100644
index 000..91c69ba
--- /dev/null
+++ b/board/freescale/mpc8610hpcd/ddr.c
@@ -0,0 +1,254 @@
+/*
+ * Copyright 2008 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * Version 2 as published by the Free Software Foundation.
+ */
+
+#include 
+#include 
+
+#include <../cpu/mpc8xxx/fsl_ddr_sdram.h>
+
+#define SDRAM_TYPE_DDR12
+#define SDRAM_TYPE_DDR23
+#define SDRAM_TYPE_LPDDR1  6
+#define SDRAM_TYPE_DDR37
+
+
+static void
+get_spd(ddr2_spd_eeprom_t *spd, unsigned char i2c_address)
+{
+   i2c_read(i2c_address, 0, 1, (uchar *)spd, sizeof(ddr2_spd_eeprom_t));
+}
+
+
+unsigned int
+fsl_ddr_sdram_get_mem_data_rate(void)
+{
+   return get_bus_freq(0);
+}
+
+
+void
+fsl_ddr_sdram_get_spd(ddr2_spd_eeprom_t *ctrl_dimms_spd,
+ unsigned int ctrl_num)
+{
+   unsigned int i;
+   unsigned int i2c_address = 0;
+
+   for (i = 0; i < CONFIG_DIMM_SLOTS_PER_CTLR; i++) {
+   if (ctrl_num == 0 && i == 0) {
+   i2c_address = SPD_EEPROM_ADDRESS1;
+   }
+   get_spd(&(ctrl_dimms_spd[i]), i2c_address);
+   }
+}
+
+
+void
+fsl_ddr_sdram_dump_memctl_regs(unsigned int ctrl_num)
+{
+   unsigned int i;
+   volatile ccsr_ddr_t *ddr;
+
+   if (ctrl_num == 0)
+   ddr = (void *)CFG_MPC86xx_DDR_ADDR;
+   else
+   ddr = (void *)CFG_MPC86xx_DDR2_ADDR;
+
+   for (i = 0; i < CONFIG_CHIP_SELECTS_PER_CTRL; i++) {
+   unsigned int bnds = 0;
+   unsigned int config = 0;
+
+   if (i == 0) {
+   bnds = ddr->cs0_bnds;
+   config = ddr->cs0_config;
+
+   } else if (i == 1) {
+   bnds = ddr->cs1_bnds;
+   config = ddr->cs1_config;
+
+   } else if (i == 2) {
+   bnds = ddr->cs2_bnds;
+   config = ddr->cs2_config;
+
+   } else if (i == 3) {
+   bnds = ddr->cs3_bnds;
+   config = ddr->cs3_config;
+
+   } else {
+   /*
+* FIXME what happens when CONFIG_CHIP_SELECTS_PER_CTRL 
> 4
+*/
+   }
+
+   printf("cs%u_bnds   = %08X\n", i, bnds);
+   printf("cs%u_config = %08X\n", i, config);
+   }
+
+   printf("timing_cfg_3   = %08X\n", ddr->timing_cfg_3);
+   printf("timing_cfg_0   = %08X\n", ddr->timing_cfg_0);
+   printf("timing_cfg_1   = %08X\n", ddr->timing_cfg_1);
+   printf("timing_cfg_2   = %08X\n", ddr->timing_cfg_2);
+   printf("ddr_sdram_cfg  = %08X\n", ddr->sdram_cfg_1);
+   printf("ddr_sdram_cfg_2= %08X\n", ddr->sdram_cfg_2);
+   printf("ddr_sdram_mode = %08X\n", ddr->sdram_mode_1);
+   printf("ddr_sdram_mode_2   = %08X\n", ddr->sdram_mode_2);
+   printf("ddr_sdram_interval = %08X\n", ddr->sdram_interval);
+   printf("ddr_data_init  = %08X\n", ddr->sdram_data_init);
+   printf("ddr_sdram_clk_cntl = %08X\n", ddr->sdram_clk_cntl);
+   printf("ddr_init_addr  = %08X\n", ddr->init_addr);
+}
+
+
+void
+fsl_ddr_sdram_set_memctl_regs(const fsl_memctl_config_regs_t *regs,
+ unsigned int ctrl_num)
+{
+   unsigned int i;
+   volatile ccsr_ddr_t *ddr;
+
+   switch (ctrl_num) {
+   case 0:
+   ddr = (void *)CFG_MPC86xx_DDR_ADDR;
+   break;
+   case 1:
+   ddr = (void *)CFG_MP

[U-Boot] [PATCH 08/14] FSL DDR: Convert MPC8544DS to new DDR code.

2008-08-12 Thread Kumar Gala
Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
---
 Makefile  |1 +
 board/freescale/mpc8544ds/Makefile|9 +-
 board/freescale/mpc8544ds/ddr.c   |  268 +
 board/freescale/mpc8544ds/mpc8544ds.c |   11 +-
 cpu/mpc85xx/Makefile  |2 +-
 include/configs/MPC8544DS.h   |   52 +--
 6 files changed, 324 insertions(+), 19 deletions(-)
 create mode 100644 board/freescale/mpc8544ds/ddr.c

diff --git a/Makefile b/Makefile
index c0c359f..138dffb 100644
--- a/Makefile
+++ b/Makefile
@@ -236,6 +236,7 @@ LIBS += drivers/qe/qe.a
 endif
 ifeq ($(CPU),mpc85xx)
 LIBS += drivers/qe/qe.a
+LIBS += cpu/mpc8xxx/libmpc8xxx.a
 endif
 ifeq ($(CPU),mpc86xx)
 LIBS += cpu/mpc8xxx/libmpc8xxx.a
diff --git a/board/freescale/mpc8544ds/Makefile 
b/board/freescale/mpc8544ds/Makefile
index 3a5ea00..3997994 100644
--- a/board/freescale/mpc8544ds/Makefile
+++ b/board/freescale/mpc8544ds/Makefile
@@ -26,10 +26,13 @@ include $(TOPDIR)/config.mk
 
 LIB= $(obj)lib$(BOARD).a
 
-COBJS  := $(BOARD).o law.o tlb.o
+COBJS-y+= $(BOARD).o
+COBJS-y+= ddr.o
+COBJS-y+= law.o
+COBJS-y+= tlb.o
 
-SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(COBJS))
+SRCS   := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS-y))
 SOBJS  := $(addprefix $(obj),$(SOBJS))
 
 $(LIB):$(obj).depend $(OBJS) $(SOBJS)
diff --git a/board/freescale/mpc8544ds/ddr.c b/board/freescale/mpc8544ds/ddr.c
new file mode 100644
index 000..6e2fd03
--- /dev/null
+++ b/board/freescale/mpc8544ds/ddr.c
@@ -0,0 +1,268 @@
+/*
+ * Copyright 2008 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * Version 2 as published by the Free Software Foundation.
+ */
+
+#include 
+#include 
+
+#include <../cpu/mpc8xxx/fsl_ddr_sdram.h>
+
+#define SDRAM_TYPE_DDR12
+#define SDRAM_TYPE_DDR23
+
+
+static void
+get_spd(ddr2_spd_eeprom_t *spd, unsigned char i2c_address)
+{
+   i2c_read(i2c_address, 0, 1, (uchar *)spd, sizeof(ddr2_spd_eeprom_t));
+}
+
+
+unsigned int
+fsl_ddr_sdram_get_mem_data_rate(void)
+{
+   return get_ddr_freq(0);
+}
+
+
+void
+fsl_ddr_sdram_get_spd(ddr2_spd_eeprom_t *ctrl_dimms_spd,
+ unsigned int ctrl_num)
+{
+   unsigned int i;
+
+   if (ctrl_num) {
+   printf("%s unexpected ctrl_num = %u\n", __FUNCTION__, ctrl_num);
+   return;
+   }
+
+   for (i = 0; i < CONFIG_DIMM_SLOTS_PER_CTLR; i++) {
+   get_spd(&(ctrl_dimms_spd[i]), SPD_EEPROM_ADDRESS1);
+   }
+}
+
+
+void
+fsl_ddr_sdram_dump_memctl_regs(unsigned int ctrl_num)
+{
+   unsigned int i;
+   volatile ccsr_ddr_t *ddr = (void *)CFG_MPC85xx_DDR_ADDR;
+
+   for (i = 0; i < CONFIG_CHIP_SELECTS_PER_CTRL; i++) {
+   unsigned int bnds = 0;
+   unsigned int config = 0;
+   unsigned int *pbnds = NULL;
+   unsigned int *pconfig = NULL;
+
+   if (i == 0) {
+   bnds = ddr->cs0_bnds;
+   config   = ddr->cs0_config;
+   pbnds= (unsigned int *)&ddr->cs0_bnds;
+   pconfig  = (unsigned int *)&ddr->cs0_config;
+
+   } else if (i == 1) {
+   bnds = ddr->cs1_bnds;
+   config   = ddr->cs1_config;
+   pbnds= (unsigned int *)&ddr->cs1_bnds;
+   pconfig  = (unsigned int *)&ddr->cs1_config;
+
+   } else if (i == 2) {
+   bnds = ddr->cs2_bnds;
+   config   = ddr->cs2_config;
+   pbnds= (unsigned int *)&ddr->cs2_bnds;
+   pconfig  = (unsigned int *)&ddr->cs2_config;
+
+   } else if (i == 3) {
+   bnds = ddr->cs3_bnds;
+   config   = ddr->cs3_config;
+   pbnds= (unsigned int *) &ddr->cs3_bnds;
+   pconfig  = (unsigned int *) &ddr->cs3_config;
+
+   } else {
+   /*
+* FIXME what happens if CONFIG_CHIP_SELECTS_PER_CTRL > 
4
+*/
+   }
+
+   printf("cs%u_bnds   = %08X\t%p\n", i, bnds, pbnds);
+   printf("cs%u_config = %08X\t%p\n", i, config, pconfig);
+   }
+
+   /*
+* Due to inconsistencies between immap_85xx.h and immap_86xx.h,
+* you will have to modify the structure member names by hand
+* between architectures.
+*/
+   printf("timing_cfg_3   = %08X\t%p\n",
+  ddr->timing_cfg_3, &ddr->timing_cfg_3);
+   printf("timing_cfg_0   = %08X\t%p\n",
+  ddr->timing_cfg_0, &ddr->timing_cfg_0);
+   printf("timing_cfg_1   = 

[U-Boot] [PATCH 09/14] FSL DDR: Convert MPC8540ADS to new DDR code.

2008-08-12 Thread Kumar Gala
Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
---
 board/freescale/mpc8540ads/Makefile |   13 +-
 board/freescale/mpc8540ads/ddr.c|  296 +++
 board/freescale/mpc8540ads/mpc8540ads.c |   16 ++-
 include/configs/MPC8540ADS.h|   70 +---
 4 files changed, 360 insertions(+), 35 deletions(-)
 create mode 100644 board/freescale/mpc8540ads/ddr.c

diff --git a/board/freescale/mpc8540ads/Makefile 
b/board/freescale/mpc8540ads/Makefile
index 2d71cbc..4c6da4d 100644
--- a/board/freescale/mpc8540ads/Makefile
+++ b/board/freescale/mpc8540ads/Makefile
@@ -25,11 +25,14 @@ include $(TOPDIR)/config.mk
 
 LIB= $(obj)lib$(BOARD).a
 
-COBJS  := $(BOARD).o law.o tlb.o
-
-SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(COBJS))
-SOBJS  := $(addprefix $(obj),$(SOBJS))
+COBJS-y+= $(BOARD).o
+COBJS-y+= ddr.o
+COBJS-y+= law.o
+COBJS-y+= tlb.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS-y))
+SOBJS  := $(addprefix $(obj),$(SOBJS-y))
 
 $(LIB):$(obj).depend $(OBJS) $(SOBJS)
$(AR) $(ARFLAGS) $@ $(OBJS)
diff --git a/board/freescale/mpc8540ads/ddr.c b/board/freescale/mpc8540ads/ddr.c
new file mode 100644
index 000..1414da9
--- /dev/null
+++ b/board/freescale/mpc8540ads/ddr.c
@@ -0,0 +1,296 @@
+/*
+ * Copyright 2008 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * Version 2 as published by the Free Software Foundation.
+ */
+
+#include 
+#include 
+
+#include <../cpu/mpc8xxx/fsl_ddr_sdram.h>
+
+#define SDRAM_TYPE_DDR12
+#define SDRAM_TYPE_DDR23
+#define SDRAM_TYPE_LPDDR1  6
+#define SDRAM_TYPE_DDR37
+
+
+static void
+get_spd(ddr1_spd_eeprom_t *spd, unsigned char i2c_address)
+{
+   i2c_read(i2c_address, 0, 1, (uchar *)spd, sizeof(ddr1_spd_eeprom_t));
+}
+
+
+unsigned int
+fsl_ddr_sdram_get_mem_data_rate(void)
+{
+   return get_ddr_freq(0);
+}
+
+
+void
+fsl_ddr_sdram_get_spd(ddr1_spd_eeprom_t *ctrl_dimms_spd,
+ unsigned int ctrl_num)
+{
+   unsigned int i;
+   unsigned int i2c_address = 0;
+
+   for (i = 0; i < CONFIG_DIMM_SLOTS_PER_CTLR; i++) {
+   if (ctrl_num == 0 && i == 0) {
+   i2c_address = SPD_EEPROM_ADDRESS1;
+   }
+   get_spd(&(ctrl_dimms_spd[i]), i2c_address);
+   }
+}
+
+
+void
+fsl_ddr_sdram_dump_memctl_regs(unsigned int ctrl_num)
+{
+   unsigned int i;
+   volatile ccsr_ddr_t *ddr;
+
+   if (ctrl_num == 0)
+   ddr = (void *)CFG_MPC85xx_DDR_ADDR;
+   else
+   ddr = (void *)CFG_MPC85xx_DDR2_ADDR;
+
+   for (i = 0; i < CONFIG_CHIP_SELECTS_PER_CTRL; i++) {
+   unsigned int bnds = 0;
+   unsigned int config = 0;
+   unsigned int config_2 = 0;
+   unsigned int *pbnds = NULL;
+   unsigned int *pconfig = NULL;
+   unsigned int *pconfig_2 = NULL;
+
+   if (i == 0) {
+   bnds = ddr->cs0_bnds;
+   config   = ddr->cs0_config;
+   config_2 = ddr->cs0_config_2;
+   pbnds= (unsigned int *)&ddr->cs0_bnds;
+   pconfig  = (unsigned int *)&ddr->cs0_config;
+   pconfig_2= (unsigned int *)&ddr->cs0_config_2;
+
+   } else if (i == 1) {
+   bnds = ddr->cs1_bnds;
+   config   = ddr->cs1_config;
+   config_2 = ddr->cs1_config_2;
+   pbnds= (unsigned int *)&ddr->cs1_bnds;
+   pconfig  = (unsigned int *)&ddr->cs1_config;
+   pconfig_2= (unsigned int *)&ddr->cs1_config_2;
+
+   } else if (i == 2) {
+   bnds = ddr->cs2_bnds;
+   config   = ddr->cs2_config;
+   config_2 = ddr->cs2_config_2;
+   pbnds= (unsigned int *)&ddr->cs2_bnds;
+   pconfig  = (unsigned int *)&ddr->cs2_config;
+   pconfig_2= (unsigned int *)&ddr->cs2_config_2;
+
+   } else if (i == 3) {
+   bnds = ddr->cs3_bnds;
+   config   = ddr->cs3_config;
+   config_2 = ddr->cs3_config_2;
+   pbnds= (unsigned int *) &ddr->cs3_bnds;
+   pconfig  = (unsigned int *) &ddr->cs3_config;
+   pconfig_2= (unsigned int *) &ddr->cs3_config_2;
+
+   } else {
+   /*
+* FIXME what happens if CONFIG_CHIP_SELECTS_PER_CTRL > 
4
+*/
+   }
+
+   printf("cs%u_bnds   = %08X\t%p\n", i, bnds, pbnds);
+   printf("cs%u_config = %08

[U-Boot] [PATCH 01/14] Add proper SPD definitions for DDR1/2/3

2008-08-12 Thread Kumar Gala
From: James Yang <[EMAIL PROTECTED]>

Also added a few helper functions for DDR1 & DDR2 to print SPD info and
verify the checksum.

Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
---
 common/Makefile   |1 +
 common/ddr_spd.c  |  498 +
 include/ddr_spd.h |  249 ++
 3 files changed, 748 insertions(+), 0 deletions(-)
 create mode 100644 common/ddr_spd.c
 create mode 100644 include/ddr_spd.h

diff --git a/common/Makefile b/common/Makefile
index 4287108..3ea4abf 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -144,6 +144,7 @@ COBJS-y += cmd_mac.o
 COBJS-$(CONFIG_CMD_MFSL) += cmd_mfsl.o
 COBJS-$(CONFIG_MP) += cmd_mp.o
 COBJS-$(CONFIG_CMD_SF) += cmd_sf.o
+COBJS-$(CONFIG_DDR_SPD) += ddr_spd.o
 
 COBJS  := $(COBJS-y)
 SRCS   := $(AOBJS:.o=.S) $(COBJS:.o=.c)
diff --git a/common/ddr_spd.c b/common/ddr_spd.c
new file mode 100644
index 000..e4be34f
--- /dev/null
+++ b/common/ddr_spd.c
@@ -0,0 +1,498 @@
+/*
+ * Copyright 2008 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * Version 2 as published by the Free Software Foundation.
+ */
+
+#include 
+#include 
+
+void
+ddr1_spd_dump(const ddr1_spd_eeprom_t *spd)
+{
+   unsigned int i;
+
+   printf("%-3d: %02x %s\n",
+  0, spd->info_size,
+  " spd->info_size,   *  0 # bytes written into serial memory *");
+   printf("%-3d: %02x %s\n",
+  1, spd->chip_size,
+  " spd->chip_size,   *  1 Total # bytes of SPD memory device *");
+   printf("%-3d: %02x %s\n",
+  2, spd->mem_type,
+  " spd->mem_type,*  2 Fundamental memory type *");
+   printf("%-3d: %02x %s\n",
+  3, spd->nrow_addr,
+  " spd->nrow_addr,   *  3 # of Row Addresses on this assembly *");
+   printf("%-3d: %02x %s\n",
+  4, spd->ncol_addr,
+  " spd->ncol_addr,   *  4 # of Column Addrs on this assembly *");
+   printf("%-3d: %02x %s\n",
+  5, spd->nrows,
+  " spd->nrows*  5 # of DIMM Banks *");
+   printf("%-3d: %02x %s\n",
+  6, spd->dataw_lsb,
+  " spd->dataw_lsb,   *  6 Data Width lsb of this assembly *");
+   printf("%-3d: %02x %s\n",
+  7, spd->dataw_msb,
+  " spd->dataw_msb,   *  7 Data Width msb of this assembly *");
+   printf("%-3d: %02x %s\n",
+  8, spd->voltage,
+  " spd->voltage, *  8 Voltage intf std of this assembly *");
+   printf("%-3d: %02x %s\n",
+  9, spd->clk_cycle,
+  " spd->clk_cycle,   *  9 SDRAM Cycle time at CL=X *");
+   printf("%-3d: %02x %s\n",
+  10, spd->clk_access,
+  " spd->clk_access,  * 10 SDRAM Access from Clock at CL=X *");
+   printf("%-3d: %02x %s\n",
+  11, spd->config,
+  " spd->config,  * 11 DIMM Configuration type *");
+   printf("%-3d: %02x %s\n",
+  12, spd->refresh,
+  " spd->refresh, * 12 Refresh Rate/Type *");
+   printf("%-3d: %02x %s\n",
+  13, spd->primw,
+  " spd->primw,   * 13 Primary SDRAM Width *");
+   printf("%-3d: %02x %s\n",
+  14, spd->ecw,
+  " spd->ecw, * 14 Error Checking SDRAM width *");
+   printf("%-3d: %02x %s\n",
+  15, spd->min_delay,
+  " spd->min_delay,   * 15 Back to Back Random Access *");
+   printf("%-3d: %02x %s\n",
+  16, spd->burstl,
+  " spd->burstl,  * 16 Burst Lengths Supported *");
+   printf("%-3d: %02x %s\n",
+  17, spd->nbanks,
+  " spd->nbanks,  * 17 # of Banks on Each SDRAM Device *");
+   printf("%-3d: %02x %s\n",
+  18, spd->cas_lat,
+  " spd->cas_lat, * 18 CAS# Latencies Supported *");
+   printf("%-3d: %02x %s\n",
+  19, spd->cs_lat,
+  " spd->cs_lat,  * 19 Chip Select Latency *");
+   printf("%-3d: %02x %s\n",
+  20, spd->write_lat,
+  " spd->write_lat,   * 20 Write Latency/Recovery *");
+   printf("%-3d: %02x %s\n",
+  21, spd->mod_attr,
+  " spd->mod_attr,* 21 SDRAM Module Attributes *");
+   printf("%-3d: %02x %s\n",
+  22, spd->dev_attr,
+  " spd->dev_attr,* 22 SDRAM Device Attributes *");
+   printf("%-3d: %02x %s\n",
+  23, spd->clk_cycle2,
+  " spd->clk_cycle2,  * 23 Min SDRAM Cycle time at CL=X-1 *");
+   printf("%-3d: %02x %s\n",
+  24, spd->clk_access2,
+  " spd->clk_access2, * 24 SDRAM Access from Clock at CL=X-1 *");
+   printf("%-3d: %02x %s\n",
+

[U-Boot] [PATCH 05/14] FSL DDR: Add e500 TLB helper for DDR code

2008-08-12 Thread Kumar Gala
Provide a helper function that board code can call to map TLBs when
setting up DDR.

Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
---
 cpu/mpc85xx/tlb.c |   63 +
 include/asm-ppc/mmu.h |1 +
 2 files changed, 64 insertions(+), 0 deletions(-)

diff --git a/cpu/mpc85xx/tlb.c b/cpu/mpc85xx/tlb.c
index 3d15d50..63f34e6 100644
--- a/cpu/mpc85xx/tlb.c
+++ b/cpu/mpc85xx/tlb.c
@@ -90,3 +90,66 @@ void init_tlbs(void)
 
return ;
 }
+
+unsigned int setup_ddr_tlbs(unsigned int memsize_in_meg)
+{
+   unsigned int tlb_size;
+   unsigned int ram_tlb_index;
+   unsigned int ram_tlb_address;
+
+   /*
+* Determine size of each TLB1 entry.
+*/
+   switch (memsize_in_meg) {
+   case 16:
+   case 32:
+   tlb_size = BOOKE_PAGESZ_16M;
+   break;
+   case 64:
+   case 128:
+   tlb_size = BOOKE_PAGESZ_64M;
+   break;
+   case 256:
+   case 512:
+   tlb_size = BOOKE_PAGESZ_256M;
+   break;
+   case 1024:
+   case 2048:
+   if (PVR_VER(get_pvr()) > PVR_VER(PVR_85xx))
+   tlb_size = BOOKE_PAGESZ_1G;
+   else
+   tlb_size = BOOKE_PAGESZ_256M;
+   break;
+   default:
+   puts("DDR: only 16M,32M,64M,128M,256M,512M,1G and 2G are 
supported.\n");
+
+   /*
+* The memory was not able to be mapped.
+* Default to a small size.
+*/
+   tlb_size = BOOKE_PAGESZ_64M;
+   memsize_in_meg = 64;
+   break;
+   }
+
+   /*
+* Configure DDR TLB1 entries.
+* Starting at TLB1 8, use no more than 8 TLB1 entries.
+*/
+   ram_tlb_index = 8;
+   ram_tlb_address = (unsigned int)CFG_DDR_SDRAM_BASE;
+   while (ram_tlb_address < (memsize_in_meg * 1024 * 1024)
+ && ram_tlb_index < 16) {
+   set_tlb(1, ram_tlb_address, ram_tlb_address,
+   MAS3_SX|MAS3_SW|MAS3_SR, 0,
+   0, ram_tlb_index, tlb_size, 1);
+
+   ram_tlb_address += (0x1000 << ((tlb_size - 1) * 2));
+   ram_tlb_index++;
+   }
+
+   /*
+* Confirm that the requested amount of memory was mapped.
+*/
+   return memsize_in_meg;
+}
diff --git a/include/asm-ppc/mmu.h b/include/asm-ppc/mmu.h
index 050a7b6..8975e6c 100644
--- a/include/asm-ppc/mmu.h
+++ b/include/asm-ppc/mmu.h
@@ -431,6 +431,7 @@ extern void set_tlb(u8 tlb, u32 epn, u64 rpn,
 extern void disable_tlb(u8 esel);
 extern void invalidate_tlb(u8 tlb);
 extern void init_tlbs(void);
+extern unsigned int setup_ddr_tlbs(unsigned int memsize_in_meg);
 
 #define SET_TLB_ENTRY(_tlb, _epn, _rpn, _perms, _wimge, _ts, _esel, _sz, 
_iprot) \
{ .tlb = _tlb, .epn = _epn, .rpn = _rpn, .perms = _perms, \
-- 
1.5.5.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 03/14] FSL DDR: Add interactive DDR config support

2008-08-12 Thread Kumar Gala
Provide a mechanism to allow interactive configuration of DDR params.  This
is useful when trying to test various DDR settings to determine optimal
configuration values for a given board.

Signed-off-by: James Yang <[EMAIL PROTECTED]>
Signed-off-by: Jon Loeliger <[EMAIL PROTECTED]>
Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
---
 cpu/mpc8xxx/Makefile  |1 +
 cpu/mpc8xxx/fsl_ddr_interactive.c | 1280 +
 cpu/mpc8xxx/fsl_ddr_sdram.c   |   10 +
 cpu/mpc8xxx/fsl_ddr_sdram.h   |3 +
 4 files changed, 1294 insertions(+), 0 deletions(-)
 create mode 100644 cpu/mpc8xxx/fsl_ddr_interactive.c

diff --git a/cpu/mpc8xxx/Makefile b/cpu/mpc8xxx/Makefile
index 30f81ff..0ceac5b 100644
--- a/cpu/mpc8xxx/Makefile
+++ b/cpu/mpc8xxx/Makefile
@@ -10,6 +10,7 @@ include $(TOPDIR)/config.mk
 
 LIB= $(obj)libmpc8xxx.a
 
+COBJS-$(CONFIG_FSL_DDR_INTERACTIVE)+= fsl_ddr_interactive.o
 COBJS-$(CONFIG_FSL_DDR1)   += fsl_ddr_sdram.o
 COBJS-$(CONFIG_FSL_DDR1)   += fsl_ddr1.o
 
diff --git a/cpu/mpc8xxx/fsl_ddr_interactive.c 
b/cpu/mpc8xxx/fsl_ddr_interactive.c
new file mode 100644
index 000..ee2ae6b
--- /dev/null
+++ b/cpu/mpc8xxx/fsl_ddr_interactive.c
@@ -0,0 +1,1280 @@
+/*
+ * Copyright 2008 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * Version 2 as published by the Free Software Foundation.
+ */
+
+/*
+ * Generic driver for Freescale DDR/DDR2/DDR3 memory controller.
+ * Based on code from spd_sdram.c
+ * Author: James Yang [at freescale.com]
+ */
+
+#include 
+#include 
+
+#include "fsl_ddr_sdram.h"
+/*
+ * Option parameter Structures
+ */
+typedef struct {
+   const char *option_name;
+   unsigned long long *pointer;
+} options_strings_ulonglong_t;
+
+typedef struct {
+   const char *option_name;
+   unsigned int *pointer;
+} options_strings_uint_t;
+
+
+extern int do_reset(void *cmdtp, int flag, int argc, char *argv[]);
+
+/*
+ * interactive prompt
+ */
+
+static int is_a_num_char(const char c)
+{
+   return c >= '0' && c <= '9';
+}
+
+static unsigned int picos_to_mhz(unsigned int picos)
+{
+   return 100 / picos;
+}
+
+static int
+handle_uint_option_table(options_strings_uint_t *table,
+int table_size,
+const char *opt,
+const char *val)
+{
+   unsigned int i;
+   unsigned int value;
+
+   for (i = 0; i < table_size; i++) {
+   if (strcmp(table[i].option_name, opt) == 0) {
+   value = simple_strtoul(val, NULL, 0);
+   *table[i].pointer = value;
+   return 1;
+   }
+   }
+
+   return 0;
+}
+
+
+static int
+handle_ull_option_table(options_strings_ulonglong_t *table,
+   int table_size,
+   const char *opt,
+   const char *val)
+{
+   unsigned int i;
+   unsigned long long value;
+
+   for (i = 0; i < table_size; i++) {
+   if (strcmp(table[i].option_name, opt) == 0) {
+   value = simple_strtoull(val, NULL, 0);
+   *table[i].pointer = value;
+   return 1;
+   }
+   }
+
+   return 0;
+}
+
+static void
+fsl_ddr_sdram_generic_edit(void *pdata,
+  void *pend,
+  unsigned int element_size,
+  unsigned int element_num,
+  unsigned int value)
+{
+   char *pcdata = (char *)pdata;   /* BIG ENDIAN ONLY */
+
+   pcdata += element_num * element_size;
+   if ((pcdata + element_size) > (char *) pend) {
+   debug("trying to write past end of data\n");
+   return;
+   }
+
+   switch (element_size) {
+   case 1:
+   asm volatile ("stb %0,0(%1)" : : "r" (value) , "b" (pcdata));
+   break;
+   case 2:
+   asm volatile ("sth %0,0(%1)" : : "r" (value) , "b" (pcdata));
+   break;
+   case 4:
+   asm volatile ("stw %0,0(%1)" : : "r" (value) , "b" (pcdata));
+   break;
+   default:
+   debug("unexpected element size %u\n", element_size);
+   break;
+   }
+}
+
+
+static void
+fsl_ddr_sdram_spd_edit(fsl_ddr_sdram_info_t *pinfo,
+  unsigned int ctrl_num,
+  unsigned int dimm_num,
+  unsigned int element_num,
+  unsigned int value)
+{
+   generic_spd_eeprom_t *pspd;
+
+   pspd = &(pinfo->spd_installed_dimms[ctrl_num][dimm_num]);
+   fsl_ddr_sdram_generic_edit(pspd, pspd + 1,
+  sizeof(char), element_num, value);
+}
+
+static void
+fsl_ddr_sdram_lowest_common_dimm_parameters_edit(fsl_ddr_sdram_info_t *pinfo,
+  

[U-Boot] [PATCH 04/14] FSL DDR: Provide a generic fsl_ddr_sdram_set_lawbar()

2008-08-12 Thread Kumar Gala
Make fsl_ddr_sdram_set_lawbar() a weak function to allow board code to
override if desired.

Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
---
 drivers/misc/fsl_law.c |   87 
 1 files changed, 87 insertions(+), 0 deletions(-)

diff --git a/drivers/misc/fsl_law.c b/drivers/misc/fsl_law.c
index 48ece4f..37af297 100644
--- a/drivers/misc/fsl_law.c
+++ b/drivers/misc/fsl_law.c
@@ -121,6 +121,93 @@ void print_laws(void)
return;
 }
 
+#if defined(CONFIG_FSL_DDR1) || \
+defined(CONFIG_FSL_DDR2) || \
+defined(CONFIG_FSL_DDR3)
+#include <../cpu/mpc8xxx/fsl_ddr_sdram.h>
+
+/* use up to 2 LAWs for DDR, used the last available LAWs */
+int __set_ddr_laws(u64 start, u64 sz, enum law_trgt_if id)
+{
+   u64 start_align, law_sz;
+   int law_sz_enc;
+
+   if (start == 0)
+   start_align = 1ull << (LAW_SIZE_32G + 1);
+   else
+   start_align = 1ull << (ffs64(start) - 1);
+   law_sz = min(start_align, sz);
+   law_sz_enc = __ilog2_u64(law_sz) - 1;
+
+   if (set_last_law(start, law_sz_enc, id) < 0)
+   return -1;
+
+   /* do we still have anything to map */
+   sz = sz - law_sz;
+   if (sz) {
+   start += law_sz;
+
+   start_align = 1ull << (ffs64(start) - 1);
+   law_sz = min(start_align, sz);
+   law_sz_enc = __ilog2_u64(law_sz) - 1;
+
+   if (set_last_law(start, law_sz_enc, id) < 0)
+   return -1;
+   } else {
+   return 0;
+   }
+
+   /* do we still have anything to map */
+   sz = sz - law_sz;
+   if (sz)
+   return 1;
+
+   return 0;
+}
+
+void
+__fsl_ddr_sdram_set_lawbar(const common_timing_params_t *memctl_common_params,
+  unsigned int memctl_interleaved,
+  unsigned int ctrl_num)
+{
+   /*
+* If no DIMMs on this controller, do not proceed any further.
+*/
+   if (!memctl_common_params->ndimms_present) {
+   return;
+   }
+
+   if (ctrl_num == 0) {
+   /*
+* Set up LAW for DDR controller 1 space.
+*/
+   unsigned int lawbar1_target_id = memctl_interleaved
+   ? LAW_TRGT_IF_DDR_INTRLV : LAW_TRGT_IF_DDR_1;
+
+   if (__set_ddr_laws(memctl_common_params->base_address,
+   memctl_common_params->total_mem,
+   lawbar1_target_id) < 0) {
+   printf("ERROR\n");
+   return ;
+   }
+   } else if (ctrl_num == 1) {
+   if (__set_ddr_laws(memctl_common_params->base_address,
+   memctl_common_params->total_mem,
+   LAW_TRGT_IF_DDR_2) < 0) {
+   printf("ERROR\n");
+   return ;
+   }
+   } else {
+   printf("unexpected controller number %u in 
fsl_ddr_sdram_set_lawbar()\n", ctrl_num);
+   }
+}
+
+__attribute__((weak, alias("__fsl_ddr_sdram_set_lawbar"))) void
+fsl_ddr_sdram_set_lawbar(const common_timing_params_t *memctl_common_params,
+unsigned int memctl_interleaved,
+unsigned int ctrl_num);
+#endif
+
 void init_laws(void)
 {
int i;
-- 
1.5.5.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [Fwd: Re: mvbc_p board: build warnings]

2008-08-12 Thread André Schwarz

sorry - wrong list address.

 Original Message 
Subject:Re: mvbc_p board: build warnings
Date:   Tue, 12 Aug 2008 17:38:28 +0200
From:   André Schwarz <[EMAIL PROTECTED]>
To: Wolfgang Denk <[EMAIL PROTECTED]>
CC: [EMAIL PROTECTED]
References: 	<[EMAIL PROTECTED]> 
<[EMAIL PROTECTED]> 
<[EMAIL PROTECTED]>




Wolfgang,

sorry for this - it's been quite a mess before my holiday.

I'll be back in office next week and won't be able to fix it before mid 
of next week.


I have absolutely no problem if you do not wait for the patch.
Maybe there will be other changes also ...


regards,
André

Wolfgang Denk wrote:

Dear André,

in message <[EMAIL PROTECTED]> you wrote:
  
thanks - I'll fix it on monday/tuesday and send a patch after testing 
the -rc2.



Maybe I have missed your patch?

This problem is still open!

I have to decide if you fix this now, i. e. wait with the 1.3.4
release, or later.

Best regards,

Wolfgang Denk

  




MATRIX VISION GmbH, Talstraße 16, DE-71570 Oppenweiler  - Registergericht: 
Amtsgericht Stuttgart, HRB 271090
Geschäftsführer: Gerhard Thullner, Werner Armingeon, Uwe Furtner
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Xilinx FX12MM Board - xparameters.h

2008-08-12 Thread Ricardo
Hello Georg


> for example i copy the xparameters.h to the new board/xilinx/fx12mm
> directory, but also in board/xilinx/common and board/xilinx/xilinx_enet.
>
> this is not correct, or ?  i think there is something wrong in the
> configuration, so the compiler did not found the file in
> board/xilinx/fx12mm ?

   Instad of doing that you can add this line to you config file

#include "../board/xilinx/ml507/xparameters.h"








-- 
Ricardo Ribalda
http://www.eps.uam.es/~rribalda/
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] i.MX31: switch to CFG_HZ=1000

2008-08-12 Thread Magnus Lilja
Hi,

On Tue, Aug 12, 2008 at 1:42 PM, Guennadi Liakhovetski <[EMAIL PROTECTED]> 
wrote:
> Switch to the standard CFG_HZ=1000 value, while at it, minor white-space
> cleanup, remove CFG_CLKS_IN_HZ from config-headers. Tested on mx31ads,
> provides 2% or 0.4% precision depending on the
> CONFIG_MX31_TIMER_HIGH_PRECISION flag. Measured with stop-watch on 100s
> boot-delay.
>
> Signed-off-by: Guennadi Liakhovetski <[EMAIL PROTECTED]>
> ---
>
> Based on the current arm/next + the "i.MX31: Add reset_timer() and modify
> get_timer_masked()" patch from Magnus Lilja. Tests on other i.MX31 boards
> requested!

Litekit seems to be OK. Tested with stop-watch on 100s boot-delay
without the HIGH_PRECISION flag, better than 2% precision.


Regards, Magnus
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] boots (subcommands)

2008-08-12 Thread Kumar Gala
So after refactoring the bootm code I get to the following "sub  
command set":

* interrupt on/off (to enable/disable interrupts)
* icache/dcache (already exists)
* usb stop (already exists)
* boots (boot sub command):
start  - takes same args as bootm, parses the args and sets up  
bootm_headers_t
load_os - decompresses and loads OS image
relocate_initrd - relocates initrd based on constraints
relocate_fdt- relocates fdt based on constraints
jump

(load_os, relocate_initrd, relocate_fdt, jump will fail if start has  
been called, beyond that they can be called in any order and its left  
to the user to do the right thing).

* fdt:
chosen -- expand to allow setting initrd info
boardsetup -- exists
resize - new

We might need one or two other commands to prep things for the OS and  
some bd related foo.

- k
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] ppc4xx: Optimize PLB4 arbiter and Memory Queue settings for PPC 440SP/SPe and 460EX/GT/SX

2008-08-12 Thread Stefan Roese
On Tuesday 12 August 2008, Prodyut Hazarika wrote:
> Thanks Stefan. Please see replies below.
>
> > Patch is line-wrapped this time. I suggest that you use git-send-email to
> > send your git formatted patches.
>
> I will use git-send-email next time to avoid these issues

Good.

> >> +defined (CONFIG_460GT) || defined(CONFIG_460SX)
> >
> >No space after "defined" please. -> "defined("
>
> Sorry about that. I will be careful in future.
>
> >> +#if defined(CONFIG_440SP) || defined(CONFIG_440SPE) || \
> >> +defined(CONFIG_460EX) || defined(CONFIG_460GT)  || \
> >> +defined(CONFIG_405EX) || defined(CONFIG_460SX)
> >
> > Why don't you add 440GP and 440GX here? From my understanding they would
> > benefit from this pipeline change too.
>
> 400GP/GX have a slightly different register layout. I plan to make a
> separate patch adding the defines and the changes in a separate patch.

That's what I thought. OK.

> >> +#define plb0_revid(PLB_ARBITER_BASE+ 0x00)
> >> +#define plb0_acr  (PLB_ARBITER_BASE+ 0x01)
> >
> >No upper case defines in this patch. I'm fine with this as long as we
> > update this in a later patch.
>
> I plan to make a cleanup patch soon. Felt it was appropriate to separate
> them.

Good. Thanks.

> >And from a quick check of the manuals the 440GP/GX have a slightly
> > different register layout. Is this the reason you didn't include those
> > PPC's in this patch version? What are your plans for those PPC's?
>
> That is right. I want to send a separate patch for the same.

OK.

> Also could you please let me know whether you applied the patch. Sorry for
> the line wrap issues - I will use git-send-email next time.

No, I didn't apply it yet. Please fix the nitpicking issues and re-send via 
git-send-email. I'll apply it then.

Thanks.

Best regards,
Stefan

=
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: [EMAIL PROTECTED]
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [WIP][PATCH 11/11] fdt: refactor initrd related code

2008-08-12 Thread Kumar Gala
Created a new fdt_initrd() to deal with setting the initrd properties
in the device tree and fixing up the mem reserve.  We can use this both
in the choosen node handling and lets us remove some duplicated code when
we fixup the initrd info in bootm on PPC.

Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
---
 common/fdt_support.c  |  109 ++---
 include/fdt_support.h |1 +
 lib_ppc/bootm.c   |   28 +
 3 files changed, 70 insertions(+), 68 deletions(-)

diff --git a/common/fdt_support.c b/common/fdt_support.c
index dadb294..4fc1915 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -99,44 +99,85 @@ static int fdt_fixup_stdout(void *fdt, int chosenoff)
 }
 #endif
 
-int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force)
+int fdt_initrd(void *fdt, ulong initrd_start, ulong initrd_end, int force)
 {
int   nodeoffset;
-   int   err;
-   u32   tmp;  /* used to set 32 bit integer properties */
-   char  *str; /* used to set string properties */
+   int   err, j, total;
+   u32   tmp;
const char *path;
+   uint64_t addr, size;
 
-   err = fdt_check_header(fdt);
-   if (err < 0) {
-   printf("fdt_chosen: %s\n", fdt_strerror(err));
-   return err;
+   /* Find the "chosen" node.  */
+   nodeoffset = fdt_path_offset (fdt, "/chosen");
+
+   /* If there is no "chosen" node in the blob return */
+   if (nodeoffset < 0) {
+   printf("fdt_initrd: %s\n", fdt_strerror(nodeoffset));
+   return nodeoffset;
}
 
-   if (initrd_start && initrd_end) {
-   uint64_t addr, size;
-   int  total = fdt_num_mem_rsv(fdt);
-   int  j;
+   /* just return if initrd_start/end aren't valid */
+   if ((initrd_start == 0) || (initrd_end == 0))
+   return 0;
 
-   /*
-* Look for an existing entry and update it.  If we don't find
-* the entry, we will j be the next available slot.
-*/
-   for (j = 0; j < total; j++) {
-   err = fdt_get_mem_rsv(fdt, j, &addr, &size);
-   if (addr == initrd_start) {
-   fdt_del_mem_rsv(fdt, j);
-   break;
-   }
+   total = fdt_num_mem_rsv(fdt);
+
+   /*
+* Look for an existing entry and update it.  If we don't find
+* the entry, we will j be the next available slot.
+*/
+   for (j = 0; j < total; j++) {
+   err = fdt_get_mem_rsv(fdt, j, &addr, &size);
+   if (addr == initrd_start) {
+   fdt_del_mem_rsv(fdt, j);
+   break;
}
+   }
 
-   err = fdt_add_mem_rsv(fdt, initrd_start, initrd_end - 
initrd_start + 1);
+   err = fdt_add_mem_rsv(fdt, initrd_start, initrd_end - initrd_start + 1);
+   if (err < 0) {
+   printf("fdt_initrd: %s\n", fdt_strerror(err));
+   return err;
+   }
+
+   path = fdt_getprop(fdt, nodeoffset, "linux,initrd-start", NULL);
+   if ((path == NULL) || force) {
+   tmp = __cpu_to_be32(initrd_start);
+   err = fdt_setprop(fdt, nodeoffset,
+   "linux,initrd-start", &tmp, sizeof(tmp));
+   if (err < 0) {
+   printf("WARNING: "
+   "could not set linux,initrd-start %s.\n",
+   fdt_strerror(err));
+   return err;
+   }
+   tmp = __cpu_to_be32(initrd_end);
+   err = fdt_setprop(fdt, nodeoffset,
+   "linux,initrd-end", &tmp, sizeof(tmp));
if (err < 0) {
-   printf("fdt_chosen: %s\n", fdt_strerror(err));
+   printf("WARNING: could not set linux,initrd-end %s.\n",
+   fdt_strerror(err));
+
return err;
}
}
 
+   return 0;
+}
+
+int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force)
+{
+   int   nodeoffset;
+   int   err;
+   char  *str; /* used to set string properties */
+   const char *path;
+
+   err = fdt_check_header(fdt);
+   if (err < 0) {
+   printf("fdt_chosen: %s\n", fdt_strerror(err));
+   return err;
+   }
+
/*
 * Find the "chosen" node.
 */
@@ -173,24 +214,8 @@ int fdt_chosen(void *fdt, ulong initrd_start, ulong 
initrd_end, int force)
fdt_strerror(err));
}
}
-   if (initrd_start && initrd_end) {
-   path = fdt_getprop(fdt, nodeoffset, "linux,initrd-start", NULL);
-   if ((path == NULL) || force) {
-  

[U-Boot] [WIP][PATCH 10/11] fdt: refactor fdt resize code

2008-08-12 Thread Kumar Gala
Move the fdt resizing code out of ppc specific boot code and into
common fdt support code.

Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
---
 common/fdt_support.c  |   39 +++
 include/fdt_support.h |1 +
 lib_ppc/bootm.c   |   32 
 3 files changed, 44 insertions(+), 28 deletions(-)

diff --git a/common/fdt_support.c b/common/fdt_support.c
index 93b144e..dadb294 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -529,3 +529,42 @@ void fdt_fixup_crypto_node(void *blob, int sec_rev)
   fdt_strerror(err));
 }
 #endif /* defined(CONFIG_MPC83XX) || defined(CONFIG_MPC85xx) */
+
+/* Resize the fdt to its actual size + a bit of padding */
+int fdt_resize(void *blob)
+{
+   int i;
+   uint64_t addr, size;
+   int total, ret;
+   uint actualsize;
+
+   if (!blob)
+   return 0;
+
+   total = fdt_num_mem_rsv(blob);
+   for (i = 0; i < total; i++) {
+   fdt_get_mem_rsv(blob, i, &addr, &size);
+   if (addr == (uint64_t)(u32)blob) {
+   fdt_del_mem_rsv(blob, i);
+   break;
+   }
+   }
+
+   /* Calculate the actual size of the fdt */
+   actualsize = fdt_off_dt_strings(blob) +
+   fdt_size_dt_strings(blob);
+
+   /* Make it so the fdt ends on a page boundary */
+   actualsize = ALIGN(actualsize, 0x1000);
+   actualsize = actualsize - ((uint)blob & 0xfff);
+
+   /* Change the fdt header to reflect the correct size */
+   fdt_set_totalsize(blob, actualsize);
+
+   /* Add the new reservation */
+   ret = fdt_add_mem_rsv(blob, (uint)blob, actualsize);
+   if (ret < 0)
+   return ret;
+
+   return actualsize;
+}
diff --git a/include/fdt_support.h b/include/fdt_support.h
index 761f85c..b3f0adb 100644
--- a/include/fdt_support.h
+++ b/include/fdt_support.h
@@ -69,6 +69,7 @@ void ft_pci_setup(void *blob, bd_t *bd);
 #endif
 
 void set_working_fdt_addr(void *addr);
+int fdt_resize(void *blob);
 
 #endif /* ifdef CONFIG_OF_LIBFDT */
 #endif /* ifndef __FDT_SUPPORT_H */
diff --git a/lib_ppc/bootm.c b/lib_ppc/bootm.c
index fb3..01d6499 100644
--- a/lib_ppc/bootm.c
+++ b/lib_ppc/bootm.c
@@ -163,38 +163,14 @@ do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char 
*argv[],
 
/* Fixup the fdt memreserve now that we know how big it is */
if (of_flat_tree) {
-   int j;
-   uint64_t addr, size;
-   int total = fdt_num_mem_rsv(of_flat_tree);
-   uint actualsize;
-
-   for (j = 0; j < total; j++) {
-   fdt_get_mem_rsv(of_flat_tree, j, &addr, &size);
-   if (addr == (uint64_t)(u32)of_flat_tree) {
-   fdt_del_mem_rsv(of_flat_tree, j);
-   break;
-   }
-   }
-
/* Delete the old LMB reservation */
lmb_free(lmb, (phys_addr_t)(u32)of_flat_tree,
(phys_size_t)fdt_totalsize(of_flat_tree));
 
-   /* Calculate the actual size of the fdt */
-   actualsize = fdt_off_dt_strings(of_flat_tree) +
-   fdt_size_dt_strings(of_flat_tree);
-
-   /* Make it so the fdt ends on a page boundary */
-   actualsize = ALIGN(actualsize, 0x1000);
-   actualsize = actualsize - ((uint)of_flat_tree & 0xfff);
-
-   /* Change the fdt header to reflect the correct size */
-   fdt_set_totalsize(of_flat_tree, actualsize);
-   of_size = actualsize;
-
-   /* Add the new reservation */
-   ret = fdt_add_mem_rsv(of_flat_tree, (uint)of_flat_tree,
-   of_size);
+   ret = fdt_resize(of_flat_tree);
+   if (ret < 0)
+   goto error;
+   of_size = ret;
 
/* Create a new LMB reservation */
lmb_reserve(lmb, (ulong)of_flat_tree, of_size);
-- 
1.5.5.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [WIP][PATCH 09/11] bootm: refactor image detection and os load steps

2008-08-12 Thread Kumar Gala
Created a bootm_start() that handles the parsing and detection of all the
images that will be used by the bootm command (OS, ramdisk, fdt). As part
of this we now tract all the relevant image offsets in the bootm_headers_t
struct.  This will allow us to have all the needed state for future
sub-commands and lets us reduce a bit of arch specific code on SPARC.

Created a bootm_load_os() that deals with decompression and loading the
OS image.

Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
---
 common/cmd_bootm.c |  219 ++-
 include/image.h|9 ++
 lib_sparc/bootm.c  |   19 +
 3 files changed, 139 insertions(+), 108 deletions(-)

diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index 598f5af..adab88f 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -151,24 +151,16 @@ void board_lmb_reserve(struct lmb *lmb) 
__attribute__((weak, alias("__board_lmb_
 # error Unknown CPU type
 #endif
 
-/***/
-/* bootm - boot application image from image in memory */
-/***/
-int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+static int bootm_start(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
-   ulong   iflag;
-   const char  *type_name;
-   uintunc_len = CFG_BOOTM_LEN;
-   uint8_t comp, type, os;
-
-   void*os_hdr;
-   ulong   os_data, os_len;
-   ulong   image_start, image_end;
-   ulong   load_start, load_end;
ulong   mem_start;
phys_size_t mem_size;
+   void*os_hdr;
int ret;
 
+   if (images.valid)
+   return 0;
+
memset ((void *)&images, 0, sizeof (images));
images.verify = getenv_yesno ("verify");
 
@@ -183,8 +175,8 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char 
*argv[])
 
/* get kernel image header, start address and length */
os_hdr = boot_get_kernel (cmdtp, flag, argc, argv,
-   &images, &os_data, &os_len);
-   if (os_len == 0) {
+   &images, &images.os.image_start, &images.os.image_len);
+   if (images.os.image_len == 0) {
puts ("ERROR: can't get kernel image!\n");
return 1;
}
@@ -192,40 +184,40 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char 
*argv[])
/* get image parameters */
switch (genimg_get_format (os_hdr)) {
case IMAGE_FORMAT_LEGACY:
-   type = image_get_type (os_hdr);
-   comp = image_get_comp (os_hdr);
-   os = image_get_os (os_hdr);
+   images.os.type = image_get_type (os_hdr);
+   images.os.comp = image_get_comp (os_hdr);
+   images.os.os = image_get_os (os_hdr);
 
-   image_end = image_get_image_end (os_hdr);
-   load_start = image_get_load (os_hdr);
+   images.os.end = image_get_image_end (os_hdr);
+   images.os.load = image_get_load (os_hdr);
break;
 #if defined(CONFIG_FIT)
case IMAGE_FORMAT_FIT:
if (fit_image_get_type (images.fit_hdr_os,
-   images.fit_noffset_os, &type)) {
+   images.fit_noffset_os, 
&images.os.type)) {
puts ("Can't get image type!\n");
show_boot_progress (-109);
return 1;
}
 
if (fit_image_get_comp (images.fit_hdr_os,
-   images.fit_noffset_os, &comp)) {
+   images.fit_noffset_os, 
&images.os.comp)) {
puts ("Can't get image compression!\n");
show_boot_progress (-110);
return 1;
}
 
if (fit_image_get_os (images.fit_hdr_os,
-   images.fit_noffset_os, &os)) {
+   images.fit_noffset_os, &images.os.os)) {
puts ("Can't get image OS!\n");
show_boot_progress (-111);
return 1;
}
 
-   image_end = fit_get_end (images.fit_hdr_os);
+   images.os.end = fit_get_end (images.fit_hdr_os);
 
if (fit_image_get_load (images.fit_hdr_os, 
images.fit_noffset_os,
-   &load_start)) {
+   &images.os.load)) {
puts ("Can't get image load address!\n");
show_boot_progress (-112);
return 1;
@@ -254,7 +246,7 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char 
*argv[])
return 1;
}

[U-Boot] [WIP][PATCH 08/11] bootm: move lmb into the bootm_headers_t structure

2008-08-12 Thread Kumar Gala
To allow for persistent state between future bootm subcommands we need
the lmb to exist in a global state.  Moving it into the bootm_headers_t
allows us to do that.

Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
---
 common/cmd_bootm.c |   11 ---
 include/image.h|4 +++-
 lib_m68k/bootm.c   |2 +-
 lib_ppc/bootm.c|2 +-
 lib_sparc/bootm.c  |2 +-
 5 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index c5dbf76..598f5af 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -169,20 +169,17 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char 
*argv[])
phys_size_t mem_size;
int ret;
 
-   struct lmb lmb;
-
memset ((void *)&images, 0, sizeof (images));
images.verify = getenv_yesno ("verify");
-   images.lmb = &lmb;
 
-   lmb_init(&lmb);
+   lmb_init(&images.lmb);
 
mem_start = getenv_bootm_low();
mem_size = getenv_bootm_size();
 
-   lmb_add(&lmb, (phys_addr_t)mem_start, mem_size);
+   lmb_add(&images.lmb, (phys_addr_t)mem_start, mem_size);
 
-   board_lmb_reserve(&lmb);
+   board_lmb_reserve(&images.lmb);
 
/* get kernel image header, start address and length */
os_hdr = boot_get_kernel (cmdtp, flag, argc, argv,
@@ -388,7 +385,7 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char 
*argv[])
 
show_boot_progress (8);
 
-   lmb_reserve(&lmb, load_start, (load_end - load_start));
+   lmb_reserve(&images.lmb, load_start, (load_end - load_start));
 
switch (os) {
default:/* handled by (original) Linux case */
diff --git a/include/image.h b/include/image.h
index 04dd7d2..1975012 100644
--- a/include/image.h
+++ b/include/image.h
@@ -229,7 +229,9 @@ typedef struct bootm_headers {
 #endif
 
int verify; /* getenv("verify")[0] != 'n' */
-   struct lmb  *lmb;   /* for memory mgmt */
+#ifndef USE_HOSTCC
+   struct lmb  lmb;/* for memory mgmt */
+#endif
 } bootm_headers_t;
 
 /*
diff --git a/lib_m68k/bootm.c b/lib_m68k/bootm.c
index 241721d..1c3b9c9 100644
--- a/lib_m68k/bootm.c
+++ b/lib_m68k/bootm.c
@@ -58,7 +58,7 @@ void do_bootm_linux(cmd_tbl_t * cmdtp, int flag,
ulong bootmap_base;
bd_t  *kbd;
void  (*kernel) (bd_t *, ulong, ulong, ulong, ulong);
-   struct lmb *lmb = images->lmb;
+   struct lmb *lmb = &images->lmb;
 
bootmap_base = getenv_bootm_low();
 
diff --git a/lib_ppc/bootm.c b/lib_ppc/bootm.c
index 45f6a47..fb3 100644
--- a/lib_ppc/bootm.c
+++ b/lib_ppc/bootm.c
@@ -73,7 +73,7 @@ do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char 
*argv[],
  ulong r7, ulong r8, ulong r9);
int ret;
ulong   of_size = images->ft_len;
-   struct lmb *lmb = images->lmb;
+   struct lmb *lmb = &images->lmb;
 
 #if defined(CONFIG_OF_LIBFDT)
char*of_flat_tree = images->ft_addr;
diff --git a/lib_sparc/bootm.c b/lib_sparc/bootm.c
index 71d34ba..aac05e4 100644
--- a/lib_sparc/bootm.c
+++ b/lib_sparc/bootm.c
@@ -93,7 +93,7 @@ void do_bootm_linux(cmd_tbl_t * cmdtp, int flag, int argc, 
char *argv[],
unsigned int data, len, checksum;
unsigned int initrd_addr, kernend;
void (*kernel) (struct linux_romvec *, void *);
-   struct lmb *lmb = images->lmb;
+   struct lmb *lmb = &images->lmb;
int ret;
 
if (images->legacy_hdr_valid) {
-- 
1.5.5.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [WIP][PATCH 07/11] bootm: Set working fdt address as part of the bootm flow

2008-08-12 Thread Kumar Gala
Set the fdt working address so "fdt FOO" commands can be used as part
of the bootm flow.

Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
---
 common/cmd_bootm.c|9 +
 common/cmd_fdt.c  |5 +
 common/image.c|1 +
 include/fdt_support.h |2 ++
 4 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index 918ea98..c5dbf76 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -44,6 +44,13 @@
 #include 
 #endif
 
+#if defined(CONFIG_OF_LIBFDT)
+#include 
+#include 
+#include 
+#endif
+
+
 DECLARE_GLOBAL_DATA_PTR;
 
 extern int gunzip (void *dst, int dstlen, unsigned char *src, unsigned long 
*lenp);
@@ -267,6 +274,8 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char 
*argv[])
puts ("Could not find a valid device tree\n");
return 1;
}
+
+   set_working_fdt_addr(images.ft_addr);
 #endif
}
 
diff --git a/common/cmd_fdt.c b/common/cmd_fdt.c
index d3b19dd..44acc34 100644
--- a/common/cmd_fdt.c
+++ b/common/cmd_fdt.c
@@ -50,6 +50,11 @@ static int fdt_print(const char *pathp, char *prop, int 
depth);
  */
 struct fdt_header *working_fdt;
 
+void set_working_fdt_addr(void *addr)
+{
+   working_fdt = addr;
+}
+
 /*
  * Flattened Device Tree command, see the help for parameter definitions.
  */
diff --git a/common/image.c b/common/image.c
index e7cb57c..60e1c9d 100644
--- a/common/image.c
+++ b/common/image.c
@@ -1245,6 +1245,7 @@ int boot_relocate_fdt (struct lmb *lmb, ulong 
bootmap_base,
*of_size = of_len;
}
 
+   set_working_fdt_addr(*of_flat_tree);
return 0;
 
 error:
diff --git a/include/fdt_support.h b/include/fdt_support.h
index a7c6326..761f85c 100644
--- a/include/fdt_support.h
+++ b/include/fdt_support.h
@@ -68,5 +68,7 @@ void ft_cpu_setup(void *blob, bd_t *bd);
 void ft_pci_setup(void *blob, bd_t *bd);
 #endif
 
+void set_working_fdt_addr(void *addr);
+
 #endif /* ifdef CONFIG_OF_LIBFDT */
 #endif /* ifndef __FDT_SUPPORT_H */
-- 
1.5.5.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [WIP][PATCH 06/11] bootm: refactor fdt locating and relocation code

2008-08-12 Thread Kumar Gala
Move the code that handles finding a device tree blob and relocating
it (if needed) into common code so all arch's have access to it.

Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
---
 common/cmd_bootm.c |   10 +
 common/image.c |  502 
 include/image.h|   13 ++
 lib_ppc/bootm.c|  492 +--
 4 files changed, 533 insertions(+), 484 deletions(-)

diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index 56236b9..918ea98 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -258,6 +258,16 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char 
*argv[])
puts ("Ramdisk image is corrupt\n");
return 1;
}
+
+#if defined(CONFIG_OF_LIBFDT)
+   /* find flattened device tree */
+   ret = boot_get_fdt (cmdtp, flag, argc, argv,
+   &images, &images.ft_addr, &images.ft_len);
+   if (ret) {
+   puts ("Could not find a valid device tree\n");
+   return 1;
+   }
+#endif
}
 
image_start = (ulong)os_hdr;
diff --git a/common/image.c b/common/image.c
index 6d2ce32..e7cb57c 100644
--- a/common/image.c
+++ b/common/image.c
@@ -1070,6 +1070,508 @@ error:
return -1;
 }
 
+#ifdef CONFIG_OF_LIBFDT
+static void fdt_error (const char *msg)
+{
+   puts ("ERROR: ");
+   puts (msg);
+   puts (" - must RESET the board to recover.\n");
+}
+
+static image_header_t *image_get_fdt (ulong fdt_addr)
+{
+   image_header_t *fdt_hdr = (image_header_t *)fdt_addr;
+
+   image_print_contents (fdt_hdr);
+
+   puts ("   Verifying Checksum ... ");
+   if (!image_check_hcrc (fdt_hdr)) {
+   fdt_error ("fdt header checksum invalid");
+   return NULL;
+   }
+
+   if (!image_check_dcrc (fdt_hdr)) {
+   fdt_error ("fdt checksum invalid");
+   return NULL;
+   }
+   puts ("OK\n");
+
+   if (!image_check_type (fdt_hdr, IH_TYPE_FLATDT)) {
+   fdt_error ("uImage is not a fdt");
+   return NULL;
+   }
+   if (image_get_comp (fdt_hdr) != IH_COMP_NONE) {
+   fdt_error ("uImage is compressed");
+   return NULL;
+   }
+   if (fdt_check_header ((char *)image_get_data (fdt_hdr)) != 0) {
+   fdt_error ("uImage data is not a fdt");
+   return NULL;
+   }
+   return fdt_hdr;
+}
+
+/**
+ * fit_check_fdt - verify FIT format FDT subimage
+ * @fit_hdr: pointer to the FIT  header
+ * fdt_noffset: FDT subimage node offset within FIT image
+ * @verify: data CRC verification flag
+ *
+ * fit_check_fdt() verifies integrity of the FDT subimage and from
+ * specified FIT image.
+ *
+ * returns:
+ * 1, on success
+ * 0, on failure
+ */
+#if defined(CONFIG_FIT)
+static int fit_check_fdt (const void *fit, int fdt_noffset, int verify)
+{
+   fit_image_print (fit, fdt_noffset, "   ");
+
+   if (verify) {
+   puts ("   Verifying Hash Integrity ... ");
+   if (!fit_image_check_hashes (fit, fdt_noffset)) {
+   fdt_error ("Bad Data Hash");
+   return 0;
+   }
+   puts ("OK\n");
+   }
+
+   if (!fit_image_check_type (fit, fdt_noffset, IH_TYPE_FLATDT)) {
+   fdt_error ("Not a FDT image");
+   return 0;
+   }
+
+   if (!fit_image_check_comp (fit, fdt_noffset, IH_COMP_NONE)) {
+   fdt_error ("FDT image is compressed");
+   return 0;
+   }
+
+   return 1;
+}
+#endif /* CONFIG_FIT */
+
+#ifndef CFG_FDT_PAD
+#define CFG_FDT_PAD 0x3000
+#endif
+
+/**
+ * boot_relocate_fdt - relocate flat device tree
+ * @lmb: pointer to lmb handle, will be used for memory mgmt
+ * @bootmap_base: base address of the bootmap region
+ * @of_flat_tree: pointer to a char* variable, will hold fdt start address
+ * @of_size: pointer to a ulong variable, will hold fdt length
+ *
+ * boot_relocate_fdt() determines if the of_flat_tree address is within
+ * the bootmap and if not relocates it into that region
+ *
+ * of_flat_tree and of_size are set to final (after relocation) values
+ *
+ * returns:
+ *  0 - success
+ *  1 - failure
+ */
+int boot_relocate_fdt (struct lmb *lmb, ulong bootmap_base,
+   char **of_flat_tree, ulong *of_size)
+{
+   char*fdt_blob = *of_flat_tree;
+   ulong   relocate = 0;
+   ulong   of_len = 0;
+
+   /* nothing to do */
+   if (*of_size == 0)
+   return 0;
+
+   if (fdt_check_header (fdt_blob) != 0) {
+   fdt_error ("image is not a fdt");
+   goto error;
+   }
+
+#ifndef CFG_NO_FLASH
+   /* move the blob if it is in flash (set relocate) */
+   if (addr2info ((ulong)fdt_blob) != NULL)
+   relocate = 1;
+#en

[U-Boot] [WIP][PATCH 05/11] bootm: refactor ramdisk locating code

2008-08-12 Thread Kumar Gala
Move determing if we have a ramdisk and where its located into the common
code.  Keep track of the ramdisk start and end in the bootm_headers_t image
struct.

Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
---
 common/cmd_bootm.c |   38 ++
 include/image.h|2 ++
 lib_arm/bootm.c|   10 ++
 lib_avr32/bootm.c  |   12 +++-
 lib_i386/bootm.c   |8 +---
 lib_m68k/bootm.c   |   12 +++-
 lib_mips/bootm.c   |   12 +++-
 lib_ppc/bootm.c|   16 +---
 lib_sparc/bootm.c  |   17 +++--
 9 files changed, 60 insertions(+), 67 deletions(-)

diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index 3f63b84..56236b9 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -116,6 +116,33 @@ void __board_lmb_reserve(struct lmb *lmb)
 }
 void board_lmb_reserve(struct lmb *lmb) __attribute__((weak, 
alias("__board_lmb_reserve")));
 
+#if defined(__ARM__)
+  #define IH_INITRD_ARCH IH_ARCH_ARM
+#elif defined(__avr32__)
+  #define IH_INITRD_ARCH IH_ARCH_AVR32
+#elif defined(__bfin__)
+  #define IH_INITRD_ARCH IH_ARCH_BLACKFIN
+#elif defined(__I386__)
+  #define IH_INITRD_ARCH IH_ARCH_I386
+#elif defined(__M68K__)
+  #define IH_INITRD_ARCH IH_ARCH_M68K
+#elif defined(__microblaze__)
+  #define IH_INITRD_ARCH IH_ARCH_MICROBLAZE
+#elif defined(__mips__)
+  #define IH_INITRD_ARCH IH_ARCH_MIPS
+#elif defined(__nios__)
+  #define IH_INITRD_ARCH IH_ARCH_NIOS
+#elif defined(__nios2__)
+  #define IH_INITRD_ARCH IH_ARCH_NIOS2
+#elif defined(__PPC__)
+  #define IH_INITRD_ARCH IH_ARCH_PPC
+#elif defined(__sh__)
+  #define IH_INITRD_ARCH IH_ARCH_SH
+#elif defined(__sparc__)
+  #define IH_INITRD_ARCH IH_ARCH_SPARC
+#else
+# error Unknown CPU type
+#endif
 
 /***/
 /* bootm - boot application image from image in memory */
@@ -133,6 +160,7 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char 
*argv[])
ulong   load_start, load_end;
ulong   mem_start;
phys_size_t mem_size;
+   int ret;
 
struct lmb lmb;
 
@@ -222,6 +250,16 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char 
*argv[])
return 1;
}
 
+   if (os == IH_OS_LINUX) {
+   /* find ramdisk */
+   ret = boot_get_ramdisk (argc, argv, &images, IH_INITRD_ARCH,
+   &images.rd_start, &images.rd_end);
+   if (ret) {
+   puts ("Ramdisk image is corrupt\n");
+   return 1;
+   }
+   }
+
image_start = (ulong)os_hdr;
load_end = 0;
type_name = genimg_get_type_name (type);
diff --git a/include/image.h b/include/image.h
index e16c253..b8577a0 100644
--- a/include/image.h
+++ b/include/image.h
@@ -221,6 +221,8 @@ typedef struct bootm_headers {
 
ulong   ep; /* entry point of OS */
 
+   ulong   rd_start, rd_end;/* ramdisk start/end */
+
int verify; /* getenv("verify")[0] != 'n' */
struct lmb  *lmb;   /* for memory mgmt */
 } bootm_headers_t;
diff --git a/lib_arm/bootm.c b/lib_arm/bootm.c
index 5660a50..f9f702f 100644
--- a/lib_arm/bootm.c
+++ b/lib_arm/bootm.c
@@ -61,7 +61,6 @@ extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, 
char *argv[]);
 void do_bootm_linux (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
 bootm_headers_t *images)
 {
-   ulong   initrd_start, initrd_end;
bd_t*bd = gd->bd;
char*s;
int machid = bd->bi_arch_number;
@@ -80,11 +79,6 @@ void do_bootm_linux (cmd_tbl_t *cmdtp, int flag, int argc, 
char *argv[],
printf ("Using machid 0x%x from environment\n", machid);
}
 
-   ret = boot_get_ramdisk (argc, argv, images, IH_ARCH_ARM,
-   &initrd_start, &initrd_end);
-   if (ret)
-   goto error;
-
show_boot_progress (15);
 
debug ("## Transferring control to Linux (at address %08lx) ...\n",
@@ -111,8 +105,8 @@ void do_bootm_linux (cmd_tbl_t *cmdtp, int flag, int argc, 
char *argv[],
setup_commandline_tag (bd, commandline);
 #endif
 #ifdef CONFIG_INITRD_TAG
-   if (initrd_start && initrd_end)
-   setup_initrd_tag (bd, initrd_start, initrd_end);
+   if (images->rd_start && images->rd_end)
+   setup_initrd_tag (bd, images->rd_start, images->rd_end);
 #endif
 #if defined (CONFIG_VFD) || defined (CONFIG_LCD)
setup_videolfb_tag ((gd_t *) gd);
diff --git a/lib_avr32/bootm.c b/lib_avr32/bootm.c
index 7beab99..762701f 100644
--- a/lib_avr32/bootm.c
+++ b/lib_avr32/bootm.c
@@ -176,7 +176,6 @@ static void setup_end_tag(struct tag *params)
 void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
bootm_headers_t *images)
 {
-   ulong   initrd_start, initrd_end;
 

  1   2   >