[U-Boot] Problems with fw_printenv

2010-03-03 Thread Ronald Kortekaas
I have some problems with the fw_printenv tool. I use the following versions of 
u-boot, kernel and compiler:


-   u-boot-2009.11.1

-   linux-2.6.22

-   gcc-3.4.3-glibc-2.3.2 arm-linux-

The problem is that the fw_printenv complains about: Warning: Bad CRC, using 
default environment.

My U-boot configuration for the environment is:

#define PHYS_FLASH_1   0xc000
#define CONFIG_ENV_IS_IN_FLASH
#define CONFIG_ENV_OFFSET  (0x4)
#define CONFIG_ENV_SECT_SIZE 0x2 /* Env 
sector Size */
#define CONFIG_ENV_SIZE CONFIG_ENV_SECT_SIZE

#define MTDIDS_DEFAULT  nor0=physmap-flash.0
#define MTDPARTS_DEFAULT
mtdparts=physmap-flash.0:256k(uboot)ro,128k(ubootenv),4096k(kernel)

Mtd in u-boot prints:

device nor0 physmap-flash.0, # parts = 3
 #: namesizeoffset  mask_flags
 0: uboot   0x0004  0x  1
 1: ubootenv0x0002  0x0004  0
 2: kernel  0x0040  0x0006  0

active partition: nor0,0 - (uboot) 0x0004 @ 0x

defaults:
mtdids  : nor0=physmap-flash.0
mtdparts: mtdparts=physmap-flash.0:256k(uboot)ro,128k(ubootenv),4096k(kernel)

So my environment is located at 0xc004. My /proc/mtd is:

dev:size   erasesize  name
mtd0: 0080 0002 NOR flash on Clever
mtd1: 0004 0002 uboot
mtd2: 0002 0002 ubootenv
mtd3: 0040 0002 Kernel

My fw_env.config is:

/dev/mtd2   0x  0x2 0x2

When I copy the /dev/mtd2 to a file I see the environment variables from 
U-Boot. This starts with Gøwbootdelay=5
When I do a fw_setenv bootdelay 4, it says Warning: Bad CRC, using default 
environment. But if I use then fw_printenv everything is fine.
If I copy the contents of /dev/mtd2 to a file is starts with: Ð   
U(bootcmd=bootp. So I can write the environment from linux but not read it 
from u-boot.

If I restarts my board U-boot compains about a bad CRC (this is the expected 
result). So I looks like the offsets are wrong because my kernel image get 
damaged after saving the environment from linux.

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


Re: [U-Boot] imx27lite board support no longer compile

2010-03-03 Thread Stefano Babic
 Heiko Schocher wrote:
 your following commit breaks building the imx27lite board
 (and all boards, which uses the ./drivers/net/fec_mxc.c
 I think), because the following function is missing:

Hello Heiko,

I have applied John's patches to the u-boot-imx tree. Building of
imx27lite is ok using that tree.

Regards,
Stefano

-- 
=
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: off...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] FSL UPM NAND read not proper from u-boot

2010-03-03 Thread lloyd vas
Hi,

  Our development board using MPC8321E processor have two FLASH memory
devices, one connected in GPCM (NOR Flash) and
another connected in UPM mode(NAND Flash is STM Micro electronics chip
NAND512W3A2C). I understood from the mailing list user discussions,
 that to support it in u-boot 1.3.2 code base I can port code changes
similar to MPC836x RDK code base from u-boot 1.3.4 code base.
Considering this I had merged the code changes of MPC836x RDK support, apart
from files (drivers/mtd/nand/fsl_upm.c and
board/freescale/mpc8323erdb/nand.c),
below summary changes were made

1) GPIO port configured is as below

File: board/freescale/mpc8323erdb/mpc8323erdb.c


const qe_iop_conf_t qe_iop_conf_tab[] = {
/* UCC3 */

#ifdef FSL_NAND_SUPPORT
/* NAND device connected to  PORT C 15th PIN */
{2, 15, 2, 0, 0}, /* NAND_RYnBY */
#endif
}

2) To configure 8-bit port size (64MB NAND Flash) and using UPM A
configuration

File: include/configs/MPC8323ERDB.h


// NOR Flash configuration starts here 16MB (16-bit)
#define CFG_FLASH_BASE  0xFE00  /* FLASH base address */

