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

2010-04-29 Thread Terry Lv
This patch is to save environment data to mmc card.
It uses interfaces defined in generic mmc.

Signed-off-by: Terry Lv r65...@freescale.com
---
 arch/arm/lib/board.c |   10 ++--
 arch/powerpc/lib/board.c |   12 ++--
 common/Makefile  |1 +
 common/cmd_nvedit.c  |1 +
 common/env_mmc.c |  154 ++
 5 files changed, 167 insertions(+), 11 deletions(-)
 create mode 100644 common/env_mmc.c

diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
index f5660a9..f62e0eb 100644
--- a/arch/arm/lib/board.c
+++ b/arch/arm/lib/board.c
@@ -347,6 +347,11 @@ void start_armboot (void)
dataflash_print_info();
 #endif
 
+#ifdef CONFIG_GENERIC_MMC
+   puts (MMC:   );
+   mmc_initialize (gd-bd);
+#endif
+
/* initialize environment */
env_relocate ();
 
@@ -419,11 +424,6 @@ extern void davinci_eth_set_mac_addr (const u_int8_t 
*addr);
board_late_init ();
 #endif
 
-#ifdef CONFIG_GENERIC_MMC
-   puts (MMC:   );
-   mmc_initialize (gd-bd);
-#endif
-
 #ifdef CONFIG_BITBANGMII
bb_miiphy_init();
 #endif
diff --git a/arch/powerpc/lib/board.c b/arch/powerpc/lib/board.c
index 7b09fb5..1008635 100644
--- a/arch/powerpc/lib/board.c
+++ b/arch/powerpc/lib/board.c
@@ -783,6 +783,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
+
/* relocate environment function pointers etc. */
env_relocate ();
 
@@ -939,12 +945,6 @@ void board_init_r (gd_t *id, ulong dest_addr)
scsi_init ();
 #endif
 
-#ifdef CONFIG_GENERIC_MMC
-   WATCHDOG_RESET ();
-   puts (MMC:  );
-   mmc_initialize (bd);
-#endif
-
 #if defined(CONFIG_CMD_DOC)
WATCHDOG_RESET ();
puts (DOC:   );
diff --git a/common/Makefile b/common/Makefile
index dbf7a05..2c37073 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -58,6 +58,7 @@ COBJS-$(CONFIG_ENV_IS_IN_FLASH) += env_embedded.o
 COBJS-$(CONFIG_ENV_IS_IN_NVRAM) += env_embedded.o
 COBJS-$(CONFIG_ENV_IS_IN_FLASH) += env_flash.o
 COBJS-$(CONFIG_ENV_IS_IN_MG_DISK) += env_mgdisk.o
+COBJS-$(CONFIG_ENV_IS_IN_MMC) += env_mmc.o
 COBJS-$(CONFIG_ENV_IS_IN_NAND) += env_nand.o
 COBJS-$(CONFIG_ENV_IS_IN_NVRAM) += env_nvram.o
 COBJS-$(CONFIG_ENV_IS_IN_ONENAND) += env_onenand.o
diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
index eb89e9e..78f75fb 100644
--- a/common/cmd_nvedit.c
+++ b/common/cmd_nvedit.c
@@ -59,6 +59,7 @@ DECLARE_GLOBAL_DATA_PTR;
 !defined(CONFIG_ENV_IS_IN_FLASH)\
 !defined(CONFIG_ENV_IS_IN_DATAFLASH)\
 !defined(CONFIG_ENV_IS_IN_MG_DISK)  \
+!defined(CONFIG_ENV_IS_IN_MMC)   \
 !defined(CONFIG_ENV_IS_IN_NAND) \
 !defined(CONFIG_ENV_IS_IN_NVRAM)\
 !defined(CONFIG_ENV_IS_IN_ONENAND)  \
diff --git a/common/env_mmc.c b/common/env_mmc.c
new file mode 100644
index 000..88db336
--- /dev/null
+++ b/common/env_mmc.c
@@ -0,0 +1,154 @@
+/*
+ * (C) Copyright 2008-2010 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
+ */
+
+/* #define DEBUG */
+
+#include common.h
+
+#include command.h
+#include environment.h
+#include linux/stddef.h
+#include malloc.h
+#include mmc.h
+
+/* references to names in env_common.c */
+extern uchar default_environment[];
+
+char *env_name_spec = MMC;
+
+#ifdef ENV_IS_EMBEDDED
+extern uchar environment[];
+env_t *env_ptr = (env_t *)(environment[0]);
+#else /* ! ENV_IS_EMBEDDED */
+env_t *env_ptr;
+#endif /* ENV_IS_EMBEDDED */
+
+/* local functions */
+#if !defined(ENV_IS_EMBEDDED)
+static void use_default(void);
+#endif
+
+DECLARE_GLOBAL_DATA_PTR;
+
+uchar env_get_char_spec(int index)
+{
+   return *((uchar *)(gd-env_addr + index));
+}
+
+int env_init(void)
+{
+   /* use default */
+   gd-env_addr = (ulong)default_environment[0];
+   gd-env_valid = 1;
+
+   return 0;
+}
+
+int init_mmc_for_env(struct mmc *mmc)
+{
+   if (!mmc) {
+   puts(No MMC card found\n);
+   return -1;
+   }
+
+   if (mmc_init(mmc)) {
+   puts(MMC init failed\n);
+ 

[U-Boot] U-boot command prompt issue....

2010-04-29 Thread Hari Babu
Hi,I want to debug (Seeing environment variables,board H/W details) the
Cavium SSL card which is having u boot loader inside.While i am seeing the
boot lines by configuring the minicom, at some time it is asking Hit any
key to stop autoboot. I had hitted the Enter key with in time but it's not
entering to the u-boot command prompt.How Can I enter to the u-boot command
prompt?
Thank you.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] sf: move useful messages from debug to printf

2010-04-29 Thread Wolfgang Denk
Dear Mike Frysinger,

In message 1272516050-17920-1-git-send-email-vap...@gentoo.org you wrote:
 At the moment, the default SPI flash subsystem is quite terse.  Errors and
 successes both result in a generic message.  So move the useful errors and
 useful successes to printf output by default.
...
 - debug(SF: Detected %s with page size %lu, total %u bytes\n,
 + printf(SF: Detected %s with page size %lu, total %u bytes\n,
   params-name, page_size, asf-flash.size);

When we touch this code, we might as well make the output more
readable and print the size in easier to parse units using
print_size() - see Timur's patches from 13 Ap 2010,
http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/77288

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
It is your destiny. - Darth Vader
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Fix typos in Korat board console output

2010-04-29 Thread Stefan Roese
On Tuesday 20 April 2010 14:11:40 Larry Johnson wrote:
 Signed-off-by: Larry Johnson l...@acm.org

Applied to u-boot-ppc4xx/master. Thanks.

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


Re: [U-Boot] [PATCH] ppc4xx: Add missing APC405 to MAKEALL

2010-04-29 Thread Stefan Roese
On Monday 26 April 2010 13:31:08 Stefan Roese wrote:
 Signed-off-by: Stefan Roese s...@denx.de
 Cc: Matthias Fuchs matthias.fu...@esd.eu

Applied to u-boot-ppc4xx/master. Thanks.

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


Re: [U-Boot] [PATCH v2] ppc4xx: Add support for ICON board (PPC440SPe)

2010-04-29 Thread Stefan Roese

On Tuesday 27 April 2010 11:37:28 Stefan Roese wrote:
 This patch adds support for the Mosaix Technologies, Inc. ICON board,
 based on the AppliedMicro (AMCC) PPC440SPe. It's equipped with an SODIMM
 (512MB standard) and 64MByte of NOR FLASH.
 
 Support for the onboard SM502 will be added later.
 
 Signed-off-by: Stefan Roese s...@denx.de

Applied to u-boot-ppc4xx/master. Thanks.

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


Re: [U-Boot] [PATCH] ppc4xx: Fix APC405 build breakage

2010-04-29 Thread Stefan Roese
On Wednesday 28 April 2010 11:09:59 Stefan Roese wrote:
 This patch fixes APC405 build, by defining CONFIG_PPC4XX_I2C. This is
 needed since the move of the PPC4xx I2C driver into the drivers/i2c
 directory.
 
 Signed-off-by: Stefan Roese s...@denx.de
 Cc: Matthias Fuchs matthias.fu...@esd.eu

Applied to u-boot-ppc4xx/master. Thanks.

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


Re: [U-Boot] U-boot command prompt issue....

2010-04-29 Thread Wolfgang Denk
Dear Hari Babu,

In message w2ge05b45b91004290050m4b0131a6jf9aedb63d506d...@mail.gmail.com you 
wrote:

 Hi,I want to debug (Seeing environment variables,board H/W details) the
 Cavium SSL card which is having u boot loader inside.While i am seeing the

Please contact Cavium technical support about questions with their
boot loader - they never contributed their code back to mainline, so
we don;t know what modifications they might have made that could cause
such behaviour.

 boot lines by configuring the minicom, at some time it is asking Hit any
 key to stop autoboot. I had hitted the Enter key with in time but it's not
 entering to the u-boot command prompt.How Can I enter to the u-boot command
 prompt?

Also, consider using a different terminal emulation program, as
minicom is known to have several issues; see for example
http://www.denx.de/wiki/view/DULG/UBootInit and
http://www.denx.de/wiki/view/DULG/SystemSetup#Section_4.4.

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
Digital computers are themselves more complex than most things people
build: They have very large numbers of states. This makes conceiving,
describing, and testing them hard. Software systems  have  orders-of-
magnitude more states than computers do.   - Fred Brooks, Jr.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Please pull u-boot-ppc4xx/master

2010-04-29 Thread Stefan Roese
The following changes since commit 3699c28e6d16b563629c285311a0ce62a2c4c5d0:

  Merge branch 'master' of git://git.denx.de/u-boot-video (2010-04-28 00:10:41 
+0200)

are available in the git repository at:

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

Larry Johnson (1):
  Fix typos in Korat board console output

Stefan Roese (3):
  ppc4xx: Add missing APC405 to MAKEALL
  ppc4xx: Add support for ICON board (PPC440SPe)
  ppc4xx: Fix APC405 build breakage

 MAINTAINERS |1 +
 MAKEALL |2 +
 Makefile|3 +
 board/korat/korat.c |6 +-
 board/mosaixtech/icon/Makefile  |   53 ++
 board/mosaixtech/icon/chip_config.c |   55 ++
 board/mosaixtech/icon/config.mk |   34 
 board/mosaixtech/icon/icon.c|  319 +++
 board/mosaixtech/icon/init.S|   88 ++
 include/configs/APC405.h|1 +
 include/configs/icon.h  |  308 +
 11 files changed, 867 insertions(+), 3 deletions(-)
 create mode 100644 board/mosaixtech/icon/Makefile
 create mode 100644 board/mosaixtech/icon/chip_config.c
 create mode 100644 board/mosaixtech/icon/config.mk
 create mode 100644 board/mosaixtech/icon/icon.c
 create mode 100644 board/mosaixtech/icon/init.S
 create mode 100644 include/configs/icon.h
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v3] at91: define matrix registers bit fields

2010-04-29 Thread Asen Dimov
Change since [PATCH v2]: use space instead of tab after #define.

Signed-off-by: Asen Dimov di...@ronetix.at
---
 arch/arm/include/asm/arch-at91/at91_matrix.h |  138 ++
 1 files changed, 138 insertions(+), 0 deletions(-)

