Re: [U-Boot] need clarification regarding mmc csd structure declaration

2008-08-18 Thread Haavard Skinnemoen
Gururaja Hebbar K R [EMAIL PROTECTED] wrote:
 Hi,
 
 I need few clarification regarding mmc csd structure declaration. I was 
 taking Atmel mci as reference.
 
 In ProductManualSDCardv2.2.pdf @ page 34  ProdManualSDCardv1.9[1].pdf @ page 
 39, says 
 
 ...
 ...
 ...
 C_SIZE_MULT   3 bit width
 ERASE_BLK_EN  1 bit width
 SECTOR_SIZE   7 bit width
 WP_GRP_SIZE   7 bit width
 WP_GRP_ENABLE 1 bit width

This seems to correspond with the SD Memory Card spec v1.01.

 But in mmc.h file inside u-boot-1.3.4\include\asm-avr32\arch-at32ap700x.
 
 Here, inside structure mmc_csd @ line 
 
 ...
 ...
 ...
 c_size_mult:3
 sector_size:5
 erase_grp_size:5
 wp_grp_size:5
 wp_grp_enable:1

And this corresponds with the MMC spec.

 So my doubt is, Shouldn't erase_grp_size come before sector size. 

No. But sometimes, erase_grp_size just isn't there at all, and you have
a 1-bit flag right before sector_size instead.

Currently, these values aren't actually used by u-boot, but I guess
ideally, we should either read them correctly or not read them at all.

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


Re: [U-Boot] need clarification regarding mmc csd structure declaration

2008-08-18 Thread Gururaja Hebbar K R
Hi,

  So my doubt is, Shouldn't erase_grp_size come before sector size. 
 
 No. But sometimes, erase_grp_size just isn't there at all, 
 and you have a 1-bit flag right before sector_size instead.
 
 Currently, these values aren't actually used by u-boot, but I 
 guess ideally, we should either read them correctly or not 
 read them at all.

Thanks for the clarification. 

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


[U-Boot] [PATCH v2 1/6] i.MX31: Add NFC_BASE_ADDR definition.

2008-08-18 Thread Magnus Lilja
Signed-off-by: Magnus Lilja [EMAIL PROTECTED]
---
 include/asm-arm/arch-mx31/mx31-regs.h |   11 +++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/include/asm-arm/arch-mx31/mx31-regs.h 
b/include/asm-arm/arch-mx31/mx31-regs.h
index b04a718..769c1e8 100644
--- a/include/asm-arm/arch-mx31/mx31-regs.h
+++ b/include/asm-arm/arch-mx31/mx31-regs.h
@@ -168,4 +168,15 @@
 #define CS5_BASE   0xB600
 #define PCMCIA_MEM_BASE0xC000
 
+/*
+ * NAND controller
+ */
+#define NFC_BASE_ADDR  0xB800
+
+/*
+ * NFMS bit in RCSR register for pagesize of nandflash
+ */
+#define NFMS (*((volatile u32 *)CCM_RCSR))
+#define NFMS_BIT 30
+
 #endif /* __ASM_ARCH_MX31_REGS_H */
-- 
1.5.2.4

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


[U-Boot] [PATCH v2 5/6] i.MX31: Make the SPI bus and chip select configurable for MC13783

2008-08-18 Thread Magnus Lilja
The i.MX31 has three SPI buses and each bus has several chip selects
and the MC13783 chip can be connected to any of these. The current
RTC driver for MC13783 is hardcoded for CSPI2/SS2.

This patch makes make MC13783 SPI bus and chip select configurable
via CONFIG_MC13783_SPI_BUS and CONFIG_MC13783_SPI_CS.

Signed-off-by: Magnus Lilja [EMAIL PROTECTED]
---
 drivers/rtc/mc13783-rtc.c   |6 --
 include/configs/imx31_litekit.h |3 +++
 include/configs/mx31ads.h   |3 +++
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/rtc/mc13783-rtc.c b/drivers/rtc/mc13783-rtc.c
index b6e1501..38ef3aa 100644
--- a/drivers/rtc/mc13783-rtc.c
+++ b/drivers/rtc/mc13783-rtc.c
@@ -34,7 +34,8 @@ int rtc_get(struct rtc_time *rtc)
 
if (!slave) {
/* FIXME: Verify the max SCK rate */
-   slave = spi_setup_slave(1, 0, 100,
+   slave = spi_setup_slave(CONFIG_MC13783_SPI_BUS,
+   CONFIG_MC13783_SPI_CS, 100,
SPI_MODE_2 | SPI_CS_HIGH);
if (!slave)
return -1;
@@ -83,7 +84,8 @@ void rtc_set(struct rtc_time *rtc)
 
if (!slave) {
/* FIXME: Verify the max SCK rate */
-   slave = spi_setup_slave(1, 0, 100,
+   slave = spi_setup_slave(CONFIG_MC13783_SPI_BUS,
+   CONFIG_MC13783_SPI_CS, 100,
SPI_MODE_2 | SPI_CS_HIGH);
if (!slave)
return;
diff --git a/include/configs/imx31_litekit.h b/include/configs/imx31_litekit.h
index 493ec8e..da155cf 100644
--- a/include/configs/imx31_litekit.h
+++ b/include/configs/imx31_litekit.h
@@ -71,6 +71,9 @@
 #define CONFIG_DEFAULT_SPI_MODE(SPI_MODE_2 | SPI_CS_HIGH)
 
 #define CONFIG_RTC_MC13783 1
+/* MC13783 connected to CSPI2 and SS0 */
+#define CONFIG_MC13783_SPI_BUS 1
+#define CONFIG_MC13783_SPI_CS  0
 
 /* allow to overwrite serial and ethaddr */
 #define CONFIG_ENV_OVERWRITE
diff --git a/include/configs/mx31ads.h b/include/configs/mx31ads.h
index 9ede764..b9ad3e4 100644
--- a/include/configs/mx31ads.h
+++ b/include/configs/mx31ads.h
@@ -66,6 +66,9 @@
 #define CONFIG_DEFAULT_SPI_MODE(SPI_MODE_2 | SPI_CS_HIGH)
 
 #define CONFIG_RTC_MC13783 1
+/* MC13783 connected to CSPI2 and SS0 */
+#define CONFIG_MC13783_SPI_BUS 1
+#define CONFIG_MC13783_SPI_CS  0
 
 /* allow to overwrite serial and ethaddr */
 #define CONFIG_ENV_OVERWRITE
-- 
1.5.2.4

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


[U-Boot] [PATCH v2 0/6] i.MX31: Add NAND support and new PDK board.

2008-08-18 Thread Magnus Lilja
Hi again

This series of patches adds support for the NAND flash controller in the
i.MX31 device and also introduces the Freescale i.MX31 PDK board.

Changes since v1:

- Moved PDK board to boards/freescale/mx31pdk
- Moved mxc_nd.c to driver/mtd/nand/mx31_nand.c
- Moved contents of mxc_nd.h to mx31-regs.h
- Cleaned up the mx31pdk.h config file after comments from this list
- CONFIG_CMD_IMLS is still #undef'd but a comment is added in the config
  file about that.
- A new patch has been inserted into the series, it makes the MC13783 SPI
  bus and chip select configurable.

The patches are based on the current main U-boot git repo.

Original intro for this series of patches:

At the moment, the patch series does not add support for booting from
NAND. This means that the PDK board support assumes that some other entity
configures the SDRAM and loads U-boot into RAM (e.g. another bootloader or a
JTAG debugger). Support for NAND boot is in progress and will be submitted
later.

The NAND driver is based on Freescale's Linux driver from their BSP. I've
cleaned it up a bit and made the (minor) modifications necessary for
U-boot. Perhaps the driver should be cleaned up even more, there are some
CONFIG_MTD_MXC_* leftovers in the driver.

I have tested the driver on the Litekit (small page NAND) and on the PDK
(large page NAND) by having the U-boot environment placed in NAND.



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


[U-Boot] [PATCH v2 4/6] i.MX31: Add NAND support in the i.MX31 Litekit config file.

2008-08-18 Thread Magnus Lilja
Signed-off-by: Magnus Lilja [EMAIL PROTECTED]
---
 include/configs/imx31_litekit.h |   12 
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/include/configs/imx31_litekit.h b/include/configs/imx31_litekit.h
index c476333..493ec8e 100644
--- a/include/configs/imx31_litekit.h
+++ b/include/configs/imx31_litekit.h
@@ -36,6 +36,8 @@
 #define CONFIG_MX31_HCLK_FREQ  2600
 #define CONFIG_MX31_CLK32  32000
 
+#define CONFIG_MX31_NAND   1
+
 #define CONFIG_DISPLAY_CPUINFO
 #define CONFIG_DISPLAY_BOARDINFO
 
@@ -87,6 +89,8 @@
 #define CONFIG_CMD_SPI
 #define CONFIG_CMD_DATE
 
+#define CONFIG_CMD_NAND
+
 #define CONFIG_BOOTDELAY   3
 
 #define CONFIG_NETMASK 255.255.255.0
@@ -172,4 +176,12 @@
 #undef CONFIG_JFFS2_CMDLINE
 #define CONFIG_JFFS2_DEV   nor0
 
+/*
+ * NAND flash
+ */
+
+#define NAND_MAX_CHIPS 1
+#define CFG_MAX_NAND_DEVICE1
+#define CFG_NAND_BASE  0x4000
+
 #endif /* __CONFIG_H */
-- 
1.5.2.4

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


[U-Boot] [PATCH v2 3/6] i.MX31: Add i.MX31 NAND Flash Controller driver.

2008-08-18 Thread Magnus Lilja
Imported from Freescale's Linux NFC driver from the i.MX31 BSP
release 5 (Linux 2.6.22.5) and the i.MX31 PDK BSP (Linux 2.6.24).

The code has been changed to conform (better) with the coding style
in Linux/U-boot. Sections not used by U-boot have been removed.

The driver has been tested on i.MX31 Litekit (small page NAND)
and i.MX31 PDK (large page NAND). Both boards have 8 bit wide
NAND devices.
16 bit NAND devices have not been tested and probably requires a
minor code change.

Signed-off-by: Magnus Lilja [EMAIL PROTECTED]
---
 drivers/mtd/nand/Makefile |1 +
 drivers/mtd/nand/mx31_nand.c  | 1172 +
 include/asm-arm/arch-mx31/mx31-regs.h |   85 +++
 3 files changed, 1258 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/nand/Makefile b/drivers/mtd/nand/Makefile
index 1923310..729b8c2 100644
--- a/drivers/mtd/nand/Makefile
+++ b/drivers/mtd/nand/Makefile
@@ -37,6 +37,7 @@ endif
 
 COBJS-$(CONFIG_NAND_FSL_ELBC) += fsl_elbc_nand.o
 COBJS-$(CONFIG_NAND_FSL_UPM) += fsl_upm.o
+COBJS-$(CONFIG_MX31_NAND) += mx31_nand.o
 endif
 
 COBJS  := $(COBJS-y)
diff --git a/drivers/mtd/nand/mx31_nand.c b/drivers/mtd/nand/mx31_nand.c
new file mode 100644
index 000..af40772
--- /dev/null
+++ b/drivers/mtd/nand/mx31_nand.c
@@ -0,0 +1,1172 @@
+/*
+ * (C) Copyright 2008 Magnus Lilja [EMAIL PROTECTED]
+ *
+ * Based on Freescale's Linux MXC NAND driver.
+ *
+ * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
+ */
+
+/*
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+#include common.h
+#include nand.h
+#include asm-arm/arch/mx31-regs.h
+
+/* The bool type is used locally in this file, added for U-boot. */
+typedef enum {false = 0, true = 1 } bool;
+
+struct mxc_mtd_s {
+   struct mtd_info mtd;
+   struct nand_chip nand;
+   struct device *dev;
+};
+
+static struct mxc_mtd_s *mxc_nand_data;
+
+/*
+ * Define delays in microsec for NAND device operations
+ */
+#define TROP_US_DELAY   2000
+
+/*
+ * Macros to get byte and bit positions of ECC
+ */
+#define COLPOS(x) ((x)  4)
+#define BITPOS(x) ((x)  0xf)
+
+/* Define single bit Error positions in Main  Spare area */
+#define MAIN_SINGLEBIT_ERROR 0x4
+#define SPARE_SINGLEBIT_ERROR 0x1
+
+struct nand_info {
+   bool bSpareOnly;
+   bool bStatusRequest;
+   u16 colAddr;
+};
+
+static struct nand_info g_nandfc_info;
+
+#ifdef CONFIG_MTD_NAND_MXC_SWECC
+static int hardware_ecc;
+#else
+static int hardware_ecc = 1;
+#endif
+
+#ifndef CONFIG_MTD_NAND_MXC_ECC_CORRECTION_OPTION2
+static int Ecc_disabled;
+#endif
+
+static int is2k_Pagesize;
+
+/*
+ * OOB placement block for use with hardware ecc generation
+ */
+static struct nand_ecclayout nand_hw_eccoob_8 = {
+   .eccbytes = 5,
+   .eccpos = {6, 7, 8, 9, 10},
+   .oobfree = {
+   {.offset = 0,
+.length = 5},
+   {.offset = 11,
+.length = 5}}
+};
+
+static struct nand_ecclayout nand_hw_eccoob_16 = {
+   .eccbytes = 5,
+   .eccpos = {6, 7, 8, 9, 10},
+   .oobfree = {
+   {.offset = 0,
+.length = 6},
+   {.offset = 12,
+.length = 4}}
+};
+
+static struct nand_ecclayout nand_hw_eccoob_2k = {
+   .eccbytes = 20,
+   .eccpos = {6, 7, 8, 9, 10, 22, 23, 24, 25, 26,
+  38, 39, 40, 41, 42, 54, 55, 56, 57, 58},
+   .oobfree = {
+   {.offset = 0,
+.length = 5},
+   {.offset = 11,
+.length = 10},
+   {.offset = 27,
+.length = 10},
+   {.offset = 43,
+.length = 10},
+   {.offset = 59,
+.length = 5}}
+};
+
+/* Define some generic bad / good block scan pattern which are used
+ * while scanning a device for factory marked good / bad blocks. */
+static uint8_t scan_ff_pattern[] = { 0xff, 0xff };
+
+static struct nand_bbt_descr smallpage_memorybased = {
+   .options = NAND_BBT_SCAN2NDPAGE,
+   .offs = 5,
+   .len = 1,
+   .pattern = scan_ff_pattern
+};
+
+static struct nand_bbt_descr largepage_memorybased = {
+   .options = 0,
+   .offs = 0,
+   .len = 2,
+   .pattern = scan_ff_pattern
+};
+
+/* Generic flash bbt decriptors */
+static uint8_t bbt_pattern[] = { 'B', 'b', 't', '0' };
+static uint8_t mirror_pattern[] = { '1', 't', 'b', 'B' };
+
+static struct nand_bbt_descr bbt_main_descr = {
+   .options = NAND_BBT_LASTBLOCK | NAND_BBT_CREATE | NAND_BBT_WRITE
+   | NAND_BBT_2BIT | NAND_BBT_VERSION | NAND_BBT_PERCHIP,
+   .offs = 0,
+   .len = 4,
+   .veroffs = 4,
+   .maxblocks = 4,
+   .pattern = bbt_pattern
+};
+
+static struct 

[U-Boot] [PATCH] Consolidate strmhz() implementation

2008-08-18 Thread Haavard Skinnemoen
ARM, i386, m68k and ppc all have identical implementations of strmhz().
Other architectures don't provide this function at all.

This patch moves strmhz() into lib_generic, reducing code duplication
and providing a more unified API across architectures.

Signed-off-by: Haavard Skinnemoen [EMAIL PROTECTED]
---
 include/common.h |4 +++-
 lib_arm/board.c  |   13 -
 lib_generic/Makefile |1 +
 lib_generic/strmhz.c |   36 
 lib_i386/board.c |   13 -
 lib_m68k/board.c |   17 -
 lib_ppc/board.c  |   13 -
 7 files changed, 40 insertions(+), 57 deletions(-)
 create mode 100644 lib_generic/strmhz.c

diff --git a/include/common.h b/include/common.h
index 2fcb1fd..7c80fb9 100644
--- a/include/common.h
+++ b/include/common.h
@@ -222,7 +222,6 @@ voidboard_init_r  (gd_t *, ulong) __attribute__ 
((noreturn));
 intcheckboard(void);
 intcheckflash(void);
 intcheckdram (void);
-char * strmhz(char *buf, long hz);
 intlast_stage_init(void);
 extern ulong monitor_flash_len;
 int mac_read_from_eeprom(void);
@@ -613,6 +612,9 @@ int sprintf(char * buf, const char *fmt, ...)
__attribute__ ((format (__printf__, 2, 3)));
 intvsprintf(char *buf, const char *fmt, va_list args);
 
+/* lib_generic/strmhz.c */
+char * strmhz(char *buf, long hz);
+
 /* lib_generic/crc32.c */
 uint32_t crc32 (uint32_t, const unsigned char *, uint);
 uint32_t crc32_wd (uint32_t, const unsigned char *, uint, uint);
diff --git a/lib_arm/board.c b/lib_arm/board.c
index a093860..6e3ef08 100644
--- a/lib_arm/board.c
+++ b/lib_arm/board.c
@@ -115,19 +115,6 @@ void *sbrk (ptrdiff_t increment)
return ((void *) old);
 }
 
-char *strmhz(char *buf, long hz)
-{
-   long l, n;
-   long m;
-
-   n = hz / 100L;
-   l = sprintf (buf, %ld, n);
-   m = (hz % 100L) / 1000L;
-   if (m != 0)
-   sprintf (buf + l, .%03ld, m);
-   return (buf);
-}
-
 
 /
  * Coloured LED functionality
diff --git a/lib_generic/Makefile b/lib_generic/Makefile
index 4f6ce73..bf0e31d 100644
--- a/lib_generic/Makefile
+++ b/lib_generic/Makefile
@@ -40,6 +40,7 @@ COBJS-$(CONFIG_MD5) += md5.o
 COBJS-y += sha1.o
 COBJS-$(CONFIG_SHA256) += sha256.o
 COBJS-y += string.o
+COBJS-y+= strmhz.o
 COBJS-y += vsprintf.o
 COBJS-y += zlib.o
 
diff --git a/lib_generic/strmhz.c b/lib_generic/strmhz.c
new file mode 100644
index 000..d0b6bc6
--- /dev/null
+++ b/lib_generic/strmhz.c
@@ -0,0 +1,36 @@
+/*
+ * (C) Copyright 2002-2006
+ * Wolfgang Denk, DENX Software Engineering, [EMAIL PROTECTED]
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+#include common.h
+
+char *strmhz (char *buf, long hz)
+{
+   long l, n;
+   long m;
+
+   n = hz / 100L;
+   l = sprintf (buf, %ld, n);
+   m = (hz % 100L) / 1000L;
+   if (m != 0)
+   sprintf (buf + l, .%03ld, m);
+   return (buf);
+}
diff --git a/lib_i386/board.c b/lib_i386/board.c
index 22191e6..55fa42a 100644
--- a/lib_i386/board.c
+++ b/lib_i386/board.c
@@ -108,19 +108,6 @@ void *sbrk (ptrdiff_t increment)
return ((void *) old);
 }
 
-char *strmhz (char *buf, long hz)
-{
-   long l, n;
-   long m;
-
-   n = hz / 100L;
-   l = sprintf (buf, %ld, n);
-   m = (hz % 100L) / 1000L;
-   if (m != 0)
-   sprintf (buf + l, .%03ld, m);
-   return (buf);
-}
-
 /
  * Init Utilities  *
  
diff --git a/lib_m68k/board.c b/lib_m68k/board.c
index a13ea26..39e8f23 100644
--- a/lib_m68k/board.c
+++ b/lib_m68k/board.c
@@ -136,23 +136,6 @@ void *sbrk (ptrdiff_t increment)
return ((void *)old);
 }
 
-char *strmhz(char *buf, long hz)
-{
-   long l, n;
-   long m;
-
-   n = hz / 100L;
-
-   l = sprintf (buf, %ld, n);
-
-   m = (hz % 100L) / 1000L;
-
-   if (m != 0)
-   sprintf (buf+l, .%03ld, m);

Re: [U-Boot] [PATCH] remove MVS1 board

2008-08-18 Thread Wolfgang Denk
Dear Andre,

In message [EMAIL PROTECTED] you wrote:
 
 MVS1 board has reached end-of-life and can be removed completely.

But there are probably still users around that might be interestied in
keeping the board supported?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [EMAIL PROTECTED]
'Tis true, 'tis pity, and pity 'tis 'tis true.
- Poloniouius, in Willie the Shake's _Hamlet, Prince of Darkness_
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] remove MVS1 board

2008-08-18 Thread Andre Schwarz
Wolfgang,

no users out there.

The hardware is out of production for 5 years now.
We already waited that long to make sure.

After all there have been OEM customers only.

You can definitely remove it.

regards,
Andre

Wolfgang Denk schrieb:
 Dear Andre,

 In message [EMAIL PROTECTED] you wrote:
   
 MVS1 board has reached end-of-life and can be removed completely.
 

 But there are probably still users around that might be interestied in
 keeping the board supported?

 Best regards,

 Wolfgang Denk

   


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


[U-Boot] MPC5200 custodianship

2008-08-18 Thread Grant Likely
Hi Wolfgang,

I've found that I'm just not good at splitting my focus between U-Boot
and the kernel.  I've asked John if he'd like to take responsibility
for all of 5xxx support, not just 5121, and he said sure.  Is that
okay by you?

g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] change fdt_fixup_ethernet to use env instead of bd_t

2008-08-18 Thread Kumar Gala
Does anyone see any issue with moving to using the environment instead of
the bd_t to get the mac address for a given ethernet controller.  This has
the benefit of having this bit of code scales easier w/the # of
controllers.

Right now I've set the max to 10, but we can easily make it configurable.

- k

void fdt_fixup_ethernet(void *fdt)
{
int i, j;
int node;
const char *path;

node = fdt_path_offset(fdt, /aliases);
if (node = 0) {
char enet[12], mac[10], *tmp, *end;
unsigned char mac_addr[6];

for (i = 0; i  10; i++) {
sprintf(enet, ethernet%d, i);
sprintf(mac, eth%daddr,i);

sprintf(mac, i ? eth%daddr : ethaddr, i);
tmp = getenv(mac);
path = fdt_getprop(fdt, node, enet, NULL);

if (!path) {
continue;
}
if (!tmp) {
continue;
}

for (j = 0; j  6; j++) {
mac_addr[j] = tmp ? simple_strtoul(tmp, end, 
16) : 0;
if (tmp)
tmp = (*end) ? end+1 : end;
}

do_fixup_by_path(fdt, path, mac-address,
mac_addr, 6, 0);
do_fixup_by_path(fdt, path, local-mac-address,
mac_addr, 6, 1);
}
}
}
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] fdt: rework fdt_fixup_ethernet() to use env instead of bd_t

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

In message [EMAIL PROTECTED] you wrote:
 Move to using the environment variables 'ethaddr', 'eth1addr', etc..
 instead of bd-bi_enetaddr, bi_enet1addr, etc.
 
 This makes the code a bit more flexible to the number of ethernet
 interfaces.  Right now we assume a max of 10 interfaces.

How does this match with our very static way of selecting this using
'CONFIG_HAS_ETHn' #defines?  There is no such thing as
CONFIG_HAS_ETH8 anywhere in the code...

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [EMAIL PROTECTED]
The one who says it cannot be done should never interrupt the one who
is doing it.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] fdt: rework fdt_fixup_ethernet() to use env instead of bd_t

2008-08-18 Thread Kumar Gala

On Aug 18, 2008, at 2:12 PM, Wolfgang Denk wrote:

 Dear Kumar Gala,

 In message [EMAIL PROTECTED]  
 you wrote:
 Move to using the environment variables 'ethaddr', 'eth1addr', etc..
 instead of bd-bi_enetaddr, bi_enet1addr, etc.

 This makes the code a bit more flexible to the number of ethernet
 interfaces.  Right now we assume a max of 10 interfaces.

 How does this match with our very static way of selecting this using
 'CONFIG_HAS_ETHn' #defines?  There is no such thing as
 CONFIG_HAS_ETH8 anywhere in the code...

oops, forgot about that.  I think we just have the code exist always  
(for CONFIG_OF_LIBFDT)

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


Re: [U-Boot] [PATCH] fdt: rework fdt_fixup_ethernet() to use env instead of bd_t

2008-08-18 Thread Kumar Gala

On Aug 18, 2008, at 2:16 PM, Kumar Gala wrote:


 On Aug 18, 2008, at 2:12 PM, Wolfgang Denk wrote:

 Dear Kumar Gala,

 In message [EMAIL PROTECTED]
 you wrote:
 Move to using the environment variables 'ethaddr', 'eth1addr', etc..
 instead of bd-bi_enetaddr, bi_enet1addr, etc.

 This makes the code a bit more flexible to the number of ethernet
 interfaces.  Right now we assume a max of 10 interfaces.

 How does this match with our very static way of selecting this using
 'CONFIG_HAS_ETHn' #defines?  There is no such thing as
 CONFIG_HAS_ETH8 anywhere in the code...

 oops, forgot about that.  I think we just have the code exist always
 (for CONFIG_OF_LIBFDT)

74xx_7xx, mpc8xx, ppc4xx -- called regardless of CONFIG_HAS_ETHn
mpc512x -- called only based on HAS_ETH0
mpc8260, mpc83xx, mpc85xx, mpc86xx -- called if HAS_ETH0 || HAS_ETH1  
|| HAS_ETH2 || HAS_ETH3

With ETH3 being the max today.

We have a part (p4080) in the works with 8 interfaces (its unlikely  
we'll have support for all 8 in u-boot, but do want to be ablity to  
set mac addresses for all 8.)

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


[U-Boot] [PATCH v2] fdt: rework fdt_fixup_ethernet() to use env instead of bd_t

2008-08-18 Thread Kumar Gala
Move to using the environment variables 'ethaddr', 'eth1addr', etc..
instead of bd-bi_enetaddr, bi_enet1addr, etc.

This makes the code a bit more flexible to the number of ethernet
interfaces.  Right now we assume a max of 10 interfaces.

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

Since we can support 10 interfaces and aren't coupled to the bd we can remove
the conditionality of HAS_ETHn for fdt_fixup_ethernet.

- k

 common/fdt_support.c  |   69 ++---
 cpu/74xx_7xx/cpu.c|2 +-
 cpu/mpc512x/cpu.c |2 +-
 cpu/mpc8260/cpu.c |2 +-
 cpu/mpc83xx/fdt.c |2 +-
 cpu/mpc85xx/fdt.c |2 +-
 cpu/mpc86xx/fdt.c |2 +-
 cpu/mpc8xx/fdt.c  |2 +-
 cpu/ppc4xx/fdt.c  |2 +-
 include/fdt_support.h |2 +-
 10 files changed, 40 insertions(+), 47 deletions(-)

diff --git a/common/fdt_support.c b/common/fdt_support.c
index 93b144e..b8f6fde 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -368,55 +368,48 @@ int fdt_fixup_memory(void *blob, u64 start, u64 size)
return 0;
 }

-#if defined(CONFIG_HAS_ETH0) || defined(CONFIG_HAS_ETH1) ||\
-defined(CONFIG_HAS_ETH2) || defined(CONFIG_HAS_ETH3)
-
-void fdt_fixup_ethernet(void *fdt, bd_t *bd)
+#define CFG_MAX_NUM_ETH(10)
+void fdt_fixup_ethernet(void *fdt)
 {
+   int i, j;
int node;
const char *path;

node = fdt_path_offset(fdt, /aliases);
if (node = 0) {
-#if defined(CONFIG_HAS_ETH0)
-   path = fdt_getprop(fdt, node, ethernet0, NULL);
-   if (path) {
-   do_fixup_by_path(fdt, path, mac-address,
-   bd-bi_enetaddr, 6, 0);
-   do_fixup_by_path(fdt, path, local-mac-address,
-   bd-bi_enetaddr, 6, 1);
-   }
-#endif
-#if defined(CONFIG_HAS_ETH1)
-   path = fdt_getprop(fdt, node, ethernet1, NULL);
-   if (path) {
-   do_fixup_by_path(fdt, path, mac-address,
-   bd-bi_enet1addr, 6, 0);
-   do_fixup_by_path(fdt, path, local-mac-address,
-   bd-bi_enet1addr, 6, 1);
-   }
-#endif
-#if defined(CONFIG_HAS_ETH2)
-   path = fdt_getprop(fdt, node, ethernet2, NULL);
-   if (path) {
-   do_fixup_by_path(fdt, path, mac-address,
-   bd-bi_enet2addr, 6, 0);
-   do_fixup_by_path(fdt, path, local-mac-address,
-   bd-bi_enet2addr, 6, 1);
-   }
-#endif
-#if defined(CONFIG_HAS_ETH3)
-   path = fdt_getprop(fdt, node, ethernet3, NULL);
-   if (path) {
+   char enet[12], mac[10], *tmp, *end;
+   unsigned char mac_addr[6];
+
+   for (i = 0; i  CFG_MAX_NUM_ETH; i++) {
+   sprintf(enet, ethernet%d, i);
+   sprintf(mac, eth%daddr,i);
+
+   sprintf(mac, i ? eth%daddr : ethaddr, i);
+   tmp = getenv(mac);
+   path = fdt_getprop(fdt, node, enet, NULL);
+
+   if (!path) {
+   debug(No alias for %s\n, enet);
+   continue;
+   }
+   if (!tmp) {
+   debug(No environment variable for %s\n, mac);
+   continue;
+   }
+
+   for (j = 0; j  6; j++) {
+   mac_addr[j] = tmp ? simple_strtoul(tmp, end, 
16) : 0;
+   if (tmp)
+   tmp = (*end) ? end+1 : end;
+   }
+
do_fixup_by_path(fdt, path, mac-address,
-   bd-bi_enet3addr, 6, 0);
+   mac_addr, 6, 0);
do_fixup_by_path(fdt, path, local-mac-address,
-   bd-bi_enet3addr, 6, 1);
+   mac_addr, 6, 1);
}
-#endif
}
 }
-#endif

 #ifdef CONFIG_HAS_FSL_DR_USB
 void fdt_fixup_dr_usb(void *blob, bd_t *bd)
diff --git a/cpu/74xx_7xx/cpu.c b/cpu/74xx_7xx/cpu.c
index ea43c9a..c007abc 100644
--- a/cpu/74xx_7xx/cpu.c
+++ b/cpu/74xx_7xx/cpu.c
@@ -314,7 +314,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)

fdt_fixup_memory(blob, (u64)bd-bi_memstart, (u64)bd-bi_memsize);

-   fdt_fixup_ethernet(blob, bd);
+   fdt_fixup_ethernet(blob);
 }
 #endif
 /* - */
diff --git a/cpu/mpc512x/cpu.c b/cpu/mpc512x/cpu.c
index 703e188..1f39ac4 100644
--- a/cpu/mpc512x/cpu.c
+++ b/cpu/mpc512x/cpu.c
@@ -191,7 +191,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)
 #endif
ft_clock_setup(blob, bd);
 

Re: [U-Boot] [PATCH] fdt: rework fdt_fixup_ethernet() to use env instead of bd_t

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

In message [EMAIL PROTECTED] you wrote:
 
 74xx_7xx, mpc8xx, ppc4xx -- called regardless of CONFIG_HAS_ETHn
 mpc512x -- called only based on HAS_ETH0
 mpc8260, mpc83xx, mpc85xx, mpc86xx -- called if HAS_ETH0 || HAS_ETH1  
 || HAS_ETH2 || HAS_ETH3
 
 With ETH3 being the max today.

Yes. and I have to admit that I really dislike this static
configuration which prevents any loops in the code.

 We have a part (p4080) in the works with 8 interfaces (its unlikely  
 we'll have support for all 8 in u-boot, but do want to be ablity to  
 set mac addresses for all 8.)

I guess we should try to find some clever way of overcoming  the  old
style.

Best regards,

Wolfgang Denk

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


Re: [U-Boot] [U-Boot-Users] [PATCH] add 'unzip' command to u-boot commandline

2008-08-18 Thread Wolfgang Denk
Dear Harald Welte,

In message [EMAIL PROTECTED] you wrote:
 
 [PATCH] add new 'unzip' command to u-boot commandline
 
 common/cmd_mem.c: new command unzip srcaddr dstaddr [dstsize] to unzip from
 memory to memory, and option CONFIG_CMD_UNZIP to enable it
 
 Signed-off-by: Werner Almesberger [EMAIL PROTECTED]
 Signed-off-by: Harald Welte [EMAIL PROTECTED]

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [EMAIL PROTECTED]
Quantum particles: The dreams that stuff is made of.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [U-boot] [PATCH 1/2] NET: QE: UEC: Make uec_miiphy_read() and uec_miiphy_write() use the devname arg.

2008-08-18 Thread Ben Warren
richardretanubun wrote:
 Added a new function uec_miiphy_find_dev_by_name to allow uec_miiphy_read 
 and uec_miiphy_write to use the passed devname and not hardcoded to devlist[0]

 Signed-off-by: Richard Retanubun RichardRetanubun_at_ruggedcom.com

 diff --git a/drivers/qe/uec.c b/drivers/qe/uec.c
 index 344c649..d14566e 100644
 --- a/drivers/qe/uec.c
 +++ b/drivers/qe/uec.c
 @@ -639,6 +639,32 @@ static void phy_change(struct eth_device *dev)
!defined(BITBANGMII)
  
  /*
 + * Find a device index from the devlist by name
 + *
 + * Returns:
 + *  The index where the device is located, else 0
   
But index 0 is a valid device.  Return -1 on failure and check for it.
 + */
 +static int uec_miiphy_find_dev_by_name(char *devname)
 +{
 + int i = 0;
   
No need to initialize this variable.
 +
 +
 + for (i = 0; i  MAXCONTROLLERS; i++) {
 + if (strncmp(devname, devlist[i]-name, strlen(devname)) == 0) {
 + break;
 + }
 + }
 +
 + // If device cannot be found, default to 0
   
No C++ - style comments please.
 + if (i == MAXCONTROLLERS) {
 + debug (%s: device %s not found in devlist\n, __FUNCTION__, 
 devname);
 + i = 0;
   
As mentioned above, don't set to a valid index on failure.  -1 is 
standard for this type of thing.
 + }
 +
 + return (i);
   
No brackets needed around return value.
 +}
 +
 +/*
   * Read a MII PHY register.
   *
   * Returns:
 @@ -647,8 +673,15 @@ static void phy_change(struct eth_device *dev)
  static int uec_miiphy_read(char *devname, unsigned char addr,
   unsigned char reg, unsigned short *value)
  {
 - *value = uec_read_phy_reg(devlist[0], addr, reg);
 + int i = 0;
   
This isn't a good variable name except for iterators.  Please use 
something more meaningful.
 +
  
 + if (devname == NULL || value == NULL) {
 + debug(%s: NULL pointer given\n, __FUNCTION__);
 + } else {
 + i = uec_miiphy_find_dev_by_name(devname);
   
Bail if i0
 + *value = uec_read_phy_reg(devlist[i], addr, reg);
 + }
   return 0;
  }
  
 @@ -661,11 +694,17 @@ static int uec_miiphy_read(char *devname, unsigned char 
 addr,
  static int uec_miiphy_write(char *devname, unsigned char addr,
unsigned char reg, unsigned short value)
  {
 - uec_write_phy_reg(devlist[0], addr, reg, value);
 + int i = 0;
 +
  
 + if (devname == NULL) {
 + debug(%s: NULL pointer given\n, __FUNCTION__);
 + } else {
 + i = uec_miiphy_find_dev_by_name(devname);
 + uec_write_phy_reg(devlist[i], addr, reg, value);
 + }
   
Same comments as with other function.
   return 0;
  }
 -
  #endif
  
  static int uec_set_mac_address(uec_private_t *uec, u8 *mac_addr)

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


Re: [U-Boot] [PATCH 06/11] misc: Clean drivers/misc/Makefile

2008-08-18 Thread Wolfgang Denk
Dear [EMAIL PROTECTED],

In message [EMAIL PROTECTED] you wrote:
 From: Michal Simek [EMAIL PROTECTED]
 
 
 Signed-off-by: Michal Simek [EMAIL PROTECTED]
 ---
  drivers/misc/Makefile |6 +++---
  drivers/misc/ali512x.c|5 -
  drivers/misc/ns87308.c|4 
  drivers/misc/status_led.c |4 
  4 files changed, 3 insertions(+), 16 deletions(-)

Applying misc: Clean drivers/misc/Makefile
error: patch failed: drivers/misc/Makefile:25
error: drivers/misc/Makefile: patch does not apply
error: patch failed: drivers/misc/ali512x.c:32
error: drivers/misc/ali512x.c: patch does not apply
error: patch failed: drivers/misc/ns87308.c:23
error: drivers/misc/ns87308.c: patch does not apply
error: patch failed: drivers/misc/status_led.c:35
error: drivers/misc/status_led.c: patch does not apply
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
Auto-merged drivers/misc/Makefile
CONFLICT (content): Merge conflict in drivers/misc/Makefile
Failed to merge in the changes.
Patch failed at 0006.

Please rebase and resubmit.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [EMAIL PROTECTED]
God made the integers; all else is the work of Man.   - Kronecker
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 07/11] block: Clean drivers/block/Makefile

2008-08-18 Thread Wolfgang Denk
Dear [EMAIL PROTECTED],

In message [EMAIL PROTECTED] you wrote:
 From: Michal Simek [EMAIL PROTECTED]
 
 
 Signed-off-by: Michal Simek [EMAIL PROTECTED]
 ---
  drivers/block/Makefile|   10 +-
  drivers/block/ahci.c  |3 ---
  drivers/block/ata_piix.c  |4 
  drivers/block/sil680.c|4 +---
  drivers/block/sym53c8xx.c |5 -
  drivers/block/systemace.c |3 ---
  6 files changed, 6 insertions(+), 23 deletions(-)

Oops, wrong message sent.

Applying block: Clean drivers/block/Makefile
error: patch failed: drivers/block/Makefile:25
error: drivers/block/Makefile: patch does not apply
error: patch failed: drivers/block/ahci.c:26
error: drivers/block/ahci.c: patch does not apply
error: patch failed: drivers/block/ata_piix.c:35
error: drivers/block/ata_piix.c: patch does not apply
error: patch failed: drivers/block/sil680.c:54
error: drivers/block/sil680.c: patch does not apply
error: patch failed: drivers/block/sym53c8xx.c:35
error: drivers/block/sym53c8xx.c: patch does not apply
error: patch failed: drivers/block/systemace.c:44
error: drivers/block/systemace.c: patch does not apply
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
Auto-merged drivers/block/Makefile
CONFLICT (content): Merge conflict in drivers/block/Makefile
Auto-merged drivers/block/sil680.c
CONFLICT (content): Merge conflict in drivers/block/sil680.c
Auto-merged drivers/block/sym53c8xx.c
Failed to merge in the changes.
Patch failed at 0007.


Please rebase and resubmit.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [EMAIL PROTECTED]
Q:  How do you play religious roulette?
A:  You stand around in a circle  and  blaspheme  and  see  who  gets
struck by lightning first.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 08/11] dma: Clean drivers/dma/Makefile

2008-08-18 Thread Wolfgang Denk
Dear [EMAIL PROTECTED],

In message [EMAIL PROTECTED] you wrote:
 From: Michal Simek [EMAIL PROTECTED]
 
 
 Signed-off-by: Michal Simek [EMAIL PROTECTED]
 ---
  drivers/dma/MCD_dmaApi.c|3 ---
  drivers/dma/MCD_tasks.c |4 
  drivers/dma/MCD_tasksInit.c |4 
  drivers/dma/Makefile|2 +-
  4 files changed, 1 insertions(+), 12 deletions(-)

*this one* was already applied, it seems.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [EMAIL PROTECTED]
The computer programmer is a creator of universes for which he alone
is responsible. Universes of virtually unlimited  complexity  can  be
created  in  the  form  of  computer  programs. - Joseph Weizenbaum,
_Computer Power and Human Reason_
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 10/11] input: Clean drivers/input/Makefile

2008-08-18 Thread Wolfgang Denk
Dear [EMAIL PROTECTED],

In message [EMAIL PROTECTED] you wrote:
 From: Michal Simek [EMAIL PROTECTED]
 
 
 Signed-off-by: Michal Simek [EMAIL PROTECTED]
 ---
  drivers/input/Makefile   |7 ---
  drivers/input/i8042.c|4 
  drivers/input/keyboard.c |4 
  drivers/input/pc_keyb.c  |4 
  4 files changed, 4 insertions(+), 15 deletions(-)

Applying input: Clean drivers/input/Makefile
error: patch failed: drivers/input/Makefile:25
error: drivers/input/Makefile: patch does not apply
error: patch failed: drivers/input/i8042.c:27
error: drivers/input/i8042.c: patch does not apply
error: patch failed: drivers/input/keyboard.c:11
error: drivers/input/keyboard.c: patch does not apply
error: patch failed: drivers/input/pc_keyb.c:13
error: drivers/input/pc_keyb.c: patch does not apply
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
Auto-merged drivers/input/Makefile
CONFLICT (content): Merge conflict in drivers/input/Makefile
Auto-merged drivers/input/pc_keyb.c
Failed to merge in the changes.
Patch failed at 0010.

Please rebase and resubmit.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [EMAIL PROTECTED]
The algorithm to do that is extremely nasty. You might want  to  mug
someone with it.   - M. Devine, Computer Science 340
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 11/11] video: Clean drivers/video/Makefile

2008-08-18 Thread Wolfgang Denk
Dear [EMAIL PROTECTED],

In message [EMAIL PROTECTED] you wrote:
 From: Michal Simek [EMAIL PROTECTED]
 
 
 Signed-off-by: Michal Simek [EMAIL PROTECTED]
 ---
  drivers/video/Makefile|   16 
  drivers/video/ati_radeon_fb.c |3 ---
  drivers/video/cfb_console.c   |3 ---
  drivers/video/ct69000.c   |5 -
  drivers/video/mb862xx.c   |3 ---
  drivers/video/sed13806.c  |3 ---
  drivers/video/sed156x.c   |4 
  drivers/video/sm501.c |4 
  drivers/video/smiLynxEM.c |4 
  9 files changed, 8 insertions(+), 37 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [EMAIL PROTECTED]
Extreme feminine beauty is always disturbing.
-- Spock, The Cloud Minders, stardate 5818.4
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] MV Linux uImage not working with u-boot, but zImage does

2008-08-18 Thread john h
I wasn't sure if this is a Linux issue or a u-boot issue.

We are using an older version of arch/ppc MontaVista Linux and having
a problem with u-boot.  We can build a zImage and convert it to a
uImage and it runs from u-boot fine.

If we build a uImage from MV, the kernel crashes as shown below. We
are using u-boot version U-Boot 1.3.0-rc3.

Yet we can boot an arch/ppc Linux kernel (uImage) that's based on
2.6.26.  Is there something we're not realizing that is different in
the u-boot interface?

Thanks,
John

version 2.6.10_mvl401-ml40x () (gcc version 3.4.3 (MontaVista 3.4.3
25.0.70.0501961
4mem_pieces_remove: [0,0) not in any region
2kernel BUG in free_bootmem_core at mm/bootmem.c:115!
4NIP: C02B4D04 LR: C02B2350 SP: C02A3F90 REGS: c02a3ee0 TRAP: 0700
 Not tainted
6GPR00:  C02A3F90 C026C720 C02D6EAC  0001
C027 C026DC48
6GPR08: C027    48002028 A5A5
1C00 
6GPR16: 007FFF00  007FFE80 0080  
0FFFA304 
6GPR24:  0FEDA958 0DC0 007FFF3A 007FFF00 C02D
0001 C02CEC04
4NIP [c02b4d04] free_bootmem_core+0x1c/0xac
4LR [c02b2350] do_init_bootmem+0xfc/0x1404 Call trace:
4 [c02b1cec] setup_arch+0xd8/0x1dc
4 [c02a44d8] start_kernel+0x28/0x1bc
4 [c240] skpinv+0x1e8/0x224
0Kernel panic - not syncing: Attempted to kill the idle task!
4 0 Rebooting in 180 seconds..
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 02/15] Clean up usage of icache_disable/dcache_disable

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

In message [EMAIL PROTECTED] you wrote:
 There is no point in disabling the icache on 7xx/74xx/86xx parts and not
 also flushing the icache.  All callers of invalidate_l1_instruction_cache()
 call icache_disable() right after.  Make it so icache_disable() calls
 invalidate_l1_instruction_cache() for us.
 
 Also, dcache_disable() already calls dcache_flush() so there is no point
 in the explicit calls of dcache_flush().
 
 Signed-off-by: Kumar Gala [EMAIL PROTECTED]
 ---
  board/Marvell/db64360/db64360.c   |5 -
  board/Marvell/db64460/db64460.c   |5 -
  board/esd/cpci750/cpci750.c   |4 
  board/freescale/mpc7448hpc2/mpc7448hpc2.c |2 --
  board/prodrive/p3mx/p3mx.c|2 --
  common/cmd_bootm.c|2 --
  cpu/74xx_7xx/cache.S  |4 
  cpu/mpc86xx/cache.S   |4 
  8 files changed, 8 insertions(+), 20 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

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


Re: [U-Boot] [U-boot] [PATCH 2/2] NET: QE: UEC: Allow uec re-initialization based on netretry environment variable.

2008-08-18 Thread richardretanubun
Hi Ben,

Ben Warren wrote:
 richardretanubun wrote:
 Allow uec_init to run more than once, based on the netretry 
 environment variable.
 This allows for manual (back and forth) switching between network 
 interfaces.

   
 Can't you do this by changing the 'ethactive' environment variable?
You are correct,  changing 'ethact' environment variable works if you 
are actually changing the network interface (say from FSL UEC0 to FSL 
UEC1)

I'm sorry for not adding this earlier.

The scenario I am trying to handle is if switching network interface fails.
I am trying to switch and activate specific network interfaces for 
testing and
often times the interface will fail to initialize and will have to be 
reinitialized

I am using these function call sequence to do activate the specific eth 
interface repeatedly:

void net_set_eth(char *newEthDev)
{

setenv(ethact, newEthDev);
eth_set_current();
eth_init(gd-bd);

}

By adding the patch, I can just keep trying the same eth interface. The 
'ethrotate' environment variable will also work,
but only for rotating once, once a failure occur, there is no way to 
retry the same ethernet connection.


 regards,
 Ben

Hope this does not confuse more :)

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


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

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

In message [EMAIL PROTECTED] you wrote:
 Signed-off-by: Kumar Gala [EMAIL PROTECTED]
 ---
  common/cmd_fdt.c |   21 +
  1 files changed, 17 insertions(+), 4 deletions(-)
 
 diff --git a/common/cmd_fdt.c b/common/cmd_fdt.c
 index d3b19dd..436fec9 100644
 --- a/common/cmd_fdt.c
 +++ b/common/cmd_fdt.c
 @@ -417,9 +417,21 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char 
 *argv[])
   ft_board_setup(working_fdt, gd-bd);
  #endif
   /* Create a chosen node */
 - else if (argv[1][0] == 'c')
 - fdt_chosen(working_fdt, 0, 0, 1);
 - else {
 + else if (argv[1][0] == 'c') {
 + unsigned long initrd_start = 0, initrd_end = 0;

I guess we should use phys_addr_t here.

 + if ((argc != 2)  (argc != 4)) {
 + printf (Usage:\n%s\n, cmdtp-usage);
 + return 1;
 + }
 +
 + if (argc == 4) {
 + initrd_start = simple_strtoul(argv[2], NULL, 16);
 + initrd_end = simple_strtoul(argv[3], NULL, 16);

Ah - do we have some simple_strtouphys yet? I think we don't. This
might be a sleeping dog in a lot af places in the code, actually...


Hm... what do you think?

[Except from that it's fine with me.]

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [EMAIL PROTECTED]
A supercomputer is a machine that runs an endless loop in 2 seconds.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 03/15] Add command to enable/disable interrupts

2008-08-18 Thread Kumar Gala

On Aug 18, 2008, at 5:59 PM, Wolfgang Denk wrote:

 Dear Kumar Gala,

 In message 1218806685-3615-3-git-send-email- 
 [EMAIL PROTECTED] you wrote:
 Signed-off-by: Kumar Gala [EMAIL PROTECTED]
 ---
 common/Makefile  |1 +
 common/cmd_irq.c |   50  
 ++
 2 files changed, 51 insertions(+), 0 deletions(-)
 create mode 100644 common/cmd_irq.c
 ...
 +U_BOOT_CMD(
 +interrupts, 5, 0, do_interrupts,
 +interrupts - enable or disable interrupts\n,
 +[on, off]\n
 +- enable or disable interrupts\n

 I suggest to also support this command without argument, in which case
 it would print the current setting.

The current arch interfaces don't have a clean way to do this right  
now.

I can hack it in via:

iflag = disable_interrupts()
if (iflag) {
enable_interrupts()
printf(interrupts are enabled\n);
} else {
printf(interrupts are disabled\n);
}

If this isn't ok, I'd request you take this patch and I'll look at  
adding an get_irqflags() to all the arches and add support to print  
the interrupt state based on that.

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


Re: [U-Boot] [U-Boot-Users] [PATCH] add 'unzip' command to u-boot commandline

2008-08-18 Thread Wolfgang Denk
Dear Harald Welte,

In message [EMAIL PROTECTED] you wrote:
 
 [PATCH] add new 'unzip' command to u-boot commandline
 
 common/cmd_mem.c: new command unzip srcaddr dstaddr [dstsize] to unzip from
 memory to memory, and option CONFIG_CMD_UNZIP to enable it
 
 Signed-off-by: Werner Almesberger [EMAIL PROTECTED]
 Signed-off-by: Harald Welte [EMAIL PROTECTED]

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [EMAIL PROTECTED]
Quantum particles: The dreams that stuff is made of.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


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

2008-08-18 Thread Jerry Van Baren
Wolfgang Denk wrote:
 Hi Jerry,
 
 In message [EMAIL PROTECTED] Kumar Gala wrote:
 Signed-off-by: Kumar Gala [EMAIL PROTECTED]
 ---
  common/cmd_fdt.c |8 
  1 files changed, 8 insertions(+), 0 deletions(-)

[snip]

 
 This looks ok to me. Will you add this, or should I pull it directly?
 
 Best regards,
 
 Wolfgang Denk

Please pull it directly.

Thanks,
gvb

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


Re: [U-Boot] [PATCH] Fix OneNAND read_oob/write_oob functions compatability

2008-08-18 Thread Scott Wood
Kyungmin Park wrote:
 diff --git a/common/cmd_onenand.c b/common/cmd_onenand.c
 index 5e2062b..8d87b78 100644
 --- a/common/cmd_onenand.c
 +++ b/common/cmd_onenand.c
 @@ -85,15 +85,25 @@ int do_onenand(cmd_tbl_t * cmdtp, int flag, int argc, 
 char *argv[])
   ulong addr = simple_strtoul(argv[2], NULL, 16);
   ulong ofs = simple_strtoul(argv[3], NULL, 16);
   size_t len = simple_strtoul(argv[4], NULL, 16);
 - size_t retlen = 0;
   int oob = strncmp(argv[1], read.oob, 8) ? 0 : 1;
 + struct mtd_oob_ops ops;
 +
 + ops.mode = MTD_OOB_PLACE;
 I think this should be MTD_OOB_RAW.
 
 What's the difference? In the code it can't support the MTD_OOB_RAW case.

Sorry, I was confusing PLACE with AUTO.

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


[U-Boot] [PATCH] Fix OneNAND read_oob/write_oob functions compatability (take #2)

2008-08-18 Thread Kyungmin Park
Also sync with kernel OneNAND codes with adrian contribution credits

Signed-off-by: Kyungmin Park [EMAIL PROTECTED]
---
diff --git a/common/cmd_onenand.c b/common/cmd_onenand.c
index 5e2062b..8d87b78 100644
--- a/common/cmd_onenand.c
+++ b/common/cmd_onenand.c
@@ -85,15 +85,25 @@ int do_onenand(cmd_tbl_t * cmdtp, int flag, int argc, char 
*argv[])
ulong addr = simple_strtoul(argv[2], NULL, 16);
ulong ofs = simple_strtoul(argv[3], NULL, 16);
size_t len = simple_strtoul(argv[4], NULL, 16);
-   size_t retlen = 0;
int oob = strncmp(argv[1], read.oob, 8) ? 0 : 1;
+   struct mtd_oob_ops ops;
+
+   ops.mode = MTD_OOB_PLACE;
+
+   if (oob) {
+   ops.len = 0;
+   ops.datbuf = NULL;
+   ops.ooblen = len;
+   ops.oobbuf = (u_char *) addr;
+   } else {
+   ops.len = len;
+   ops.datbuf = (u_char *) addr;
+   ops.ooblen = 0;
+   ops.oobbuf = NULL;
+   }
+   ops.retlen = ops.oobretlen = 0;
 
-   if (oob)
-   onenand_read_oob(onenand_mtd, ofs, len,
-retlen, (u_char *) addr);
-   else
-   onenand_read(onenand_mtd, ofs, len, retlen,
-(u_char *) addr);
+   onenand_mtd.read_oob(onenand_mtd, ofs, ops);
printf(Done\n);
 
return 0;
@@ -117,9 +127,12 @@ int do_onenand(cmd_tbl_t * cmdtp, int flag, int argc, char 
*argv[])
ulong block = simple_strtoul(argv[3], NULL, 10);
ulong page = simple_strtoul(argv[4], NULL, 10);
size_t len = simple_strtol(argv[5], NULL, 10);
-   size_t retlen = 0;
ulong ofs;
int oob = strncmp(argv[1], block.oob, 9) ? 0 : 1;
+   struct mtd_oob_ops ops;
+
+   ops.mode = MTD_OOB_PLACE;
+
 
ofs = block  onenand_chip.erase_shift;
if (page)
@@ -127,17 +140,21 @@ int do_onenand(cmd_tbl_t * cmdtp, int flag, int argc, 
char *argv[])
 
if (!len) {
if (oob)
-   len = 64;
+   ops.ooblen = 64;
else
-   len = 512;
+   ops.len = 512;
+   }
+
+   if (oob) {
+   ops.datbuf = NULL;
+   ops.oobbuf = (u_char *) addr;
+   } else {
+   ops.datbuf = (u_char *) addr;
+   ops.oobbuf = NULL;
}
+   ops.retlen = ops.oobretlen = 0;
 
-   if (oob)
-   onenand_read_oob(onenand_mtd, ofs, len,
-retlen, (u_char *) addr);
-   else
-   onenand_read(onenand_mtd, ofs, len, retlen,
-(u_char *) addr);
+   onenand_read_oob(onenand_mtd, ofs, ops);
return 0;
}
 
diff --git a/drivers/mtd/onenand/onenand_base.c 
b/drivers/mtd/onenand/onenand_base.c
index 9ce68e1..67901bb 100644
--- a/drivers/mtd/onenand/onenand_base.c
+++ b/drivers/mtd/onenand/onenand_base.c
@@ -4,6 +4,11 @@
  *  Copyright (C) 2005-2007 Samsung Electronics
  *  Kyungmin Park [EMAIL PROTECTED]
  *
+ *  Credits:
+ *  Adrian Hunter [EMAIL PROTECTED]:
+ *  auto-placement support, read-while load support, various fixes
+ *  Copyright (C) Nokia Corporation, 2007
+ *
  * 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.
@@ -526,83 +531,269 @@ static void onenand_release_device(struct mtd_info *mtd)
 }
 
 /**
- * onenand_read_ecc - [MTD Interface] Read data with ECC
+ * onenand_transfer_auto_oob - [Internal] oob auto-placement transfer
+ * @param mtd  MTD device structure
+ * @param buf  destination address
+ * @param column   oob offset to read from
+ * @param thislen  oob length to read
+ */
+static int onenand_transfer_auto_oob(struct mtd_info *mtd, uint8_t *buf,
+   int 

Re: [U-Boot] [PATCH v2] fdt: rework fdt_fixup_ethernet() to use env instead of bd_t

2008-08-18 Thread Jerry Van Baren
Wolfgang Denk wrote:
 Dear Kumar Gala,
 
 In message [EMAIL PROTECTED] you wrote:
 This makes the code a bit more flexible to the number of ethernet
 interfaces.  Right now we assume a max of 10 interfaces.
 Hm... where exactly is this artificial limit coming from? Do we really
 need it?
 We need some upper limit to stop checking at.
 
 The upper limit should be the real  (configured)  number  of  network
 interfaces, not some artificial limit which is either too high or too
 low.

It is (was) - CFG_MAX_NUM_ETH:
+   for (i = 0; i  CFG_MAX_NUM_ETH; i++) {

Actually, I don't see any arbitrary upper limit in the code, including 
Kumar's value of 10 (well, until you overflow the strings, anyway, but 
that is 100 interfaces).

 If we assume,  that  all  existing  interfaces  must  have  addresses
 assigned, we could use a break here instead of the continue. That
 would be (1) much faster on most boards and (2) would allow us to get
 rid of the artifical limit of 10.

CFG_MAX_NUM_ETH would presumably be the physical max and the 
/aliases/ethernet (and associated env variables) should *not* be sparse, 
therefore I agree with the the break recommendation.

 What do you think?
 I dont like making this assumption and do think its too much work to  
 check 10 possible aliases and skip to the next one if it doesn't exist.
 
 I do not want to see any  such  hard-coded  limits  if  they  can  be
 avoided. Which problem do you see to stop here at the first interface
 that has no MAC address assigned to it?

I originally wrote to support sparse ethernet MAC addresses, but on 
reflection I don't think that is an issue because we will have 
/aliases/ethernet[0-9]+ which won't be sparse, even if the actual SOC 
(e.g. PowerQuicc) channels that are used for ethernet are used in a 
sparse manner.

 Best regards,
 
 Wolfgang Denk

Best regards,
gvb

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


Re: [U-Boot] Resubmit : [PATCH] Correct ARM Versatile TimerInitialization

2008-08-18 Thread Gururaja Hebbar K R
Hi,

Today I download u-boot-1.3.4 and checked drivers\rtc directory with 
u-boot-1.3.3\drivers\rtc .

 There is change in the files that this patch touches. So I think the same 
patch can be applied to u-boot-1.3.4 also.

 

Kindly update me if any changes is needed

 

Regards

Gururaja

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


Re: [U-Boot] [U-Boot-Users] [Part 2 of A PATCH SERIES for STLS]: Upate Makefile, MAKEALL and MAINTAINERS files in root directory!

2008-08-18 Thread Ryan CHEN
Dear Wolfgang,
Yes, I was modifying my codes in the past several days. Since I need give
support to another project, I was so late to continue my push work for
U-Boot. Sorry! 
I am unskilled on git tools, so now I also try to study how to use
git-format-patch to make my patchs reasonable. I will resubmit them ASAP.

Thanks for your help!

Best Regards,
Ryan Chen
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 19, 2008 6:10 AM
To: Ryan CHEN
Cc: u-boot@lists.denx.de; Antonio Maria BORNEO
Subject: Re: [U-Boot-Users] [Part 2 of A PATCH SERIES for STLS]: Upate
Makefile, MAKEALL and MAINTAINERS files in root directory!

Dear Ryan CHEN,

In message [EMAIL PROTECTED] you wrote:

 This is part 2 of a patch series for STLS. It will update Makefile,
MAKEALL and MAINTAINERS files with STLS information!

After the review comments on this list I'm still waiting for you to post an
updated patch (a single one). Please note that the merge window is open
*now*, so if you want to see that code in the next release, please act now.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [EMAIL PROTECTED] 
Life
sucks, but it's better than the alternative.
- Peter da Silva

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