#define CFG_LBLAWBAR0_PRELIMCFG_FLASH_BASE  /* Window base at flash base
*/
#define CFG_LBLAWAR0_PRELIM(LBLAWAR_EN | LBLAWAR_16MB)/* 16MB window
size */
#define CFG_BR0_PRELIM  (CFG_FLASH_BASE |   /* Flash Base address */ \
(2  BR_PS_SHIFT) |/* 16 bit port size */ \
BR_V)   /* valid */

#define CFG_LBLAWBAR1_PRELIMCFG_NAND_BASE
#define CFG_LBLAWAR1_PRELIM(LBLAWAR_EN | LBLAWAR_64MB)/* 64MB window
size */

// NOR Flash configuration ends here

//NAND Flash configuration starts here - 64MB (8bit)
#define CFG_NAND_BASE   0xf800
/* Port size 8 bit, UPMA */
#define CFG_BR1_PRELIM  (CFG_NAND_BASE |\
 BR_PS_8|  /* 8 bit Port size */\
 BR_MS_UPMA | /* UPMA */\
 BR_V)

#define CFG_OR1_PRELIM   (OR_AM_64MB | /* 64MB */\
  0x6000 |  /* Reserved set ??? */\
  OR_UPM_BI | /* bank does not support accesses
*/\
  OR_UPM_EAD) /* Extra bus clock cycles added */


#ifdef FSL_NAND_SUPPORT
/* NAND: cache-inhibit and guarded */
#define CFG_IBAT3L  (CFG_NAND_BASE | BATL_PP_10 | BATL_MEMCOHERENCE)
#define CFG_IBAT3U  (CFG_NAND_BASE | BATU_BL_64M | BATU_VS | BATU_VP)
#define CFG_DBAT3L  CFG_IBAT3L
#define CFG_DBAT3U  CFG_IBAT3U
#endif // FSL_NAND_SUPPORT
//NAND Flash configuration ends here

//LCRR
#define CFG_LCRR(LCRR_DBYP | LCRR_EADC_3 | LCRR_CLKDIV_2)


3)
Using the UPM editor tool provided by freescale I had generated the below
UPM RAM in the file board/freescale/mpc8323erdb/nand.c
static const u32 upm_array[] = {

  0x0ff03c00,  0x0ff03c00,  0x0ff03c04,  0x0ff33c00, //Words 0 to 3
0xfff33c01,  0xfc30,  0xfc30,  0xfc30, //Words 4 to 7
0x0faf3c30,  0x0faf3c30,  0x0faf3c30,  0x0fff3c34, //Words 8 to 11
0x3c31,  0xfc30,  0xfc30,  0xfc30, //Words 12 to 15
0x0fa3fc30,  0x0fa3fc30,  0x0fa3fc30,  0x0ff3fc34, //Words 16 to 19
0xfff3fc31,  0xfc30,  0xfc30,  0xfc30, //Words 20 to 23
0x0ff33c00,  0x0fa33c00,  0x0fa33c04,  0x0ff33c00, //Words 24 to 27
0xfff33c01,  0xfff0fc30,  0xfff0fc30,  0xfff0fc30, //Words 28 to 31
0xfff3fc30,  0xfff3fc30,  0xfff6fc30,  0xfffcfc30, //Words 32 to 35
0xfffcfc30,  0xfffcfc30,  0xfffcfc30,  0xfffcfc30, //Words 36 to 39
0xfffcfc30,  0xfffcfc30,  0xfffcfc30,  0xfffcfc30, //Words 40 to 43
0xfffdfc30,  0xfc30,  0xfc30,  0xfc31, //Words 44 to 47
0xfc30,  0xfc00,  0xfc00,  0xfc00, //Words 48 to 51
0xfc00,  0xfc00,  0xfc00,  0xfc00, //Words 52 to 55
0xfc00,  0xfc00,  0xfc00,  0xfc01, //Words 56 to 59
0xfc00,  0xfc00,  0xfc00,  0xfc01  //Words 60 to 63

}

Am I missing out any other changes?

I have the following observation to be shared on the debugging this
development board

1) UPM RAM Array intialization is succesfull ( I verified using the UPM RAM
array read command)

2) For the memory mapped region of NAND u-boot memory display using the
command  md shows the values like 4040, 8080, 3f3f,7f7f and . Is it
showing some junk values?

