Re: [U-Boot] [PATCH v4] Program net device MAC addresses after initializing

2010-04-26 Thread Thomas Chou
On 04/27/2010 02:23 AM, Ben Warren wrote:
> Add a new function to the eth_device struct for programming a network
> controller's hardware address.
>
> After all network devices have been initialized and the proper MAC address
> for each has been determined, make a device driver call to program the
> address into the device.  Only device instances with valid unicast addresses
> will be programmed.
>
> Signed-off-by: Ben Warren
> Acked-by: Heiko Schocher
> Acked-by: Detlev Zundel
> Tested-by: Prafulla Wadaskar
>
Tested using ethoc and altera_tse driver on nios2 NEEK and EP3C120 boards.

Tested-by: Thomas Chou 

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


[U-Boot] [PATCH] bootdelay can be an environemt variable

2010-04-26 Thread Matthias Weisser
This patch allows the bootdelay variable contain the name of
another variable holding the actual bootdelay value.

Signed-off-by: Matthias Weisser 
---
 common/main.c |9 -
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/common/main.c b/common/main.c
index f7e7c1c..f43802c 100644
--- a/common/main.c
+++ b/common/main.c
@@ -371,7 +371,14 @@ void main_loop (void)
 
 #if defined(CONFIG_BOOTDELAY) && (CONFIG_BOOTDELAY >= 0)
s = getenv ("bootdelay");
-   bootdelay = s ? (int)simple_strtol(s, NULL, 10) : CONFIG_BOOTDELAY;
+   if (s != NULL) {
+   char *v = getenv (s);
+   if (v != NULL)
+   bootdelay = (int)simple_strtol(v, NULL, 10);
+   else
+   bootdelay = (int)simple_strtol(s, NULL, 10);
+   } else
+   bootdelay = CONFIG_BOOTDELAY;
 
debug ("### main_loop entered: bootdelay=%d\n\n", bootdelay);
 
-- 
1.5.6.3

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


[U-Boot] [PATCH] net: altera_tse: add write_hwaddr support

2010-04-26 Thread Thomas Chou
Signed-off-by: Thomas Chou 
---
 drivers/net/altera_tse.c |   63 ++---
 1 files changed, 36 insertions(+), 27 deletions(-)

diff --git a/drivers/net/altera_tse.c b/drivers/net/altera_tse.c
index 5927904..0cf23d6 100644
--- a/drivers/net/altera_tse.c
+++ b/drivers/net/altera_tse.c
@@ -752,6 +752,40 @@ static int init_phy(struct eth_device *dev)
return 1;
 }
 
+static int tse_set_mac_address(struct eth_device *dev)
+{
+   struct altera_tse_priv *priv = dev->priv;
+   volatile struct alt_tse_mac *mac_dev = priv->mac_dev;
+
+   debug("Setting MAC address to 0x%02x%02x%02x%02x%02x%02x\n",
+ dev->enetaddr[5], dev->enetaddr[4],
+ dev->enetaddr[3], dev->enetaddr[2],
+ dev->enetaddr[1], dev->enetaddr[0]);
+   mac_dev->mac_addr_0 = ((dev->enetaddr[3]) << 24 |
+  (dev->enetaddr[2]) << 16 |
+  (dev->enetaddr[1]) << 8 | (dev->enetaddr[0]));
+
+   mac_dev->mac_addr_1 = ((dev->enetaddr[5] << 8 |
+   (dev->enetaddr[4])) & 0x);
+
+   /* Set the MAC address */
+   mac_dev->supp_mac_addr_0_0 = mac_dev->mac_addr_0;
+   mac_dev->supp_mac_addr_0_1 = mac_dev->mac_addr_1;
+
+   /* Set the MAC address */
+   mac_dev->supp_mac_addr_1_0 = mac_dev->mac_addr_0;
+   mac_dev->supp_mac_addr_1_1 = mac_dev->mac_addr_1;
+
+   /* Set the MAC address */
+   mac_dev->supp_mac_addr_2_0 = mac_dev->mac_addr_0;
+   mac_dev->supp_mac_addr_2_1 = mac_dev->mac_addr_1;
+
+   /* Set the MAC address */
+   mac_dev->supp_mac_addr_3_0 = mac_dev->mac_addr_0;
+   mac_dev->supp_mac_addr_3_1 = mac_dev->mac_addr_1;
+   return 0;
+}
+
 static int tse_eth_init(struct eth_device *dev, bd_t * bd)
 {
int dat;
@@ -830,33 +864,7 @@ static int tse_eth_init(struct eth_device *dev, bd_t * bd)
mac_dev->command_config.image = dat;
 
/* Set the MAC address */
-   debug("Setting MAC address to 0x%x%x%x%x%x%x\n",
- dev->enetaddr[5], dev->enetaddr[4],
- dev->enetaddr[3], dev->enetaddr[2],
- dev->enetaddr[1], dev->enetaddr[0]);
-   mac_dev->mac_addr_0 = ((dev->enetaddr[3]) << 24 |
-  (dev->enetaddr[2]) << 16 |
-  (dev->enetaddr[1]) << 8 | (dev->enetaddr[0]));
-
-   mac_dev->mac_addr_1 = ((dev->enetaddr[5] << 8 |
-   (dev->enetaddr[4])) & 0x);
-
-   /* Set the MAC address */
-   mac_dev->supp_mac_addr_0_0 = mac_dev->mac_addr_0;
-   mac_dev->supp_mac_addr_0_1 = mac_dev->mac_addr_1;
-
-   /* Set the MAC address */
-   mac_dev->supp_mac_addr_1_0 = mac_dev->mac_addr_0;
-   mac_dev->supp_mac_addr_1_1 = mac_dev->mac_addr_1;
-
-   /* Set the MAC address */
-   mac_dev->supp_mac_addr_2_0 = mac_dev->mac_addr_0;
-   mac_dev->supp_mac_addr_2_1 = mac_dev->mac_addr_1;
-
-   /* Set the MAC address */
-   mac_dev->supp_mac_addr_3_0 = mac_dev->mac_addr_0;
-   mac_dev->supp_mac_addr_3_1 = mac_dev->mac_addr_1;
-
+   tse_set_mac_address(dev);
/* configure the TSE core  */
/*  -- output clocks,  */
/*  -- and later config stuff for SGMII */
@@ -920,6 +928,7 @@ int altera_tse_initialize(u8 dev_num, int mac_base,
dev->halt = tse_eth_halt;
dev->send = tse_eth_send;
dev->recv = tse_eth_rx;
+   dev->write_hwaddr = tse_set_mac_address;
sprintf(dev->name, "%s-%hu", "ALTERA_TSE", dev_num);
 
eth_register(dev);
-- 
1.6.6.1

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


[U-Boot] [PATCH] net: fec_mxc: add write_hwaddr support

2010-04-26 Thread Heiko Schocher
tested on the magnesium board.

Signed-off-by: Heiko Schocher 
---
Patch from Ben must be applied before, see this patch here:

http://lists.denx.de/pipermail/u-boot/2010-April/070691.html

 drivers/net/fec_mxc.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
index 8c4ade5..2ea4fee 100644
--- a/drivers/net/fec_mxc.c
+++ b/drivers/net/fec_mxc.c
@@ -505,7 +505,6 @@ static int fec_init(struct eth_device *dev, bd_t* bd)
miiphy_restart_aneg(dev);

fec_open(dev);
-   fec_set_hwaddr(dev);
return 0;
 }

@@ -713,6 +712,7 @@ static int fec_probe(bd_t *bd)
edev->send = fec_send;
edev->recv = fec_recv;
edev->halt = fec_halt;
+   edev->write_hwaddr = fec_set_hwaddr;

fec->eth = (struct ethernet_regs *)IMX_FEC_BASE;
fec->bd = bd;
-- 
1.6.2.5

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


Re: [U-Boot] [PATCH v4] Program net device MAC addresses after initializing

2010-04-26 Thread Heiko Schocher
Hello Ben,

Ben Warren wrote:
> Add a new function to the eth_device struct for programming a network
> controller's hardware address.
> 
> After all network devices have been initialized and the proper MAC address
> for each has been determined, make a device driver call to program the
> address into the device.  Only device instances with valid unicast addresses
> will be programmed.
> 
> Signed-off-by: Ben Warren 
> Acked-by: Heiko Schocher 
> Acked-by: Detlev Zundel 
> Tested-by: Prafulla Wadaskar 
> ---
> v4->v3 First controller uses 'ethmacskip' instead of 'eth0macskip'
> v2->v3 Made the sprintf in new function actually work :(
> v1->v2 Add documentation & environment variable for overriding new behavior
> ACKs mentioned above are for v1
> 
>  README |5 +
>  doc/README.drivers.eth |7 ++-
>  doc/README.enetaddr|   10 ++
>  include/net.h  |1 +
>  net/eth.c  |   13 +
>  5 files changed, 31 insertions(+), 5 deletions(-)

Tested on the magnesium board, patch for adapting fec_mxc
driver follow, so:

Tested-by: Heiko Schocher 

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


Re: [U-Boot] [PATCH v2 12/17] SPEAr : i2c driver moved completely into drivers/i2c

2010-04-26 Thread Heiko Schocher
Hello Vipin,

Vipin KUMAR wrote:
> The i2c IP used by spear platform is a synopsys i2c controller
> The earlier driver adds the driver of this controller as if it is specific to
> spear platform.
> The driver files are now moved into drivers/i2c folder for reusability by 
> other
> platforms
> 
> Signed-off-by: Vipin Kumar 
> ---
>  drivers/i2c/Makefile   |2 +-
>  drivers/i2c/{spr_i2c.c => designware_i2c.c}|4 ++--
>  .../spr_i2c.h => drivers/i2c/designware_i2c.h  |6 +++---
>  include/configs/spear-common.h |2 +-
>  4 files changed, 7 insertions(+), 7 deletions(-)
>  rename drivers/i2c/{spr_i2c.c => designware_i2c.c} (98%)
>  rename arch/arm/include/asm/arch-spear/spr_i2c.h => 
> drivers/i2c/designware_i2c.h (98%)

As this patch is in a patchseries, which I think not go through the
i2c tree, you get my:

Acked-by: Heiko Schocher 

Thanks.

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


[U-Boot] [PATCH] net: ethoc: add write_hwaddr support

2010-04-26 Thread Thomas Chou
Signed-off-by: Thomas Chou 
---
 drivers/net/ethoc.c |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethoc.c b/drivers/net/ethoc.c
index b912e44..286fbe7 100644
--- a/drivers/net/ethoc.c
+++ b/drivers/net/ethoc.c
@@ -215,13 +215,14 @@ static inline void ethoc_write_bd(struct eth_device *dev, 
int index,
ethoc_write(dev, offset + 4, bd->addr);
 }
 
-static inline void ethoc_set_mac_address(struct eth_device *dev)
+static int ethoc_set_mac_address(struct eth_device *dev)
 {
u8 *mac = dev->enetaddr;
 
ethoc_write(dev, MAC_ADDR0, (mac[2] << 24) | (mac[3] << 16) |
(mac[4] << 8) | (mac[5] << 0));
ethoc_write(dev, MAC_ADDR1, (mac[0] << 8) | (mac[1] << 0));
+   return 0;
 }
 
 static inline void ethoc_ack_irq(struct eth_device *dev, u32 mask)
@@ -504,6 +505,7 @@ int ethoc_initialize(u8 dev_num, int base_addr)
dev->halt = ethoc_halt;
dev->send = ethoc_send;
dev->recv = ethoc_recv;
+   dev->write_hwaddr = ethoc_set_mac_address;
sprintf(dev->name, "%s-%hu", "ETHOC", dev_num);
 
eth_register(dev);
-- 
1.6.6.1

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


[U-Boot] [PATCH] Fixup native builds on powerpc

2010-04-26 Thread Kumar Gala
When we changed ARCH from ppc to powerpc we need to treat HOSTARCH the
same way.  We use HOSTARCH == ARCH to determine if a build is native.

Signed-off-by: Kumar Gala 
---
 Makefile |5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 34f10ce..f3e9dde 100644
--- a/Makefile
+++ b/Makefile
@@ -38,9 +38,8 @@ HOSTARCH := $(shell uname -m | \
-e s/sun4u/sparc64/ \
-e s/arm.*/arm/ \
-e s/sa110/arm/ \
-   -e s/powerpc/ppc/ \
-   -e s/ppc64/ppc/ \
-   -e s/macppc/ppc/)
+   -e s/ppc64/powerpc/ \
+   -e s/macppc/powerpc/)
 
 HOSTOS := $(shell uname -s | tr '[:upper:]' '[:lower:]' | \
sed -e 's/\(cygwin\).*/cygwin/')
-- 
1.6.0.6

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


Re: [U-Boot] [PATCH] fdt_support: add entry for sec3.1 and remove tls_ssl_stream descriptor type capability for sec3.3

2010-04-26 Thread Kumar Gala
>> be a small and necessary improvement to existing code, it would be 
>> better to move the Freescale specific fixups into a Freescale CPU 
>> subdirectory, probably cpu/mpc8xxx/fdt.c.
> 
> to do that properly, a merge of 83xx and 8[56]xx families' both cpu and
> pci code would have to be made - something that I feel is way out of
> scope for this patch subject.

Why can't we move fdt_fixup_crypto_node & fdt_fixup_dr_usb into 
arch/powerpc/cpu/mpc8xxx/fdt.c ?

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


[U-Boot] Please pull u-boot-mpc85xx

2010-04-26 Thread Kumar Gala
The following changes since commit 6e5fb4eec3702a13770769a5a48a9423aa68ee9c:
  Wolfgang Denk (1):
Merge branch 'master' of git://git.denx.de/u-boot-mmc

are available in the git repository at:

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

Dave Liu (6):
  ppc/p4080: Extend the GUTS memory map
  fsl-ddr: add the macro for Rtt_Nom definition
  fsl-ddr: Add extra cycle to turnaround times
  fsl_sata: Add the workaround for errata SATA-A001
  fsl_sata: Move the snoop bit to another place
  85xx: clean up the io_sel for PCI express of P1022

Detlev Zundel (1):
  85xx/socrates: Remove NFS support to fit image size.

Kumar Gala (5):
  ppc/85xx: Fixup PCI nodes for P1_P2_RDB
  ppc/p4080: Add p4080 DEVDISR2 & SRDS_PLLCR0 defines
  85xx: Convert cpu_init_f code to use out_be32 for LBC registers
  85xx: Fix compile warning
  ppc: Split MPC83xx SERDES code from MPC85xx/MPC86xx/QorIQ

Lan Chunhe (1):
  mpc85xx: Add the ability to set LCRR[CLKDIV] to improve R/W speed of flash

Srikanth Srinivasan (1):
  ppc/p4080: Fix synchronous frequency calculations

 arch/powerpc/cpu/mpc83xx/serdes.c |2 +-
 arch/powerpc/cpu/mpc85xx/cpu.c|   16 +++
 arch/powerpc/cpu/mpc85xx/cpu_init.c   |   51 +++
 arch/powerpc/cpu/mpc85xx/speed.c  |   28 -
 arch/powerpc/cpu/mpc8xxx/ddr/ctrl_regs.c  |2 +
 arch/powerpc/cpu/mpc8xxx/pci_cfg.c|   13 +++---
 arch/powerpc/include/asm/fsl_ddr_sdram.h  |8 +++-
 arch/powerpc/include/asm/fsl_lbc.h|6 ++-
 arch/powerpc/include/asm/fsl_mpc83xx_serdes.h |   36 +
 arch/powerpc/include/asm/immap_85xx.h |   53 ++---
 board/freescale/mpc837xemds/mpc837xemds.c |2 +-
 board/freescale/mpc837xemds/pci.c |2 +-
 board/freescale/mpc837xerdb/mpc837xerdb.c |2 +-
 board/freescale/p1_p2_rdb/p1_p2_rdb.c |4 ++
 drivers/block/fsl_sata.c  |   22 ++
 drivers/block/fsl_sata.h  |8 +++-
 include/configs/socrates.h|8 ++--
 17 files changed, 201 insertions(+), 62 deletions(-)
 create mode 100644 arch/powerpc/include/asm/fsl_mpc83xx_serdes.h
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/4] ppc: Split MPC83xx SERDES code from MPC85xx/MPC86xx/QorIQ