diff --git a/arch/arm/include/asm/arch-at91/at91_matrix.h 
b/arch/arm/include/asm/arch-at91/at91_matrix.h
index 981ec20..aa62fe7 100644
--- a/arch/arm/include/asm/arch-at91/at91_matrix.h
+++ b/arch/arm/include/asm/arch-at91/at91_matrix.h
@@ -113,4 +113,142 @@ typedef struct at91_matrix {
 
 #define AT91_MATRIX_CSA_EBI1_CS2A  0x0008
 
+#if defined CONFIG_AT91SAM9261
+/* Remap Command for AHB Master 0 (ARM926EJ-S Instruction Master) */
+#define AT91_MATRIX_MCFG_RCB0  (1  0)
+/* Remap Command for AHB Master 1 (ARM926EJ-S Data Master) */
+#define AT91_MATRIX_MCFG_RCB1  (1  1)
+#endif
+
+/* Undefined Length Burst Type */
+#if defined(CONFIG_AT91SAM9260) || defined(CONFIG_AT91SAM9263) || \
+   defined(CONFIG_AT91SAM9G45)
+#define AT91_MATRIX_MCFG_ULBT_INFINITE 0x
+#define AT91_MATRIX_MCFG_ULBT_SINGLE   0x0001
+#define AT91_MATRIX_MCFG_ULBT_FOUR 0x0002
+#define AT91_MATRIX_MCFG_ULBT_EIGHT0x0003
+#define AT91_MATRIX_MCFG_ULBT_SIXTEEN  0x0004
+#endif
+#if defined(CONFIG_AT91SAM9G45)
+#define AT91_MATRIX_MCFG_ULBT_THIRTYTWO0x0005
+#define AT91_MATRIX_MCFG_ULBT_SIXTYFOUR0x0006
+#define AT91_MATRIX_MCFG_ULBT_128  0x0007
+#endif
+
+/* Default Master Type */
+#define AT91_MATRIX_SCFG_DEFMSTR_TYPE_NONE 0x
+#define AT91_MATRIX_SCFG_DEFMSTR_TYPE_LAST 0x0001
+#define AT91_MATRIX_SCFG_DEFMSTR_TYPE_FIXED0x0002
+
+/* Fixed Index of Default Master */
+#if defined(CONFIG_AT91SAM9G45) || defined(CONFIG_AT91SAM9263)
+#define AT91_MATRIX_SCFG_FIXED_DEFMSTR(x)  ((x  0xf)  18)
+#elif defined(CONFIG_AT91SAM9261) || defined(CONFIG_AT91SAM9260)
+#define AT91_MATRIX_SCFG_FIXED_DEFMSTR(x)  ((x  7)  18)
+#endif
+
+/* Maximum Number of Allowed Cycles for a Burst */
+#if defined(CONFIG_AT91SAM9G45)
+#define AT91_MATRIX_SCFG_SLOT_CYCLE(x) ((x  0x1ff)  0)
+#elif defined(CONFIG_AT91SAM9260) || defined(CONFIG_AT91SAM9261) || \
+   defined(CONFIG_AT91SAM9263)
+#define AT91_MATRIX_SCFG_SLOT_CYCLE(x) ((x  0xff)  0)
+#endif
+
+/* Arbitration Type */
+#if defined(CONFIG_AT91SAM9260) || defined(CONFIG_AT91SAM9263)
+#define AT91_MATRIX_SCFG_ARBT_ROUND_ROBIN  0x
+#define AT91_MATRIX_SCFG_ARBT_FIXED_PRIORITY   0x0100
+#endif
+
+/* Master Remap Control Register */
+#if defined(CONFIG_AT91SAM9260) || defined(CONFIG_AT91SAM9263) || \
+   defined(CONFIG_AT91SAM9G45)
+/* Remap Command for AHB Master 0 (ARM926EJ-S Instruction Master) */
+#define AT91_MATRIX_MRCR_RCB0  (1  0)
+/* Remap Command for AHB Master 1 (ARM926EJ-S Data Master) */
+#define AT91_MATRIX_MRCR_RCB1  (1  1)
+#endif
+#if defined(CONFIG_AT91SAM9263) || defined(CONFIG_AT91SAM9G45)
+#define AT91_MATRIX_MRCR_RCB2  0x0004
+#define AT91_MATRIX_MRCR_RCB3  0x0008
+#define AT91_MATRIX_MRCR_RCB4  0x0010
+#define AT91_MATRIX_MRCR_RCB5  0x0020
+#define AT91_MATRIX_MRCR_RCB6  0x0040
+#define AT91_MATRIX_MRCR_RCB7  0x0080
+#define AT91_MATRIX_MRCR_RCB8  0x0100
+#endif
+#if defined(CONFIG_AT91SAM9G45)
+#define AT91_MATRIX_MRCR_RCB9  0x0200
+#define AT91_MATRIX_MRCR_RCB10 0x0400
+#define AT91_MATRIX_MRCR_RCB11 0x0800
+#endif
+
+/* TCM Configuration Register */
+#if defined(CONFIG_AT91SAM9G45)
+/* Size of ITCM enabled memory block */
+#define AT91_MATRIX_TCMR_ITCM_00x
+#define AT91_MATRIX_TCMR_ITCM_32   0x0040
+/* Size of DTCM enabled memory block */
+#define AT91_MATRIX_TCMR_DTCM_00x
+#define AT91_MATRIX_TCMR_DTCM_32   0x0060
+#define AT91_MATRIX_TCMR_DTCM_64   0x0070
+/* Wait state TCM register */
+#define AT91_MATRIX_TCMR_TCM_NO_WS 0x
+#define AT91_MATRIX_TCMR_TCM_ONE_WS0x0800
+#endif
+#if defined(CONFIG_AT91SAM9263)
+/* Size of ITCM enabled memory block */
+#define AT91_MATRIX_TCMR_ITCM_00x
+#define AT91_MATRIX_TCMR_ITCM_16   0x0005
+#define AT91_MATRIX_TCMR_ITCM_32   0x0006
+/* Size of DTCM enabled memory block */
+#define AT91_MATRIX_TCMR_DTCM_00x
+#define AT91_MATRIX_TCMR_DTCM_16   0x0050
+#define AT91_MATRIX_TCMR_DTCM_32   0x0060
+#endif
+#if defined(CONFIG_AT91SAM9261)
+/* Size of ITCM enabled memory block */
+#define AT91_MATRIX_TCMR_ITCM_00x
+#define AT91_MATRIX_TCMR_ITCM_16   0x0005
+#define AT91_MATRIX_TCMR_ITCM_32   0x0006
+#define AT91_MATRIX_TCMR_ITCM_64   0x0007
+/* Size of DTCM enabled memory block */
+#define AT91_MATRIX_TCMR_DTCM_00x
+#define AT91_MATRIX_TCMR_DTCM_16   0x0050
+#define AT91_MATRIX_TCMR_DTCM_32   0x0060
+#define AT91_MATRIX_TCMR_DTCM_64   0x0070
+#endif
+
+#if defined(CONFIG_AT91SAM9G45)
+/* Video 

Re: [U-Boot] [PATCH V6 1/3] Initial support for Marvell Orion5x SoC

2010-04-29 Thread Prafulla Wadaskar
 

 -Original Message-
 From: Albert ARIBAUD [mailto:albert.arib...@free.fr] 
 Sent: Thursday, April 15, 2010 12:05 PM
 To: Prafulla Wadaskar
 Cc: Wolfgang Denk; U-Boot@lists.denx.de; Tom
 Subject: Re: [U-Boot] [PATCH V6 1/3] Initial support for 
 Marvell Orion5x SoC
 
...snip...
  I am waiting for u-boot-arm.git to get rebased so that I 
 can rebase u-boot-mravell.git
  Meanwhile this happens, you can post your patches w.r.to u-boot.git.
  
  Regards..
  Prafulla . .
 
 Prafulla,
 
 FYI, I will unfortunately be unable to work further on this 
 patch until 
 next wednesday.

Ping

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


[U-Boot] Splash screen problem

2010-04-29 Thread Radovan Vápeník
Hello,
i am new in uboot. I have already configured and compiled uboot (i am using 
version 2009.11), but i have problem with splash image. I am using AT91SAM9263 
processor witch connected NAND flash and some RAM. I can save image to nand or 
read it back without problems, but i can't load image and show it to display. 
When I use and save setenv splashimage 'nand read 2500 C 2', 
during next boot shows me warning Error: no valid bmp image at 0. How to 
solve this problem. Thanks for advice.

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


Re: [U-Boot] Splash screen problem

2010-04-29 Thread Wolfgang Denk
Dear =?iso-8859-2?Q?Radovan=20V=E1pen=EDk?=,

In message 56283.4061.1017-16955-880731597-1272534...@seznam.cz you wrote:
 Hello,
 i am new in uboot. I have already configured and compiled uboot (i am using 
 version 2009.11), but i have problem with splash image. I am using 
 AT91SAM9263 processor witch connected NAND flash and some RAM. I can save 
 image to nand or read it back withou
 t problems, but i can't load image and show it to display. When I use and 
 save setenv splashimage 'nand read 2500 C 2', during next boot 
 shows me warning Error: no valid bmp image at 0. How to solve this problem. 
 Thanks for advice.

0 is obviously a bad address for this purpose - what exactly is your
setting of the splashimage environment variable?

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
A stone was placed at a ford in a river with the inscription:
When this stone is covered it is dangerous to ford here.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [GIT PULL] Please pull u-boot-pxa/next

2010-04-29 Thread Marek Vasut
Dne Čt 29. dubna 2010 06:37:47 Wolfgang Denk napsal(a):
 Dear Marek Vasut,
 
 In message 201004290313.29496.marek.va...@gmail.com you wrote:
  I rebased the branch ... Tom, please pull.
  Thanks
  
  The following changes since commit 3699c28e6d16b563629c285311a0ce62a2c4c5d0:
Wolfgang Denk (1):
  Merge branch 'master' of git://git.denx.de/u-boot-video
  
  are available in the git repository at:
git://git.denx.de/u-boot-pxa.git next
  
  Marek Vasut (5):
PXA: Align stack to 8 bytes
 
 This one is a bug fix. Please let's add this to the current release.
 
 
 Best regards,
 
 Wolfgang Denk
see the other mail then please
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [GIT PULL] Please pull u-boot-pxa/fix

2010-04-29 Thread Marek Vasut
The following changes since commit 3699c28e6d16b563629c285311a0ce62a2c4c5d0:
  Wolfgang Denk (1):
Merge branch 'master' of git://git.denx.de/u-boot-video

are available in the git repository at:

  git://git.denx.de/u-boot-pxa.git fix

Marek Vasut (1):
  PXA: Align stack to 8 bytes

 arch/arm/cpu/pxa/start.S |5 -
 1 files changed, 4 insertions(+), 1 deletions(-)
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [GIT PULL] Please pull u-boot-pxa/next

2010-04-29 Thread Marek Vasut
Tom, ok, one more time, I moved the fix Wolfgang requested to another branch. 
Please pull these changes then.
Cheers

The following changes since commit 3699c28e6d16b563629c285311a0ce62a2c4c5d0:
  Wolfgang Denk (1):
Merge branch 'master' of git://git.denx.de/u-boot-video

are available in the git repository at:

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

Marek Vasut (4):
  PXA: PXAMMC: Drop different delays for PXA27X
  PXA: PXAMMC: Add Monahans support
  PXA: Add UP2OCR register bit definitions
  PXA: Add missing MDREFR bits

 arch/arm/include/asm/arch-pxa/pxa-regs.h |   25 +
 drivers/mmc/pxa_mmc.c|   17 ++---
 2 files changed, 27 insertions(+), 15 deletions(-)
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Splash screen problem

2010-04-29 Thread Radovan Vápeník
The environment variable preboot runs after splashimage, which other env 
variablecan I use, which runs before splashimage?

Best regards
Radovan Vapenik

  Původní zpráva 
 Od: Wolfgang Denk w...@denx.de
 Předmět: Re: Re: [U-Boot] Splash screen problem
 Datum: 29.4.2010 13:54:16
 
 Dear =?iso-8859-2?Q?Radovan=20V=E1pen=EDk?=,
 
 please make sure to keep the mailing list on Cc:
 
 In message 56290.4066.1012-16596-130053893-1272541...@seznam.cz you wrote:
  Yes, it is bad address :-)
  Settings of splashimage:
  splashimage=nand read 2500 C 2
 
 Well, this cannot work.
 
 As documented, splashimage is supposed to hold the address where the
 image is stored in memory.
 
  The enviroment variable splashimage runs the command to read from NAND,
  but i don't know how to tell (return) to splashimage the address of
  bitmap after reading from NAND.
 
 The command above reads the image to address 2500 in RAM, so you
 should define
 
   = setenv splashimage 2500
 
 Of course the reading from NAND must be done somewhere else, for
 example as part of a preboot command.
 
 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
 The bad reputation UNIX has gotten is totally undeserved, laid on by
 people who don't understand, who have not gotten in there  and  tried
 anything.  -- Jim Joyce, owner of Jim Joyce's UNIX Bookstore
 
 
 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [x86] Success! - Linux is UP

2010-04-29 Thread Graeme Russ
Hi All,

Just a really quick message to say that I now have Linux Kernel 2.6.33 and
a JFFS2 Root File System up and running on my AMD SC520 board.

I big thanks to everyone for helping out on this 'little' project of mine.

There is no way I could have possibly gained so much personal satisfaction
for such a huge task if not for people like yourselves committed to FOSS -
Thank You All

Graeme

(more patches from me will come I'm sure)
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] at91: define matrix registers bit fields

2010-04-29 Thread Tom Rix
Asen Dimov wrote:
 Signed-off-by: Asen Dimov di...@ronetix.at
 ---
  arch/arm/include/asm/arch-at91/at91_matrix.h |  138 
 ++
  1 files changed, 138 insertions(+), 0 deletions(-)
 

I saw this v2 right after the v1.
It fixed the problem with the cpp typo.

This is ok.
Applied to arm/master.
Thanks
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] pm9263 converted to at91 soc access

2010-04-29 Thread Tom Rix
Asen Dimov wrote:
 Signed-off-by: Asen Dimov di...@ronetix.at
 ---
  board/ronetix/pm9263/led.c|   15 ++--
  board/ronetix/pm9263/pm9263.c |  195 
 +
  include/configs/pm9263.h  |   87 +-
  3 files changed, 152 insertions(+), 145 deletions(-)
 
Applied to arm/master.
Thanks
Tom
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3] at91: define matrix registers bit fields

2010-04-29 Thread Tom Rix
Asen Dimov wrote:
 Change since [PATCH v2]: use space instead of tab after #define.
 
 Signed-off-by: Asen Dimov di...@ronetix.at

I saw this after v2 was pushed.
The space vs tab was not as important as fixing the cpp.
Tom

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


Re: [U-Boot] [x86] Success! - Linux is UP

2010-04-29 Thread Joakim Tjernlund
 Hi All,

 Just a really quick message to say that I now have Linux Kernel 2.6.33 and
 a JFFS2 Root File System up and running on my AMD SC520 board.

 I big thanks to everyone for helping out on this 'little' project of mine.

 There is no way I could have possibly gained so much personal satisfaction
 for such a huge task if not for people like yourselves committed to FOSS -
 Thank You All

Way to go :) Now if we only could get a fully relocatable u-boot ...

  Jocke

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


[U-Boot] [PATCH] OMAP3: remove unused config macros

2010-04-29 Thread Grazvydas Ignotas
Most OMAP3 boards have various flash related macros in their configs
that are either not referenced anywhere in the code or are used by
drivers that are not enabled. Remove them.

Signed-off-by: Grazvydas Ignotas nota...@gmail.com
---
 include/configs/omap3_beagle.h  |   18 --
 include/configs/omap3_evm.h |   18 --
 include/configs/omap3_overo.h   |   18 --
 include/configs/omap3_pandora.h |   20 
 include/configs/omap3_sdp3430.h |7 ---
 include/configs/omap3_zoom1.h   |   18 --
 include/configs/omap3_zoom2.h   |   10 --
 7 files changed, 0 insertions(+), 109 deletions(-)

diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h
index 08d79ac..f8266b1 100644
--- a/include/configs/omap3_beagle.h
+++ b/include/configs/omap3_beagle.h
@@ -291,9 +291,6 @@
 #define PISMO1_NAND_SIZE   GPMC_SIZE_128M
 #define PISMO1_ONEN_SIZE   GPMC_SIZE_128M
 
-#define CONFIG_SYS_MAX_FLASH_SECT  520 /* max number of sectors on */
-   /* one chip */
-#define CONFIG_SYS_MAX_FLASH_BANKS 2   /* max number of flash banks */
 #define CONFIG_SYS_MONITOR_LEN (256  10) /* Reserve 2 sectors */
 
 #define CONFIG_SYS_FLASH_BASE  boot_flash_base
@@ -310,21 +307,6 @@
 #define CONFIG_ENV_OFFSET  boot_flash_off
 #define CONFIG_ENV_ADDRSMNAND_ENV_OFFSET
 
-/*---
- * CFI FLASH driver setup
- */
-/* timeout values are in ticks */
-#define CONFIG_SYS_FLASH_ERASE_TOUT(100 * CONFIG_SYS_HZ)
-#define CONFIG_SYS_FLASH_WRITE_TOUT(100 * CONFIG_SYS_HZ)
-
-/* Flash banks JFFS2 should use */
-#define CONFIG_SYS_MAX_MTD_BANKS   (CONFIG_SYS_MAX_FLASH_BANKS + \
-   CONFIG_SYS_MAX_NAND_DEVICE)
-#define CONFIG_SYS_JFFS2_MEM_NAND
-/* use flash_info[2] */
-#define CONFIG_SYS_JFFS2_FIRST_BANKCONFIG_SYS_MAX_FLASH_BANKS
-#define CONFIG_SYS_JFFS2_NUM_BANKS 1
-
 #ifndef __ASSEMBLY__
 extern unsigned int boot_flash_base;
 extern volatile unsigned int boot_flash_env_addr;