3) Intially probing of the nand using nand_scan() says No NAND device
found, I meant manufacture ID and device ID is displayed as zero.
But, we just want to know whether the sequence followed for reading the IDs
of device and manufacture is the proper provided in fsl_upm.c for our NAND
flash device.
NAND flash datasheet link is (
http://www.alldatasheet.com/datasheet-pdf/pdf/228090/NUMONYX/NAND512R3A2C.html
).

4)  Another thing I observed in the nand_scan() during the READ device and
manufacturer ID that we are executing the run pattern for writing the
command and address location. But, it looks like we are not executing the
UPM run pattern for reading the data( device ID and manufacturer 

Re: [U-Boot] imx27lite board support no longer compile

2010-03-03 Thread Heiko Schocher
Hello Stefano,

Stefano Babic wrote:
 Heiko Schocher wrote:
 your following commit breaks building the imx27lite board
 (and all boards, which uses the ./drivers/net/fec_mxc.c
 I think), because the following function is missing:
 
 Hello Heiko,
 
 I have applied John's patches to the u-boot-imx tree. Building of
 imx27lite is ok using that tree.

Thanks for the info!

bye
Heiko
-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Problems with fw_printenv

2010-03-03 Thread Ronald Kortekaas
The problem was the definition of CONFIG_ENV_ADDR_REDUND after undefining this 
it works.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] SPEAr : Adding maintainer name for spear SoCs

2010-03-03 Thread Tom
Vipin KUMAR wrote:
 From: Vipin Kumar vipin.ku...@st.com
 
 Signed-off-by: Vipin Kumar vipin.ku...@st.com
 ---
  MAINTAINERS |7 +++
  1 files changed, 7 insertions(+), 0 deletions(-)
 
 diff --git a/MAINTAINERS b/MAINTAINERS
 index dd1579e..49a3762 100644
 --- a/MAINTAINERS
 +++ b/MAINTAINERS
 @@ -771,6 +771,13 @@ Minkyu Kang mk7.k...@samsung.com
  
   SMDKC100ARM CORTEX-A8 (S5PC100 SoC)
  
The smdkc100 is a mistake.
Minkyu,
Please move this up to be after

Feng Kan f...@amcc.com

redwood PPC4xx


 +Vipin Kumar vipin.ku...@st.com
 +
 + spear300ARM926EJS (spear300 Soc)
 + spear310ARM926EJS (spear310 Soc)
 + spear320ARM926EJS (spear320 Soc)
 + spear600ARM926EJS (spear600 Soc)
 +
  -

Vipin,
Please move this up to be after
Sangmoon Kim dog...@etinsys.com

debris  MPC8245
KVME080 MPC8245

The mach id changing looks fine.

Tom

  
  Unknown / orphaned boards:

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


Re: [U-Boot] Problems with fw_printenv

2010-03-03 Thread Wolfgang Denk
Dear Ronald Kortekaas,

In message d94411866239f14cae874e27a9b65ca88485e5e...@exalg01.chess.int you 
wrote:

 The problem was the definition of CONFIG_ENV_ADDR_REDUND after undefining 
 this it works.

Do you understand the consequewnces of removing this definition? Are
you sure you really want to do this?

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: w...@denx.de
Niklaus Wirth has lamented that, whereas Europeans pronounce his name
correctly  (Ni-klows  Virt),  Americans  invariably  mangle  it  into
(Nick-les  Worth).  Which  is to say that Europeans call him by name,
but Americans call him by value.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] SPEAr : Adding maintainer name for spear SoCs

2010-03-03 Thread Minkyu Kang
Dear Tom,

On 3 March 2010 23:56, Tom tom@windriver.com wrote:
 Vipin KUMAR wrote:
 From: Vipin Kumar vipin.ku...@st.com

 Signed-off-by: Vipin Kumar vipin.ku...@st.com
 ---
  MAINTAINERS |    7 +++
  1 files changed, 7 insertions(+), 0 deletions(-)

 diff --git a/MAINTAINERS b/MAINTAINERS
 index dd1579e..49a3762 100644
 --- a/MAINTAINERS
 +++ b/MAINTAINERS
 @@ -771,6 +771,13 @@ Minkyu Kang mk7.k...@samsung.com

       SMDKC100        ARM CORTEX-A8 (S5PC100 SoC)

 The smdkc100 is a mistake.
 Minkyu,
 Please move this up to be after

 Feng Kan f...@amcc.com

        redwood                 PPC4xx