2010-04-26 Thread Kumar Gala

On Apr 21, 2010, at 10:55 AM, Kim Phillips wrote:

> On Tue, 20 Apr 2010 10:39:26 -0500
> Kumar Gala  wrote:
> 
>> The MPC83xx SERDES control is different from the other FSL PPC chips.
>> For now lets split it out so we can standardize on interfaces for
>> determining of a device on SERDES is configured.
>> 
>> Signed-off-by: Kumar Gala 
>> ---
>> arch/ppc/cpu/mpc83xx/serdes.c |2 +-
>> arch/ppc/include/asm/fsl_mpc83xx_serdes.h |   36 
>> +
>> board/freescale/mpc837xemds/mpc837xemds.c |2 +-
>> board/freescale/mpc837xemds/pci.c |2 +-
>> board/freescale/mpc837xerdb/mpc837xerdb.c |2 +-
>> 5 files changed, 40 insertions(+), 4 deletions(-)
>> create mode 100644 arch/ppc/include/asm/fsl_mpc83xx_serdes.h
> 
> Acked-by: Kim Phillips 
> 
> (to go through 85xx tree)
> 
> Kim

applied to 85xx

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


[U-Boot] [PATCH] nios2: add epcs, gpio led and mmc_spi to nios2-generic

2010-04-26 Thread Thomas Chou
Since Wolfgang requests that new driver should be used with a
board, these peripherals are added to the nios2-generic board.

It will exercise drivers in these outstanding patches,
04/17 [PATCH v4] nios2: add gpio support
04/21 [PATCH v2] misc: add gpio based status led driver
04/27 [PATCH v8] spi: add altera spi controller support
04/27 [PATCH v3] mmc: add generic mmc spi driver

Signed-off-by: Thomas Chou 
---
 board/altera/nios2-generic/custom_fpga.h   |   29 
 board/altera/nios2-generic/nios2-generic.c |   13 
 include/configs/nios2-generic.h|9 ++-
 3 files changed, 49 insertions(+), 2 deletions(-)

diff --git a/board/altera/nios2-generic/custom_fpga.h 
b/board/altera/nios2-generic/custom_fpga.h
index 761f605..4e51ea3 100644
--- a/board/altera/nios2-generic/custom_fpga.h
+++ b/board/altera/nios2-generic/custom_fpga.h
@@ -63,4 +63,33 @@
 /* sysid.control_slave is a altera_avalon_sysid */
 #define CONFIG_SYS_SYSID_BASE 0x821208b8
 
+/* epcs_controller.epcs_control_port is a altera_avalon_epcs_flash_controller 
*/
+#define CONFIG_SYS_SPI_BASE 0x82100200
+#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
+
+/* gpio_0.avalon_slave_0 is a gpio */
+#define CONFIG_SYS_GPIO_BASE 0x82120900
+
+/* mmc_spi.spi_control_port is a altera_avalon_spi */
+#define MMC_SPI_BASE 0x82120940
+#define CONFIG_SYS_ALTERA_SPI_LIST { CONFIG_SYS_SPI_BASE, MMC_SPI_BASE }
+#define CONFIG_ALTERA_SPI
+#define CONFIG_CMD_SPI
+#define CONFIG_CMD_MMC
+#define CONFIG_MMC
+#define CONFIG_GENERIC_MMC
+#define CONFIG_CMD_MMC_SPI
+#define CONFIG_MMC_SPI
+#define CONFIG_MMC_SPI_BUS 1
+#define CONFIG_MMC_SPI_CS 0
+#define CONFIG_MMC_SPI_SPEED 3000
+#define CONFIG_MMC_SPI_MODE SPI_MODE_3
+#define CONFIG_CMD_FAT
+#define CONFIG_DOS_PARTITION
+
 #endif /* _CUSTOM_FPGA_H_ */
diff --git a/board/altera/nios2-generic/nios2-generic.c 
b/board/altera/nios2-generic/nios2-generic.c
index 89848cf..f19fb1a 100644
--- a/board/altera/nios2-generic/nios2-generic.c
+++ b/board/altera/nios2-generic/nios2-generic.c
@@ -24,6 +24,7 @@
 
 #include 
 #include 
+#include 
 
 void text_base_hook(void); /* nop hook for text_base.S */
 
@@ -66,3 +67,15 @@ int board_eth_init(bd_t *bis)
return rc;
 }
 #endif
+
+#ifdef CONFIG_GENERIC_MMC
+int board_mmc_init(bd_t *bis)
+{
+   int rc = 0;
+#ifdef CONFIG_MMC_SPI
+   rc = mmc_spi_init(CONFIG_MMC_SPI_BUS, CONFIG_MMC_SPI_CS,
+ CONFIG_MMC_SPI_SPEED, CONFIG_MMC_SPI_MODE);
+#endif
+   return rc;
+}
+#endif
diff --git a/include/configs/nios2-generic.h b/include/configs/nios2-generic.h
index e83e1e3..3716275 100644
--- a/include/configs/nios2-generic.h
+++ b/include/configs/nios2-generic.h
@@ -63,6 +63,7 @@
  * STATUS LED
  */
 #define CONFIG_STATUS_LED  /* Enable status driver */
+#undef  CONFIG_GPIO_LED/* Enable GPIO LED driver */
 #define CONFIG_EPLED   /* Enable LED PIO driver */
 #define CONFIG_SYS_LEDPIO_ADDR LED_PIO_BASE
 
@@ -108,7 +109,7 @@
 #define CONFIG_ENV_SIZE0x1 /* 64k, 1 sector */
 #define CONFIG_ENV_OVERWRITE   /* Serial change Ok */
 #define CONFIG_ENV_ADDR((CONFIG_SYS_RESET_ADDR + \
- CONFIG_SYS_MONITOR_LEN) | \
+ 0x4) | \
 CONFIG_SYS_FLASH_BASE)
 
 /*
@@ -119,7 +120,11 @@
  * -The stack is placed below global data (&grows down).
  */
 #define CONFIG_MONITOR_IS_IN_RAM
-#define CONFIG_SYS_MONITOR_LEN 0x4 /* Reserve 256k */
+#if defined(CONFIG_CMD_FAT)
+# define CONFIG_SYS_MONITOR_LEN0x8 /* Reserve 512k */
+#else
+# define CONFIG_SYS_MONITOR_LEN0x4 /* Reserve 256k */
+#endif
 #define CONFIG_SYS_MONITOR_BASE(CONFIG_SYS_SDRAM_BASE + \
 CONFIG_SYS_SDRAM_SIZE - \
 CONFIG_SYS_MONITOR_LEN)
-- 
1.6.6.1

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


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

2010-04-26 Thread Thomas Chou
This patch supports mmc/sd card with spi interface. It is based on
the generic mmc framework. It works with SDHC and supports write.

The crc7 lib func is merged from linux and used to compute mmc
command checksum.

There is a subcomamnd "mmc_spi" to setup spi bus and cs at run time.