diff --git a/include/configs/omap3_evm.h b/include/configs/omap3_evm.h
index 0d99f7d..39eb4b5 100644
--- a/include/configs/omap3_evm.h
+++ b/include/configs/omap3_evm.h
@@ -295,9 +295,6 @@
 #define PISMO1_NAND_SIZE   GPMC_SIZE_128M
 #define PISMO1_ONEN_SIZE   GPMC_SIZE_128M
 
-#define CONFIG_SYS_MAX_FLASH_SECT  520 /* max number of sectors */
-   /* on one chip */
-#define CONFIG_SYS_MAX_FLASH_BANKS 2   /* max number of flash banks */
 #define CONFIG_SYS_MONITOR_LEN (256  10) /* Reserve 2 sectors */
 
 #define CONFIG_SYS_FLASH_BASE  boot_flash_base
@@ -314,21 +311,6 @@
 #define CONFIG_ENV_OFFSET  boot_flash_off
 #define CONFIG_ENV_ADDRboot_flash_env_addr
 
-/*---
- * CFI FLASH driver setup
- */
-/* timeout values are in ticks */
-#define CONFIG_SYS_FLASH_ERASE_TOUT(100 * CONFIG_SYS_HZ)
-#define CONFIG_SYS_FLASH_WRITE_TOUT(100 * CONFIG_SYS_HZ)
-
-/* Flash banks JFFS2 should use */
-#define CONFIG_SYS_MAX_MTD_BANKS   (CONFIG_SYS_MAX_FLASH_BANKS + \
-   CONFIG_SYS_MAX_NAND_DEVICE)
-#define CONFIG_SYS_JFFS2_MEM_NAND
-/* use flash_info[2] */
-#define CONFIG_SYS_JFFS2_FIRST_BANKCONFIG_SYS_MAX_FLASH_BANKS
-#define CONFIG_SYS_JFFS2_NUM_BANKS 1
-
 #ifndef __ASSEMBLY__
 extern unsigned int boot_flash_base;
 extern volatile unsigned int boot_flash_env_addr;
diff --git a/include/configs/omap3_overo.h b/include/configs/omap3_overo.h
index a43500b..b5b2dbe 100644
--- a/include/configs/omap3_overo.h
+++ b/include/configs/omap3_overo.h
@@ -260,9 +260,6 @@
 #define PISMO1_NAND_SIZE   GPMC_SIZE_128M
 #define PISMO1_ONEN_SIZE   GPMC_SIZE_128M
 
-#define CONFIG_SYS_MAX_FLASH_SECT  520 /* max number of sectors on */
-   /* one chip */
-#define CONFIG_SYS_MAX_FLASH_BANKS 2   /* max number of flash banks */
 #define CONFIG_SYS_MONITOR_LEN (256  10) /* Reserve 2 sectors */
 
 #define CONFIG_SYS_FLASH_BASE  boot_flash_base
@@ -279,21 +276,6 @@
 #define CONFIG_ENV_OFFSET  boot_flash_off
 #define CONFIG_ENV_ADDRSMNAND_ENV_OFFSET
 
-/*---
- * CFI FLASH driver setup
- */
-/* timeout values are in ticks */
-#define CONFIG_SYS_FLASH_ERASE_TOUT(100 * CONFIG_SYS_HZ)
-#define CONFIG_SYS_FLASH_WRITE_TOUT(100 * CONFIG_SYS_HZ)
-
-/* Flash banks JFFS2 should use */
-#define CONFIG_SYS_MAX_MTD_BANKS   (CONFIG_SYS_MAX_FLASH_BANKS + \
-   

Re: [U-Boot] Exception in U-Boot

2010-04-29 Thread Manuel Lauss
On Thu, Apr 29, 2010 at 4:04 PM, Sanjay Kumar sanjay.ku...@gmobis.com wrote:
 After reset address 0xbfc00400, code executes lowlevel_init and subsequently 
 hangs at 0xbfc00570 (RomException).

 I'm attaching start.S and lowlevel_init.S files we are using.

 Please let me know if am doing anything wrong or missing something.

The lowelevel_init.S references registers which don't exist on the Au13xx series
(IC0_* for starters, and I believe the DDR controller registers are wrong too).

I suggest you take the lowlevel_init.S from the DB1300 YAMON sources,
modify dynamic and static bus controller settings, GPIO, ... and use it as
entrypoint.

Manuel
___
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-04-29 Thread Stefano Babic
Terry Lv wrote:
 This patch is to save environment data to mmc card.
 It uses interfaces defined in generic mmc.

Hi Terry,

 
 Signed-off-by: Terry Lv r65...@freescale.com
 ---
  arch/arm/lib/board.c |   10 ++--
  arch/powerpc/lib/board.c |   12 ++--
  common/Makefile  |1 +
  common/cmd_nvedit.c  |1 +
  common/env_mmc.c |  154 
 ++
  5 files changed, 167 insertions(+), 11 deletions(-)
  create mode 100644 common/env_mmc.c