I don't understand what is a mistake.
I think.. that is section of PowerPC systems.
Do you really want to move it?


 +Vipin Kumar vipin.ku...@st.com
 +
 +     spear300        ARM926EJS (spear300 Soc)
 +     spear310        ARM926EJS (spear310 Soc)
 +     spear320        ARM926EJS (spear320 Soc)
 +     spear600        ARM926EJS (spear600 Soc)
 +
  -

 Vipin,
 Please move this up to be after
 Sangmoon Kim dog...@etinsys.com

        debris          MPC8245
        KVME080         MPC8245

 The mach id changing looks fine.

 Tom


  Unknown / orphaned boards:

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


Thanks
Minkyu Kang
-- 
from. prom.
www.promsoft.net
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Save environment data to mmc.

2010-03-03 Thread Lv Terry-R65388
Hi Babic,

Thanks for reviewing the patch.

I will send out a new patch to fix the problems you point out.

For setting block numbers for MMC offset, I just don't want env mmc to 
be different. I want users to use it as similiar as other env devices.

For the initalization for ARM and PPC, It will be added for all 
architectures.

Thanks a lot ~~

Yours
Terry

-Original Message-
From: Stefano Babic [mailto:sba...@denx.de] 
Sent: 2010年3月3日 1:03
To: Lv Terry-R65388
Cc: u-boot@lists.denx.de
Subject: Re: [U-Boot] [PATCH] Save environment data to mmc.

Terry Lv wrote:

 diff --git a/common/env_mmc.c b/common/env_mmc.c

 +#include linux/stddef.h
 +#include malloc.h
 +#include mmc.h
 +
 +#if defined(CONFIG_CMD_ENV)  defined(CONFIG_CMD_MMC)

This seems not correct. If not explicitely set, we get a compiler error.
Assuming you has taken this check from env_nand.c, this should be:

#if defined(CONFIG_CMD_SAVEENV)  defined(CONFIG_CMD_MMC)

 +#define CMD_SAVEENV
 +#elif defined(CONFIG_ENV_OFFSET_REDUND) #error Cannot use 
 +CONFIG_ENV_OFFSET_REDUND without CONFIG_CMD_ENV  CONFIG_CMD_MMC

Line too long.

 +#endif
 +
 +#if defined(CONFIG_ENV_SIZE_REDUND)  (CONFIG_ENV_SIZE_REDUND  
 +CONFIG_ENV_SIZE)

Ditto.


 +
 +#ifdef CMD_SAVEENV
 +
 +inline int write_env(struct mmc *mmc, unsigned long size,
 + unsigned long offset, const 
 void *buffer)