Signed-off-by: Thomas Chou 
---
v3: add mmc_spi_init() proto to mmc_spi.h.
v2: add crc7, use cmd58 to read ocr, add subcommand mmc_spi.

 common/Makefile   |1 +
 common/cmd_mmc_spi.c  |   92 ++
 drivers/mmc/Makefile  |1 +
 drivers/mmc/mmc_spi.c |  316 +
 include/linux/crc7.h  |   14 ++
 include/mmc_spi.h |   26 
 lib/Makefile  |1 +
 lib/crc7.c|   62 ++
 8 files changed, 513 insertions(+), 0 deletions(-)
 create mode 100644 common/cmd_mmc_spi.c
 create mode 100644 drivers/mmc/mmc_spi.c
 create mode 100644 include/linux/crc7.h
 create mode 100644 include/mmc_spi.h
 create mode 100644 lib/crc7.c

diff --git a/common/Makefile b/common/Makefile
index dbf7a05..ee23e2f 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -118,6 +118,7 @@ COBJS-$(CONFIG_CMD_MII) += miiphyutil.o
 COBJS-$(CONFIG_CMD_MII) += cmd_mii.o
 COBJS-$(CONFIG_CMD_MISC) += cmd_misc.o
 COBJS-$(CONFIG_CMD_MMC) += cmd_mmc.o
+COBJS-$(CONFIG_CMD_MMC_SPI) += cmd_mmc_spi.o
 COBJS-$(CONFIG_MP) += cmd_mp.o
 COBJS-$(CONFIG_CMD_MTDPARTS) += cmd_mtdparts.o
 COBJS-$(CONFIG_CMD_NAND) += cmd_nand.o
diff --git a/common/cmd_mmc_spi.c b/common/cmd_mmc_spi.c
new file mode 100644
index 000..578d7a7
--- /dev/null
+++ b/common/cmd_mmc_spi.c
@@ -0,0 +1,92 @@
+/*
+ * Command for mmc_spi setup.
+ *
+ * Copyright (C) 2010 Thomas Chou 
+ * Licensed under the GPL-2 or later.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+static int do_mmc_spi(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+{
+   int dev_num;
+   uint bus;
+   uint cs;
+   uint speed;
+   uint mode;
+   char *endp;
+   struct mmc *mmc = NULL;
+   struct mmc_spi_priv *priv;
+
+   if (argc < 2)
+   goto usage;
+
+   dev_num = simple_strtoul(argv[1], &endp, 0);
+   if (*endp != 0)
+   goto usage;
+   mmc = find_mmc_device(dev_num);
+   if (!mmc || strcmp(mmc->name, "MMC_SPI"))
+   goto usage;
+   priv = mmc->priv;
+   bus = priv->bus;
+   cs = priv->cs;
+   speed = priv->speed;
+   mode = priv->mode;
+
+   if (argc < 3)
+   goto info;
+
+   cs = simple_strtoul(argv[2], &endp, 0);
+   if (*argv[2] == 0 || (*endp != 0 && *endp != ':'))
+   goto usage;
+   if (*endp == ':') {
+   if (endp[1] == 0)
+   goto usage;
+   bus = cs;
+   cs = simple_strtoul(endp + 1, &endp, 0);
+   if (*endp != 0)
+   goto usage;
+   }
+
+   if (argc >= 4) {
+   speed = simple_strtoul(argv[3], &endp, 0);
+   if (*argv[3] == 0 || *endp != 0)
+   goto usage;
+   }
+   if (argc >= 5) {
+   mode = simple_strtoul(argv[4], &endp, 16);
+   if (*argv[4] == 0 || *endp != 0)
+   goto usage;
+   }
+
+   if (bus != priv->bus || cs != priv->cs ||
+   speed != priv->speed || mode != priv->speed) {
+   priv->bus = bus;
+   priv->cs = cs;
+   priv->speed = speed;
+   priv->mode = mode;
+   if (priv->slave) {
+   free(priv->slave);
+   priv->slave = NULL;
+   }
+   }
+info:
+   printf("%s:%d at %u:%u %u %u\n", mmc->name, dev_num,
+  bus, cs, speed, mode);
+   return 0;
+
+usage:
+   cmd_usage(cmdtp);
+   return 1;
+}
+
+U_BOOT_CMD(
+   mmc_spi,5,  0,  do_mmc_spi,
+   "mmc_spi setup",
+   "dev_num [bus:][cs] [hz] [mode] - setup mmc_spi device on given\n"
+   "  SPI bus and chip select\n"
+);
diff --git a/drivers/mmc/Makefile b/drivers/mmc/Makefile
index 6fa04b8..02ed329 100644
--- a/drivers/mmc/Makefile
+++ b/drivers/mmc/Makefile
@@ -28,6 +28,7 @@ LIB   := $(obj)libmmc.a
 COBJS-$(CONFIG_GENERIC_MMC) += mmc.o
 COBJS-$(CONFIG_ATMEL_MCI) += atmel_mci.o
 COBJS-$(CONFIG_BFIN_SDH) += bfin_sdh.o
+COBJS-$(CONFIG_MMC_SPI) += mmc_spi.o
 COBJS-$(CONFIG_OMAP3_MMC) += omap3_mmc.o
 COBJS-$(CONFIG_FSL_ESDHC) += fsl_esdhc.o
 COBJS-$(CONFIG_MXC_MMC) += mxcmmc.o
diff --git a/drivers/mmc/mmc_spi.c b/drivers/mmc/mmc_spi.c
new file mode 100644
index 000..3ff171f
--- /dev/null
+++ b/drivers/mmc/mmc_spi.c
@@ -0,0 +1,316 @@
+/*
+ * generic mmc spi driver
+ *
+ * Copyright (C) 2010 Thomas Chou 
+ * Licensed under the GPL-2 or later.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define CTOUT 0x10
+#define RTOUT 0x1
+#define WTOUT 0

[U-Boot] [PATCH v8] spi: add altera spi controller support

2010-04-26 Thread Thomas Chou
This patch adds the driver of altera spi controller, which is also
used as epcs/spi flash controller. It also works with mmc_spi
driver.

This driver support more than one spi bus, with base list declared
#define CONFIG_SYS_ALTERA_SPI_LIST { BASE_0,BASE_1,... }

Signed-off-by: Thomas Chou 
---
v8 fix cs activate timing.
v7 add cs activate deactive to work with legacy spi_mmc driver.
v6 wrong patch, same as v5.
v5 tabify.

 drivers/spi/Makefile |1 +
 drivers/spi/altera_spi.c |  169 ++
 2 files changed, 170 insertions(+), 0 deletions(-)
 create mode 100644 drivers/spi/altera_spi.c

diff --git a/drivers/spi/Makefile b/drivers/spi/Makefile
index f112ed0..dfcbb8b 100644
--- a/drivers/spi/Makefile
+++ b/drivers/spi/Makefile
@@ -25,6 +25,7 @@ include $(TOPDIR)/config.mk
 
 LIB:= $(obj)libspi.a
 
+COBJS-$(CONFIG_ALTERA_SPI) += altera_spi.o
 COBJS-$(CONFIG_ATMEL_DATAFLASH_SPI) += atmel_dataflash_spi.o
 COBJS-$(CONFIG_ATMEL_SPI) += atmel_spi.o
 COBJS-$(CONFIG_BFIN_SPI) += bfin_spi.o
diff --git a/drivers/spi/altera_spi.c b/drivers/spi/altera_spi.c
new file mode 100644
index 000..e60f3f5
--- /dev/null
+++ b/drivers/spi/altera_spi.c
@@ -0,0 +1,169 @@
+/*
+ * Altera SPI driver
+ *
+ * based on bfin_spi.c
+ * Copyright (c) 2005-2008 Analog Devices Inc.
+ * Copyright (C) 2010 Thomas Chou 
+ *
+ * Licensed under the GPL-2 or later.
+ */
+#include 
+#include 
+#include 
+#include 
+
+#define ALTERA_SPI_RXDATA  0
+#define ALTERA_SPI_TXDATA  4
+#define ALTERA_SPI_STATUS  8
+#define ALTERA_SPI_CONTROL 12
+#define ALTERA_SPI_SLAVE_SEL   20
+
+#define ALTERA_SPI_STATUS_ROE_MSK  (0x8)
+#define ALTERA_SPI_STATUS_TOE_MSK  (0x10)
+#define ALTERA_SPI_STATUS_TMT_MSK  (0x20)
+#define ALTERA_SPI_STATUS_TRDY_MSK (0x40)
+#define ALTERA_SPI_STATUS_RRDY_MSK (0x80)
+#define ALTERA_SPI_STATUS_E_MSK(0x100)
+
+#define ALTERA_SPI_CONTROL_IROE_MSK(0x8)
+#define ALTERA_SPI_CONTROL_ITOE_MSK(0x10)
+#define ALTERA_SPI_CONTROL_ITRDY_MSK   (0x40)
+#define ALTERA_SPI_CONTROL_IRRDY_MSK   (0x80)
+#define ALTERA_SPI_CONTROL_IE_MSK  (0x100)
+#define ALTERA_SPI_CONTROL_SSO_MSK (0x400)
+
+#ifndef CONFIG_SYS_ALTERA_SPI_LIST
+#define CONFIG_SYS_ALTERA_SPI_LIST { CONFIG_SYS_SPI_BASE }
+#endif
+
+static ulong altera_spi_base_list[] = CONFIG_SYS_ALTERA_SPI_LIST;
+
+struct altera_spi_slave {
+   struct spi_slave slave;
+   ulong base;
+};
+#define to_altera_spi_slave(s) container_of(s, struct altera_spi_slave, slave)
+
+__attribute__((weak))
+int spi_cs_is_valid(unsigned int bus, unsigned int cs)
+{
+   return cs < 32;
+}
+
+__attribute__((weak))
+void spi_cs_activate(struct spi_slave *slave)
+{
+   struct altera_spi_slave *altspi = to_altera_spi_slave(slave);
+   writel(1 << slave->cs, altspi->base + ALTERA_SPI_SLAVE_SEL);
+   writel(ALTERA_SPI_CONTROL_SSO_MSK, altspi->base + ALTERA_SPI_CONTROL);
+}
+
+__attribute__((weak))
+void spi_cs_deactivate(struct spi_slave *slave)
+{
+   struct altera_spi_slave *altspi = to_altera_spi_slave(slave);
+   writel(0, altspi->base + ALTERA_SPI_CONTROL);
+   writel(0, altspi->base + ALTERA_SPI_SLAVE_SEL);
+}
+
+void spi_init(void)
+{
+}
+
+struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
+ unsigned int max_hz, unsigned int mode)
+{
+   struct altera_spi_slave *altspi;
+
+   if (!spi_cs_is_valid(bus, cs))
+   return NULL;
+
+   if (bus >= ARRAY_SIZE(altera_spi_base_list))
+   return NULL;
+
+   altspi = malloc(sizeof(*altspi));
+   if (!altspi)
+   return NULL;
+
+   altspi->slave.bus = bus;
+   altspi->slave.cs = cs;
+   altspi->base = altera_spi_base_list[bus];
+   debug("%s: bus:%i cs:%i base:%lx\n", __func__,
+   bus, cs, altspi->base);
+
+   return &altspi->slave;
+}
+
+void spi_free_slave(struct spi_slave *slave)
+{
+   struct altera_spi_slave *altspi = to_altera_spi_slave(slave);
+   free(altspi);
+}
+
+int spi_claim_bus(struct spi_slave *slave)
+{
+   struct altera_spi_slave *altspi = to_altera_spi_slave(slave);
+
+   debug("%s: bus:%i cs:%i\n", __func__, slave->bus, slave->cs);
+   writel(0, altspi->base + ALTERA_SPI_CONTROL);
+   writel(0, altspi->base + ALTERA_SPI_SLAVE_SEL);
+   return 0;
+}
+
+void spi_release_bus(struct spi_slave *slave)
+{
+   struct altera_spi_slave *altspi = to_altera_spi_slave(slave);
+
+   debug("%s: bus:%i cs:%i\n", __func__, slave->bus, slave->cs);
+   writel(0, altspi->base + ALTERA_SPI_SLAVE_SEL);
+}
+
+#ifndef CONFIG_ALTERA_SPI_IDLE_VAL
+# define CONFIG_ALTERA_SPI_IDLE_VAL 0xff
+#endif
+
+int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *dout,
+void *din, unsigned long flags)
+{
+   struct altera_spi_slave *altspi = to_altera_spi_slave(slave);
+   /* assume spi core configured to do 8 bit transfers */
+   uint bytes 

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

2010-04-26 Thread Thomas Chou
This patch supports mmc/sd card with spi interface. It is based on
the generic mmc framework. It works with SDHC and supports write.

The crc7 lib func is merged from linux and used to compute mmc
command checksum.

There is a subcomamnd "mmc_spi" to setup spi bus and cs at run time.

Signed-off-by: Thomas Chou 
---
v2 add crc7, use cmd58 to read ocr, add subcommand mmc_spi.

 common/Makefile   |1 +
 common/cmd_mmc_spi.c  |   92 ++
 drivers/mmc/Makefile  |1 +
 drivers/mmc/mmc_spi.c |  316 +
 include/linux/crc7.h  |   14 ++
 include/mmc_spi.h |   19 +++
 lib/Makefile  |1 +
 lib/crc7.c|   62 ++
 8 files changed, 506 insertions(+), 0 deletions(-)
 create mode 100644 common/cmd_mmc_spi.c
 create mode 100644 drivers/mmc/mmc_spi.c
 create mode 100644 include/linux/crc7.h
 create mode 100644 include/mmc_spi.h
 create mode 100644 lib/crc7.c

diff --git a/common/Makefile b/common/Makefile
index dbf7a05..ee23e2f 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -118,6 +118,7 @@ COBJS-$(CONFIG_CMD_MII) += miiphyutil.o
 COBJS-$(CONFIG_CMD_MII) += cmd_mii.o
 COBJS-$(CONFIG_CMD_MISC) += cmd_misc.o
 COBJS-$(CONFIG_CMD_MMC) += cmd_mmc.o
+COBJS-$(CONFIG_CMD_MMC_SPI) += cmd_mmc_spi.o
 COBJS-$(CONFIG_MP) += cmd_mp.o
 COBJS-$(CONFIG_CMD_MTDPARTS) += cmd_mtdparts.o
 COBJS-$(CONFIG_CMD_NAND) += cmd_nand.o
diff --git a/common/cmd_mmc_spi.c b/common/cmd_mmc_spi.c
new file mode 100644
index 000..578d7a7
--- /dev/null
+++ b/common/cmd_mmc_spi.c
@@ -0,0 +1,92 @@
+/*
+ * Command for mmc_spi setup.
+ *
+ * Copyright (C) 2010 Thomas Chou 
+ * Licensed under the GPL-2 or later.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+static int do_mmc_spi(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+{
+   int dev_num;
+   uint bus;
+   uint cs;
+   uint speed;
+   uint mode;
+   char *endp;
+   struct mmc *mmc = NULL;
+   struct mmc_spi_priv *priv;
+
+   if (argc < 2)
+   goto usage;
+
+   dev_num = simple_strtoul(argv[1], &endp, 0);
+   if (*endp != 0)
+   goto usage;
+   mmc = find_mmc_device(dev_num);
+   if (!mmc || strcmp(mmc->name, "MMC_SPI"))
+   goto usage;
+   priv = mmc->priv;
+   bus = priv->bus;
+   cs = priv->cs;
+   speed = priv->speed;
+   mode = priv->mode;
+
+   if (argc < 3)
+   goto info;
+
+   cs = simple_strtoul(argv[2], &endp, 0);
+   if (*argv[2] == 0 || (*endp != 0 && *endp != ':'))
+   goto usage;
+   if (*endp == ':') {
+   if (endp[1] == 0)
+   goto usage;
+   bus = cs;
+   cs = simple_strtoul(endp + 1, &endp, 0);
+   if (*endp != 0)
+   goto usage;
+   }
+
+   if (argc >= 4) {
+   speed = simple_strtoul(argv[3], &endp, 0);
+   if (*argv[3] == 0 || *endp != 0)
+   goto usage;
+   }
+   if (argc >= 5) {
+   mode = simple_strtoul(argv[4], &endp, 16);
+   if (*argv[4] == 0 || *endp != 0)
+   goto usage;
+   }
+
+   if (bus != priv->bus || cs != priv->cs ||
+   speed != priv->speed || mode != priv->speed) {
+   priv->bus = bus;
+   priv->cs = cs;
+   priv->speed = speed;
+   priv->mode = mode;
+   if (priv->slave) {
+   free(priv->slave);
+   priv->slave = NULL;
+   }
+   }
+info:
+   printf("%s:%d at %u:%u %u %u\n", mmc->name, dev_num,
+  bus, cs, speed, mode);
+   return 0;
+
+usage:
+   cmd_usage(cmdtp);
+   return 1;
+}
+
+U_BOOT_CMD(
+   mmc_spi,5,  0,  do_mmc_spi,
+   "mmc_spi setup",
+   "dev_num [bus:][cs] [hz] [mode] - setup mmc_spi device on given\n"
+   "  SPI bus and chip select\n"
+);
diff --git a/drivers/mmc/Makefile b/drivers/mmc/Makefile
index 1b8f5bd..d03eb47 100644
--- a/drivers/mmc/Makefile
+++ b/drivers/mmc/Makefile
@@ -31,6 +31,7 @@ LIB   := $(obj)libmmc.a
 COBJS-$(CONFIG_GENERIC_MMC) += mmc.o
 COBJS-$(CONFIG_ATMEL_MCI) += atmel_mci.o
 COBJS-$(CONFIG_BFIN_SDH) += bfin_sdh.o
+COBJS-$(CONFIG_MMC_SPI) += mmc_spi.o
 COBJS-$(CONFIG_OMAP3_MMC) += omap3_mmc.o
 COBJS-$(CONFIG_FSL_ESDHC) += fsl_esdhc.o
 COBJS-$(CONFIG_MXC_MMC) += mxcmmc.o
diff --git a/drivers/mmc/mmc_spi.c b/drivers/mmc/mmc_spi.c
new file mode 100644
index 000..3ff171f
--- /dev/null
+++ b/drivers/mmc/mmc_spi.c
@@ -0,0 +1,316 @@
+/*
+ * generic mmc spi driver
+ *
+ * Copyright (C) 2010 Thomas Chou 
+ * Licensed under the GPL-2 or later.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define CTOUT 0x10
+#define RTOUT 0x1
+#define WTOUT 0x1
+
+static uint mmc_spi_sendcmd(struct 

Re: [U-Boot] [PATCH v3] Program net device MAC addresses after initializing

2010-04-26 Thread Prafulla Wadaskar
 

> -Original Message-
> From: Ben Warren [mailto:biggerbadder...@gmail.com] 
> Sent: Monday, April 26, 2010 10:09 PM
> To: Prafulla Wadaskar
> Cc: u-boot@lists.denx.de
> Subject: Re: [U-Boot] [PATCH v3] Program net device MAC 
> addresses after initializing
> 
> Hi Prafulla,
> 
> On 4/26/2010 3:09 AM, Prafulla Wadaskar wrote:
> >
> >
> >
> >> -Original Message-
> >> From: u-boot-boun...@lists.denx.de
> >> [mailto:u-boot-boun...@lists.denx.de] On Behalf Of Ben Warren
> >> Sent: Monday, April 26, 2010 11:26 AM
> >> To: u-boot@lists.denx.de
> >> Cc: biggerbadder...@gmail.com
> >> Subject: [U-Boot] [PATCH v3] Program net device MAC addresses
> >> after initializing
> >>
> >> Add a new function to the eth_device struct for 
> programming a network
> >> controller's hardware address.
> >>
> >> After all network devices have been initialized and the
> >> proper MAC address for
> >> each has been determined, make a device driver call to
> >> program the address
> >> into the device.  Only device instances with valid unicast
> >> addresses will be
> >> programmed.
> >>
> >> Signed-off-by: Ben Warren
> >> Acked-by: Heiko Schocher
> >> Acked-by: Prafulla Wadaskar
> >> Acked-by: Detlev Zundel
> >> ---
> >> v2->v3 Made the sprintf in new function actually work :(
> >> v1->v2 Add documentation&  environment variable for
> >> overriding new behavior
> >> ACKs mentioned above are for v1
> >>
> >>   README |5 +
> >>   doc/README.drivers.eth |7 ++-
> >>   doc/README.enetaddr|   10 ++
> >>   include/net.h  |1 +
> >>   net/eth.c  |   13 +
> >>   5 files changed, 31 insertions(+), 5 deletions(-)
> >>
> >>  
> > ..snip..
> >
> >> diff --git a/net/eth.c b/net/eth.c
> >> index aff6987..1653ea9 100644
> >> --- a/net/eth.c
> >> +++ b/net/eth.c
> >> @@ -60,6 +60,14 @@ int eth_getenv_enetaddr_by_index(int
> >> index, uchar *enetaddr)
> >>return eth_getenv_enetaddr(enetvar, enetaddr);
> >>   }
> >>
> >> +static int eth_mac_skip(int index)
> >> +{
> >> +  char enetvar[15];
> >> +  char *skip_state;
> >> +  sprintf(enetvar, "eth%dmacskip", index);
> >> +  return ((skip_state = getenv(enetvar)) != NULL);
> >> +}
> >> +
> >>  
> > Hi Ben
> > Pls remove the white space in the above line,
> > I have tested the patch on guruplug platform and found 
> functional properly
> >
> >
> Will do.  I'll change your line to "Tested-by" if you don't mind.

Yes, you can..

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


Re: [U-Boot] [PATCH] fdt_support: add entry for sec3.1 and remove tls_ssl_stream descriptor type capability for sec3.3

2010-04-26 Thread Kim Phillips
On Sun, 25 Apr 2010 19:55:27 -0400
Jerry Van Baren  wrote:

> Hi Kim, Haiying,

Hi Jerry,

> Kim Phillips wrote:
> > Add sec3.1 h/w geometry for fdt node fixups.
> > 
> > Also, technically, whilst SEC v3.3 h/w honours the tls_ssl_stream descriptor
> > type, it lacks the ARC4 algorithm execution unit required to be able
> > to execute anything meaningful with it.  Change the node to agree with
> > the documentation that declares that the sec3.3 really doesn't have such
> > a descriptor type.
> > 
> > Reported-by: Haiying Wang 
> > Signed-off-by: Kim Phillips 
> > ---
> >  common/fdt_support.c |3 ++-
> >  1 files changed, 2 insertions(+), 1 deletions(-)

> Hmmm, we have two pieces of Freescale processor-specific fixups in 
> fdt_support.c:
> 
> #ifdef CONFIG_HAS_FSL_DR_USB

> #endif /* defined(CONFIG_MPC83xx) || defined(CONFIG_MPC85xx) */
> 
> While I'm OK with the change and am willing to ack since it appears to 

thanks.

> be a small and necessary improvement to existing code, it would be 
> better to move the Freescale specific fixups into a Freescale CPU 
> subdirectory, probably cpu/mpc8xxx/fdt.c.

to do that properly, a merge of 83xx and 8[56]xx families' both cpu and
pci code would have to be made - something that I feel is way out of
scope for this patch subject.

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


Re: [U-Boot] Ethernet over USB using PXA320

2010-04-26 Thread Thad Phetteplace
Alan,

Yes, I did actually run across that link already.  Unfortunately, it talks
about
the device being supported by linux, but I find nothing specific regarding
u-boot
support.  My hope was to find a specific driver in u-boot that already
supports a USB Ethernet dongle or even IP over USB/USB, but from digging
through the source code I am not finding a good candidate to use as a
reference for my own driver.  Thanks for the suggestion though.

Thad


On Mon, Apr 26, 2010 at 1:47 PM, Alan Carvalho de Assis
wrote:

> Hi Thad,
>
> On 4/26/10, Thad Phetteplace  wrote:
> > I'm working on a board based on the PXA320 Zylonite reference board and
> > attempting to get Ethernet via USB support working in u-boot.  From what
> I
> > can tell so far, this is not yet well supported in the u-boot mainline.
> > I've been looking at the u-boot-usb branch but its been slow going.  Can
> > anyone point me at a particular driver or board that would make a good
> > starting point?  What success has there been in using USB attached
> Ethernet
> > dongles with u-boot?
> >
> > I apologize if this is well documented somewhere.  I've been searching
> the
> > archives and digging through source code, but I could use a nudge in the
> > right direction to speed things along.
> >
>
> Did you see that:
> http://free-electrons.com/blog/usbeth/
>
> I hope it help you.
>
> Best Regards,
>
> Alan
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Facing problems in Porting U-boot to MIPS32 (Au1350)

2010-04-26 Thread Andrew Dyer
On Mon, Apr 26, 2010 at 2:07 PM, Gurumurthy G M
 wrote:
>
>
> Hi Andrew,
>          Thank You very much for the reply.
>
> i have done a couple of porting for MPC82xx,MPC74xx i.e. only worked on Free 
> Scale processors. this is my first port on MIPS. i feel its not so simple as 
> MPC and ARM.
>
> In MIPS where i need to configure the Debug port initialization in board 
> config file.
>
> my debug port is UART 2 i.e. console port. but no where it is defined. only i 
> saw in au1x00.h file UART_DEBUG_BASE = UART2. but how it is configured to get 
> console messages.
>
> please let me know about this if am wrong let me know.

Please post to the list.  I've cc'd it

look in cpu/mips/au1x00_serial.c - in there everything is hardcoded to
uart 0.  I've attached a version from our local CVS that allows
selecting the uart, but I don't have it cleanly done as a nice patch.
Feel free to bang it into shape and submit it, but I can't support
that code.


au1x00_serial.c
Description: Binary data
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Ethernet over USB using PXA320

2010-04-26 Thread Alan Carvalho de Assis
Hi Thad,

On 4/26/10, Thad Phetteplace  wrote:
> I'm working on a board based on the PXA320 Zylonite reference board and
> attempting to get Ethernet via USB support working in u-boot.  From what I
> can tell so far, this is not yet well supported in the u-boot mainline.
> I've been looking at the u-boot-usb branch but its been slow going.  Can
> anyone point me at a particular driver or board that would make a good
> starting point?  What success has there been in using USB attached Ethernet
> dongles with u-boot?
>
> I apologize if this is well documented somewhere.  I've been searching the
> archives and digging through source code, but I could use a nudge in the
> right direction to speed things along.
>

Did you see that:
http://free-electrons.com/blog/usbeth/

I hope it help you.

Best Regards,

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


[U-Boot] [PATCH v4] Program net device MAC addresses after initializing

2010-04-26 Thread Ben Warren
Add a new function to the eth_device struct for programming a network
controller's hardware address.

After all network devices have been initialized and the proper MAC address
for each has been determined, make a device driver call to program the
address into the device.  Only device instances with valid unicast addresses
will be programmed.

Signed-off-by: Ben Warren 
Acked-by: Heiko Schocher 
Acked-by: Detlev Zundel 
Tested-by: Prafulla Wadaskar 
---
v4->v3 First controller uses 'ethmacskip' instead of 'eth0macskip'
v2->v3 Made the sprintf in new function actually work :(
v1->v2 Add documentation & environment variable for overriding new behavior
ACKs mentioned above are for v1

 README |5 +
 doc/README.drivers.eth |7 ++-
 doc/README.enetaddr|   10 ++
 include/net.h  |1 +
 net/eth.c  |   13 +
 5 files changed, 31 insertions(+), 5 deletions(-)

diff --git a/README b/README
index cdd81d4..81692c0 100644
--- a/README
+++ b/README
@@ -3303,6 +3303,11 @@ o If both the SROM and the environment contain a MAC 
address, and the
 o If neither SROM nor the environment contain a MAC address, an error
   is raised.
 
+If Ethernet drivers implement the 'write_hwaddr' function, valid MAC addresses
+will be programmed into hardware as part of the initialization process.  This
+may be skipped by setting the appropriate 'ethmacskip' environment variable.
+The naming convention is as follows:
+"ethmacskip" (=>eth0), "eth1macskip" (=>eth1) etc.
 
 Image Formats:
 ==
diff --git a/doc/README.drivers.eth b/doc/README.drivers.eth
index d0c3571..eb83038 100644
--- a/doc/README.drivers.eth
+++ b/doc/README.drivers.eth
@@ -70,6 +70,7 @@ int ape_register(bd_t *bis, int iobase)
dev->halt = ape_halt;
dev->send = ape_send;
dev->recv = ape_recv;
+   dev->write_hwaddr = ape_write_hwaddr;
 
eth_register(dev);
 
@@ -102,11 +103,12 @@ not checking its state or doing random probing.
  ---
 
 Now that we've registered with the ethernet layer, we can start getting some
-real work done.  You will need four functions:
+real work done.  You will need five functions:
int ape_init(struct eth_device *dev, bd_t *bis);
int ape_send(struct eth_device *dev, volatile void *packet, int length);
int ape_recv(struct eth_device *dev);
int ape_halt(struct eth_device *dev);
+   int ape_write_hwaddr(struct eth_device *dev);
 
 The init function checks the hardware (probing/identifying) and gets it ready
 for send/recv operations.  You often do things here such as resetting the MAC
@@ -150,6 +152,9 @@ The halt function should turn off / disable the hardware 
and place it back in
 its reset state.  It can be called at any time (before any call to the related
 init function), so make sure it can handle this sort of thing.
 
+The write_hwaddr function should program the MAC address stored in 
dev->enetaddr
+into the Ethernet controller.
+
 So the call graph at this stage would look something like:
 some net operation (ping / tftp / whatever...)
eth_init()
diff --git a/doc/README.enetaddr b/doc/README.enetaddr
index 94d800a..2d8e24f 100644
--- a/doc/README.enetaddr
+++ b/doc/README.enetaddr
@@ -33,11 +33,13 @@ Correct flow of setting up the MAC address (summarized):
 1. Read from hardware in initialize() function
 2. Read from environment in net/eth.c after initialize()
 3. Give priority to the value in the environment if a conflict
-4. Program hardware in the device's init() function.
+4. Program the address into hardware if the following conditions are met:
+   a) The relevant driver has a 'write_addr' function
+   b) The user hasn't set an 'ethmacskip' environment variable
+   c) The address is valid (unicast, not all-zeros)
 
-If somebody wants to subvert the design philosophy, this can be done
-in the board-specific board_eth_init() function by calling eth_init()
-after all the NICs have been registered.
+Previous behavior had the MAC address always being programmed into hardware
+in the device's init() function.
 
 ---
  Usage
diff --git a/include/net.h b/include/net.h
index 3f6a5d1..a180881 100644
--- a/include/net.h
+++ b/include/net.h
@@ -105,6 +105,7 @@ struct eth_device {
 #ifdef CONFIG_MCAST_TFTP
int (*mcast) (struct eth_device*, u32 ip, u8 set);
 #endif
+   int  (*write_hwaddr) (struct eth_device*);
struct eth_device *next;
void *priv;
 };
diff --git a/net/eth.c b/net/eth.c
index aff6987..45e4a26 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -60,6 +60,14 @@ int eth_getenv_enetaddr_by_index(int index, uchar *enetaddr)
return eth_getenv_enetaddr(enetvar, enetaddr);
 }
 
+static int eth_mac_skip(int index)
+{
+   char enetvar[15];
+   char *skip_state;
+   sprintf(enetvar, index ? "eth%dmacskip" : "ethmacskip", index);
+   return ((skip_state = getenv(enetvar)) != NULL);
+}
+
 #ifdef CONFIG_NET_MULTI
 
 /*
@@ -242,

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

2010-04-26 Thread Mike Frysinger
On Monday 26 April 2010 10:37:07 Thomas Chou wrote:
> I have moved spi slave setup so that we can change the cs on the fly. We
> could add a subcommand, like,
> 
> mmc_spi [bus:]cs
> 
> Where should I place this command? in a new file in common dir or inside
> the mmc_spi driver?

i would keep the current board init hook you have currently so that the boards 
which do have static settings can leverage that, and have the mmc_spi command 
simply call that.  i'd have the syntax be:
mmc_spi [bus:]cs [hz [mode]]

i'd have it be a dedicated command in common/ so that people can disable it if 
they dont want it.
-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 v2] Program net device MAC addresses after initializing

2010-04-26 Thread Ben Warren
Hi Wolfgang,

On 4/26/2010 4:52 AM, Wolfgang Denk wrote:
> Dear Ben Warren,
>
> In message<1272261030-9419-1-git-send-email-biggerbadder...@gmail.com>  you 
> wrote:
>
>> Add a new function to the eth_device struct for programming a network
>> controller's hardware address.
>>
>> After all network devices have been initialized and the proper MAC address 
>> for
>> each has been determined, make a device driver call to program the address
>> into the device.  Only device instances with valid unicast addresses will be
>> programmed.
>>  
> Thanks.
>
>
>> +If Ethernet drivers implement the 'write_hwaddr' function, valid MAC 
>> addresses
>> +will be programmed into hardware as part of the initialization process.  
>> This
>> +may be skipped by setting the appropriate 'ethmacskip' environment variable.
>> +The naming convention is as follows:
>> +"eth0macskip" (=>eth0), "eth1macskip" (=>eth1) etc.
>>  
> Would it not be more consistent to use "ethmacskip" instead of
> "eth0macskip" similar to using "ethaddr" (instead of "eth0addr") ?
>
>
I guess it depends which consistency we're going for :)  We can be 
consistent relative to an existing variable that is itself inconsistent 
for historical reasons, or we can be consistent in usage of the new 
variable.  I don't have a strong opinion either way, so will change this.
> The majority of boards still has only a single Ethernet interface
> anyway.
>
> Best regards,
>
> Wolfgang Denk
>
>
regards,
Ben
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3] Program net device MAC addresses after initializing

2010-04-26 Thread Ben Warren
Hi Prafulla,

On 4/26/2010 3:09 AM, Prafulla Wadaskar wrote:
>
>
>
>> -Original Message-
>> From: u-boot-boun...@lists.denx.de
>> [mailto:u-boot-boun...@lists.denx.de] On Behalf Of Ben Warren
>> Sent: Monday, April 26, 2010 11:26 AM
>> To: u-boot@lists.denx.de
>> Cc: biggerbadder...@gmail.com
>> Subject: [U-Boot] [PATCH v3] Program net device MAC addresses
>> after initializing
>>
>> Add a new function to the eth_device struct for programming a network
>> controller's hardware address.
>>
>> After all network devices have been initialized and the
>> proper MAC address for
>> each has been determined, make a device driver call to
>> program the address
>> into the device.  Only device instances with valid unicast
>> addresses will be
>> programmed.
>>
>> Signed-off-by: Ben Warren
>> Acked-by: Heiko Schocher
>> Acked-by: Prafulla Wadaskar
>> Acked-by: Detlev Zundel
>> ---
>> v2->v3 Made the sprintf in new function actually work :(
>> v1->v2 Add documentation&  environment variable for
>> overriding new behavior
>> ACKs mentioned above are for v1
>>
>>   README |5 +
>>   doc/README.drivers.eth |7 ++-
>>   doc/README.enetaddr|   10 ++
>>   include/net.h  |1 +
>>   net/eth.c  |   13 +
>>   5 files changed, 31 insertions(+), 5 deletions(-)
>>
>>  
> ..snip..
>
>> diff --git a/net/eth.c b/net/eth.c
>> index aff6987..1653ea9 100644
>> --- a/net/eth.c
>> +++ b/net/eth.c
>> @@ -60,6 +60,14 @@ int eth_getenv_enetaddr_by_index(int
>> index, uchar *enetaddr)
>>  return eth_getenv_enetaddr(enetvar, enetaddr);
>>   }
>>
>> +static int eth_mac_skip(int index)
>> +{
>> +char enetvar[15];
>> +char *skip_state;
>> +sprintf(enetvar, "eth%dmacskip", index);
>> +return ((skip_state = getenv(enetvar)) != NULL);
>> +}
>> +
>>  
> Hi Ben
> Pls remove the white space in the above line,
> I have tested the patch on guruplug platform and found functional properly
>
>
Will do.  I'll change your line to "Tested-by" if you don't mind.
> Regards..
> Prafulla . .
>
Thanks a lot,
Ben
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Query: NAND Flash support

2010-04-26 Thread Paulraj, Sandeep


> 
> Hi all,
> 
> We have NAND Flash in our Custom board. My Question is - will it work
> straight away, or I have add support.
> 
> If I need to add support. Could some one suggestion which part of the
> code should I touch.
> 
> 
> We are using TI DM355 processor.
DM355 support is present in U-Boot.
If you have not made any changes to the EMIF NAND on your board compared to the 
DM355 EVM, the NAND driver present in U-Boot will work.

If you have made changes then you might have to modify the DaVinci NAND driver, 
especially the ALE/CLE if they are different from the DM355 EVM.


> 
> Thanks
> Thalib

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


Re: [U-Boot] Query: NAND Flash support

2010-04-26 Thread Thomas Chou
On 04/26/2010 06:17 PM, Mohamed Thalib H wrote:
> Hi all,
>
> We have NAND Flash in our Custom board. My Question is - will it work
> straight away, or I have add support.
>
> If I need to add support. Could some one suggestion which part of the
> code should I touch.
>
>
> We are using TI DM355 processor.
>
>
Hi Thalib,

You might check the nand platform driver, at 
drivers/mtd/nand/nand_plat.c. You should be able to add some simple 
macro to access the nand flash chip.

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


[U-Boot] XScale PXA320 and USB Ethernet?

2010-04-26 Thread Thad Phetteplace
I'm reposting this question because I think the
formatting was screwed up on my last attempt.  I
apologize if I cluttered up the list with my previous
attempt.  Thanks in advance for any hints pointing
me in the right direction.

I'm working on a board based on the PXA320 Zylonite
reference board and attempting to get Ethernet via USB
support working in u-boot.  From what I can tell so far,
this is not yet well supported in the u-boot mainline.
I've been looking at the u-boot-usb branch but its been
slow going.  Can anyone point me at a particular driver
or board that would make a good starting point when
pulling this support into my own BSP?  What success
has there been in using USB attached Ethernet dongles
with u-boot?

I apologize if this is well documented somewhere.  I've
been searching the archives and digging through source
code, but I could use a nudge in the right direction to
speed things along.

Thanks,

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


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

2010-04-26 Thread Thomas Chou
On 04/25/2010 02:56 PM, Mike Frysinger wrote:
> On Friday 23 April 2010 01:55:11 Thomas Chou wrote:
>
>> On 04/23/2010 12:04 PM, Thomas Chou wrote:
>>  
 it's too bad the new framework doesnt allow for dynamic probing like
 the spi layer.  makes it a pain to work with a SPI/MMC card that can have
 the CS changed on the fly.
  
>> Second thought.
>> With generic mmc framework, we can instance multiple mmc devices. Then
>> we can probe one of them when we want.
>>  
> i dont think that's a scalable solution.  what if you have multiple spi busses
> or 10's of GPIO CS's ?  only way to scale is to have a new subcommand so
> people can do it themselves.  a simple CONFIG_CMD_MMC_SPI command which
> forwards along calls to mmc_spi_init() on the fly would work.
> -mike
>
Hi Mike,

I have resolved the SDHC issue and have tested various MMC/SD cards, 
including writing. I will submit the patch tomorrow.

I have moved spi slave setup so that we can change the cs on the fly. We 
could add a subcommand, like,

mmc_spi [bus:]cs

Where should I place this command? in a new file in common dir or inside 
the mmc_spi driver?

Cheers,
Thomas


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


[U-Boot] [PATCH] powerpc: Consolidate bootcount_{store|load} for PowerPC

2010-04-26 Thread Stefan Roese
This patch consolidates bootcount_{store|load} for PowerPC by
implementing a common version in arch/powerpc/lib/bootcount.c. This
code is now used by all PowerPC variants that currently have these
functions implemented.

The functions now use the proper IO-accessor functions to read/write the
values.

This code also supports two different bootcount versions:

a) Use 2 seperate words (2 * 32bit) to store the bootcounter
b) Use only 1 word (2* 16bit) to store the bootcounter

Version b) was already used by MPC5xxx.

Signed-off-by: Stefan Roese 
Cc: Michael Zaidman 
Cc: Wolfgang Denk 
Cc: Kim Phillips 
Cc: Anatolij Gustschin 
---
 arch/powerpc/cpu/mpc5xxx/cpu.c  |   20 
 arch/powerpc/cpu/mpc8260/commproc.c |   24 -
 arch/powerpc/cpu/mpc83xx/cpu.c  |   30 
 arch/powerpc/cpu/mpc8xx/commproc.c  |   26 --
 arch/powerpc/cpu/ppc4xx/commproc.c  |   24 -
 arch/powerpc/lib/Makefile   |1 +
 arch/powerpc/lib/bootcount.c|   90 +++
 7 files changed, 91 insertions(+), 124 deletions(-)
 create mode 100644 arch/powerpc/lib/bootcount.c

diff --git a/arch/powerpc/cpu/mpc5xxx/cpu.c b/arch/powerpc/cpu/mpc5xxx/cpu.c
index b20234d..44b8a7a 100644
--- a/arch/powerpc/cpu/mpc5xxx/cpu.c
+++ b/arch/powerpc/cpu/mpc5xxx/cpu.c
@@ -154,26 +154,6 @@ void ft_cpu_setup(void *blob, bd_t *bd)
 }
 #endif
 
-#ifdef CONFIG_BOOTCOUNT_LIMIT
-
-void bootcount_store (ulong a)
-{
-   volatile ulong *save_addr = (volatile ulong *) (MPC5XXX_CDM_BRDCRMB);
-
-   *save_addr = (BOOTCOUNT_MAGIC & 0x) | a;
-}
-
-ulong bootcount_load (void)
-{
-   volatile ulong *save_addr = (volatile ulong *) (MPC5XXX_CDM_BRDCRMB);
-
-   if ((*save_addr & 0x) != (BOOTCOUNT_MAGIC & 0x))
-   return 0;
-   else
-   return (*save_addr & 0x);
-}
-#endif /* CONFIG_BOOTCOUNT_LIMIT */
-
 #ifdef CONFIG_MPC5xxx_FEC
 /* Default initializations for FEC controllers.  To override,
  * create a board-specific function called:
diff --git a/arch/powerpc/cpu/mpc8260/commproc.c 
b/arch/powerpc/cpu/mpc8260/commproc.c
index 111a67c..c522bc5 100644
--- a/arch/powerpc/cpu/mpc8260/commproc.c
+++ b/arch/powerpc/cpu/mpc8260/commproc.c
@@ -195,27 +195,3 @@ ulong post_word_load (void)
 }
 
 #endif /* CONFIG_POST || CONFIG_LOGBUFFER*/
-
-#ifdef CONFIG_BOOTCOUNT_LIMIT
-
-void bootcount_store (ulong a)
-{
-   volatile ulong *save_addr =
-   (volatile ulong *)(CONFIG_SYS_IMMR + CPM_BOOTCOUNT_ADDR);
-
-   save_addr[0] = a;
-   save_addr[1] = BOOTCOUNT_MAGIC;
-}
-
-ulong bootcount_load (void)
-{
-   volatile ulong *save_addr =
-   (volatile ulong *)(CONFIG_SYS_IMMR + CPM_BOOTCOUNT_ADDR);
-
-   if (save_addr[1] != BOOTCOUNT_MAGIC)
-   return 0;
-   else
-   return save_addr[0];
-}
-
-#endif /* CONFIG_BOOTCOUNT_LIMIT */
diff --git a/arch/powerpc/cpu/mpc83xx/cpu.c b/arch/powerpc/cpu/mpc83xx/cpu.c
index 51180d6..fb32f01 100644
--- a/arch/powerpc/cpu/mpc83xx/cpu.c
+++ b/arch/powerpc/cpu/mpc83xx/cpu.c
@@ -302,33 +302,3 @@ int cpu_mmc_init(bd_t *bis)
return 0;
 #endif
 }
-
-#ifdef CONFIG_BOOTCOUNT_LIMIT
-
-#if !defined(CONFIG_MPC8360)
-#error "CONFIG_BOOTCOUNT_LIMIT only for MPC8360 implemented"
-#endif
-
-#if !defined(CONFIG_BOOTCOUNT_ADDR)
-#define CONFIG_BOOTCOUNT_ADDR  (0x11 + QE_MURAM_SIZE - 2 * sizeof(unsigned 
long))
-#endif
-
-#include 
-
-void bootcount_store (ulong a)
-{
-   void *reg = (void *)(CONFIG_SYS_IMMR + CONFIG_BOOTCOUNT_ADDR);
-   out_be32 (reg, a);
-   out_be32 (reg + 4, BOOTCOUNT_MAGIC);
-}
-
-ulong bootcount_load (void)
-{
-   void *reg = (void *)(CONFIG_SYS_IMMR + CONFIG_BOOTCOUNT_ADDR);
-
-   if (in_be32 (reg + 4) != BOOTCOUNT_MAGIC)
-   return 0;
-   else
-   return in_be32 (reg);
-}
-#endif /* CONFIG_BOOTCOUNT_LIMIT */
diff --git a/arch/powerpc/cpu/mpc8xx/commproc.c 
b/arch/powerpc/cpu/mpc8xx/commproc.c
index a87a0dc..2c85377 100644
--- a/arch/powerpc/cpu/mpc8xx/commproc.c
+++ b/arch/powerpc/cpu/mpc8xx/commproc.c
@@ -103,29 +103,3 @@ ulong post_word_load (void)
 }
 
 #endif /* CONFIG_POST || CONFIG_LOGBUFFER*/
-
-#ifdef CONFIG_BOOTCOUNT_LIMIT
-
-void bootcount_store (ulong a)
-{
-   volatile ulong *save_addr =
-   (volatile ulong *)( ((immap_t *) 
CONFIG_SYS_IMMR)->im_cpm.cp_dpmem +
-   CPM_BOOTCOUNT_ADDR );
-
-   save_addr[0] = a;
-   save_addr[1] = BOOTCOUNT_MAGIC;
-}
-
-ulong bootcount_load (void)
-{
-   volatile ulong *save_addr =
-   (volatile ulong *)( ((immap_t *) 
CONFIG_SYS_IMMR)->im_cpm.cp_dpmem +
-   CPM_BOOTCOUNT_ADDR );
-
-   if (save_addr[1] != BOOTCOUNT_MAGIC)
-   return 0;
-   else
-   return save_addr[0];
-}
-
-#endif /* CONFIG_BOOTCOUNT_LIMIT */
diff --git a/arch/powerpc/cpu/ppc4xx/commproc.c 
b/arch/powerpc/cpu/ppc4xx/commproc.c
ind

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

2010-04-26 Thread Stefan Roese
Hi Matthias,

On Monday 26 April 2010 16:20:28 Matthias Fuchs wrote:
> good catch! Thanks for fixing.

Unfortunately APC405 doesn't compile anymore. Care to send a patch?

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-26 Thread Matthias Fuchs
Stefan, 

good catch! Thanks for fixing.

Matthias

Acked-by: Matthias Fuchs 

On Monday 26 April 2010 13:31, Stefan Roese wrote:
> Signed-off-by: Stefan Roese 
> Cc: Matthias Fuchs 
> ---
>  MAKEALL |1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/MAKEALL b/MAKEALL
> index 4632750..391b1e4 100755
> --- a/MAKEALL
> +++ b/MAKEALL
> @@ -185,6 +185,7 @@ LIST_4xx="\
>   ADCIOP  \
>   alpr\
>   AP1000  \
> + APC405  \
>   AR405   \
>   arches  \
>   ASH405  \
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v5] net: add altera triple speeds ethernet mac driver

2010-04-26 Thread Thomas Chou
On 04/26/2010 02:13 PM, Ben Warren wrote:
> Thomas,
>
> On 4/19/2010 9:49 PM, Thomas Chou wrote:
>> This driver supports the Altera triple speeds 10/100/1000 ethernet
>> mac.
>>
> applied to net repo.
>
> If you'd like this driver to automatically program MAC addresses after 
> initialization (see a patch that I submitted tonight), please submit a 
> follow-on to this one and I'll accept for the current release.
> regards,
> Ben
>
>
Hi Ben,

Thanks a lot. I will prepare the write mac address patches for both drivers.

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


Re: [U-Boot] [PATCH 1/2] The bootcount_{store|load} moved to arch specific generic locations.

2010-04-26 Thread Stefan Roese
Hi Michael,

On Friday 23 April 2010 21:07:12 Michael Zaidman wrote:
> Signed-off-by: Michael Zaidman 
> Suggested-by: Wolfgang Denk 

Thanks. Even though this patch is an improvement to the current state, we 
still duplicate some code in the multiple implementations. And the code still 
doesn't use IO-accessors to load/store the values. I'm currently working on a 
patch do clean this up a bit more. I think I have it ready this 
afternoon/evening and will send it then for review. Stay tuned...

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] ARM1176: Coexist with other ARM1176 platforms

2010-04-26 Thread Tom Rix
Cyril Chemparathy wrote:
> The current ARM1176 CPU specific code is too specific to the SMDK6400
> architecture.  The following changes were necessary prerequisites for the
> addition of other SoCs based on ARM1176.
> 
> Existing board's (SMDK6400) configuration has been modified to keep behavior
> unchanged despite these changes.
> 
> 1. Peripheral port remap configurability
> The earlier code had hardcoded remap values specific to s3c64xx in start.S.
> This change makes the peripheral port remap addresses and sizes configurable.
> 
> 2. Skip low level initialization
> Ability to skip low level initialization if necessary.  Many other platforms
> have a similar capability, and this is quite useful during debug/bring-up.
> 
> 3. U-Boot code relocation support
> Most architectures allow u-boot code to run initially at a different
> address (possibly in NOR) and then get relocated to its final resting place
> in RAM.  Added support for this capability in ARM1176 architecture.
> 
> 4. Disable TCM if necessary
> If a ROM based bootloader happened to have initialized TCM, we disable it here
> to keep things sane.
> 
> 5. Remove unnecessary SoC specific includes
> ARM1176 code does not really need this SoC specific include.  The presence
> of this include prevents builds on other ARM1176 archs.
> 
> 6. ARM926 style MMU disable when !CONFIG_ENABLE_MMU
> The original MMU disable code masks out too many bits from the load address
> when it tries to figure out the physical address of the jump target label.
> Consequently, it ends up branching to the wrong address after disabling the
> MMU.
> 
> Signed-off-by: Cyril Chemparathy 
> ---
>  cpu/arm1176/cpu.c  |1 -
>  cpu/arm1176/start.S|   60 
> ++--
>  include/configs/smdk6400.h |6 
>  3 files changed, 58 insertions(+), 9 deletions(-)
> 
> diff --git a/cpu/arm1176/cpu.c b/cpu/arm1176/cpu.c
> index 2c0014f..c0fd114 100644
> --- a/cpu/arm1176/cpu.c
> +++ b/cpu/arm1176/cpu.c
> @@ -33,7 +33,6 @@
>  
>  #include 
>  #include 
> -#include 
>  #include 
>  
>  static void cache_flush (void);
> diff --git a/cpu/arm1176/start.S b/cpu/arm1176/start.S
> index 68a356d..beec574 100644
> --- a/cpu/arm1176/start.S
> +++ b/cpu/arm1176/start.S
> @@ -1,5 +1,5 @@
>  /*
> - *  armboot - Startup Code for S3C6400/ARM1176 CPU-core
> + *  armboot - Startup Code for ARM1176 CPU-core
>   *
>   * Copyright (c) 2007Samsung Electronics
>   *
> @@ -35,7 +35,6 @@
>  #ifdef CONFIG_ENABLE_MMU
>  #include 
>  #endif
> -#include 
>  
>  #if !defined(CONFIG_ENABLE_MMU) && !defined(CONFIG_SYS_PHY_UBOOT_BASE)
>  #define CONFIG_SYS_PHY_UBOOT_BASECONFIG_SYS_UBOOT_BASE
> @@ -145,6 +144,7 @@ reset:
>   *
>   *
>   */
> +#ifndef CONFIG_SKIP_LOWLEVEL_INIT

CONFIG_SKIP_LOWLEVEL_INIT is not used in the other patches.
Why is this needed ?
board/samsung/samsung/smdk6400 has a lowlevel_init.o function.
It is confusing why this function is being if-def and not the real
lowlevel_init..

>   /*
>* we do sys-critical inits only at reboot,
>* not when booting from ram!
> @@ -170,6 +170,8 @@ cpu_init_crit:
>   bic r0, r0, #0x0087 @ clear bits 7, 2:0 (B--- -CAM)
>   orr r0, r0, #0x0002 @ set bit 2 (A) Align
>   orr r0, r0, #0x1000 @ set bit 12 (I) I-Cache
> +
> +#ifdef CONFIG_ENABLE_MMU

This logic is may not be quite correct
 From include/configs/smdk6400.h
#if !defined(CONFIG_NAND_SPL) && (TEXT_BASE >= 0xc000)
#define CONFIG_ENABLE_MMU
#endif
Please check

>   /* Prepare to disable the MMU */
>   adr r1, mmu_disable_phys
>   /* We presume we're within the first 1024 bytes */
> @@ -187,20 +189,60 @@ mmu_disable:
>   nop
>   nop
>   mov pc, r2
> +mmu_disable_phys:
> +#else
> + mcr p15, 0, r0, c1, c0, 0

Are the noop's above needed here?

>  #endif
>  
> -mmu_disable_phys:
> +#ifdef CONFIG_DISABLE_TCM
> + /*
> +  * Disable the TCMs
> +  */
> + mrc p15, 0, r0, c0, c0, 2   /* Return TCM details */
> + cmp r0, #0
> + beq skip_tcmdisable
> + mov r1, #0
> + mov r2, #1
> + tst r0, r2
> + mcrne   p15, 0, r1, c9, c1, 1   /* Disable Instruction TCM if present*/
> + tst r0, r2, LSL #16
> + mcrne   p15, 0, r1, c9, c1, 0   /* Disable Data TCM if present*/
> +skip_tcmdisable:
> +#endif
> +#endif
> +
> +#ifdef CONFIG_PERIPORT_REMAP
>   /* Peri port setup */
> - ldr r0, =0x7000
> - orr r0, r0, #0x13
> + ldr r0, =CONFIG_PERIPORT_BASE
> + orr r0, r0, #CONFIG_PERIPORT_SIZE
>   mcr p15,0,r0,c15,c2,4   @ 256M (0x7000 - 0x7fff)

This comment '@ 256 .. ' is no longer valid.

> +#endif
>  
>   /*
>* Go setup Memory and board specific bits prior to relocation.
>*/
>   bl  lowlevel_init   /* go setup pll,mux,memory */
> +

Re: [U-Boot] [PATCH v2] Program net device MAC addresses after initializing

2010-04-26 Thread Prafulla Wadaskar
 

> -Original Message-
> From: u-boot-boun...@lists.denx.de 
> [mailto:u-boot-boun...@lists.denx.de] On Behalf Of Wolfgang Denk
> Sent: Monday, April 26, 2010 5:22 PM
> To: Ben Warren
> Cc: u-boot@lists.denx.de
> Subject: Re: [U-Boot] [PATCH v2] Program net device MAC 
> addresses after initializing
> 
> Dear Ben Warren,
...snip...
> > +If Ethernet drivers implement the 'write_hwaddr' function, 
> valid MAC addresses
> > +will be programmed into hardware as part of the 
> initialization process.  This
> > +may be skipped by setting the appropriate 'ethmacskip' 
> environment variable.
> > +The naming convention is as follows:
> > +"eth0macskip" (=>eth0), "eth1macskip" (=>eth1) etc.
> 
> Would it not be more consistent to use "ethmacskip" instead of
> "eth0macskip" similar to using "ethaddr" (instead of "eth0addr") ?
> 
> The majority of boards still has only a single Ethernet interface
> anyway.

Kirkwood has two egiga controllers and some of boards are using both, like 
OpenRD, GuruPlug.
Guruplug has two ports- eth0 and eth1, and setting eth1macskip I can only 
program eth0 mac address.

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


Re: [U-Boot] da850/L138 SPI flash transfer speed

2010-04-26 Thread Nori, Sekhar
On Sat, Apr 24, 2010 at 03:59:22, Wolfgang Denk wrote:
> Dear Delio Brignoli,
>
> please mind the NetiQuette and restrict your line length to some 70
> charatcers or so.  Thanks.
>
> In message <4d573595-069a-4490-af2d-38ed3aad7...@audioscience.com> you wrote:
> >
> > I am working on reducing boot time on an L138 EVM and SPI flash transfer 
> > speed is currently the worst offender. U-Boot transfers from the SPI flash 
> > at 0.6Mbytes/s, this a lot slower than I would expect for a 50MHz SPI 
> > clock. Using a scope we found that
> > the chip select is active throughout the transfer (as expected), we see 
> > ~160ns bursts of activity on the clock line for each byte transferred (8 
> > bits @ 50MHz) with 1us idle periods in between. Where does the 1us delay 
> > between byte transfers come from? I
> > s reading data bytes from the SPI registers very slow or is writing to RAM 
> > one byte at a time slowing the transfer?
>
> Everything is slow as caches are not enabled.

The only delays being configured in the driver are the
chip-select hold time delays which should not matter
here as you see delays inserted between bytes which
are part of a single transfer. I am starting to doubt
peripheral mis-configuration as a possible cause here.

One way to mitigate the slow access to RAM would be to
take advantage of external RAM burst by using EDMA. That
will be some work because there is no other example of
EDMA usage in U-Boot.

Thanks,
Sekhar

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


Re: [U-Boot] [PATCH v2] Program net device MAC addresses after initializing

2010-04-26 Thread Wolfgang Denk
Dear Ben Warren,

In message <1272261030-9419-1-git-send-email-biggerbadder...@gmail.com> you 
wrote:
> Add a new function to the eth_device struct for programming a network
> controller's hardware address.
> 
> After all network devices have been initialized and the proper MAC address for
> each has been determined, make a device driver call to program the address
> into the device.  Only device instances with valid unicast addresses will be
> programmed.

Thanks.

> +If Ethernet drivers implement the 'write_hwaddr' function, valid MAC 
> addresses
> +will be programmed into hardware as part of the initialization process.  This
> +may be skipped by setting the appropriate 'ethmacskip' environment variable.
> +The naming convention is as follows:
> +"eth0macskip" (=>eth0), "eth1macskip" (=>eth1) etc.

Would it not be more consistent to use "ethmacskip" instead of
"eth0macskip" similar to using "ethaddr" (instead of "eth0addr") ?

The majority of boards still has only a single Ethernet interface
anyway.

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
F u cn rd ths u cnt spl wrth a dm!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


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

2010-04-26 Thread Stefan Roese
Signed-off-by: Stefan Roese 
Cc: Matthias Fuchs 
---
 MAKEALL |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/MAKEALL b/MAKEALL
index 4632750..391b1e4 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -185,6 +185,7 @@ LIST_4xx="  \
ADCIOP  \
alpr\
AP1000  \
+   APC405  \
AR405   \
arches  \
ASH405  \
-- 
1.7.1

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


Re: [U-Boot] da850/L138 SPI flash transfer speed

2010-04-26 Thread Alessandro Rubini
>> To you knowledge, would enabling the
>> cache for davinci da850 break anything in U-Boot?
> 
> No, except that it should be done consistently for all ARM processors.

Which reminds me I have to post V2 of my cache patch. V1 was sent on
2010-01-26 and some flush was missing. I didn't notice as network
download worked fine.

I'll try to respin it as soon as possible.

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


Re: [U-Boot] da850/L138 SPI flash transfer speed

2010-04-26 Thread Nori, Sekhar
Hello Delio,

On Sat, Apr 24, 2010 at 05:00:49, Delio Brignoli wrote:
> Hello Wolfgang,
>
> On 24/04/2010, at 10:29 AM, Wolfgang Denk wrote:
> > please mind the NetiQuette and restrict your line length to some 70
> > charatcers or so.  Thanks.
>
> Will do, thanks.
>
> > Everything is slow as caches are not enabled.
>
> OK, so reducing the number of reads from registers and writes to RAM
> should improve performance. To you knowledge, would enabling the
> cache for davinci da850 break anything in U-Boot?

It would break EMAC driver for sure. The driver does not
flush/invalidate the buffers under the assumption that
the data cache is kept disabled.

Thanks,
Sekhar

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


[U-Boot] Query: NAND Flash support

2010-04-26 Thread Mohamed Thalib H
Hi all,

We have NAND Flash in our Custom board. My Question is - will it work 
straight away, or I have add support.

If I need to add support. Could some one suggestion which part of the 
code should I touch.


We are using TI DM355 processor.

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


Re: [U-Boot] [PATCH v3] Program net device MAC addresses after initializing

2010-04-26 Thread Prafulla Wadaskar
 

> -Original Message-
> From: u-boot-boun...@lists.denx.de 
> [mailto:u-boot-boun...@lists.denx.de] On Behalf Of Ben Warren
> Sent: Monday, April 26, 2010 11:26 AM
> To: u-boot@lists.denx.de
> Cc: biggerbadder...@gmail.com
> Subject: [U-Boot] [PATCH v3] Program net device MAC addresses 
> after initializing
> 
> Add a new function to the eth_device struct for programming a network
> controller's hardware address.
> 
> After all network devices have been initialized and the 
> proper MAC address for
> each has been determined, make a device driver call to 
> program the address
> into the device.  Only device instances with valid unicast 
> addresses will be
> programmed.
> 
> Signed-off-by: Ben Warren 
> Acked-by: Heiko Schocher 
> Acked-by: Prafulla Wadaskar 
> Acked-by: Detlev Zundel 
> ---
> v2->v3 Made the sprintf in new function actually work :(
> v1->v2 Add documentation & environment variable for 
> overriding new behavior
> ACKs mentioned above are for v1
> 
>  README |5 +
>  doc/README.drivers.eth |7 ++-
>  doc/README.enetaddr|   10 ++
>  include/net.h  |1 +
>  net/eth.c  |   13 +
>  5 files changed, 31 insertions(+), 5 deletions(-)
> 
..snip..
> diff --git a/net/eth.c b/net/eth.c
> index aff6987..1653ea9 100644
> --- a/net/eth.c
> +++ b/net/eth.c
> @@ -60,6 +60,14 @@ int eth_getenv_enetaddr_by_index(int 
> index, uchar *enetaddr)
>   return eth_getenv_enetaddr(enetvar, enetaddr);
>  }
>  
> +static int eth_mac_skip(int index)
> +{
> + char enetvar[15];
> + char *skip_state;
> + sprintf(enetvar, "eth%dmacskip", index);
> + return ((skip_state = getenv(enetvar)) != NULL);
> +}
> + 

Hi Ben
Pls remove the white space in the above line,
I have tested the patch on guruplug platform and found functional properly

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


Re: [U-Boot] [PATCH 07/17] SPEAr : Network driver support added

2010-04-26 Thread Vipin KUMAR
On 4/26/2010 1:31 PM, Armando VISCONTI wrote:
> Hi Ben,
> 
>> I agree that MDIO bus probing doesn't make much sense.  I don't know
>> anything about your SOC, but the ones that I work with typically have
>> multiple MACs (data link) but only one MDIO bus (control link).  The
>> end result is multiple PHYs on a multi-drop bus, and there's no way of
>> knowing which one has its data link connected to which MAC.
>>
>> I'd prefer to see it hard-coded, either through a CONFIG option or an
>> environment variable.
> In our SoC current architecture there are multiple sdio buses, basically
> one for each MAC.
> Neverthelees this architecture might change in the future.
> 
> Moreover, I agree that driver should be generic, so I guess that we
> might add a phy_addr field
> in the device structure and pass it thru the initialize routine, as the
> macb driver is doing.
> 
> In the meantime I saw that Vipin already provided a V2 of the driver,
> which is still in the old
> way.
> Vipin, can you possibly provide your comments?
> 

Actually speaking, I was waiting for a patch from Ben and this issue to
get resolved by then.
Seeing no reply from Ben, I sent a patch v2 to get the comments at least
on other subpatches. 
I think the suggested changes are fine and can be made in patch v3

> Thanks,
> Arm
> 
> 
> 
> 

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


Re: [U-Boot] [PATCH] da830: Move common code out of da830evm.c file

2010-04-26 Thread Nick Thompson
On 21/04/10 12:58, Sudhakar Rajashekhara wrote:
> TI's DA850/OMAP-L138 platform is similar to DA830/OMAP-L137
> in many aspects. So instead of repeating the same code in
> multiple files, move the common code to a different file
> and call those functions from the respective da830/da850
> files.
>
> Signed-off-by: Sudhakar Rajashekhara 
> ---
>  board/davinci/common/misc.c   |   30 ++
>  board/davinci/common/misc.h   |6 ++
>  board/davinci/da830evm/da830evm.c |   28 +++-
>  3 files changed, 47 insertions(+), 17 deletions(-)
>   

As this patch mainly effects da830evm:

Acked-by: Nick Thompson 

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


[U-Boot] Uboot application problem

2010-04-26 Thread robin
Hi,

I have a couple of custom application for uboot.
I am able to build and run the application individually 
If i power up the board and run the first application, It executes
without powering off the board if i load second application to same
location, the system hangs.
Both the application has been compiled for same location 0x8000.
i have tested both application seperately, both are fine.
But when i execute one after another without power off, then system
hangs.
i compiled one application for 0x8000 and another for 0x8100
then both application executes without requiring reboot.
i am using the below lds file for applications.

Can some one suggest if it is a stack issue or some other issue.
i had defined usrstack area in my application and verified it using map
file.
but after execution of application i check that area, its not at all
modified,
its 0x, i think its using uboot's stack area not the one defined
by my application.
what is causing this behavior and how to resolve it ?

Regards,
Robin


=
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
OUTPUT_ARCH(arm)
ENTRY(main)

MEMORY
{
ram  : o = 0x8000, l = 256k
usrstack : o = 0x8300, l = 64k
}

SECTIONS
{

  /* Code and Constants */
  .text :
{
. = 0x00;

  __text_start = .;
  *.o(.text)
  *.o(.strings)
  *.o(.rodata)
  *.o(.rodata.*)
  *.o(.comment)
  *.o(.debug*)
  *(.rodata.*)
  *(.rodata)
   *(.eh_frame)
   . = ALIGN(32);
  __text_end = .;
} > ram
  /* Initialized data */
  .init :
{
 . = ALIGN(32);
  __data_start = .;
   . = ALIGN(32);
  *(.data)
  *(.glue_7)
  *(.glue_7t)
  . = ALIGN(32);
  __data_end = .;
  . = ALIGN(32);
} > ram

  .bss :
{
  __bss_start = .;
  *(.bss)
  *(COMMON)
  . = ALIGN(32);
  __bss_end = .;
} > ram

  /* Application stack */
  .stack :
{
  __stack_start = .;
  *(.stack)
  __stack_end = .;
  . = ALIGN(32);
} > usrstack
}
   

--- 
DISCLAIMER: This e-mail and any attachment (s) is for authorised use by the
intended recipient (s) only. It may contain proprietary material, confidential
information and/or be subject to the legal privilege of iWave Systems
Technologies Private Limited. If you have received this message in error,
please notify the originator immediately. If you are not the intended
recipient, you are notified that you are strictly prohibited from retaining,
using, copying, alerting or disclosing the content of this message. Thank you
for your co-operation. 
--

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


Re: [U-Boot] [PATCH 07/17] SPEAr : Network driver support added

2010-04-26 Thread Armando VISCONTI
Hi Ben,

> I agree that MDIO bus probing doesn't make much sense.  I don't know 
> anything about your SOC, but the ones that I work with typically have 
> multiple MACs (data link) but only one MDIO bus (control link).  The 
> end result is multiple PHYs on a multi-drop bus, and there's no way of 
> knowing which one has its data link connected to which MAC.
>
> I'd prefer to see it hard-coded, either through a CONFIG option or an 
> environment variable.
In our SoC current architecture there are multiple sdio buses, basically 
one for each MAC.
Neverthelees this architecture might change in the future.

Moreover, I agree that driver should be generic, so I guess that we 
might add a phy_addr field
in the device structure and pass it thru the initialize routine, as the 
macb driver is doing.

In the meantime I saw that Vipin already provided a V2 of the driver, 
which is still in the old
way.
Vipin, can you possibly provide your comments?

Thanks,
Arm




-- 
-- "Every step appears to be the unavoidable consequence of the
-- preceding one." (A. Einstein) 
-- 
Armando Visconti  Mobile: (+39) 346 8879146
Senior SW EngineerFax:(+39) 02 93519290
CPG   Work:   (+39) 02 93519683
Computer System Division  e-mail: armando.visco...@st.com
ST Microelectronics   TINA:   051  4683

 

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