Could you set a version of your patch (something like [PATCH V*] in the
subject, so it is easier to track changes ? This is the third version,
but it is difficult to get it without searching in archive.

 
 diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
 index f5660a9..f62e0eb 100644
 --- a/arch/arm/lib/board.c
 +++ b/arch/arm/lib/board.c
 @@ -347,6 +347,11 @@ void start_armboot (void)
   dataflash_print_info();
  #endif
  
 +#ifdef CONFIG_GENERIC_MMC
 + puts (MMC:   );
 + mmc_initialize (gd-bd);
 +#endif
 +
   /* initialize environment */
   env_relocate ();
  
 @@ -419,11 +424,6 @@ extern void davinci_eth_set_mac_addr (const u_int8_t 
 *addr);
   board_late_init ();
  #endif
  
 -#ifdef CONFIG_GENERIC_MMC
 - puts (MMC:   );
 - mmc_initialize (gd-bd);
 -#endif
 -
  #ifdef CONFIG_BITBANGMII
   bb_miiphy_init();
  #endif

Because it is required to move the initialization of the mmc before
env_relocate(), we need probably to advise that there are some
consequences. If someone implements the mmc support in board_late_init()
(setting a pin multiplexer or something like that, for example), it does
not work. I think we should at least write a comment to advise that the
mmc/sd controller should work after board_init() is called.
However, after a quick check in the arm boards, I have not found a board
that is initializing the mmc controller in board_late_init(). Not sure
for powerpc.

 diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
 index eb89e9e..78f75fb 100644
 --- a/common/cmd_nvedit.c
 +++ b/common/cmd_nvedit.c
 @@ -59,6 +59,7 @@ DECLARE_GLOBAL_DATA_PTR;
  !defined(CONFIG_ENV_IS_IN_FLASH)  \
  !defined(CONFIG_ENV_IS_IN_DATAFLASH)  \
  !defined(CONFIG_ENV_IS_IN_MG_DISK)\
 +!defined(CONFIG_ENV_IS_IN_MMC)   \
  !defined(CONFIG_ENV_IS_IN_NAND)   \
  !defined(CONFIG_ENV_IS_IN_NVRAM)  \
  !defined(CONFIG_ENV_IS_IN_ONENAND)\

From the first version you remove the changes in the error string:

 # error Define one of CONFIG_ENV_IS_IN_{EEPROM|FLASH|DATAFLASH|ONENAND|\
-SPI_FLASH|MG_DISK|NVRAM|NOWHERE}
+SPI_FLASH|MG_DISK|NVRAM|MMC|NOWHERE}

I know it is only an error message, but the change seems correct. I have
not found a comment against it ;)


 +#else /* ! ENV_IS_EMBEDDED */
 +env_t *env_ptr;
 +#endif /* ENV_IS_EMBEDDED */

You missed Andy's comment. You have to initialize env_ptr.

 + if (read_env(mmc, CONFIG_ENV_SIZE, CONFIG_ENV_OFFSET, env_ptr))
 + return use_default();

This is still broken, as found by Andy. I cannot find a line where
env_ptr is initialized and then you pass the pointer to the mmc read
function.

Best 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 v5] mmc: add generic mmc spi driver

2010-04-29 Thread Thomas Chou
On 04/28/2010 11:21 PM, Andy Fleming wrote:

 +static int do_mmc_spi(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 +{
 +   int dev_num = -1;
 +   uint bus;
 +   uint cs;
 +   uint speed;
 +   uint mode;
 +   char *endp;
 +   struct mmc *mmc;
 +   struct mmc_spi_priv *priv;
 +
 +   do {
 +   mmc = find_mmc_device(++dev_num);
 +   } while (mmc  strcmp(mmc-name, MMC_SPI));
 +   if (!mmc) {
 +   printf(Create MMC Device\n);
 +   mmc = mmc_spi_init(CONFIG_MMC_SPI_BUS,
 +  CONFIG_MMC_SPI_CS,
 +  CONFIG_MMC_SPI_SPEED,
 +  CONFIG_MMC_SPI_MODE);
 +   if (!mmc) {
 +   printf(Failed to create MMC Device\n);
 +   return 1;
 +   }
 +   dev_num = mmc-block_dev.dev;
 +   }
  

 I'm not sure I understand the logic behind this code.  The arguments
 to the command should be used to either find the already-existing bus,
 or to create a new one.  Unless I'm misunderstanding, this searches
 for the first MMC_SPI bus, and if it finds it, uses that, otherwise it
 creates a new one with the values specified in the config file.  Then
 it parses the command and overwrites the old parameters for the bus
 with new ones?  Why?  My instinct would be to create a separate
 instance of an MMC_SPI bus for each bus and chip select.  My SPI is
 rusty, so maybe chip-select should be configurable on a use-by-use
 basis.

 Certainly the current code will only use at most one MMC_SPI bus even
 if more are created, which seems wrong.

Hi Mike,

Could you please give me some suggestion on the mmc_spi subcommand?

1. In v5 patch, I assumed a single changeable mmc_spi device is enough.

2. Andy suggested to create a new mmc_spi device for each bus and cs.

Either way is fine to me. Which one do you prefer?

Best regards,
Thomas

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


[U-Boot] [PATCH] OMAP3: pandora: enable battery backup capacitor

2010-04-29 Thread Grazvydas Ignotas
Pandora has a capacitor connected as backup battery, which allows
retaining RTC for some time while main battery is removed. Enable backup
battery charge function to charge that capacitor.

Signed-off-by: Grazvydas Ignotas nota...@gmail.com
---
 board/pandora/pandora.c |9 +
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/board/pandora/pandora.c b/board/pandora/pandora.c
index 75e4330..355e9ea 100644
--- a/board/pandora/pandora.c
+++ b/board/pandora/pandora.c
@@ -37,6 +37,10 @@
 #include asm/mach-types.h
 #include pandora.h
 
+#define TWL4030_BB_CFG_BBCHEN  (1  4)
+#define TWL4030_BB_CFG_BBSEL_3200MV(3  2)
+#define TWL4030_BB_CFG_BBISEL_500UA2
+
 /*
  * Routine: board_init
  * Description: Early hardware init.
@@ -78,6 +82,11 @@ int misc_init_r(void)
writel(GPIO28, gpio5_base-setdataout);
writel(GPIO4, gpio6_base-setdataout);
 
+   /* Enable battery backup capacitor (3.2V, 0.5mA charge current) */
+   twl4030_i2c_write_u8(TWL4030_CHIP_PM_RECEIVER,
+   TWL4030_BB_CFG_BBCHEN | TWL4030_BB_CFG_BBSEL_3200MV |
+   TWL4030_BB_CFG_BBISEL_500UA, TWL4030_PM_RECEIVER_BB_CFG);
+
dieid_num_r();
 
return 0;
-- 
1.6.3.3

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


[U-Boot] [U-Boot-Users] mpc8641hpcn linker script and the bootpg section

2010-04-29 Thread sunil khatri
hello sir 

i m new to bootloader but i have studied its architecture and tried to
dig deep into source code.i found u have worked on this and want ur help
our company is designing a new board based on mpc8641 processor we are
using mpc8641hpcn type board except that we dnt erequire all the
pheripherals on our board we just interested in four ethernet ports and
thts it.it would be a great help if u tell me what changes are to be
made in uboot source and in which folder/file.

thnx and regards 
sunil khatri
rtts india.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [GIT PULL] Please pull u-boot-pxa/next

2010-04-29 Thread Tom Rix
Marek Vasut wrote:
 Tom, ok, one more time, I moved the fix Wolfgang requested to another branch. 
 Please pull these changes then.
 Cheers
 
 The following changes since commit 3699c28e6d16b563629c285311a0ce62a2c4c5d0:
   Wolfgang Denk (1):
 Merge branch 'master' of git://git.denx.de/u-boot-video
 
 are available in the git repository at:
 
   git://git.denx.de/u-boot-pxa.git next
 
 Marek Vasut (4):
   PXA: PXAMMC: Drop different delays for PXA27X
   PXA: PXAMMC: Add Monahans support

The name of this patch changed
http://www.mail-archive.com/u-boot@lists.denx.de/msg29975.html

This is close but not the same patch.

   PXA: Add UP2OCR register bit definitions

http://www.mail-archive.com/u-boot@lists.denx.de/msg31137.html
This is close but not the same patch

   PXA: Add missing MDREFR bits
 
  arch/arm/include/asm/arch-pxa/pxa-regs.h |   25 +
  drivers/mmc/pxa_mmc.c|   17 ++---
  2 files changed, 27 insertions(+), 15 deletions(-)
 
 

It seems like there are two patches in this set that were
changed without being posted to the mailing list.

Please post all changes to mailing list.

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


Re: [U-Boot] Exception in U-Boot

2010-04-29 Thread Viswanath Bandi
On Thu, Apr 29, 2010 at 7:34 PM, Sanjay Kumar sanjay.ku...@gmobis.comwrote:

 Hi All,
  We are porting U-boot. 2010.03  version for MIPS32 processor (Au1350).
 Currently we are facing one problem:

 When I compile u-boot and program to NOR Flash using bdiGDB through BDI3000
 Debugger, I am observing u-boot hangs at exception i.e. at address
 0xbfc00570 after reset .

 error log is below:


 Au1350ti
Core number   : 0
Core state: Debug Mode
Debug entry cause : single step
Current PC: 0xbfc00400
Current SR: 0x0044
Current LR  (r31) : 0xbfc0f6e4
Current SP  (r29) : 0x803fff00
 Au1350go
 Au1350halt
Core number   : 0
Core state: Debug Mode
Debug entry cause : JTAG break request
Current PC: 0xbfc00570
Current SR: 0x0042
Current LR  (r31) : 0xbfc0f6e4
Current SP  (r29) : 0x803fff00
 Au1350

 After reset address 0xbfc00400, code executes lowlevel_init and
 subsequently hangs at 0xbfc00570 (RomException).

 I'm attaching start.S and lowlevel_init.S files we are using.


romExcHandle is reached when one of the valid exceptions (filled using
XVECENT) occur. From your start.S, there are 4 possibilities. Checking the
value of register k0 can give you an idea of the actual exception.

Hope this helps.

Thanks,
Bandi



 Please let me know if am doing anything wrong or missing something.

 With Thanks and Regards,
 Sanjay Kumar
 KPIT Cummins Infosystems Pvt Ltd




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


[U-Boot] [PATCH RFC] OMAP: mmc: add support for second and third mmc channels

2010-04-29 Thread Steve Sakoman
This patch adds support for the second and third mmc channels on OMAP3
processors

Boards wishing to use this feature should define
CONFIG_SYS_MMC_SET_DEV in the board config

Tested on Overo

Signed-off-by: Steve Sakoman st...@sakoman.com
---

diff --git a/arch/arm/include/asm/arch-omap3/mmc_host_def.h
b/arch/arm/include/asm/arch-omap3/mmc_host_def.h
index aa751c9..f081b43 100644
--- a/arch/arm/include/asm/arch-omap3/mmc_host_def.h
+++ b/arch/arm/include/asm/arch-omap3/mmc_host_def.h
@@ -31,11 +31,18 @@
 typedef struct t2 {
unsigned char res1[0x274];
unsigned int devconf0;  /* 0x274 */
-   unsigned char res2[0x2A8];
+   unsigned char res2[0x064];
+   unsigned int devconf1;  /* 0x2D8 */
+   unsigned char res3[0x248];
unsigned int pbias_lite;/* 0x520 */
 } t2_t;

 #define MMCSDIO1ADPCLKISEL (1  24)
+#define MMCSDIO2ADPCLKISEL (1  6)
+
+#define EN_MMC1(1  24)
+#define EN_MMC2(1  25)
+#define EN_MMC3(1  30)

 #define PBIASLITEPWRDNZ0   (1  1)
 #define PBIASSPEEDCTRL0(1  2)
@@ -44,7 +51,9 @@ typedef struct t2 {
 /*
  * OMAP HSMMC register definitions
  */
-#define OMAP_HSMMC_BASE0x4809C000
+#define OMAP_HSMMC1_BASE   0x4809C000
+#define OMAP_HSMMC2_BASE   0x480B4000
+#define OMAP_HSMMC3_BASE   0x480AD000

 typedef struct hsmmc {
unsigned char res1[0x10];
diff --git a/drivers/mmc/omap3_mmc.c b/drivers/mmc/omap3_mmc.c
index 96c0e65..bf650ba 100644
--- a/drivers/mmc/omap3_mmc.c
+++ b/drivers/mmc/omap3_mmc.c
@@ -52,7 +52,27 @@ const unsigned short mmc_transspeed_val[15][4] = {

 mmc_card_data cur_card_data;
 static block_dev_desc_t mmc_blk_dev;
-static hsmmc_t *mmc_base = (hsmmc_t *)OMAP_HSMMC_BASE;
+static hsmmc_t *mmc_base = (hsmmc_t *)OMAP_HSMMC1_BASE;
+
+unsigned char mmc_set_dev(int dev)
+{
+   switch (dev) {
+   case 1:
+   mmc_base = (hsmmc_t *)OMAP_HSMMC1_BASE;
+   break;
+   case 2:
+   mmc_base = (hsmmc_t *)OMAP_HSMMC2_BASE;
+   break;
+   case 3:
+   mmc_base = (hsmmc_t *)OMAP_HSMMC3_BASE;
+   break;
+   default:
+   mmc_base = (hsmmc_t *)OMAP_HSMMC1_BASE;
+   return 1;
+   }
+
+   return 0;
+}

 block_dev_desc_t *mmc_get_dev(int dev)
 {
@@ -62,6 +82,7 @@ block_dev_desc_t *mmc_get_dev(int dev)
 unsigned char mmc_board_init(void)
 {
t2_t *t2_base = (t2_t *)T2_BASE;
+   struct prcm *prcm_base = (struct prcm *)PRCM_BASE;

 #if defined(CONFIG_TWL4030_POWER)
twl4030_power_mmc_init();
@@ -74,6 +95,17 @@ unsigned char mmc_board_init(void)
writel(readl(t2_base-devconf0) | MMCSDIO1ADPCLKISEL,
t2_base-devconf0);

+   writel(readl(t2_base-devconf1) | MMCSDIO2ADPCLKISEL,
+   t2_base-devconf1);
+
+   writel(readl(prcm_base-fclken1_core) |
+   EN_MMC1 | EN_MMC2 | EN_MMC3,
+   prcm_base-fclken1_core);
+
+   writel(readl(prcm_base-iclken1_core) |
+   EN_MMC1 | EN_MMC2 | EN_MMC3,
+   prcm_base-iclken1_core);
+
return 1;
 }

@@ -512,8 +544,11 @@ unsigned long mmc_bread(int dev_num, unsigned
long blknr, lbaint_t blkcnt,
return 1;
 }

-int mmc_legacy_init(int verbose)
+int mmc_legacy_init(int dev)
 {
+   if (mmc_set_dev(dev) != 0)
+   return 1;
+
if (configure_mmc(cur_card_data) != 1)
return 1;
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH RFC] OMAP: mmc: add support for second and third mmc channels

2010-04-29 Thread Scott Wood
Steve Sakoman wrote:
 This patch adds support for the second and third mmc channels on OMAP3
 processors
 
 Boards wishing to use this feature should define
 CONFIG_SYS_MMC_SET_DEV in the board config
 
 Tested on Overo
 
 Signed-off-by: Steve Sakoman st...@sakoman.com
 ---
 
 diff --git a/arch/arm/include/asm/arch-omap3/mmc_host_def.h
 b/arch/arm/include/asm/arch-omap3/mmc_host_def.h
 index aa751c9..f081b43 100644
 --- a/arch/arm/include/asm/arch-omap3/mmc_host_def.h
 +++ b/arch/arm/include/asm/arch-omap3/mmc_host_def.h
 @@ -31,11 +31,18 @@
  typedef struct t2 {
   unsigned char res1[0x274];
   unsigned int devconf0;  /* 0x274 */
 - unsigned char res2[0x2A8];
 + unsigned char res2[0x064];
 + unsigned int devconf1;  /* 0x2D8 */
 + unsigned char res3[0x248];
   unsigned int pbias_lite;/* 0x520 */

This changes the offset of pbias_lite -- 0x64+4+0x248 = 0x2b0, not 0x2a8.

The mandatory use of structs even with large reserved areas seems to 
invite and obscure such issues (and the comments don't help much, since 
nothing ensures they're accurate).

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


[U-Boot] [PATCH 1/4] PXA: PXAMMC: Drop different delays for PXA27X

2010-04-29 Thread Marek Vasut
In case the delays were set to 1, the MMC card on PXA27X boards (and PXA3xx
boards) didn't initialize on first try. Increasing the delays and leaving just
those for PXA25x and 26x (that is 20) fixes this problem.

Signed-off-by: Marek Vasut marek.va...@gmail.com
---
 drivers/mmc/pxa_mmc.c |8 
 1 files changed, 0 insertions(+), 8 deletions(-)

diff --git a/drivers/mmc/pxa_mmc.c b/drivers/mmc/pxa_mmc.c
index 8225235..b155541 100644
--- a/drivers/mmc/pxa_mmc.c
+++ b/drivers/mmc/pxa_mmc.c
@@ -584,11 +584,7 @@ mmc_legacy_init(int verbose)
debug(Detected SD card\n);
break;
}
-#ifdef CONFIG_PXA27X
-   udelay(1);
-#else
udelay(20);
-#endif
}
 
if (retries = 0 || !(IF_TYPE_SD == mmc_dev.if_type)) {
@@ -598,11 +594,7 @@ mmc_legacy_init(int verbose)
 
retries = 10;
while (retries--  resp  !(resp[0]  0x8000)) {
-#ifdef CONFIG_PXA27X
-   udelay(1);
-#else
udelay(20);
-#endif
resp =
mmc_cmd(MMC_CMD_SEND_OP_COND, 0x00ff, 0x8000,
MMC_CMDAT_R3);
-- 
1.7.0

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


[U-Boot] [PATCH 2/4] PXA: PXAMMC: Add Monahans support

2010-04-29 Thread Marek Vasut
This patch enables PXAMCI support on PXA3xx CPUs. This patch only enables MMC1
though, MMC2 and PXA31x MMC3 will need further patch to be operational.

Signed-off-by: Marek Vasut marek.va...@gmail.com
---
 drivers/mmc/pxa_mmc.c |9 ++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/mmc/pxa_mmc.c b/drivers/mmc/pxa_mmc.c
index b155541..8776903 100644
--- a/drivers/mmc/pxa_mmc.c
+++ b/drivers/mmc/pxa_mmc.c
@@ -126,7 +126,7 @@ mmc_block_read(uchar * dst, ulong src, ulong len)
MMC_I_MASK = ~MMC_I_MASK_RXFIFO_RD_REQ;
while (len) {
if (MMC_I_REG  MMC_I_REG_RXFIFO_RD_REQ) {
-#ifdef CONFIG_PXA27X
+#if defined(CONFIG_PXA27X) || defined(CONFIG_CPU_MONAHANS)
int i;
for (i = min(len, 32); i; i--) {
*dst++ = *((volatile uchar *)MMC_RXFIFO);
@@ -558,8 +558,11 @@ mmc_legacy_init(int verbose)
set_GPIO_mode(GPIO6_MMCCLK_MD);
set_GPIO_mode(GPIO8_MMCCS0_MD);
 #endif
+#ifdef CONFIG_CPU_MONAHANS /* pxa3xx */
+   CKENA |= CKENA_12_MMC0 | CKENA_13_MMC1;
+#else  /* pxa2xx */
CKEN |= CKEN12_MMC; /* enable MMC unit clock */
-
+#endif
MMC_CLKRT = MMC_CLKRT_0_3125MHZ;
MMC_RESTO = MMC_RES_TO_MAX;
MMC_SPI = MMC_SPI_DISABLE;
@@ -624,7 +627,7 @@ mmc_legacy_init(int verbose)
MMC_CLKRT = 0;  /* 20 MHz */
resp = mmc_cmd(MMC_CMD_SELECT_CARD, rca, 0, MMC_CMDAT_R1);
 
-#ifdef CONFIG_PXA27X
+#if defined(CONFIG_PXA27X) || defined(CONFIG_CPU_MONAHANS)
if (IF_TYPE_SD == mmc_dev.if_type) {
resp = mmc_cmd(MMC_CMD_APP_CMD, rca, 0, MMC_CMDAT_R1);
resp = mmc_cmd(SD_CMD_APP_SET_BUS_WIDTH, 0, 2, MMC_CMDAT_R1);
-- 
1.7.0

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


[U-Boot] [PATCH 4/4] PXA: Add missing MDREFR bits

2010-04-29 Thread Marek Vasut
Signed-off-by: Marek Vasut marek.va...@gmail.com
---
 arch/arm/include/asm/arch-pxa/pxa-regs.h |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/arm/include/asm/arch-pxa/pxa-regs.h 
b/arch/arm/include/asm/arch-pxa/pxa-regs.h
index 7cd7a14..cd7b7f9 100644
--- a/arch/arm/include/asm/arch-pxa/pxa-regs.h
+++ b/arch/arm/include/asm/arch-pxa/pxa-regs.h
@@ -2421,6 +2421,9 @@ typedef void  (*ExcpHndlr) (void) ;
 #define MDMRS  __REG(0x4840)  /* MRS value to be written to SDRAM 
*/
 #define BOOT_DEF   __REG(0x4844)  /* Read-Only Boot-Time Register. 
Contains BOOT_SEL and PKG_SEL */
 
+#define MDREFR_ALTREFA (1  31)   /* Exiting Alternate Bus Master Mode 
Refresh Control */
+#define MDREFR_ALTREFB (1  30)   /* Entering Alternate Bus Master Mode 
Refresh Control */
+#define MDREFR_K0DB4   (1  29)   /* SDCLK0 Divide by 4 Control/Status */
 #define MDREFR_K2FREE  (1  25)   /* SDRAM Free-Running Control */
 #define MDREFR_K1FREE  (1  24)   /* SDRAM Free-Running Control */
 #define MDREFR_K0FREE  (1  23)   /* SDRAM Free-Running Control */
-- 
1.7.0

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


[U-Boot] [PATCH 3/4] PXA: Add UP2OCR register bit definitions

2010-04-29 Thread Marek Vasut
This register is used on PXA to control the USB Port2 operation (USB Port2 is
the host port).

Signed-off-by: Marek Vasut marek.va...@gmail.com
---
 arch/arm/include/asm/arch-pxa/pxa-regs.h |   22 ++
 1 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/arch/arm/include/asm/arch-pxa/pxa-regs.h 
b/arch/arm/include/asm/arch-pxa/pxa-regs.h
index a25d4c5..7cd7a14 100644
--- a/arch/arm/include/asm/arch-pxa/pxa-regs.h
+++ b/arch/arm/include/asm/arch-pxa/pxa-regs.h
@@ -992,10 +992,6 @@ typedef void   (*ExcpHndlr) (void) ;
 #define UHCHIE __REG(0x4C68)
 #define UHCHIT __REG(0x4C6C)
 
-#if defined(CONFIG_CPU_MONAHANS)
-#define UP2OCR __REG(0x40600020)
-#endif
-
 #define UHCHR_FSBIR(10)
 #define UHCHR_FHR  (11)
 #define UHCHR_CGR  (12)
@@ -1015,6 +1011,24 @@ typedef void (*ExcpHndlr) (void) ;
 #define UHCHIE_HBAIE   (18)
 #define UHCHIE_RWIE(17)
 
+#if defined(CONFIG_CPU_MONAHANS) || defined(CONFIG_PXA27X)
+#define UP2OCR __REG(0x40600020)
+#endif
+
+#define UP2OCR_HXOE(117)
+#define UP2OCR_HXS (116)
+#define UP2OCR_IDON(110)
+#define UP2OCR_EXSUS   (19)
+#define UP2OCR_EXSP(18)
+#define UP2OCR_DMSTATE (17)
+#define UP2OCR_VPM (16)
+#define UP2OCR_DPSTATE (15)
+#define UP2OCR_DPPUE   (14)
+#define UP2OCR_DMPDE   (13)
+#define UP2OCR_DPPDE   (12)
+#define UP2OCR_CPVPE   (11)
+#define UP2OCR_CPVEN   (10)
+
 #endif
 
 /*
-- 
1.7.0

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


Re: [U-Boot] [GIT PULL] Please pull u-boot-pxa/next

2010-04-29 Thread Marek Vasut
Dne Čt 29. dubna 2010 18:31:41 Tom Rix napsal(a):
 Marek Vasut wrote:
  Tom, ok, one more time, I moved the fix Wolfgang requested to another
  branch. Please pull these changes then.
  Cheers
  
  The following changes since commit 3699c28e6d16b563629c285311a0ce62a2c4c5d0:
Wolfgang Denk (1):
  Merge branch 'master' of git://git.denx.de/u-boot-video
  
  are available in the git repository at:
git://git.denx.de/u-boot-pxa.git next
  
  Marek Vasut (4):
PXA: PXAMMC: Drop different delays for PXA27X
PXA: PXAMMC: Add Monahans support
 
 The name of this patch changed
 http://www.mail-archive.com/u-boot@lists.denx.de/msg29975.html
 
 This is close but not the same patch.
 
PXA: Add UP2OCR register bit definitions
 
 http://www.mail-archive.com/u-boot@lists.denx.de/msg31137.html
 This is close but not the same patch
 
PXA: Add missing MDREFR bits
   
   arch/arm/include/asm/arch-pxa/pxa-regs.h |   25
   + drivers/mmc/pxa_mmc.c|  
   17 ++--- 2 files changed, 27 insertions(+), 15 deletions(-)
 
 It seems like there are two patches in this set that were
 changed without being posted to the mailing list.
 
 Please post all changes to mailing list.
 
 Tom

Posted whole series again ... now you can pull finally ? And also I informed I 
did bugfix changes to that patch.
Cheers
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v5] mmc: add generic mmc spi driver

2010-04-29 Thread Mike Frysinger
On Thursday 29 April 2010 10:51:03 Thomas Chou wrote:
 2. Andy suggested to create a new mmc_spi device for each bus and cs.

this is what i was suggesting from the start ... sorry if i wasnt clear
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH RFC] OMAP: mmc: add support for second and third mmc channels

2010-04-29 Thread Steve Sakoman
On Thu, Apr 29, 2010 at 11:15 AM, Scott Wood scottw...@freescale.com wrote:
 Steve Sakoman wrote:

 This patch adds support for the second and third mmc channels on OMAP3
 processors

 Boards wishing to use this feature should define
 CONFIG_SYS_MMC_SET_DEV in the board config

 Tested on Overo

 Signed-off-by: Steve Sakoman st...@sakoman.com
 ---

 diff --git a/arch/arm/include/asm/arch-omap3/mmc_host_def.h
 b/arch/arm/include/asm/arch-omap3/mmc_host_def.h
 index aa751c9..f081b43 100644
 --- a/arch/arm/include/asm/arch-omap3/mmc_host_def.h
 +++ b/arch/arm/include/asm/arch-omap3/mmc_host_def.h
 @@ -31,11 +31,18 @@
  typedef struct t2 {
        unsigned char res1[0x274];
        unsigned int devconf0;          /* 0x274 */
 -       unsigned char res2[0x2A8];
 +       unsigned char res2[0x064];
 +       unsigned int devconf1;          /* 0x2D8 */
 +       unsigned char res3[0x248];
        unsigned int pbias_lite;        /* 0x520 */

 This changes the offset of pbias_lite -- 0x64+4+0x248 = 0x2b0, not 0x2a8.

 The mandatory use of structs even with large reserved areas seems to invite
 and obscure such issues (and the comments don't help much, since nothing
 ensures they're accurate).

Good catch!

Agreed  -- I really hate sparse structs like this since they just
invite this type of error when you fill in missing registers.

I'll fix and resubmit the patch for further comment.

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


Re: [U-Boot] [PATCH RFC] OMAP: mmc: add support for second and third mmc channels

2010-04-29 Thread Steve Sakoman
On Thu, Apr 29, 2010 at 12:55 PM, Steve Sakoman sako...@gmail.com wrote:
 On Thu, Apr 29, 2010 at 11:15 AM, Scott Wood scottw...@freescale.com wrote:
 The mandatory use of structs even with large reserved areas seems to invite
 and obscure such issues (and the comments don't help much, since nothing
 ensures they're accurate).

 Good catch!

 Agreed  -- I really hate sparse structs like this since they just
 invite this type of error when you fill in missing registers.

 I'll fix and resubmit the patch for further comment.

BTW, the reason I didn't catch this in testing is that the error would
only show up for mmc channel 2, which is not available on Overo (it is
used for the SDIO wifi interface).  My testing was done on mmc1 and
mmc2.

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


[U-Boot] [PATCH RFC v2] OMAP: mmc: add support for second and third mmc channels

2010-04-29 Thread Steve Sakoman
This patch adds support for the second and third mmc channels on OMAP3
processors

Boards wishing to use this feature should define CONFIG_SYS_MMC_SET_DEV

Tested on Overo

Signed-off-by: Steve Sakoman st...@sakoman.com
---

diff --git a/arch/arm/include/asm/arch-omap3/mmc_host_def.h
b/arch/arm/include/asm/arch-omap3/mmc_host_def.h
index aa751c9..f081b43 100644
--- a/arch/arm/include/asm/arch-omap3/mmc_host_def.h
+++ b/arch/arm/include/asm/arch-omap3/mmc_host_def.h
@@ -31,11 +31,18 @@
 typedef struct t2 {
unsigned char res1[0x274];
unsigned int devconf0;  /* 0x274 */
-   unsigned char res2[0x2A8];
+   unsigned char res2[0x060];
+   unsigned int devconf1;  /* 0x2D8 */
+   unsigned char res3[0x244];
unsigned int pbias_lite;/* 0x520 */
 } t2_t;

 #define MMCSDIO1ADPCLKISEL (1  24)
+#define MMCSDIO2ADPCLKISEL (1  6)
+
+#define EN_MMC1(1  24)
+#define EN_MMC2(1  25)
+#define EN_MMC3(1  30)

 #define PBIASLITEPWRDNZ0   (1  1)
 #define PBIASSPEEDCTRL0(1  2)
@@ -44,7 +51,9 @@ typedef struct t2 {
 /*
  * OMAP HSMMC register definitions
  */
-#define OMAP_HSMMC_BASE0x4809C000
+#define OMAP_HSMMC1_BASE   0x4809C000
+#define OMAP_HSMMC2_BASE   0x480B4000
+#define OMAP_HSMMC3_BASE   0x480AD000

 typedef struct hsmmc {
unsigned char res1[0x10];
diff --git a/drivers/mmc/omap3_mmc.c b/drivers/mmc/omap3_mmc.c
index 96c0e65..bf650ba 100644
--- a/drivers/mmc/omap3_mmc.c
+++ b/drivers/mmc/omap3_mmc.c
@@ -52,7 +52,27 @@ const unsigned short mmc_transspeed_val[15][4] = {

 mmc_card_data cur_card_data;
 static block_dev_desc_t mmc_blk_dev;
-static hsmmc_t *mmc_base = (hsmmc_t *)OMAP_HSMMC_BASE;
+static hsmmc_t *mmc_base = (hsmmc_t *)OMAP_HSMMC1_BASE;
+
+unsigned char mmc_set_dev(int dev)
+{
+   switch (dev) {
+   case 1:
+   mmc_base = (hsmmc_t *)OMAP_HSMMC1_BASE;
+   break;
+   case 2:
+   mmc_base = (hsmmc_t *)OMAP_HSMMC2_BASE;
+   break;
+   case 3:
+   mmc_base = (hsmmc_t *)OMAP_HSMMC3_BASE;
+   break;
+   default:
+   mmc_base = (hsmmc_t *)OMAP_HSMMC1_BASE;
+   return 1;
+   }
+
+   return 0;
+}

 block_dev_desc_t *mmc_get_dev(int dev)
 {
@@ -62,6 +82,7 @@ block_dev_desc_t *mmc_get_dev(int dev)
 unsigned char mmc_board_init(void)
 {
t2_t *t2_base = (t2_t *)T2_BASE;
+   struct prcm *prcm_base = (struct prcm *)PRCM_BASE;

 #if defined(CONFIG_TWL4030_POWER)
twl4030_power_mmc_init();
@@ -74,6 +95,17 @@ unsigned char mmc_board_init(void)
writel(readl(t2_base-devconf0) | MMCSDIO1ADPCLKISEL,
t2_base-devconf0);

+   writel(readl(t2_base-devconf1) | MMCSDIO2ADPCLKISEL,
+   t2_base-devconf1);
+
+   writel(readl(prcm_base-fclken1_core) |
+   EN_MMC1 | EN_MMC2 | EN_MMC3,
+   prcm_base-fclken1_core);
+
+   writel(readl(prcm_base-iclken1_core) |
+   EN_MMC1 | EN_MMC2 | EN_MMC3,
+   prcm_base-iclken1_core);
+
return 1;
 }

@@ -512,8 +544,11 @@ unsigned long mmc_bread(int dev_num, unsigned
long blknr, lbaint_t blkcnt,
return 1;
 }

-int mmc_legacy_init(int verbose)
+int mmc_legacy_init(int dev)
 {
+   if (mmc_set_dev(dev) != 0)
+   return 1;
+
if (configure_mmc(cur_card_data) != 1)
return 1;
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Splash screen problem

2010-04-29 Thread Wolfgang Denk
Dear =?iso-8859-2?Q?Radovan=20V=E1pen=EDk?=,

In message 56295.4069.1007-22739-950867926-1272543...@seznam.cz you wrote:
 The environment variable preboot runs after splashimage, which other
 env variablecan I use, which runs before splashimage?

You cannot. But you can fake the actions by using nand read and
bmp as preboot command. Not perfect, but close.

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
People are always a lot more complicated than you  think.  It's  very
important to remember that. - Terry Pratchett, _Truckers_
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH RFC v2] OMAP: mmc: add support for second and third mmc channels

2010-04-29 Thread Steve Sakoman
On Thu, Apr 29, 2010 at 1:38 PM, Andy Fleming aflem...@gmail.com wrote:
 On Thu, Apr 29, 2010 at 3:26 PM, Steve Sakoman sako...@gmail.com wrote:
 This patch adds support for the second and third mmc channels on OMAP3
 processors

 Boards wishing to use this feature should define CONFIG_SYS_MMC_SET_DEV

 Tested on Overo

 Signed-off-by: Steve Sakoman st...@sakoman.com
 ---

 diff --git a/arch/arm/include/asm/arch-omap3/mmc_host_def.h
 b/arch/arm/include/asm/arch-omap3/mmc_host_def.h
 index aa751c9..f081b43 100644
 --- a/arch/arm/include/asm/arch-omap3/mmc_host_def.h
 +++ b/arch/arm/include/asm/arch-omap3/mmc_host_def.h
 @@ -31,11 +31,18 @@
  typedef struct t2 {
        unsigned char res1[0x274];
        unsigned int devconf0;          /* 0x274 */
 -       unsigned char res2[0x2A8];
 +       unsigned char res2[0x060];
 +       unsigned int devconf1;          /* 0x2D8 */
 +       unsigned char res3[0x244];
        unsigned int pbias_lite;        /* 0x520 */
  } t2_t;


 Errr...just to make sure, you *meant* to move devconf1, too, right?

Yes!  It is used one time to set a magic bit that makes the mmc2
channel work.  That is why my testing didn't pick up this error --
mmc2 is not available on my hardware, only mmc1 and mmc3.  The error
with pbias_lite seemed to have no negative effect in my testing!

At any rate, both registers now seem to be correct :-)

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


[U-Boot] Amount Won 1,000,000 GBP.

2010-04-29 Thread British Global Lottery.
This is to inform you that You have won 1,000,000 GBP,Please Contact:
Mr.Mark Anderson/E-mail Address:(markander...@discuz.org) and also call Tel
Phone:+4470-1118-2592.contact him With the following,Full Name:/Contact
Address:/Tel/Age/Country.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Amount Won 1,000,000 GBP.

2010-04-29 Thread British Global Lottery.
This is to inform you that You have won 1,000,000 GBP,Please Contact:
Mr.Mark Anderson/E-mail Address:(markander...@discuz.org) and also call Tel
Phone:+4470-1118-2592.contact him With the following,Full Name:/Contact
Address:/Tel/Age/Country.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Amount Won: 1,000,000 GBP.

2010-04-29 Thread British Global Lottery.
This is to inform you that You have won 1,000,000 GBP,Please Contact:
Mr.Mark Anderson/E-mail Address:(markander...@discuz.org) and also call Tel
Phone:+4470-1118-2592.contact him With the following,Full Name:/Contact
Address:/Tel/Age/Country.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Business-Vorschlag

2010-04-29 Thread radchenko
Guten Tag!

Ich bin Wiktor Drogin, Direktor of Info-soft Co. Wir spezialisieren unsauf 
angewandte Entwicklung, Systemintegration, korporativen Netze und andere 
Softwarefuer verschiedenen Loesungen der Geschaefts - und Finanzproblemen.

Unsere Firma befindet sich in Ukraine. Wir stehen in gutem Ruf, und unsere 
Gesellschaft ist eine sichere und vertrauenswuerdige Firma. Wir haben mit 
vielen europaeschen und nordamerikanischen Gesellschaften im Softwarebereich 
zusammengearbeitet, und Software zur Verfuegung gestellt haben. Etwa ein 
Jahre lange arbeiten wir mit Partner aus anderen Laender mit. Fruher haben 
wir keine Schwierigkeiten gehabt. Doch die Bezahlungen ( 3000 . 20 000 ) 
weist man ungefaehr 3-5 Tagen lange ueber + man braucht so lange Zeit,
um diese Bezahlungen zu bekommen. In der Regel kommt ungefaehr von 10
Tagen bis 2-3 Woche mit Wochenende heraus. Jetzt arbeiten wir mit gossen 
Projekten, die hohe Betraege brauchen. Wir koennen nicht auf diese Bezahlung 
so lange warten. Deshalb suchen wir Partner jetzt in ihrem Land, die uns 
helfen koennen, diese Bezahlungen schneller zu bekommen, abzuheben und 
auszuarbeiten. Wenn Sie Chance suchen, einen Nebenverdienst zu kriegen, 
Sie koennen unserer Vertreter in ihrem Land sein. Als unserer Vertreter 
bekommen Sie 8% von jedes Geschaeft, das wir durch ihres Konto fuehren aus. 
Ihre Arbeit besteht in Abhebung der Bezahlungen auf ihres Konto und
Ueberweisungen nach Ukraine. Das ist sehr bequem und schnell, Geld zu 
bekommen. Wir moechten auch spaeter eines Buero in ihrem Land oeffnen, 
dann Sie werden Privilegie haben, eine Arbeitsstelle zu bekommen.
Wir freuen uns, wenn Sie sich fuer unsere Business interessieren. 


Setzen Sie sich bitte in Verbindung mit mir fuer zusaetzliche Information 
per  infoso...@aim.com   und senden Sie bitte folgende Information:

1. Ihr Name
2. Bildung
3. Ihre Adresse.
4. Kontaktstelefonnummer/ Fax.
5. Koennen Sie Englisch sprechen?
6. Alter


Antworten Sie bitte uns, und wir gewaehren zusaetzliche Einzelheiten und
Information ueber unsere Gesellschaft und wie Sie unsere Vertreter sein
koennen. Diese Eingliederung zu uns und zu unseres Business ist
heutzutage kostenlos, aber Sie bekommen eine Moeglichkeit, Geld rasch und
muehelos zu verdienen. Wenn Sie verschiedenartige Fragen haben, verlegen
Sie bitte nicht. Schreiben Sie uns, und wir antworten sehr gerne.

Mit lieben Gruessen,
Wiktor Drogin,
Director Infosoft Co.

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


[U-Boot] [PATCH 0/6] add gpio_led and altera_spi drivers

2010-04-29 Thread Thomas Chou
This patch series add gpio_led and altera_spi support for the nios2-generic
board, which is based on the Altera EP1C20 board. It enables status LED and
SPI flash access on this board. It includes the outstanding patches to
complete the support.

Best regards,
Thomas

Thomas Chou (6):
  nios2: add gpio support
  misc: add gpio based status led driver
  nios2: add gpio support to nios2-generic board
  spi: add altera spi controller support
  spi_flash: support old STMicro parts with RES
  nios2: add spi flash support to nios2-generic board

 arch/nios2/include/asm/gpio.h|   52 ++
 board/altera/nios2-generic/Makefile  |1 +
 board/altera/nios2-generic/custom_fpga.h |   10 ++
 board/altera/nios2-generic/gpio.c|   55 ++
 drivers/misc/Makefile|1 +
 drivers/misc/gpio_led.c  |   30 ++
 drivers/mtd/spi/spi_flash.c  |1 +
 drivers/mtd/spi/stmicro.c|   21 
 drivers/spi/Makefile |1 +
 drivers/spi/altera_spi.c |  165 ++
 include/configs/nios2-generic.h  |6 +-
 11 files changed, 340 insertions(+), 3 deletions(-)
 create mode 100644 arch/nios2/include/asm/gpio.h
 create mode 100644 board/altera/nios2-generic/gpio.c
 create mode 100644 drivers/misc/gpio_led.c
 create mode 100644 drivers/spi/altera_spi.c

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


[U-Boot] [PATCH 1/6 v4] nios2: add gpio support

2010-04-29 Thread Thomas Chou
This patch adds driver for a trivial gpio core, which is described
in http://nioswiki.com/GPIO. It is used for gpio led and nand flash
interface in u-boot.

When CONFIG_SYS_GPIO_BASE is not defined, board may provide
its own driver.

Signed-off-by: Thomas Chou tho...@wytron.com.tw
---
v4: remove () from gpio when it is not in a macro.
v3: arch dir reorganized.

 arch/nios2/include/asm/gpio.h |   52 +
 1 files changed, 52 insertions(+), 0 deletions(-)
 create mode 100644 arch/nios2/include/asm/gpio.h

diff --git a/arch/nios2/include/asm/gpio.h b/arch/nios2/include/asm/gpio.h
new file mode 100644
index 000..76c425e
--- /dev/null
+++ b/arch/nios2/include/asm/gpio.h
@@ -0,0 +1,52 @@
+/*
+ * nios2 gpio driver
+ *
+ * This gpio core is described in http://nioswiki.com/GPIO
+ * bit[0] data
+ * bit[1] output enable
+ *
+ * when CONFIG_SYS_GPIO_BASE is not defined, board may provide
+ * its own driver.
+ *
+ * Copyright (C) 2010 Thomas Chou tho...@wytron.com.tw
+ *
+ * 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.
+ */
+
+#ifndef _ASM_NIOS2_GPIO_H_
+#define _ASM_NIOS2_GPIO_H_
+
+#ifdef CONFIG_SYS_GPIO_BASE
+#include asm/io.h
+
+static inline int gpio_direction_input(unsigned gpio)
+{
+   writel(1, CONFIG_SYS_GPIO_BASE + (gpio  2));
+   return 0;
+}
+
+static inline int gpio_direction_output(unsigned gpio, int value)
+{
+   writel(value ? 3 : 2, CONFIG_SYS_GPIO_BASE + (gpio  2));
+   return 0;
+}
+
+static inline int gpio_get_value(unsigned gpio)
+{
+   return readl(CONFIG_SYS_GPIO_BASE + (gpio  2));
+}
+
+static inline void gpio_set_value(unsigned gpio, int value)
+{
+   writel(value ? 3 : 2, CONFIG_SYS_GPIO_BASE + (gpio  2));
+}
+#else
+extern int gpio_direction_input(unsigned gpio);
+extern int gpio_direction_output(unsigned gpio, int value);
+extern int gpio_get_value(unsigned gpio);
+extern void gpio_set_value(unsigned gpio, int value);
+#endif /* CONFIG_SYS_GPIO_BASE */
+
+#endif /* _ASM_NIOS2_GPIO_H_ */
-- 
1.6.6.1

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


[U-Boot] [PATCH 3/6 v3] nios2: add gpio support to nios2-generic board

2010-04-29 Thread Thomas Chou
This patch adds gpio support of Altera PIO component to the
nios2-generic board. Though it drives only gpio_led at the
moment, it supports bidirectional port to control bit-banging
I2C, NAND flash busy status or button switches, etc.

Signed-off-by: Thomas Chou tho...@wytron.com.tw
---
v3: split patches for gpio and spi, based gpio on altera pio core.
v2: remove mmc_spi_init()

 board/altera/nios2-generic/Makefile |1 +
 board/altera/nios2-generic/gpio.c   |   55 +++
 include/configs/nios2-generic.h |6 ++--
 3 files changed, 59 insertions(+), 3 deletions(-)
 create mode 100644 board/altera/nios2-generic/gpio.c

diff --git a/board/altera/nios2-generic/Makefile 
b/board/altera/nios2-generic/Makefile
index 6780872..d1fca70 100644
--- a/board/altera/nios2-generic/Makefile
+++ b/board/altera/nios2-generic/Makefile
@@ -32,6 +32,7 @@ LIB   = $(obj)lib$(BOARD).a
 COBJS-y:= $(BOARD).o
 COBJS-$(CONFIG_CMD_IDE) += ../common/cfide.o
 COBJS-$(CONFIG_EPLED) += ../common/epled.o
+COBJS-$(CONFIG_GPIO) += gpio.o
 COBJS-$(CONFIG_SEVENSEG) += ../common/sevenseg.o
 
 SOBJS-y:= text_base.o
diff --git a/board/altera/nios2-generic/gpio.c 
b/board/altera/nios2-generic/gpio.c
new file mode 100644
index 000..6c9c6c2
--- /dev/null
+++ b/board/altera/nios2-generic/gpio.c
@@ -0,0 +1,55 @@
+/*
+ * board gpio driver
+ *
+ * Copyright (C) 2010 Thomas Chou tho...@wytron.com.tw
+ * Licensed under the GPL-2 or later.
+ */
+#include common.h
+#include asm/io.h
+
+#ifndef CONFIG_SYS_GPIO_BASE
+
+#define ALTERA_PIO_BASE LED_PIO_BASE
+#define ALTERA_PIO_DATA (ALTERA_PIO_BASE + 0)
+#define ALTERA_PIO_DIR (ALTERA_PIO_BASE + 4)
+static u32 pio_data_reg;
+static u32 pio_dir_reg;
+
+int gpio_direction_input(unsigned gpio)
+{
+   u32 mask = 1  gpio;
+   writel(pio_dir_reg = ~mask, ALTERA_PIO_DIR);
+   return 0;
+}
+
+int gpio_direction_output(unsigned gpio, int value)
+{
+   u32 mask = 1  gpio;
+   if (value)
+   pio_data_reg |= mask;
+   else
+   pio_data_reg = ~mask;
+   writel(pio_data_reg, ALTERA_PIO_DATA);
+   writel(pio_dir_reg |= mask, ALTERA_PIO_DIR);
+   return 0;
+}
+
+int gpio_get_value(unsigned gpio)
+{
+   u32 mask = 1  gpio;
+   if (pio_dir_reg  mask)
+   return (pio_data_reg  mask) ? 1 : 0;
+   else
+   return (readl(ALTERA_PIO_DATA)  mask) ? 1 : 0;
+}
+
+void gpio_set_value(unsigned gpio, int value)
+{
+   u32 mask = 1  gpio;
+   if (value)
+   pio_data_reg |= mask;
+   else
+   pio_data_reg = ~mask;
+   writel(pio_data_reg, ALTERA_PIO_DATA);
+}
+#endif
diff --git a/include/configs/nios2-generic.h b/include/configs/nios2-generic.h
index e83e1e3..e4bf57b 100644
--- a/include/configs/nios2-generic.h
+++ b/include/configs/nios2-generic.h
@@ -63,10 +63,10 @@
  * STATUS LED
  */
 #define CONFIG_STATUS_LED  /* Enable status driver */
-#define CONFIG_EPLED   /* Enable LED PIO driver */
-#define CONFIG_SYS_LEDPIO_ADDR LED_PIO_BASE
+#define CONFIG_GPIO_LED/* Enable GPIO LED driver */
+#define CONFIG_GPIO/* Enable GPIO driver */
 
-#define STATUS_LED_BIT 1   /* Bit-0 on PIO */
+#define STATUS_LED_BIT 0   /* Bit-0 on GPIO */
 #define STATUS_LED_STATE   1   /* Blinking */
 #define STATUS_LED_PERIOD  (500 / CONFIG_SYS_NIOS_TMRMS) /* 500 msec */
 
-- 
1.6.6.1

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


[U-Boot] [PATCH 6/6 v3] nios2: add spi flash support to nios2-generic board

2010-04-29 Thread Thomas Chou
This patch enables the altera_spi and spi_flash drivers for the
nios2-generic board. It allows access to the EPCS/SPI flash on
the Altera EP1C20 board.

Signed-off-by: Thomas Chou tho...@wytron.com.tw
---
v3: split patches for gpio and spi.
v2: remove mmc_spi_init()

 board/altera/nios2-generic/custom_fpga.h |   10 ++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/board/altera/nios2-generic/custom_fpga.h 
b/board/altera/nios2-generic/custom_fpga.h
index 761f605..a11add5 100644
--- a/board/altera/nios2-generic/custom_fpga.h
+++ b/board/altera/nios2-generic/custom_fpga.h
@@ -35,6 +35,16 @@
 #define CONFIG_SMC9
 #define CONFIG_SMC_USE_32_BIT
 
+/* epcs_controller.epcs_control_port is a altera_avalon_epcs_flash_controller 
*/
+#define EPCS_CONTROLLER_REG_BASE 0x82100200
+#define CONFIG_SYS_ALTERA_SPI_LIST { EPCS_CONTROLLER_REG_BASE }
+#define CONFIG_ALTERA_SPI
+#define CONFIG_CMD_SPI
+#define CONFIG_CMD_SF
+#define CONFIG_SF_DEFAULT_SPEED 3000
+#define CONFIG_SPI_FLASH
+#define CONFIG_SPI_FLASH_STMICRO
+
 /* jtag_uart.avalon_jtag_slave is a altera_avalon_jtag_uart */
 #define CONFIG_SYS_JTAG_UART_BASE 0x821208b0
 
-- 
1.6.6.1

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


[U-Boot] [PATCH 5/6 v2] spi_flash: support old STMicro parts with RES

2010-04-29 Thread Thomas Chou
Some old STMicro parts do not support JEDEC ID (0x9f). This patch
uses RES (0xab) to get Electronic ID and translates it to JEDEC ID.
This is needed to support the SPI flash chip on Altera EP1C20 board.

Signed-off-by: Thomas Chou tho...@wytron.com.tw
---
v2: move the logic to stmicro's probe function.

 drivers/mtd/spi/spi_flash.c |1 +
 drivers/mtd/spi/stmicro.c   |   21 +
 2 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
index 612f819..c8e4bdd 100644
--- a/drivers/mtd/spi/spi_flash.c
+++ b/drivers/mtd/spi/spi_flash.c
@@ -147,6 +147,7 @@ struct spi_flash *spi_flash_probe(unsigned int bus, 
unsigned int cs,
 #endif
 #ifdef CONFIG_SPI_FLASH_STMICRO
case 0x20:
+   case 0xff:
flash = spi_flash_probe_stmicro(spi, idcode);
break;
 #endif
diff --git a/drivers/mtd/spi/stmicro.c b/drivers/mtd/spi/stmicro.c
index ae0d047..21e9b00 100644
--- a/drivers/mtd/spi/stmicro.c
+++ b/drivers/mtd/spi/stmicro.c
@@ -46,6 +46,7 @@
 #define CMD_M25PXX_DP  0xb9/* Deep Power-down */
 #define CMD_M25PXX_RES 0xab/* Release from DP, and Read Signature 
*/
 
+#define STM_ID_M25P10  0x11
 #define STM_ID_M25P16  0x15
 #define STM_ID_M25P20  0x12
 #define STM_ID_M25P32  0x16
@@ -78,6 +79,13 @@ static inline struct stmicro_spi_flash 
*to_stmicro_spi_flash(struct spi_flash
 
 static const struct stmicro_spi_flash_params stmicro_spi_flash_table[] = {
{
+   .idcode1 = STM_ID_M25P10,
+   .page_size = 256,
+   .pages_per_sector = 128,
+   .nr_sectors = 4,
+   .name = M25P10,
+   },
+   {
.idcode1 = STM_ID_M25P16,
.page_size = 256,
.pages_per_sector = 256,
@@ -316,6 +324,19 @@ struct spi_flash *spi_flash_probe_stmicro(struct spi_slave 
*spi, u8 * idcode)
struct stmicro_spi_flash *stm;
unsigned int i;
 
+   if (idcode[0] == 0xff) {
+   i = spi_flash_cmd(spi, CMD_M25PXX_RES,
+ idcode, 4);
+   if (i)
+   return NULL;
+   if ((idcode[3]  0xf0) == 0x10) {
+   idcode[0] = 0x20;
+   idcode[1] = 0x20;
+   idcode[2] = idcode[3] + 1;
+   } else
+   return NULL;
+   }
+
for (i = 0; i  ARRAY_SIZE(stmicro_spi_flash_table); i++) {
params = stmicro_spi_flash_table[i];
if (params-idcode1 == idcode[2]) {
-- 
1.6.6.1

___
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-04-29 Thread Lv Terry-R65388
Hi Babic,

Pls check my comments with keyword [Ty].

Thanks for reviewing the patch.

Thanks~~

Yours
Terry

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

Terry Lv wrote:
 This patch is to save environment data to mmc card.
 It uses interfaces defined in generic mmc.

Hi Terry,

 
 Signed-off-by: Terry Lv r65...@freescale.com
 ---
  arch/arm/lib/board.c |   10 ++--
  arch/powerpc/lib/board.c |   12 ++--
  common/Makefile  |1 +
  common/cmd_nvedit.c  |1 +
  common/env_mmc.c |  154 
 ++
  5 files changed, 167 insertions(+), 11 deletions(-)  create mode 
 100644 common/env_mmc.c

Could you set a version of your patch (something like [PATCH V*] in the 
subject, so it is easier to track changes ? This is the third version, but it 
is difficult to get it without searching in archive.
[Ty]: OK, I will do that, thanks, :-)

 
 diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c index 
 f5660a9..f62e0eb 100644
 --- a/arch/arm/lib/board.c
 +++ b/arch/arm/lib/board.c
 @@ -347,6 +347,11 @@ void start_armboot (void)
   dataflash_print_info();
  #endif
  
 +#ifdef CONFIG_GENERIC_MMC
 + puts (MMC:   );
 + mmc_initialize (gd-bd);
 +#endif
 +
   /* initialize environment */
   env_relocate ();
  
 @@ -419,11 +424,6 @@ extern void davinci_eth_set_mac_addr (const u_int8_t 
 *addr);
   board_late_init ();
  #endif
  
 -#ifdef CONFIG_GENERIC_MMC
 - puts (MMC:   );
 - mmc_initialize (gd-bd);
 -#endif
 -
  #ifdef CONFIG_BITBANGMII
   bb_miiphy_init();
  #endif

Because it is required to move the initialization of the mmc before 
env_relocate(), we need probably to advise that there are some consequences. If 
someone implements the mmc support in board_late_init() (setting a pin 
multiplexer or something like that, for example), it does not work. I think we 
should at least write a comment to advise that the mmc/sd controller should 
work after board_init() is called.
However, after a quick check in the arm boards, I have not found a board that 
is initializing the mmc controller in board_late_init(). Not sure for powerpc.
[Ty]: I have moved mmc initialization in boards that uses generic mmc. I will 
add the comment, thanks.

 diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c index 
 eb89e9e..78f75fb 100644
 --- a/common/cmd_nvedit.c
 +++ b/common/cmd_nvedit.c
 @@ -59,6 +59,7 @@ DECLARE_GLOBAL_DATA_PTR;
  !defined(CONFIG_ENV_IS_IN_FLASH)  \
  !defined(CONFIG_ENV_IS_IN_DATAFLASH)  \
  !defined(CONFIG_ENV_IS_IN_MG_DISK)\
 +!defined(CONFIG_ENV_IS_IN_MMC)   \
  !defined(CONFIG_ENV_IS_IN_NAND)   \
  !defined(CONFIG_ENV_IS_IN_NVRAM)  \
  !defined(CONFIG_ENV_IS_IN_ONENAND)\

From the first version you remove the changes in the error string:

 # error Define one of CONFIG_ENV_IS_IN_{EEPROM|FLASH|DATAFLASH|ONENAND|\
-SPI_FLASH|MG_DISK|NVRAM|NOWHERE}
+SPI_FLASH|MG_DISK|NVRAM|MMC|NOWHERE}

I know it is only an error message, but the change seems correct. I have not 
found a comment against it ;)
[Ty]: I will add this.


 +#else /* ! ENV_IS_EMBEDDED */
 +env_t *env_ptr;
 +#endif /* ENV_IS_EMBEDDED */

You missed Andy's comment. You have to initialize env_ptr.
[Ty]: This is a global variable. I think that compiler will set it to zero for 
me. Correct me if I'm wrong. Anyway, I will set it to NULL.

 + if (read_env(mmc, CONFIG_ENV_SIZE, CONFIG_ENV_OFFSET, env_ptr))
 + return use_default();

This is still broken, as found by Andy. I cannot find a line where env_ptr is 
initialized and then you pass the pointer to the mmc read function.
[Ty]: env_ptr is defined in env_mmc.c and the value is assigned in 
env_common.c. Correct me if I'm wrong.

Best 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