Line too long.

 +{
 + uint blk_start = 0, blk_cnt = 0, n = 0;
 +
 + blk_start = (offset % 512) ? ((offset / 512) + 1) : (offset / 512);
 + blk_cnt = (size % 512) ? ((size / 512) + 1) : (size / 512);

The alignment to block size is repeated here and in the read function.
Should not better to set a macro (something like BLOCK_ALIGN) providing the 
required alignment ?

 +int saveenv(void)
 +{
 + struct mmc *mmc = find_mmc_device(0);

Why is the MMC device hard-coded ? At least should be configurable with a 
CONFIG_ option. There are boards with more than one MMC controller and you 
constraint to use always the first one.

 + blk_start = (offset % 512) ? ((offset / 512) + 1) : (offset / 512);

Already said, a macro is much more readable to perform alignment.

 diff --git a/include/environment.h b/include/environment.h

 +#if defined(CONFIG_ENV_IS_IN_MMC)
 +# ifndef CONFIG_ENV_OFFSET
 +#  error Need to define CONFIG_ENV_OFFSET when using CONFIG_ENV_IS_IN_MMC
 +# endif
 +# ifndef CONFIG_ENV_ADDR
 +#  define CONFIG_ENV_ADDR(CONFIG_ENV_OFFSET)
 +# endif
 +# ifndef CONFIG_ENV_OFFSET
 +#  define CONFIG_ENV_OFFSET (CONFIG_ENV_ADDR) # endif # ifdef 
 +CONFIG_ENV_OFFSET_REDUND #  define CONFIG_SYS_REDUNDAND_ENVIRONMENT # 
 +endif # ifdef CONFIG_ENV_IS_EMBEDDED
 +#  define ENV_IS_EMBEDDED1
 +# endif
 +#endif /* CONFIG_ENV_IS_IN_MMC */

You missed Wolfgang's comment. I think also that there is no reason to set 
offset for the MMC and block numbers makes more sense.

 +
  /* Embedded env is only supported for some flash types */  #ifdef 
 CONFIG_ENV_IS_EMBEDDED  # if !defined(CONFIG_ENV_IS_IN_FLASH)  \ 
 diff --git a/lib_arm/board.c b/lib_arm/board.c index 5e3d7f6..f846d0d 
 100644

 +#ifdef CONFIG_GENERIC_MMC
 + puts (MMC:   );
 + mmc_initialize (gd-bd);
 +#endif

 diff --git a/lib_ppc/board.c b/lib_ppc/board.c index 765f97a..9b3f84c 
 100644
 --- a/lib_ppc/board.c
 +++ b/lib_ppc/board.c
 @@ -776,6 +776,12 @@ void board_init_r (gd_t *id, ulong dest_addr)
   nand_init();/* go init the NAND */
  #endif
  
 +#ifdef CONFIG_GENERIC_MMC
 + WATCHDOG_RESET ();
 + puts (MMC:  );
 + mmc_initialize (bd);
 +#endif

I am quite confused. You add the initialization only for ARM and PPC.
What about the other architectures ?

I tested your patch on mx51evk, environment is correctly read/written on the SD 
situated on the back.

Regards,
Stefano

--
=
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: off...@denx.de 
=

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


Re: [U-Boot] [PATCH] Save environment data to mmc.

2010-03-03 Thread Liu Hui-R64343
Hi, Terry,

 -Original Message-
 From: u-boot-boun...@lists.denx.de 
 [mailto:u-boot-boun...@lists.denx.de] On Behalf Of Lv Terry-R65388
 Sent: 2010年3月4日 11:01
 To: Stefano Babic
 Cc: u-boot@lists.denx.de
 Subject: Re: [U-Boot] [PATCH] Save environment data to mmc.
 
 Hi Babic,
 
   Thanks for reviewing the patch.
 
   I will send out a new patch to fix the problems you point out.
 
   For setting block numbers for MMC offset, I just don't 
 want env mmc to be different. I want users to use it as 
 similiar as other env devices.
 
   For the initalization for ARM and PPC, It will be added 
 for all architectures.
 
   Thanks a lot ~~

Had better not put comments on the top of the email, need follow the community 
style. 

 
 Yours
 Terry
 
 -Original Message-
 From: Stefano Babic [mailto:sba...@denx.de]
 Sent: 2010年3月3日 1:03
 To: Lv Terry-R65388
 Cc: u-boot@lists.denx.de
 Subject: Re: [U-Boot] [PATCH] Save environment data to mmc.
 
 Terry Lv wrote:
 
  diff --git a/common/env_mmc.c b/common/env_mmc.c
 
  +#include linux/stddef.h
  +#include malloc.h
  +#include mmc.h
  +
  +#if defined(CONFIG_CMD_ENV)  defined(CONFIG_CMD_MMC)
 
 This seems not correct. If not explicitely set, we get a 
 compiler error.
 Assuming you has taken this check from env_nand.c, this should be:
 
 #if defined(CONFIG_CMD_SAVEENV)  defined(CONFIG_CMD_MMC)
 
  +#define CMD_SAVEENV
  +#elif defined(CONFIG_ENV_OFFSET_REDUND) #error Cannot use 
  +CONFIG_ENV_OFFSET_REDUND without CONFIG_CMD_ENV  CONFIG_CMD_MMC
 
 Line too long.
 
  +#endif
  +
  +#if defined(CONFIG_ENV_SIZE_REDUND)  (CONFIG_ENV_SIZE_REDUND 
  +CONFIG_ENV_SIZE)
 
 Ditto.
 
 
  +
  +#ifdef CMD_SAVEENV
  +
  +inline int write_env(struct mmc *mmc, unsigned long size,
  +   unsigned long 
 offset, const void *buffer)
 
 Line too long.
 
  +{
  +   uint blk_start = 0, blk_cnt = 0, n = 0;
  +
  +   blk_start = (offset % 512) ? ((offset / 512) + 1) : 
 (offset / 512);
  +   blk_cnt = (size % 512) ? ((size / 512) + 1) : (size / 512);
 
 The alignment to block size is repeated here and in the read function.
 Should not better to set a macro (something like BLOCK_ALIGN) 
 providing the required alignment ?
 
  +int saveenv(void)
  +{
  +   struct mmc *mmc = find_mmc_device(0);
 
 Why is the MMC device hard-coded ? At least should be 
 configurable with a CONFIG_ option. There are boards with 
 more than one MMC controller and you constraint to use always 
 the first one.
 
  +   blk_start = (offset % 512) ? ((offset / 512) + 1) : 
 (offset / 512);
 
 Already said, a macro is much more readable to perform alignment.
 
  diff --git a/include/environment.h b/include/environment.h
 
  +#if defined(CONFIG_ENV_IS_IN_MMC)
  +# ifndef CONFIG_ENV_OFFSET
  +#  error Need to define CONFIG_ENV_OFFSET when using 
 CONFIG_ENV_IS_IN_MMC
  +# endif
  +# ifndef CONFIG_ENV_ADDR
  +#  define CONFIG_ENV_ADDR  (CONFIG_ENV_OFFSET)
  +# endif
  +# ifndef CONFIG_ENV_OFFSET
  +#  define CONFIG_ENV_OFFSET (CONFIG_ENV_ADDR) # endif # ifdef 
  +CONFIG_ENV_OFFSET_REDUND #  define 
 CONFIG_SYS_REDUNDAND_ENVIRONMENT # 
  +endif # ifdef CONFIG_ENV_IS_EMBEDDED
  +#  define ENV_IS_EMBEDDED  1
  +# endif
  +#endif /* CONFIG_ENV_IS_IN_MMC */
 
 You missed Wolfgang's comment. I think also that there is no 
 reason to set offset for the MMC and block numbers makes more sense.
 
  +
   /* Embedded env is only supported for some flash types */  #ifdef 
  CONFIG_ENV_IS_EMBEDDED  # if !defined(CONFIG_ENV_IS_IN_FLASH)  \ 
  diff --git a/lib_arm/board.c b/lib_arm/board.c index 
 5e3d7f6..f846d0d
  100644
 
  +#ifdef CONFIG_GENERIC_MMC
  +   puts (MMC:   );
  +   mmc_initialize (gd-bd);
  +#endif
 
  diff --git a/lib_ppc/board.c b/lib_ppc/board.c index 
 765f97a..9b3f84c
  100644
  --- a/lib_ppc/board.c
  +++ b/lib_ppc/board.c
  @@ -776,6 +776,12 @@ void board_init_r (gd_t *id, ulong dest_addr)
  nand_init();/* go init the NAND */
   #endif
   
  +#ifdef CONFIG_GENERIC_MMC
  +   WATCHDOG_RESET ();
  +   puts (MMC:  );
  +   mmc_initialize (bd);
  +#endif
 
 I am quite confused. You add the initialization only for ARM and PPC.
 What about the other architectures ?
 
 I tested your patch on mx51evk, environment is correctly 
 read/written on the SD situated on the back.
 
 Regards,
 Stefano
 
 --
 =
 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: 
 off...@denx.de 
 =
 
 ___
 U-Boot mailing list
 U-Boot@lists.denx.de
 http://lists.denx.de/mailman/listinfo/u-boot
 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Problems with fw_printenv

2010-03-03 Thread Ronald Kortekaas
Op 3-3-2010 21:21, Wolfgang Denk schreef:
 Dear Ronald Kortekaas,

 In messaged94411866239f14cae874e27a9b65ca88485e5e...@exalg01.chess.int  you 
 wrote:

 The problem was the definition of CONFIG_ENV_ADDR_REDUND after undefining 
 this it works.
  
 Do you understand the consequewnces of removing this definition? Are
 you sure you really want to do this?

 Best regards,

 Wolfgang Denk


No, I'm not understanding the consequences of removing this definition. 
I can't find a description what is does.
It was a suggestion of one of the other readers of the maillist.

But if I want to use the CONFIG_ENV_ADDR_REDUND. Is there a way to solve 
this problem?

This message refers to 
http://lists.denx.de/pipermail/u-boot/2010-March/068204.html.

Best regards,

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


[U-Boot] [PATCH 2/2] arm, i.mx27: add support for magnesium board from LogicPD

2010-03-03 Thread Heiko Schocher
This patch adds support for the magnesium board from LogicPD.
This board uses i.MX27 SoC and has 8MB NOR flash, 128MB NAND
flash, FEC ethernet controller integrated into i.MX27.

Signed-off-by: Heiko Schocher h...@denx.de
---
against current git://git.denx.de/u-boot-imx.git

 MAINTAINERS |4 +
 MAKEALL |1 +
 Makefile|3 +
 board/logicpd/imx27lite/imx27lite.c |   19 +++
 include/configs/magnesium.h |  260 +++
 5 files changed, 287 insertions(+), 0 deletions(-)
 create mode 100644 include/configs/magnesium.h

diff --git a/MAINTAINERS b/MAINTAINERS
index d6f78de..a381ec4 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -724,6 +724,10 @@ Jens Scharsig e...@bus-elektronik.de

eb_cpux9k2  ARM920T (AT91RM9200 SoC)

+Heiko Schocher h...@denx.de
+
+   magnesium   i.MX27
+
 Robert Schwebel r.schwe...@pengutronix.de

csb226  xscale
diff --git a/MAKEALL b/MAKEALL
index 6e432ba..2b39d91 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -565,6 +565,7 @@ LIST_ARM9= \
edb9315a\
imx27lite   \
lpd7a400\
+   magnesium   \
mv88f6281gtw_ge \
mx1ads  \
mx1fs2  \
diff --git a/Makefile b/Makefile
index ee5b896..7c68115 100644
--- a/Makefile
+++ b/Makefile
@@ -2966,6 +2966,9 @@ lpd7a400_config \
 lpd7a404_config:   unconfig
@$(MKCONFIG) $(@:_config=) arm lh7a40x lpd7a40x

+magnesium_config:  unconfig
+   @$(MKCONFIG) $(@:_config=) arm arm926ejs imx27lite logicpd mx27
+
 mv88f6281gtw_ge_config: unconfig
@$(MKCONFIG) $(@:_config=) arm arm926ejs $(@:_config=) Marvell kirkwood

diff --git a/board/logicpd/imx27lite/imx27lite.c 
b/board/logicpd/imx27lite/imx27lite.c
index 63375d5..0c7041a 100644
--- a/board/logicpd/imx27lite/imx27lite.c
+++ b/board/logicpd/imx27lite/imx27lite.c
@@ -29,6 +29,10 @@ DECLARE_GLOBAL_DATA_PTR;
 int board_init (void)
 {
struct gpio_regs *regs = (struct gpio_regs *)IMX_GPIO_BASE;
+#if defined(CONFIG_MAGNESIUM)
+   struct system_control_regs *sc_regs =
+   (struct system_control_regs *)IMX_SYSTEM_CTL_BASE;
+#endif

gd-bd-bi_arch_number = MACH_TYPE_IMX27LITE;
gd-bd-bi_boot_params = PHYS_SDRAM_1 + 0x100;
@@ -43,9 +47,20 @@ int board_init (void)
regs-port[PORTC].dr);
 #endif
 #ifdef CONFIG_MXC_MMC
+#if defined(CONFIG_MAGNESIUM)
+   mx27_sd1_init_pins();
+#else
mx27_sd2_init_pins();
 #endif
+#endif

+#if defined(CONFIG_MAGNESIUM)
+   /*
+* set in FMCR NF_FMS Bit(5) to 1
+* (NAND Flash with 2 Kbyte page size)
+*/
+   writel(readl(sc_regs-fmcr) | (1  5), sc_regs-fmcr);
+#endif
return 0;
 }

@@ -68,6 +83,10 @@ int dram_init (void)

 int checkboard(void)
 {
+#if defined(CONFIG_MAGNESIUM)
+   printf(LogicPD magnesium\n);
+#else
printf(LogicPD imx27lite\n);
+#endif
return 0;
 }
diff --git a/include/configs/magnesium.h b/include/configs/magnesium.h
new file mode 100644
index 000..555278a
--- /dev/null
+++ b/include/configs/magnesium.h
@@ -0,0 +1,260 @@
+/*
+ * Copyright (C) 2010 Heiko Schocher h...@denx.de
+ *
+ * based from:
+ * Copyright (C) 2009 Ilya Yanok ya...@emcraft.com
+ *
+ * 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
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+/*
+ * SoC Configuration
+ */
+#define CONFIG_ARM926EJS   /* arm926ejs CPU core */
+#define CONFIG_MX27
+#define CONFIG_MAGNESIUM
+#define CONFIG_MX27_CLK32  32768   /* OSC32K frequency */
+#define CONFIG_SYS_HZ  1000
+#define CONFIG_HOSTNAMEmagnesium
+
+#define CONFIG_DISPLAY_CPUINFO
+
+#define CONFIG_CMDLINE_TAG 1   /* enable passing of ATAGs */
+#define CONFIG_SETUP_MEMORY_TAGS   1
+#define CONFIG_INITRD_TAG  1
+
+/*
+ * Lowlevel configuration
+ */
+#define SDRAM_ESDCFG_REGISTER_VAL(cas) \
+   (ESDCFG_TRC(10) |   \
+   ESDCFG_TRCD(3) |\
+   ESDCFG_TCAS(cas) |  \
+   ESDCFG_TRRD(1) |\
+   ESDCFG_TRAS(5) |\
+ 

Re: [U-Boot] Problems with fw_printenv

2010-03-03 Thread Ronald Kortekaas
Op 3-3-2010 21:21, Wolfgang Denk schreef:
 Dear Ronald Kortekaas,

 In messaged94411866239f14cae874e27a9b65ca88485e5e...@exalg01.chess.int  you 
 wrote:

 The problem was the definition of CONFIG_ENV_ADDR_REDUND after undefining 
 this it works.
  
 Do you understand the consequewnces of removing this definition? Are
 you sure you really want to do this?

 Best regards,

 Wolfgang Denk


I think I found the solution. I changed my configuration als follows:

Removed the #undef CONFIG_ENV_ADDR_REDUND
Added

#define CONFIG_ENV_OFFSET_REDUND(CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
#define CONFIG_ENV_SIZE_REDUNDCONFIG_ENV_SIZE

Changed my mtdparts to:

#define MTDPARTS_DEFAULT
mtdparts=physmap-flash.0:256k(uboot)ro,128k(ubootenv),128k(ubootenv_re),4096k(kernel)

So mtd in u-boot showd:

device nor0 physmap-flash.0, # parts = 3
  #: namesizeoffset  mask_flags
  0: uboot   0x0004  0x  1
  1: ubootenv0x0002  0x0004  0
  2: ubootenv0x0002  0x0006  0
  3: kernel  0x0040  0x0008  0

I changed fw_env.h to #define HAVE_REDUND.

And the fw_env.config:

/dev/mtd20x0x20x2
/dev/mtd30x0x20x2

So now it's working with the redundant environment partitions. Thanks 
for your support
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Pull request - ColdFire

2010-03-03 Thread TC Liew
Wolfgang,

Please pull. Thanks!

Regards,
TsiChung

The following changes since commit f3651764e57e353251695691677bd95ba5a420bc:
  Frans Meulenbroeks (1):
cmd_itest.c: fix pointer dereferencing

are available in the git repository at:

  git://git.denx.de/u-boot-coldfire.git next

Richard Retanubun (1):
  MCF5271-only: Added a weak board_reset function to allow custom reset

Wolfgang Wegner (3):
  add include/asm-m68k/unaligned.h
  MCF532x: make icache_enable use CONFIG_SYS_SDRAM_SIZE
  allow MCF532x to use CONFIG_MONITOR_IS_IN_RAM

 cpu/mcf52x2/cpu.c|6 ++
 cpu/mcf52x2/cpu.h|   33 +
 cpu/mcf532x/speed.c  |3 +++
 cpu/mcf532x/start.S  |6 +-
 include/asm-m68k/unaligned.h |   15 +++
 5 files changed, 62 insertions(+), 1 deletions(-)
 create mode 100644 cpu/mcf52x2/cpu.h
 create mode 100644 include/asm-m68k/unaligned.h
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot