Re: [U-Boot-Users] [PATCH] PHY: Add support for the M88E1121R Marvell chip.

2008-06-09 Thread Wolfgang Denk
Dear Ben,

in message [EMAIL PROTECTED] you wrote:
 
 This won't apply because to the net repo, I'm guessing because I've 
 already applied another patch to driver/net/tsec.c for another Marvell 
 PHY (commit 290ef6436838b1cc013bd67e0e0495c9eb3e23c0) and it hasn't made 
 it into the main line yet. I see two options:
 
 1. Somebody who knows more about git please tell me how to merge this.
 2. Rebase the patch vs. the current net tree.

If you agree with the content of the patch, then please just ACK  it.
I  will  then  first pull the net repo, and after this merge with the
socrates branch I have here. I  will  also  resolve  the  resulting
merge conflicts, if any. OK?

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]
In the beginning, there was nothing, which exploded.
- Terry Pratchett, _Lords and Ladies_

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] [PATCH v2] Move conditional compilation of MPC8XXX SPI driver to Makefile

2008-06-09 Thread Ben Warren
Signed-off-by: Ben Warren [EMAIL PROTECTED]
---
 board/freescale/mpc8349emds/mpc8349emds.c |2 +-
 drivers/spi/Makefile  |2 +-
 drivers/spi/mpc8xxx_spi.c |2 --
 include/configs/MPC8349EMDS.h |1 -
 include/spi.h |9 +
 lib_ppc/board.c   |2 --
 6 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/board/freescale/mpc8349emds/mpc8349emds.c 
b/board/freescale/mpc8349emds/mpc8349emds.c
index e18e68e..0acc17e 100644
--- a/board/freescale/mpc8349emds/mpc8349emds.c
+++ b/board/freescale/mpc8349emds/mpc8349emds.c
@@ -253,7 +253,7 @@ void sdram_init(void)
 /*
  * The following are used to control the SPI chip selects for the SPI command.
  */
-#ifdef CONFIG_HARD_SPI
+#ifdef CONFIG_MPC8XXX_SPI
 
 #define SPI_CS_MASK0x8000
 
diff --git a/drivers/spi/Makefile b/drivers/spi/Makefile
index e66e0ee..4f7b679 100644
--- a/drivers/spi/Makefile
+++ b/drivers/spi/Makefile
@@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk
 
 LIB:= $(obj)libspi.a
 
-COBJS-y += mpc8xxx_spi.o
+COBJS-$(CONFIG_MPC8XXX_SPI) += mpc8xxx_spi.o
 COBJS-$(CONFIG_ATMEL_SPI) += atmel_spi.o
 COBJS-$(CONFIG_MXC_SPI) += mxc_spi.o
 
diff --git a/drivers/spi/mpc8xxx_spi.c b/drivers/spi/mpc8xxx_spi.c
index 136fb50..9eaf986 100644
--- a/drivers/spi/mpc8xxx_spi.c
+++ b/drivers/spi/mpc8xxx_spi.c
@@ -22,7 +22,6 @@
  */
 
 #include common.h
-#if defined(CONFIG_MPC8XXX_SPI)  defined(CONFIG_HARD_SPI)
 
 #include malloc.h
 #include spi.h
@@ -180,4 +179,3 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen, 
const void *dout,
 
return 0;
 }
-#endif /* CONFIG_HARD_SPI */
diff --git a/include/configs/MPC8349EMDS.h b/include/configs/MPC8349EMDS.h
index bd77540..af72538 100644
--- a/include/configs/MPC8349EMDS.h
+++ b/include/configs/MPC8349EMDS.h
@@ -355,7 +355,6 @@
 
 /* SPI */
 #define CONFIG_MPC8XXX_SPI
-#define CONFIG_HARD_SPI/* SPI with hardware support */
 #undef CONFIG_SOFT_SPI /* SPI bit-banged */
 
 /* GPIOs.  Used as SPI chip selects */
diff --git a/include/spi.h b/include/spi.h
index 7744c2e..320e50e 100644
--- a/include/spi.h
+++ b/include/spi.h
@@ -24,6 +24,15 @@
 #ifndef _SPI_H_
 #define _SPI_H_
 
+/* Controller-specific definitions: */
+
+/* CONFIG_HARD_SPI triggers SPI bus initialization in PowerPC */
+#ifdef CONFIG_MPC8XXX_SPI
+# ifndef CONFIG_HARD_SPI
+#  define CONFIG_HARD_SPI
+# endif
+#endif
+
 /* SPI mode flags */
 #defineSPI_CPHA0x01/* clock phase */
 #defineSPI_CPOL0x02/* clock polarity */
diff --git a/lib_ppc/board.c b/lib_ppc/board.c
index a908831..afa0c74 100644
--- a/lib_ppc/board.c
+++ b/lib_ppc/board.c
@@ -90,9 +90,7 @@ void doc_init (void);
 defined(CONFIG_SOFT_I2C)
 #include i2c.h
 #endif
-#if defined(CONFIG_HARD_SPI)
 #include spi.h
-#endif
 #include nand.h
 
 static char *failed = *** failed ***\n;
-- 
1.5.4.3


-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH] PHY: Add support for the M88E1121R Marvell chip.

2008-06-09 Thread Ben Warren
Wolfgang Denk wrote:
 From: Sergei Poselenov [EMAIL PROTECTED]

 Signed-off-by: Yuri Tikhonov [EMAIL PROTECTED]
 Signed-off-by: Sergei Poselenov [EMAIL PROTECTED]
   
Acked-by: Ben Warren [EMAIL PROTECTED]
 ---
  drivers/net/tsec.c |   49 +
  drivers/net/tsec.h |7 +++
  2 files changed, 56 insertions(+), 0 deletions(-)

 diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c
 index c7af930..565da5c 100644
 --- a/drivers/net/tsec.c
 +++ b/drivers/net/tsec.c
 @@ -1128,6 +1128,54 @@ struct phy_info phy_info_M88ES = {
  },
  };
  
 +/*
 + *  Since to access LED register we need do switch the page, we
 + * do LED configuring in the miim_read-like function as follows
 + */
 +uint mii_88E1121_set_led (uint mii_reg, struct tsec_private *priv)
 +{
 + uint pg;
 +
 + /* Switch the page to access the led register */
 + pg = read_phy_reg(priv, MIIM_88E1121_PHY_PAGE);
 + write_phy_reg(priv, MIIM_88E1121_PHY_PAGE, MIIM_88E1121_PHY_LED_PAGE);
 +
 + /* Configure leds */
 + write_phy_reg(priv, MIIM_88E1121_PHY_LED_CTRL,
 +   MIIM_88E1121_PHY_LED_DEF);
 +
 + /* Restore the page pointer */
 + write_phy_reg(priv, MIIM_88E1121_PHY_PAGE, pg);
 + return 0;
 +}
 +
 +struct phy_info phy_info_M88E1121R = {
 + 0x01410cb,
 + Marvell 88E1121R,
 + 4,
 + (struct phy_cmd[]){ /* config */
 +/* Reset and configure the PHY */
 +{MIIM_CONTROL, MIIM_CONTROL_RESET, NULL},
 +{MIIM_GBIT_CONTROL, MIIM_GBIT_CONTROL_INIT, NULL},
 +{MIIM_ANAR, MIIM_ANAR_INIT, NULL},
 +/* Configure leds */
 +{MIIM_88E1121_PHY_LED_CTRL, miim_read,
 + mii_88E1121_set_led},
 +{MIIM_CONTROL, MIIM_CONTROL_INIT, mii_cr_init},
 +{miim_end,}
 +},
 + (struct phy_cmd[]){ /* startup */
 +/* Status is read once to clear old link state */
 +{MIIM_STATUS, miim_read, NULL},
 +{MIIM_STATUS, miim_read, mii_parse_sr},
 +{MIIM_STATUS, miim_read, mii_parse_link},
 +{miim_end,}
 +},
 + (struct phy_cmd[]){ /* shutdown */
 +{miim_end,}
 +},
 +};
 +
  static unsigned int m88e1145_setmode(uint mii_reg, struct tsec_private *priv)
  {
   uint mii_data = read_phy_reg(priv, mii_reg);
 @@ -1492,6 +1540,7 @@ struct phy_info *phy_info[] = {
   phy_info_BCM5464S,
   phy_info_M88E1011S,
   phy_info_M88ES,
 + phy_info_M88E1121R,
   phy_info_M88E1145,
   phy_info_M88E1149S,
   phy_info_dm9161,
 diff --git a/drivers/net/tsec.h b/drivers/net/tsec.h
 index 6a2338b..fee5934 100644
 --- a/drivers/net/tsec.h
 +++ b/drivers/net/tsec.h
 @@ -184,6 +184,13 @@
  #define MIIM_88E_PHY_LED_DIRECT  0x4100
  #define MIIM_88E_PHY_LED_COMBINE 0x411C
  
 +/* 88E1121 PHY LED Control Register */
 +#define MIIM_88E1121_PHY_LED_CTRL16
 +#define MIIM_88E1121_PHY_LED_PAGE3
 +#define MIIM_88E1121_PHY_LED_DEF 0x0030
 +
 +#define MIIM_88E1121_PHY_PAGE22
 +
  /* 88E1145 Extended PHY Specific Control Register */
  #define MIIM_88E1145_PHY_EXT_CR 20
  #define MIIM_M88E1145_RGMII_RX_DELAY 0x0080
   


-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] Pull request: u-boot-net

2008-06-09 Thread Ben Warren
Ben Warren wrote:
 Wolfgang,

 Ben Warren wrote:
 Wolfgang,

 Please pull from the net repo:

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

 are available in the git repository at:

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

 Please hold off on pulling this.  I made a git error on further 
 submissions and need to fix it.

 regards,
 Ben

It's OK now.  Please pull.

regards,
Ben

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


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

2008-06-09 Thread Stefan Roese
The following changes since commit 10a3367955bc2033b288915f8f10d0e507fe2fa1:
  Stefan Roese (1):
Merge branch 'master' of /home/stefan/git/u-boot/u-boot

are available in the git repository at:

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

Grant Erickson (3):
  PPC4xx: Simplified post_word_{load, store}
  ppc4xx: Enable Primordial Stack for 40x and Unify ECC Handling
  ppc4xx: Enable Primordial Stack for 40x and Unify ECC Handling

Kenneth Johansson (1):
  Remove shell variable UNDEF_SYM.

Matthias Fuchs (1):
  ppc4xx: Cleanup CPCI405 variant's config file

Stefan Roese (13):
  ppc4xx/NAND_SPL: Consolidate 405 and 440 NAND booting code in start.S
  ppc4xx: Consolidate PPC4xx SDRAM/DDR/DDR2 defines, part1
  ppc4xx: Consolidate PPC4xx SDRAM/DDR/DDR2 defines, part2
  ppc4xx: Change Kilauea to use the common DDR2 init function
  ppc4xx: Fix common ECC generation code for 440GP style platforms
  ppc4xx: Use new 4xx SDRAM controller enable defines in common ECC code
  ppc4xx: Remove superfluous dram_init() call or replace it by initdram()
  ppc4xx: Remove implementations of testdram()
  ppc4xx: Fix problem with SDRAM init in bamboo NAND booting port
  ppc4xx: Unify AMCC's board config files (part 1/3)
  ppc4xx: Unify AMCC's board config files (part 2/3)
  ppc4xx: Unify AMCC's board config files (part 3/3)
  ppc4xx: Fix misspelled CONFIG_440SPE/440EPX/GRX config options

 board/amcc/acadia/memory.c   |   15 -
 board/amcc/bamboo/bamboo.c   |   67 --
 board/amcc/bubinga/bubinga.c |   16 -
 board/amcc/canyonlands/canyonlands.c |   38 -
 board/amcc/ebony/ebony.c |   30 -
 board/amcc/katmai/katmai.c   |   30 -
 board/amcc/kilauea/Makefile  |3 +-
 board/amcc/kilauea/init.S|  154 
 board/amcc/kilauea/memory.c  |   79 --
 board/amcc/luan/luan.c   |   44 --
 board/amcc/makalu/Makefile   |2 +-
 board/amcc/makalu/init.S |  125 +
 board/amcc/makalu/memory.c   |  188 -
 board/amcc/ocotea/ocotea.c   |   30 -
 board/amcc/sequoia/config.mk |4 +
 board/amcc/sequoia/sequoia.c |   38 -
 board/amcc/taihu/taihu.c |   42 --
 board/amcc/taishan/taishan.c |   30 -
 board/amcc/walnut/walnut.c   |   16 -
 board/amcc/yosemite/yosemite.c   |   52 +--
 board/amcc/yucca/yucca.c |   30 -
 board/amirix/ap1000/init.S   |4 -
 board/cray/L1/init.S |   11 -
 board/csb272/csb272.c|9 +
 board/csb472/csb472.c|9 +
 board/eric/eric.c|8 +
 board/esd/ar405/ar405.c  |   22 -
 board/esd/canbt/canbt.c  |   19 -
 board/exbitgen/exbitgen.c|9 +
 board/g2000/g2000.c  |   35 -
 board/jse/init.S |   10 -
 board/lwmon5/lwmon5.c|   38 -
 board/ml2/init.S |4 -
 board/mpl/mip405/init.S  |   13 -
 board/mpl/pip405/init.S  |   13 -
 board/netstal/hcu4/hcu4.c|9 -
 board/netstal/hcu5/sdram.c   |   26 +-
 board/netstal/mcu25/mcu25.c  |9 -
 board/pcs440ep/pcs440ep.c|   38 -
 board/prodrive/alpr/alpr.c   |   30 -
 board/w7o/w7o.c  |8 +
 board/xilinx/ml300/init.S|4 -
 board/zeus/zeus.c|   45 --
 cpu/ppc4xx/44x_spd_ddr.c |  200 +-
 cpu/ppc4xx/44x_spd_ddr2.c|  131 -
 cpu/ppc4xx/4xx_uart.c|   10 +-
 cpu/ppc4xx/Makefile  |1 +
 cpu/ppc4xx/commproc.c|   26 +-
 cpu/ppc4xx/cpu_init.c|   85 ---
 cpu/ppc4xx/ecc.c |  122 
 cpu/ppc4xx/ecc.h |   69 ++
 cpu/ppc4xx/sdram.c   |   54 +--
 cpu/ppc4xx/start.S   |  522 --
 cpu/ppc4xx/traps.c   |9 +-
 include/asm-ppc/ppc4xx-sdram.h   | 1156 ++
 include/asm-ppc/processor.h  |6 +-
 include/configs/CPCI4052.h   |   38 -
 include/configs/CPCI405AB.h  |   22 -
 include/configs/CPCI405DT.h  |   33 -
 include/configs/acadia.h |  169 +
 include/configs/alpr.h   |1 -
 include/configs/amcc-common.h|  259 +++
 include/configs/bamboo.h |  169 +
 include/configs/bubinga.h|  150 +
 include/configs/canyonlands.h|  173 +
 include/configs/ebony.h  |  152 +
 include/configs/katmai.h |  163 

Re: [U-Boot-Users] How to debug u-boot?

2008-06-09 Thread Detlev Zundel
Hi Brian,

 Hi every one.
 I need help with debugging u-boot. If I comple u-Boot without -Os 
 optimization, I get bunch of errors about missing functions. They are 
 inline functions (in_be32, out_be32, out_8, etc) and I'm not sure how 
 to make sure they are included when building the code without optimization.

 I'm using ELDK4.1 for windows and u-Boot-1.3.3

 Any help or pointers will be appreciated.

You have seen by now, that you cannot disable all optimization to
successfully build U-Boot (Linux is the same btw.).  I still do wonder,
why you want to disable optimization for debugging.  Is it because GCC
reorders some statements, so gdb seems to jump around in the source
lines?

If so, you can suppress the reordering as documented in our DULG[1]:

Add -fno-schedule-insns -fno-schedule-insns2 to the CFLAGS for U-Boot.

Cheers
  Detlev

[1] http://www.denx.de/wiki/view/DULG/DebuggingTricks

-- 
 Those who do not understand Unix are condemned to reinvent it,
 poorly.
 - Henry Spencer, University of Toronto Unix hack
--
DENX Software Engineering GmbH,  MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: [EMAIL PROTECTED]

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] Pull request: u-boot-fdt

2008-06-09 Thread Jerry Van Baren
The following changes since commit 8155efbd7ae9c65564ca98affe94631d612ae088:
  Wolfgang Denk (1):
Merge branch 'master' of ssh://mercury/home/wd/git/u-boot/master

are available in the git repository at:

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

David Gibson (1):
  libfdt: Several cleanups to parameter checking

Gerald Van Baren (8):
  Convert mpc7448hpc2 to CONFIG_OF_LIBFDT
  Change the stxxst to CONFIG_OF_LIBFDT
  Remove the deprecated CONFIG_OF_FLAT_TREE
  Convert mpc7448hpc2 to CONFIG_OF_LIBFDT
  Change the stxxst to CONFIG_OF_LIBFDT
  Remove the deprecated CONFIG_OF_FLAT_TREE
  Merge branch 'master' of /opt/git/u-boot/u-boot-fdt/
  The fdt boardsetup command criteria was not unique

 README|9 +-
 board/freescale/mpc7448hpc2/mpc7448hpc2.c |   21 +-
 board/tqm8272/tqm8272.c   |4 -
 common/Makefile   |1 -
 common/cmd_fdt.c  |3 +-
 common/ft_build.c |  471 -
 cpu/74xx_7xx/cpu.c|   35 +--
 drivers/pci/tsi108_pci.c  |   33 ++-
 include/configs/mpc7448hpc2.h |3 +-
 include/configs/stxxtc.h  |4 +-
 include/ft_build.h|   71 -
 libfdt/fdt.c  |   17 +-
 libfdt/fdt_ro.c   |   26 +--
 libfdt/fdt_rw.c   |   24 +-
 libfdt/fdt_sw.c   |   31 +-
 libfdt/libfdt_internal.h  |1 +
 16 files changed, 88 insertions(+), 666 deletions(-)
 delete mode 100644 common/ft_build.c
 delete mode 100644 include/ft_build.h

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] Pull request: u-boot-fdt

2008-06-09 Thread Jerry Van Baren
Jerry Van Baren wrote:
 The following changes since commit 8155efbd7ae9c65564ca98affe94631d612ae088:
   Wolfgang Denk (1):
 Merge branch 'master' of ssh://mercury/home/wd/git/u-boot/master
 
 are available in the git repository at:
 
   git://git.denx.de/u-boot-fdt.git master
 
 David Gibson (1):
   libfdt: Several cleanups to parameter checking
 
 Gerald Van Baren (8):
   Convert mpc7448hpc2 to CONFIG_OF_LIBFDT
   Change the stxxst to CONFIG_OF_LIBFDT
   Remove the deprecated CONFIG_OF_FLAT_TREE
   Convert mpc7448hpc2 to CONFIG_OF_LIBFDT
   Change the stxxst to CONFIG_OF_LIBFDT
   Remove the deprecated CONFIG_OF_FLAT_TREE
   Merge branch 'master' of /opt/git/u-boot/u-boot-fdt/
   The fdt boardsetup command criteria was not unique

Oooo, that's kinda weird: my troikia patch is in there twice.  I 
probably should read what I send *before* sending it.  :-(
   Convert mpc7448hpc2 to CONFIG_OF_LIBFDT
   Change the stxxst to CONFIG_OF_LIBFDT
   Remove the deprecated CONFIG_OF_FLAT_TREE

I will regenerate and repost the request.

Sorry,
gvb

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] Pull request: u-boot-fdt (fixed repo)

2008-06-09 Thread Jerry Van Baren
The following changes since commit 8155efbd7ae9c65564ca98affe94631d612ae088:
  Wolfgang Denk (1):
Merge branch 'master' of ssh://mercury/home/wd/git/u-boot/master

are available in the git repository at:

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

David Gibson (1):
  libfdt: Several cleanups to parameter checking

Gerald Van Baren (4):
  Convert mpc7448hpc2 to CONFIG_OF_LIBFDT
  Change the stxxst to CONFIG_OF_LIBFDT
  Remove the deprecated CONFIG_OF_FLAT_TREE
  The fdt boardsetup command criteria was not unique

 README|9 +-
 board/freescale/mpc7448hpc2/mpc7448hpc2.c |   21 +-
 board/tqm8272/tqm8272.c   |4 -
 common/Makefile   |1 -
 common/cmd_fdt.c  |3 +-
 common/ft_build.c |  471 -
 cpu/74xx_7xx/cpu.c|   35 +--
 drivers/pci/tsi108_pci.c  |   33 ++-
 include/configs/mpc7448hpc2.h |3 +-
 include/configs/stxxtc.h  |4 +-
 include/ft_build.h|   71 -
 libfdt/fdt.c  |   17 +-
 libfdt/fdt_ro.c   |   26 +--
 libfdt/fdt_rw.c   |   24 +-
 libfdt/fdt_sw.c   |   31 +-
 libfdt/libfdt_internal.h  |1 +
 16 files changed, 88 insertions(+), 666 deletions(-)
 delete mode 100644 common/ft_build.c
 delete mode 100644 include/ft_build.h

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] [PATCH v2 RESEND] MMC: Consolidate MMC/SD command definitions

2008-06-09 Thread Haavard Skinnemoen
This moves the MMC and SD Card command definitions from
include/asm/arch/mmc.h into include/mmc.h. These definitions are given
by the MMC and SD Card standards, not by any particular architecture.

There's a lot more room for consolidation in the MMC drivers which I'm
hoping to get done eventually, but this patch is a start.

Compile-tested for all avr32 boards as well as lpc2292sodimm and
lubbock. This should cover all three mmc drivers in the tree.

Signed-off-by: Haavard Skinnemoen [EMAIL PROTECTED]
---
This patch was originally posted Thu, 22 May 2008 11:09:59 +0200

Changes since v1:
  * Split very long line in cpu/pxa/mmc.c
  * Fix whitespace damage copied from original mmc headers prior to
the big whitespace cleanup.

 cpu/at32ap/atmel_mci.c  |4 ++--
 cpu/pxa/mmc.c   |   11 +++
 include/asm-arm/arch-pxa/mmc.h  |   17 -
 include/asm-avr32/arch-at32ap700x/mmc.h |   19 ---
 include/mmc.h   |   24 
 5 files changed, 33 insertions(+), 42 deletions(-)

diff --git a/cpu/at32ap/atmel_mci.c b/cpu/at32ap/atmel_mci.c
index 3795add..61aa184 100644
--- a/cpu/at32ap/atmel_mci.c
+++ b/cpu/at32ap/atmel_mci.c
@@ -349,7 +349,7 @@ static int sd_init_card(struct mmc_cid *cid, int verbose)
 
mmc_idle_cards();
for (i = 0; i  1000; i++) {
-   ret = mmc_acmd(MMC_ACMD_SD_SEND_OP_COND, CFG_MMC_OP_COND,
+   ret = mmc_acmd(SD_CMD_APP_SEND_OP_COND, CFG_MMC_OP_COND,
   resp, R3 | NID);
if (ret || (resp[0]  0x8000))
break;
@@ -367,7 +367,7 @@ static int sd_init_card(struct mmc_cid *cid, int verbose)
mmc_dump_cid(cid);
 
/* Get RCA of the card that responded */
-   ret = mmc_cmd(MMC_CMD_SD_SEND_RELATIVE_ADDR, 0, resp, R6 | NCR);
+   ret = mmc_cmd(SD_CMD_SEND_RELATIVE_ADDR, 0, resp, R6 | NCR);
if (ret)
return ret;
 
diff --git a/cpu/pxa/mmc.c b/cpu/pxa/mmc.c
index 039ce0f..4495a80 100644
--- a/cpu/pxa/mmc.c
+++ b/cpu/pxa/mmc.c
@@ -119,7 +119,7 @@ mmc_block_read(uchar * dst, ulong src, ulong len)
MMC_RDTO = 0x;
MMC_NOB = 1;
MMC_BLKLEN = len;
-   mmc_cmd(MMC_CMD_READ_BLOCK, argh, argl,
+   mmc_cmd(MMC_CMD_READ_SINGLE_BLOCK, argh, argl,
MMC_CMDAT_R1 | MMC_CMDAT_READ | MMC_CMDAT_BLOCK |
MMC_CMDAT_DATA_EN);
 
@@ -568,7 +568,7 @@ mmc_init(int verbose)
MMC_SPI = MMC_SPI_DISABLE;
 
/* reset */
-   mmc_cmd(MMC_CMD_RESET, 0, 0, MMC_CMDAT_INIT | MMC_CMDAT_R0);
+   mmc_cmd(MMC_CMD_GO_IDLE_STATE, 0, 0, MMC_CMDAT_INIT | MMC_CMDAT_R0);
udelay(20);
retries = 3;
while (retries--) {
@@ -578,7 +578,10 @@ mmc_init(int verbose)
break;
}
 
-   resp = mmc_cmd(SD_CMD_APP_OP_COND, 0x0020, 0, MMC_CMDAT_R3 | 
(retries  2 ? 0 : MMC_CMDAT_INIT));   /* Select 3.2-3.3 and 3.3-3.4V */
+   /* Select 3.2-3.3 and 3.3-3.4V */
+   resp = mmc_cmd(SD_CMD_APP_SEND_OP_COND, 0x0020, 0,
+   MMC_CMDAT_R3 | (retries  2 ? 0
+   : MMC_CMDAT_INIT));
if (resp[0]  0x8000) {
mmc_dev.if_type = IF_TYPE_SD;
debug(Detected SD card\n);
@@ -616,7 +619,7 @@ mmc_init(int verbose)
memcpy(cid_resp, resp, sizeof(cid_resp));
 
/* MMC exists, get CSD too */
-   resp = mmc_cmd(MMC_CMD_SET_RCA, 0, 0, MMC_CMDAT_R1);
+   resp = mmc_cmd(MMC_CMD_SET_RELATIVE_ADDR, 0, 0, MMC_CMDAT_R1);
if (IF_TYPE_SD == mmc_dev.if_type)
rca = ((resp[0]  0x)  16);
resp = mmc_cmd(MMC_CMD_SEND_CSD, rca, 0, MMC_CMDAT_R2);
diff --git a/include/asm-arm/arch-pxa/mmc.h b/include/asm-arm/arch-pxa/mmc.h
index 9440d80..85e144b 100644
--- a/include/asm-arm/arch-pxa/mmc.h
+++ b/include/asm-arm/arch-pxa/mmc.h
@@ -110,23 +110,6 @@
 #define MMC_DEFAULT_RCA1
 
 #define MMC_BLOCK_SIZE 512
-#define MMC_CMD_RESET  0
-#define MMC_CMD_SEND_OP_COND   1
-#define MMC_CMD_ALL_SEND_CID   2
-#define MMC_CMD_SET_RCA3
-#define MMC_CMD_SELECT_CARD7
-#define MMC_CMD_SEND_CSD   9
-#define MMC_CMD_SEND_CID   10
-#define MMC_CMD_SEND_STATUS13
-#define MMC_CMD_SET_BLOCKLEN   16
-#define MMC_CMD_READ_BLOCK 17
-#define MMC_CMD_RD_BLK_MULTI   18
-#define MMC_CMD_WRITE_BLOCK24
-#define MMC_CMD_APP_CMD55
-
-#define SD_CMD_APP_SET_BUS_WIDTH   6
-#define SD_CMD_APP_OP_COND 41
-
 #define MMC_MAX_BLOCK_SIZE 512
 
 #define MMC_R1_IDLE_STATE  0x01
diff --git 

Re: [U-Boot-Users] [PATCH 10/10] net: Conditional COBJS inclusino of remainings

2008-06-09 Thread Ben Warren
Hi Shinya,

On Sat, Jun 7, 2008 at 9:16 AM, Shinya Kuribayashi
[EMAIL PROTECTED] wrote:
 net: Conditional COBJS inclusino of remainings


s/inclusino/inclusion/
remainings isn't a word.  Please use something like remaining
Ethernet controllers

 From: Shinya Kuribayashi [EMAIL PROTECTED]

 Signed-off-by: Shinya Kuribayashi [EMAIL PROTECTED]
 ---

 drivers/net/3c589.c|5 -
 drivers/net/Makefile   |   26 +-
 drivers/net/cs8900.c   |8 
 drivers/net/dc2114x.c  |6 --
 drivers/net/dm9000x.c  |3 ---
 drivers/net/enc28j60.c |3 ---
 drivers/net/ks8695eth.c|4 
 drivers/net/macb.c |5 -
 drivers/net/netconsole.c   |5 -
 drivers/net/pcnet.c|4 
 drivers/net/plb2800_eth.c  |6 --
 drivers/net/s3c4510b_eth.c |5 -
 drivers/net/tsi108_eth.c   |5 -
 drivers/net/uli526x.c  |4 
 14 files changed, 13 insertions(+), 76 deletions(-)


 diff --git a/drivers/net/3c589.c b/drivers/net/3c589.c
 index 3f1e770..0cf8dff 100644
 --- a/drivers/net/3c589.c
 +++ b/drivers/net/3c589.c
 @@ -26,8 +26,6 @@
 #include command.h
 #include net.h

 -#ifdef CONFIG_DRIVER_3C589
 -
 #include 3c589.h


 @@ -514,6 +512,3 @@ int eth_send(volatile void *packet, int length) {

return length;
 }
 -
 -
 -#endif /* CONFIG_DRIVER_3C589 */
 diff --git a/drivers/net/Makefile b/drivers/net/Makefile
 index ca30952..84be288 100644
 --- a/drivers/net/Makefile
 +++ b/drivers/net/Makefile
 @@ -25,21 +25,21 @@ include $(TOPDIR)/config.mk

 LIB := $(obj)libnet.a

 -COBJS-y += 3c589.o
 +COBJS-$(CONFIG_DRIVER_3C589) += 3c589.o
 COBJS-$(CONFIG_BCM570x) += bcm570x.o bcm570x_autoneg.o 5701rls.o
 COBJS-$(CONFIG_BFIN_MAC) += bfin_mac.o
 -COBJS-y += cs8900.o
 -COBJS-y += dc2114x.o
 -COBJS-y += dm9000x.o
 +COBJS-$(CONFIG_DRIVER_CS8900) += cs8900.o
 +COBJS-$(CONFIG_TULIP) += dc2114x.o
 +COBJS-$(CONFIG_DRIVER_DM9000) += dm9000x.o
 COBJS-$(CONFIG_E1000) += e1000.o
 COBJS-$(CONFIG_EEPRO100) += eepro100.o
 -COBJS-y += enc28j60.o
 +COBJS-$(CONFIG_ENC28J60) += enc28j60.o
 COBJS-$(CONFIG_FSLDMAFEC) += fsl_mcdmafec.o
 COBJS-$(CONFIG_GRETH) += greth.o
 COBJS-$(CONFIG_INCA_IP_SWITCH) += inca-ip_sw.o
 -COBJS-y += ks8695eth.o
 +COBJS-$(CONFIG_DRIVER_KS8695ETH) += ks8695eth.o
 COBJS-$(CONFIG_DRIVER_LAN91C96) += lan91c96.o
 -COBJS-y += macb.o
 +COBJS-$(CONFIG_MACB) += macb.o
 COBJS-$(CONFIG_MCFFEC) += mcffec.o
 COBJS-$(CONFIG_NATSEMI) += natsemi.o
 ifeq ($(CONFIG_DRIVER_NE2000),y)
 @@ -47,22 +47,22 @@ COBJS-y += ne2000.o
 COBJS-$(CONFIG_DRIVER_AX88796L) += ax88796.o
 endif
 COBJS-$(CONFIG_DRIVER_NETARMETH) += netarm_eth.o
 -COBJS-y += netconsole.o
 +COBJS-$(CONFIG_NETCONSOLE) += netconsole.o
 COBJS-$(CONFIG_DRIVER_NS7520_ETHERNET) += ns7520_eth.o
 COBJS-$(CONFIG_NS8382X) += ns8382x.o
 COBJS-$(CONFIG_DRIVER_NS9750_ETHERNET) += ns9750_eth.o
 -COBJS-y += pcnet.o
 -COBJS-y += plb2800_eth.o
 +COBJS-$(CONFIG_PCNET) += pcnet.o
 +COBJS-$(CONFIG_PLB2800_ETHER) += plb2800_eth.o
 COBJS-$(CONFIG_DRIVER_RTL8019) += rtl8019.o
 COBJS-$(CONFIG_RTL8139) += rtl8139.o
 COBJS-$(CONFIG_RTL8169) += rtl8169.o
 -COBJS-y += s3c4510b_eth.o
 +COBJS-$(CONFIG_DRIVER_S3C4510_ETH) += s3c4510b_eth.o
 COBJS-$(CONFIG_DRIVER_SMC9) += smc9.o
 COBJS-$(CONFIG_DRIVER_SMC911X) += smc911x.o
 COBJS-$(CONFIG_TIGON3) += tigon3.o bcm570x_autoneg.o 5701rls.o
 COBJS-$(CONFIG_TSEC_ENET) += tsec.o
 -COBJS-y += tsi108_eth.o
 -COBJS-y += uli526x.o
 +COBJS-$(CONFIG_TSI108_ETH) += tsi108_eth.o
 +COBJS-$(CONFIG_ULI526X) += uli526x.o
 COBJS-$(CONFIG_VSC7385_ENET) += vsc7385.o
 COBJS-$(CONFIG_XILINX_EMAC) += xilinx_emac.o
 COBJS-$(CONFIG_XILINX_EMACLITE) += xilinx_emaclite.o
 diff --git a/drivers/net/cs8900.c b/drivers/net/cs8900.c
 index 458b517..ae1983a 100644
 --- a/drivers/net/cs8900.c
 +++ b/drivers/net/cs8900.c
 @@ -41,10 +41,6 @@
 #include cs8900.h
 #include net.h

 -#ifdef CONFIG_DRIVER_CS8900
 -
 -#if defined(CONFIG_CMD_NET)
 -
 #undef DEBUG

 /* packet page register access functions */
 @@ -315,7 +311,3 @@ int cs8900_e2prom_write(unsigned char addr, unsigned
 short value)

return 0;
 }
 -
 -#endif /* CONFIG_CMD_NET */
 -
 -#endif /* CONFIG_DRIVER_CS8900 */
 diff --git a/drivers/net/dc2114x.c b/drivers/net/dc2114x.c
 index 1d728d8..8117239 100644
 --- a/drivers/net/dc2114x.c
 +++ b/drivers/net/dc2114x.c
 @@ -19,10 +19,6 @@
  */

 #include common.h
 -
 -#if defined(CONFIG_CMD_NET) \
 -defined(CONFIG_NET_MULTI)  defined(CONFIG_TULIP)
 -
 #include malloc.h
 #include net.h
 #include pci.h
 @@ -766,5 +762,3 @@ static void update_srom(struct eth_device *dev, bd_t
 *bis)
}
 }
 #endif  /* UPDATE_SROM */
 -
 -#endif
 diff --git a/drivers/net/dm9000x.c b/drivers/net/dm9000x.c
 index 68901cd..cb21925 100644
 --- a/drivers/net/dm9000x.c
 +++ b/drivers/net/dm9000x.c
 @@ -47,8 +47,6 @@ TODO: Homerun NIC and longrun NIC are not functional, only
 internal at the
 #include net.h
 #include asm/io.h

 -#ifdef CONFIG_DRIVER_DM9000
 -
 #include 

Re: [U-Boot-Users] [PATCH v2] Move conditional compilation of MPC8XXX SPI driver to Makefile

2008-06-09 Thread Haavard Skinnemoen
Ben Warren [EMAIL PROTECTED] wrote:
 +/* Controller-specific definitions: */
 +
 +/* CONFIG_HARD_SPI triggers SPI bus initialization in PowerPC */
 +#ifdef CONFIG_MPC8XXX_SPI
 +# ifndef CONFIG_HARD_SPI
 +#  define CONFIG_HARD_SPI
 +# endif
 +#endif

Grumble. I'm really looking forward to that Kconfig system so we can
get rid of crap like this...it won't exactly become prettier as more
SPI drivers are added...

Btw, I wonder if the _real_ fix is to move the stuff in spi_init() into
spi_claim_bus() and just kill spi_init() altogether. This will match
the u-boot design requirement about not touching hardware you don't
intend to use a bit more closely.

But I can certainly understand that you want to keep the existing code
working before doing something like that.

Haavard

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH 10/10] net: Conditional COBJS inclusino of remainings

2008-06-09 Thread Shinya Kuribayashi
Ben Warren wrote:
 diff --git a/drivers/net/dm9000x.c b/drivers/net/dm9000x.c
 index 68901cd..cb21925 100644
 --- a/drivers/net/dm9000x.c
 +++ b/drivers/net/dm9000x.c
 @@ -47,8 +47,6 @@ TODO: Homerun NIC and longrun NIC are not functional, only
 internal at the
 #include net.h
 #include asm/io.h

 -#ifdef CONFIG_DRIVER_DM9000
 -
 #include dm9000x.h

 
 This patch no longer applies due to other changes to the DM9000
 driver.  Please re-base against the net repo and resubmit.
 snip

Ok.

 thanks for doing all this Makefile fixing!  It's been on my to-do list
 but you got there first.  All others apply cleanly, BTW.

These patches were just for the review, not for git-am. I'll revised
and submit all-in-one patch soon.


  Shinya


-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] [PATCH v2] net: Conditional COBJS inclusion of network drivers

2008-06-09 Thread Shinya Kuribayashi
Replace COBJS-y with appropriate driver config names.

Signed-off-by: Shinya Kuribayashi [EMAIL PROTECTED]
---

Changes v2:

 * Kill more CONFIG_CMD_NET and CONFIG_NET_MULTI defines from
   - fsl_mcdmafec.c
   - mcffec.c
   - netarm_eth.c

 * Revised DM9000 part against the net repo.

 drivers/net/3c589.c|5 ---
 drivers/net/Makefile   |   66 ++--
 drivers/net/bcm570x.c  |5 ---
 drivers/net/cs8900.c   |8 -
 drivers/net/dc2114x.c  |6 
 drivers/net/dm9000x.c  |3 --
 drivers/net/e1000.c|5 ---
 drivers/net/eepro100.c |5 ---
 drivers/net/enc28j60.c |3 --
 drivers/net/fsl_mcdmafec.c |5 ---
 drivers/net/inca-ip_sw.c   |5 ---
 drivers/net/ks8695eth.c|4 ---
 drivers/net/lan91c96.c |9 --
 drivers/net/macb.c |5 ---
 drivers/net/mcffec.c   |7 -
 drivers/net/natsemi.c  |5 ---
 drivers/net/netarm_eth.c   |8 -
 drivers/net/netconsole.c   |5 ---
 drivers/net/ns7520_eth.c   |5 ---
 drivers/net/ns8382x.c  |5 ---
 drivers/net/ns9750_eth.c   |4 ---
 drivers/net/pcnet.c|4 ---
 drivers/net/plb2800_eth.c  |6 
 drivers/net/rtl8019.c  |8 -
 drivers/net/rtl8139.c  |4 ---
 drivers/net/rtl8169.c  |5 ---
 drivers/net/s3c4510b_eth.c |5 ---
 drivers/net/smc9.c |3 --
 drivers/net/smc911x.c  |5 ---
 drivers/net/tigon3.c   |5 +--
 drivers/net/tsec.c |3 --
 drivers/net/tsi108_eth.c   |5 ---
 drivers/net/uli526x.c  |4 ---
 drivers/net/vsc7385.c  |5 ---
 34 files changed, 34 insertions(+), 201 deletions(-)


diff --git a/drivers/net/3c589.c b/drivers/net/3c589.c
index 3f1e770..0cf8dff 100644
--- a/drivers/net/3c589.c
+++ b/drivers/net/3c589.c
@@ -26,8 +26,6 @@
 #include command.h
 #include net.h
 
-#ifdef CONFIG_DRIVER_3C589
-
 #include 3c589.h
 
 
@@ -514,6 +512,3 @@ int eth_send(volatile void *packet, int length) {
 
return length;
 }
-
-
-#endif /* CONFIG_DRIVER_3C589 */
diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index 5b031c9..84be288 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -25,45 +25,45 @@ include $(TOPDIR)/config.mk
 
 LIB:= $(obj)libnet.a
 
-COBJS-y += 3c589.o
-COBJS-y += bcm570x.o bcm570x_autoneg.o 5701rls.o
+COBJS-$(CONFIG_DRIVER_3C589) += 3c589.o
+COBJS-$(CONFIG_BCM570x) += bcm570x.o bcm570x_autoneg.o 5701rls.o
 COBJS-$(CONFIG_BFIN_MAC) += bfin_mac.o
-COBJS-y += cs8900.o
-COBJS-y += dc2114x.o
-COBJS-y += dm9000x.o
-COBJS-y += e1000.o
-COBJS-y += eepro100.o
-COBJS-y += enc28j60.o
-COBJS-y += fsl_mcdmafec.o
+COBJS-$(CONFIG_DRIVER_CS8900) += cs8900.o
+COBJS-$(CONFIG_TULIP) += dc2114x.o
+COBJS-$(CONFIG_DRIVER_DM9000) += dm9000x.o
+COBJS-$(CONFIG_E1000) += e1000.o
+COBJS-$(CONFIG_EEPRO100) += eepro100.o
+COBJS-$(CONFIG_ENC28J60) += enc28j60.o
+COBJS-$(CONFIG_FSLDMAFEC) += fsl_mcdmafec.o
 COBJS-$(CONFIG_GRETH) += greth.o
-COBJS-y += inca-ip_sw.o
-COBJS-y += ks8695eth.o
-COBJS-y += lan91c96.o
-COBJS-y += macb.o
-COBJS-y += mcffec.o
-COBJS-y += natsemi.o
+COBJS-$(CONFIG_INCA_IP_SWITCH) += inca-ip_sw.o
+COBJS-$(CONFIG_DRIVER_KS8695ETH) += ks8695eth.o
+COBJS-$(CONFIG_DRIVER_LAN91C96) += lan91c96.o
+COBJS-$(CONFIG_MACB) += macb.o
+COBJS-$(CONFIG_MCFFEC) += mcffec.o
+COBJS-$(CONFIG_NATSEMI) += natsemi.o
 ifeq ($(CONFIG_DRIVER_NE2000),y)
 COBJS-y += ne2000.o
 COBJS-$(CONFIG_DRIVER_AX88796L) += ax88796.o
 endif
-COBJS-y += netarm_eth.o
-COBJS-y += netconsole.o
-COBJS-y += ns7520_eth.o
-COBJS-y += ns8382x.o
-COBJS-y += ns9750_eth.o
-COBJS-y += pcnet.o
-COBJS-y += plb2800_eth.o
-COBJS-y += rtl8019.o
-COBJS-y += rtl8139.o
-COBJS-y += rtl8169.o
-COBJS-y += s3c4510b_eth.o
-COBJS-y += smc9.o
-COBJS-y += smc911x.o
-COBJS-y += tigon3.o
-COBJS-y += tsec.o
-COBJS-y += tsi108_eth.o
-COBJS-y += uli526x.o
-COBJS-y += vsc7385.o
+COBJS-$(CONFIG_DRIVER_NETARMETH) += netarm_eth.o
+COBJS-$(CONFIG_NETCONSOLE) += netconsole.o
+COBJS-$(CONFIG_DRIVER_NS7520_ETHERNET) += ns7520_eth.o
+COBJS-$(CONFIG_NS8382X) += ns8382x.o
+COBJS-$(CONFIG_DRIVER_NS9750_ETHERNET) += ns9750_eth.o
+COBJS-$(CONFIG_PCNET) += pcnet.o
+COBJS-$(CONFIG_PLB2800_ETHER) += plb2800_eth.o
+COBJS-$(CONFIG_DRIVER_RTL8019) += rtl8019.o
+COBJS-$(CONFIG_RTL8139) += rtl8139.o
+COBJS-$(CONFIG_RTL8169) += rtl8169.o
+COBJS-$(CONFIG_DRIVER_S3C4510_ETH) += s3c4510b_eth.o
+COBJS-$(CONFIG_DRIVER_SMC9) += smc9.o
+COBJS-$(CONFIG_DRIVER_SMC911X) += smc911x.o
+COBJS-$(CONFIG_TIGON3) += tigon3.o bcm570x_autoneg.o 5701rls.o
+COBJS-$(CONFIG_TSEC_ENET) += tsec.o
+COBJS-$(CONFIG_TSI108_ETH) += tsi108_eth.o
+COBJS-$(CONFIG_ULI526X) += uli526x.o
+COBJS-$(CONFIG_VSC7385_ENET) += vsc7385.o
 COBJS-$(CONFIG_XILINX_EMAC) += xilinx_emac.o
 COBJS-$(CONFIG_XILINX_EMACLITE) += xilinx_emaclite.o
 
diff --git a/drivers/net/bcm570x.c b/drivers/net/bcm570x.c
index 5ad31d1..6b28b95 100644
--- a/drivers/net/bcm570x.c
+++ b/drivers/net/bcm570x.c
@@ -6,9 +6,6 @@
 

Re: [U-Boot-Users] [PATCH] [FIT] Delay FIT format check on sector based devices

2008-06-09 Thread Scott Wood
On Fri, Jun 06, 2008 at 11:07:40PM +0200, Marian Balakowicz wrote:
 Global FIT image operations like format check cannot be performed on
 a first sector data, defer them to the point when whole FIT image was
 uploaded to a system RAM.
 
 Signed-off-by: Marian Balakowicz [EMAIL PROTECTED]
 ---
 
 Grant,
 
 Please give this patch a try on your system and let me know if it helped to
 solve the nand booting issue.
 
 Thanks,
 m.
 
  common/cmd_doc.c  |   19 ++-
  common/cmd_fdc.c  |   15 ---
  common/cmd_ide.c  |   19 ++-
  common/cmd_nand.c |   38 --
  common/cmd_scsi.c |   15 ---
  common/cmd_usb.c  |   15 ---
  6 files changed, 64 insertions(+), 57 deletions(-)

NAND and DOC bits Acked-by: Scott Wood [EMAIL PROTECTED]

-Scott

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH] The fdt boardsetup command criteria was not unique

2008-06-09 Thread Scott Wood
On Sat, Jun 07, 2008 at 12:29:26PM -0400, Jerry Van Baren wrote:
 diff --git a/common/cmd_fdt.c b/common/cmd_fdt.c
 index ede65ae..8592128 100644
 --- a/common/cmd_fdt.c
 +++ b/common/cmd_fdt.c
 @@ -403,7 +403,8 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char 
 *argv[])
   }
  #ifdef CONFIG_OF_BOARD_SETUP
   /* Call the board-specific fixup routine */
 - else if (argv[1][0] == 'b')
 + else if ((argv[1][0] == 'b')  (argv[1][1] == 'o') 
 +(argv[1][2] == 'a'))
   ft_board_setup(fdt, gd-bd);
  #endif

strncmp() would be clearer...

-Scott

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] Signed-off-by in mtd-2.6.22.1 branch

2008-06-09 Thread Scott Wood
There are several patches from William Juul in the mtd-2.6.22.1 branch of
u-boot-nand-flash that are missing Signed-off-by lines.  William or
Stefan, can you provide sign-offs for these?

-Scott

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH] The fdt boardsetup command criteria was not unique

2008-06-09 Thread Jerry Van Baren
Scott Wood wrote:
 On Sat, Jun 07, 2008 at 12:29:26PM -0400, Jerry Van Baren wrote:
 diff --git a/common/cmd_fdt.c b/common/cmd_fdt.c
 index ede65ae..8592128 100644
 --- a/common/cmd_fdt.c
 +++ b/common/cmd_fdt.c
 @@ -403,7 +403,8 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char 
 *argv[])
  }
  #ifdef CONFIG_OF_BOARD_SETUP
  /* Call the board-specific fixup routine */
 -else if (argv[1][0] == 'b')
 +else if ((argv[1][0] == 'b')  (argv[1][1] == 'o') 
 +   (argv[1][2] == 'a'))
  ft_board_setup(fdt, gd-bd);
  #endif
 
 strncmp() would be clearer...
 
 -Scott

Yeah, but that is the way the rest of them are.  :-/  Hmmm, looking at 
the other command/cmd_*.c files, it looks like my parsing 
character-by-character is in the minority vs. strncmp().

Best regards,
gvb

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] [RFC][FSL DDR 0/8] Freescale DDR rewrite

2008-06-09 Thread Kumar Gala
This is a series of patches that are a work-in-progress towards a new
DDR initialization for the Freescale 8{3,5,6}xxx devices that have a
common DDR controller.

These patches are also available at:

git://git.kernel.org/pub/scm/boot/u-boot/galak/u-boot.git fsl_ddr

and patch 0002 since its large is at:

http://gate.crashing.org/~galak/fsl_ddr.20080609/0002-Rewrite-the-FSL-mpc8xxx-DDR-controller-setup-code.patch

- k

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] [RFC][FSL DDR 1/8] Add proper SPD definitions for DDR1/2/3

2008-06-09 Thread Kumar Gala
Also added a few helper functions for DDR1  DDR2 to print SPD info and
verify the checksum.

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

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

[U-Boot-Users] [RFC][FSL DDR 4/8] FSL DDR: Provide a generic fsl_ddr_sdram_set_lawbar()

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

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

diff --git a/drivers/misc/fsl_law.c b/drivers/misc/fsl_law.c
index dca6a4d..f9bdf10 100644
--- a/drivers/misc/fsl_law.c
+++ b/drivers/misc/fsl_law.c
@@ -72,6 +72,69 @@ void print_laws(void)
return;
 }
 
+#if defined(CONFIG_FSL_DDR1) || \
+defined(CONFIG_FSL_DDR2) || \
+defined(CONFIG_FSL_DDR3)
+#include ../cpu/mpc8xxx/fsl_ddr_sdram.h
+
+void
+__fsl_ddr_sdram_set_lawbar(const common_timing_params_t *memctl_common_params,
+  unsigned int memctl_interleaved,
+  unsigned int ctrl_num)
+{
+   unsigned long law_base_address;
+   unsigned long memsize_MB;
+   unsigned int law_size;
+
+   /*
+* If no DIMMs on this controller, do not proceed any further.
+*/
+   if (!memctl_common_params-ndimms_present) {
+   return;
+   }
+
+   law_base_address = memctl_common_params-base_address;
+
+   /*
+* Compute LAWBARn[SIZE] value for 2**(SIZE + 1) bytes.
+* If interleaving is used, the memory size must represent
+* the combined total of both controllers.
+* The first supported LAW size is 16M, at LAWAR_SIZE_16M == 23.
+* Fnord.
+*/
+   memsize_MB = memctl_common_params-total_mem / 0x10;
+   law_size = 19 + __ilog2(memsize_MB  memctl_interleaved);
+
+   if (ctrl_num == 0) {
+   /*
+* Set up LAWBAR1 for DDR controller 1 space.
+*/
+   unsigned int lawbar1_target_id = memctl_interleaved
+   ? LAW_TRGT_IF_DDR_INTRLV : LAW_TRGT_IF_DDR_1;
+
+   set_law(1, law_base_address, law_size, lawbar1_target_id);
+   debug(ctl0 law_base_address = 0x%08X, law_size = 0x%x\n,
+ law_base_address, law_size);
+
+   } else if (ctrl_num == 1) {
+   /*
+* Set up LAWBAR2 for DDR controller 2 space.
+*/
+   set_law(2, law_base_address, law_size, LAW_TRGT_IF_DDR_2);
+   debug(ctl1 law_base_address = 0x%08X, law_size = 0x%x\n,
+ law_base_address, law_size);
+
+   } else {
+   printf(unexpected controller number %u in 
fsl_ddr_sdram_set_lawbar()\n, ctrl_num);
+   }
+}
+
+__attribute__((weak, alias(__fsl_ddr_sdram_set_lawbar))) void
+fsl_ddr_sdram_set_lawbar(const common_timing_params_t *memctl_common_params,
+unsigned int memctl_interleaved,
+unsigned int ctrl_num);
+#endif
+
 void init_laws(void)
 {
int i;
-- 
1.5.5.1


-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] [RFC][FSL DDR 8/8] Modify MPC8544 DS to use the new DDR setup code.

2008-06-09 Thread Kumar Gala
Signed-off-by: Kumar Gala [EMAIL PROTECTED]
---
 Makefile  |1 +
 board/freescale/mpc8544ds/Makefile|9 +-
 board/freescale/mpc8544ds/ddr.c   |  268 +
 board/freescale/mpc8544ds/mpc8544ds.c |   21 ++-
 cpu/mpc85xx/Makefile  |2 +-
 include/configs/MPC8544DS.h   |   59 ++--
 6 files changed, 339 insertions(+), 21 deletions(-)
 create mode 100644 board/freescale/mpc8544ds/ddr.c

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

[U-Boot-Users] [RFC][FSL DDR 6/8] Modify mpc8641HPCN to use the new DDR setup code.

2008-06-09 Thread Kumar Gala
From: Jon Loeliger [EMAIL PROTECTED]

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

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

[U-Boot-Users] [RFC][FSL DDR 7/8] Modify MPC8610HPCD to use the new DDR setup code.

2008-06-09 Thread Kumar Gala
From: Jon Loeliger [EMAIL PROTECTED]

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

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

Re: [U-Boot-Users] MX31ADS: I2C1 bus

2008-06-09 Thread Robert Schwebel
On Fri, Jun 06, 2008 at 10:46:16AM +0200, llandre wrote:
 I downloaded current u-boot repo to perform a simple test on MX31ADS: I
 just have to verify that an I2C component connected to JP13 is detected
 by U-Boot (iprobe).
 So I enabled the I2C support in MX31ADS config file:

 /* I2C */
 #define CONFIG_HARD_I2C   1
 #define CONFIG_I2C_MXC1
 #define CFG_I2C_MX31_PORT11
 #define CFG_I2C_SPEED 10
 #define CFG_I2C_SLAVE 0xfe

 U-Boot builds and boots fine however, when issuing iprobe command, SDA
 and SCL lines are stuck at ~2.1V. JP6 and JP7 are both in 2-3 position.

 Am I missing something?

That looks like u-boot-v1. Sascha maintains the u-boot-v2 tree, which
hopefully doesn't have any such #define cruft any more :-)

The v1 port was done by Guennadi Liakhovetski.

rsc
-- 
 Dipl.-Ing. Robert Schwebel | http://www.pengutronix.de
 Pengutronix - Linux Solutions for Science and Industry
   Handelsregister:  Amtsgericht Hildesheim, HRA 2686
 Hannoversche Str. 2, 31134 Hildesheim, Germany
   Phone: +49-5121-206917-0 |  Fax: +49-5121-206917-9


-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] Booting U-boot from NAND on MX31

2008-06-09 Thread Robert Schwebel
On Fri, Jun 06, 2008 at 12:06:18PM -0700, Fabio Estevam wrote:
 We can succesfully boot U-boot from NOR on a MX31ADS. Has anyone
 managed to boot U-boot from NAND in any MX31 board?

We have recently started working on NAND support for several chips
(including the MX31) in u-boot-v2. However, it's not yet production
quality. As always: roadmap depends on customer demands ...

Robert
-- 
 Dipl.-Ing. Robert Schwebel | http://www.pengutronix.de
 Pengutronix - Linux Solutions for Science and Industry
   Handelsregister:  Amtsgericht Hildesheim, HRA 2686
 Hannoversche Str. 2, 31134 Hildesheim, Germany
   Phone: +49-5121-206917-0 |  Fax: +49-5121-206917-9


-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] Question on SH7763

2008-06-09 Thread Nobuhiro Iwamatsu
Hi, Paul.

On Mon, 9 Jun 2008 14:24:11 +0900
Paul Mundt [EMAIL PROTECTED] wrote:

  If your Flash supports CFI it should work with the CFI driver in u-boot.
  Look in the u-boot readme how to start/modify the u-boot code.
  
  And I wrote a document a little.
  Please check doc/README.sh
  
 On a somewhat related note, what is the status of the SH7203 patches? I
 have some SH7206 and MX-G bits that build on top of them, yet I don't see
 any of the SH7203 stuff in the git tree?
I don't touch SH7206 and MX-G.
Do you know someone is doing the work such as MX-G? 

About SH7203 , I will put code to U-Boot 1.3.5 queue.

Best regards,
 Nobuhiro
-- 
Nobuhiro Iwamatsu


-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH] net: sh: Renesas SH7763 Ethernet device support

2008-06-09 Thread Nobuhiro Iwamatsu
Hello, Ben.

On Fri, 06 Jun 2008 16:17:48 +0900
Nobuhiro Iwamatsu [EMAIL PROTECTED] wrote:

 Renesas SH7763 has 2 channel Ethernet device.
 This is 10/100/1000 Base support.
 But this patch check 10/100 Base only.
 
 Signed-off-by: Nobuhiro Iwamatsu [EMAIL PROTECTED]
 ---
  drivers/net/Makefile |1 +
  drivers/net/sh_eth.c |  599 
 ++
  drivers/net/sh_eth.h |  195 
  3 files changed, 795 insertions(+), 0 deletions(-)
  create mode 100644 drivers/net/sh_eth.c
  create mode 100644 drivers/net/sh_eth.h
 

Please apply this code to your net tree?

Best regards,
 Nobuhiro
-- 
Nobuhiro Iwamatsu


-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] Pull request: u-boot-sh

2008-06-09 Thread Nobuhiro Iwamatsu
The following changes since commit 8155efbd7ae9c65564ca98affe94631d612ae088:
  Wolfgang Denk (1):
Merge branch 'master' of ssh://mercury/home/wd/git/u-boot/master

are available in the git repository at:

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

Nobuhiro Iwamatsu (3):
  sh: SH7763 SCIF support
  sh: Add support Renesas SH7763
  sh: Renesas Solutions SH7763RDP board support

 MAINTAINERS |1 +
 MAKEALL |1 +
 Makefile|5 +
 board/sh7763rdp/Makefile|   47 +
 board/sh7763rdp/config.mk   |   11 ++
 board/sh7763rdp/lowlevel_init.S |  351 +++
 board/sh7763rdp/sh7763rdp.c |   76 +
 board/sh7763rdp/u-boot.lds  |  106 
 drivers/serial/serial_sh.c  |  128 --
 include/asm-sh/cpu_sh4.h|2 +
 include/asm-sh/cpu_sh7763.h |   51 ++
 include/configs/sh7763rdp.h |  126 ++
 12 files changed, 850 insertions(+), 55 deletions(-)
 create mode 100644 board/sh7763rdp/Makefile
 create mode 100644 board/sh7763rdp/config.mk
 create mode 100644 board/sh7763rdp/lowlevel_init.S
 create mode 100644 board/sh7763rdp/sh7763rdp.c
 create mode 100644 board/sh7763rdp/u-boot.lds
 create mode 100644 include/asm-sh/cpu_sh7763.h
 create mode 100644 include/configs/sh7763rdp.h

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH] net: sh: Renesas SH7763 Ethernet device support

2008-06-09 Thread Ben Warren
Hi Nobuhiro,

Nobuhiro Iwamatsu wrote:
 Hello, Ben.

 On Fri, 06 Jun 2008 16:17:48 +0900
 Nobuhiro Iwamatsu [EMAIL PROTECTED] wrote:

   
 Renesas SH7763 has 2 channel Ethernet device.
 This is 10/100/1000 Base support.
 But this patch check 10/100 Base only.

 Signed-off-by: Nobuhiro Iwamatsu [EMAIL PROTECTED]
 ---
  drivers/net/Makefile |1 +
  drivers/net/sh_eth.c |  599 
 ++
  drivers/net/sh_eth.h |  195 
  3 files changed, 795 insertions(+), 0 deletions(-)
  create mode 100644 drivers/net/sh_eth.c
  create mode 100644 drivers/net/sh_eth.h

 

 Please apply this code to your net tree?

   
I've scanned over the code and plan to give it a more thorough review 
tonight.

regards,
Ben

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


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

2008-06-09 Thread Scott Wood
The following changes since commit 8155efbd7ae9c65564ca98affe94631d612ae088:
  Wolfgang Denk (1):
Merge branch 'master' of ssh://mercury/home/wd/git/u-boot/master

are available in the git repository at:

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

Stuart Wood (1):
  env_nand.c: Added bad block management for environment variables

 common/env_nand.c |  119 -
 1 files changed, 99 insertions(+), 20 deletions(-)

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] i.MX31: Cleanup comments in lowlevel_init.S.

2008-06-09 Thread Magnus Lilja

Signed-off-by: Magnus Lilja [EMAIL PROTECTED]
---

 board/imx31_litekit/lowlevel_init.S |4 ++--
 board/imx31_phycore/lowlevel_init.S |4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/board/imx31_litekit/lowlevel_init.S 
b/board/imx31_litekit/lowlevel_init.S
index 9d96db8..0003a42 100644
--- a/board/imx31_litekit/lowlevel_init.S
+++ b/board/imx31_litekit/lowlevel_init.S
@@ -62,9 +62,9 @@ lowlevel_init:
REG 0x43FAC26C, 0 /* SDCLK */
REG 0x43FAC270, 0 /* CAS */
REG 0x43FAC274, 0 /* RAS */
-   REG 0x43FAC27C, 0x1000 /* CS2   CSD0) */
+   REG 0x43FAC27C, 0x1000 /* CS2 (CSD0) */
REG 0x43FAC284, 0 /* DQM3 */
-   REG 0x43FAC288, 0 /* DQM2, DQM1, DQM0, SD31-SD0, A25-A0, MA10   
0x288..0x2DC) */
+   REG 0x43FAC288, 0 /* DQM2, DQM1, DQM0, SD31-SD0, A25-A0, MA10 
(0x288..0x2DC) */
REG 0x43FAC28C, 0
REG 0x43FAC290, 0
REG 0x43FAC294, 0
diff --git a/board/imx31_phycore/lowlevel_init.S 
b/board/imx31_phycore/lowlevel_init.S
index 70f30c0..c5d6eb0 100644
--- a/board/imx31_phycore/lowlevel_init.S
+++ b/board/imx31_phycore/lowlevel_init.S
@@ -63,9 +63,9 @@ lowlevel_init:
REG 0x43FAC26C, 0 /* SDCLK */
REG 0x43FAC270, 0 /* CAS */
REG 0x43FAC274, 0 /* RAS */
-   REG 0x43FAC27C, 0x1000 /* CS2   CSD0) */
+   REG 0x43FAC27C, 0x1000 /* CS2 (CSD0) */
REG 0x43FAC284, 0 /* DQM3 */
-   REG 0x43FAC288, 0 /* DQM2, DQM1, DQM0, SD31-SD0, A25-A0, MA10   
0x288..0x2DC) */
+   REG 0x43FAC288, 0 /* DQM2, DQM1, DQM0, SD31-SD0, A25-A0, MA10 
(0x288..0x2DC) */
REG 0x43FAC28C, 0
REG 0x43FAC290, 0
REG 0x43FAC294, 0

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [RFC][FSL DDR 1/8] Add proper SPD definitions for DDR1/2/3

2008-06-09 Thread Jerry Van Baren
Kumar Gala wrote:
 Also added a few helper functions for DDR1  DDR2 to print SPD info and
 verify the checksum.
 
 Signed-off-by: Kumar Gala [EMAIL PROTECTED]
 ---
  common/Makefile   |1 +
  common/ddr_spd.c  |  504 
 +
  include/ddr_spd.h |  249 ++
  3 files changed, 754 insertions(+), 0 deletions(-)
  create mode 100644 common/ddr_spd.c
  create mode 100644 include/ddr_spd.h
 
 diff --git a/common/Makefile b/common/Makefile
 index b425795..503c3b5 100644
 --- a/common/Makefile
 +++ b/common/Makefile
 @@ -145,6 +145,7 @@ COBJS-y += cmd_mac.o
  COBJS-$(CONFIG_CMD_MFSL) += cmd_mfsl.o
  COBJS-$(CONFIG_MP) += cmd_mp.o
  COBJS-$(CONFIG_CMD_SF) += cmd_sf.o
 +COBJS-$(CONFIG_DDR_SPD) += ddr_spd.o
  
  COBJS:= $(COBJS-y)
  SRCS := $(AOBJS:.o=.S) $(COBJS:.o=.c)
 diff --git a/common/ddr_spd.c b/common/ddr_spd.c
 new file mode 100644
 index 000..bfabb93
 --- /dev/null
 +++ b/common/ddr_spd.c
 @@ -0,0 +1,504 @@
 +/*
 + * Copyright 2008 Freescale Semiconductor, Inc.
 + *
 + * This program is free software; you can redistribute it and/or
 + * modify it under the terms of the GNU General Public License
 + * Version 2 as published by the Free Software Foundation.
 + */
 +
 +#include common.h
 +#include ddr_spd.h
 +
 +void
 +ddr1_spd_dump(const ddr1_spd_eeprom_t *spd)

[major snippage]

Hi Kumar,

There is a do_sdram command in common/cmd_i2c.c that I believe is 
doing the same thing, but probably a lot less (I suspect the command is 
showing its age).

#if defined(CONFIG_CMD_SDRAM)
U_BOOT_CMD(
 isdram, 2,  1,  do_sdram,
 isdram  - print SDRAM configuration information\n,
 chip\n- print SDRAM configuration information\n
   (valid chip values 50..57)\n
);
#endif

Are you aware of that command?  Is your SPD dump going to supersede it?

Best regards,
gvb

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [RFC][FSL DDR 1/8] Add proper SPD definitions for DDR1/2/3

2008-06-09 Thread Jon Loeliger
On Mon, 2008-06-09 at 17:03 -0400, Jerry Van Baren wrote:

   Is your SPD dump going to supersede it?

In spades.

jdl



-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] [PATCH] FSL LAW: Keep track of LAW allocations and provide a LAW allocator

2008-06-09 Thread Kumar Gala
Make it so we keep track of which LAWs have allocated and provide
a function (set_next_law) which can allocate a LAW for us if one is
free.

In the future we will move to doing more dynamic LAW allocation
since the majority of users dont really care about what LAW number
they are at.

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

This primary effects 85xx so I'm expecting Andy to pick this up and send
it via the 85xx tree.

 cpu/mpc85xx/cpu_init.c|   19 +---
 drivers/misc/fsl_law.c|   45 ++--
 include/asm-ppc/fsl_law.h |1 +
 include/asm-ppc/global_data.h |3 ++
 lib_ppc/board.c   |3 +-
 5 files changed, 50 insertions(+), 21 deletions(-)

diff --git a/cpu/mpc85xx/cpu_init.c b/cpu/mpc85xx/cpu_init.c
index e3240b5..584d0bc 100644
--- a/cpu/mpc85xx/cpu_init.c
+++ b/cpu/mpc85xx/cpu_init.c
@@ -148,6 +148,12 @@ void cpu_init_early_f(void)
}
 #endif

+   /* Pointer is writable since we allocated a register for it */
+   gd = (gd_t *) (CFG_INIT_RAM_ADDR + CFG_GBL_DATA_OFFSET);
+
+   /* Clear initial global data */
+   memset ((void *) gd, 0, sizeof (gd_t));
+
init_laws();
invalidate_tlb(0);
init_tlbs();
@@ -168,12 +174,6 @@ void cpu_init_f (void)
disable_tlb(14);
disable_tlb(15);

-   /* Pointer is writable since we allocated a register for it */
-   gd = (gd_t *) (CFG_INIT_RAM_ADDR + CFG_GBL_DATA_OFFSET);
-
-   /* Clear initial global data */
-   memset ((void *) gd, 0, sizeof (gd_t));
-
 #ifdef CONFIG_CPM2
config_8560_ioports((ccsr_cpm_t *)CFG_MPC85xx_CPM_ADDR);
 #endif
@@ -255,14 +255,7 @@ void cpu_init_f (void)
 int cpu_init_r(void)
 {
 #ifdef CONFIG_CLEAR_LAW0
-#ifdef CONFIG_FSL_LAW
disable_law(0);
-#else
-   volatile ccsr_local_ecm_t *ecm = (void *)(CFG_MPC85xx_ECM_ADDR);
-
-   /* clear alternate boot location LAW (used for sdram, or ddr bank) */
-   ecm-lawar0 = 0;
-#endif
 #endif

 #if defined(CONFIG_L2_CACHE)
diff --git a/drivers/misc/fsl_law.c b/drivers/misc/fsl_law.c
index dca6a4d..9562c1e 100644
--- a/drivers/misc/fsl_law.c
+++ b/drivers/misc/fsl_law.c
@@ -27,8 +27,21 @@
 #include asm/fsl_law.h
 #include asm/io.h

+DECLARE_GLOBAL_DATA_PTR;
+
 #define LAWAR_EN   0x8000
-#define FSL_HW_NUM_LAWS 10 /* number of LAWs in the hw implementation */
+/* number of LAWs in the hw implementation */
+#if defined(CONFIG_MPC8540) || defined(CONFIG_MPC8541) || \
+defined(CONFIG_MPC8560) || defined(CONFIG_MPC8555)
+#define FSL_HW_NUM_LAWS 8
+#elif defined(CONFIG_MPC8548) || defined(CONFIG_MPC8544) || \
+  defined(CONFIG_MPC8641) || defined(CONFIG_MPC8610)
+#define FSL_HW_NUM_LAWS 10
+#elif defined(CONFIG_MPC8572)
+#define FSL_HW_NUM_LAWS 12
+#else
+#error FSL_HW_NUM_LAWS not defined for this platform
+#endif

 void set_law(u8 idx, phys_addr_t addr, enum law_size sz, enum law_trgt_if id)
 {
@@ -36,18 +49,34 @@ void set_law(u8 idx, phys_addr_t addr, enum law_size sz, 
enum law_trgt_if id)
volatile u32 *lawbar = base + 8 * idx;
volatile u32 *lawar = base + 8 * idx + 2;

+   gd-used_laws |= (1  idx);
+
out_be32(lawbar, addr  12);
out_be32(lawar, LAWAR_EN | ((u32)id  20) | (u32)sz);

return ;
 }

+int set_next_law(phys_addr_t addr, enum law_size sz, enum law_trgt_if id)
+{
+   u32 idx = ffz(gd-used_laws);
+
+   if (idx = FSL_HW_NUM_LAWS)
+   return -1;
+
+   set_law(idx, addr, sz, id);
+
+   return idx;
+}
+
 void disable_law(u8 idx)
 {
volatile u32 *base = (volatile u32 *)(CFG_IMMR + 0xc08);
volatile u32 *lawbar = base + 8 * idx;
volatile u32 *lawar = base + 8 * idx + 2;

+   gd-used_laws = ~(1  idx);
+
out_be32(lawar, 0);
out_be32(lawbar, 0);

@@ -75,14 +104,16 @@ void print_laws(void)
 void init_laws(void)
 {
int i;
-   u8 law_idx = 0;

-   for (i = 0; i  num_law_entries; i++) {
-   if (law_table[i].index != -1)
-   law_idx = law_table[i].index;
+   gd-used_laws = ~((1  FSL_HW_NUM_LAWS) - 1);

-   set_law(law_idx++, law_table[i].addr,
-   law_table[i].size, law_table[i].trgt_id);
+   for (i = 0; i  num_law_entries; i++) {
+   if (law_table[i].index == -1)
+   set_next_law(law_table[i].addr, law_table[i].size,
+   law_table[i].trgt_id);
+   else
+   set_law(law_table[i].index, law_table[i].addr,
+   law_table[i].size, law_table[i].trgt_id);
}

return ;
diff --git a/include/asm-ppc/fsl_law.h b/include/asm-ppc/fsl_law.h
index e955c75..2ae667a 100644
--- a/include/asm-ppc/fsl_law.h
+++ b/include/asm-ppc/fsl_law.h
@@ -70,6 +70,7 @@ struct law_entry {
 };

 extern void set_law(u8 idx, phys_addr_t addr, enum law_size sz, enum 
law_trgt_if id);
+extern int 

[U-Boot-Users] [PATCH] MPC8544DS: Update config.h

2008-06-09 Thread Kumar Gala
* Enable flash progress
* remove CLEAR_LAW0 since we dont really use it

Signed-off-by: Kumar Gala [EMAIL PROTECTED]
---
 include/configs/MPC8544DS.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/configs/MPC8544DS.h b/include/configs/MPC8544DS.h
index d5006b5..acb1682 100644
--- a/include/configs/MPC8544DS.h
+++ b/include/configs/MPC8544DS.h
@@ -77,7 +77,6 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
 #define CONFIG_L2_CACHE/* toggle L2 cache */
 #define CONFIG_BTB /* toggle branch predition */
 #define CONFIG_ADDR_STREAMING  /* toggle addr streaming */
-#define CONFIG_CLEAR_LAW0  /* Clear LAW0 in cpu_init_r */

 /*
  * Only possible on E500 Version 2 or newer cores.
@@ -169,6 +168,7 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
 #undef CFG_FLASH_CHECKSUM
 #define CFG_FLASH_ERASE_TOUT   6   /* Flash Erase Timeout (ms) */
 #define CFG_FLASH_WRITE_TOUT   500 /* Flash Write Timeout (ms) */
+#define CONFIG_FLASH_SHOW_PROGRESS 45 /* count down from 45/5: 9..1 */

 #define CFG_MONITOR_BASE   TEXT_BASE   /* start of monitor */

-- 
1.5.5.1


-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] [PATCH] fdt_support: add crypto node handling for MPC8{3, 5}xxE processors

2008-06-09 Thread Kim Phillips
crypto node if not on an E-processor.  If on 8360 or 834x family,
check rev and up-rev crypto node (to SEC rev. 2.4) property values
if on an 'EA' processor, e.g. MPC8349EA.

Signed-off-by: Kim Phillips [EMAIL PROTECTED]
---
 common/fdt_support.c|   87 +++
 cpu/mpc83xx/fdt.c   |   18 +
 cpu/mpc85xx/fdt.c   |6 +++
 include/asm-ppc/processor.h |9 
 include/fdt_support.h   |6 +++
 include/mpc83xx.h   |7 +++-
 6 files changed, 132 insertions(+), 1 deletions(-)

diff --git a/common/fdt_support.c b/common/fdt_support.c
index 7507744..c5b4650 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -447,3 +447,90 @@ void fdt_fixup_dr_usb(void *blob, bd_t *bd)
   prop, compat, fdt_strerror(err));
 }
 #endif /* CONFIG_HAS_FSL_DR_USB */
+
+#if defined(CONFIG_MPC83XX) || defined(CONFIG_MPC85xx)
+/*
+ * update crypto node properties to a specified revision of the SEC
+ * called with sec_rev == 0 if not on an mpc8xxxE processor
+ */
+void fdt_fixup_crypto_node(void *blob, int sec_rev)
+{
+   const struct sec_rev_prop {
+   u32 sec_rev;
+   u32 num_channels;
+   u32 channel_fifo_len;
+   u32 exec_units_mask;
+   u32 descriptor_types_mask;
+   } sec_rev_prop_list [] = {
+   { 0x0200, 4, 24, 0x07e, 0x01010ebf }, /* SEC 2.0 */
+   { 0x0201, 4, 24, 0x0fe, 0x012b0ebf }, /* SEC 2.1 */
+   { 0x0202, 1, 24, 0x04c, 0x0122003f }, /* SEC 2.2 */
+   { 0x0204, 4, 24, 0x07e, 0x012b0ebf }, /* SEC 2.4 */
+   { 0x0300, 4, 24, 0x9fe, 0x03ab0ebf }, /* SEC 3.0 */
+   { 0x0303, 4, 24, 0x97c, 0x03ab0abf }, /* SEC 3.3 */
+   };
+   char compat_strlist[ARRAY_SIZE(sec_rev_prop_list) *
+   sizeof(fsl,secX.Y)];
+   int crypto_node, sec_idx, err;
+   char *p;
+   u32 val;
+
+   /* locate crypto node based on lowest common compatible */
+   crypto_node = fdt_node_offset_by_compatible(blob, -1, fsl,sec2.0);
+   if (crypto_node == -FDT_ERR_NOTFOUND)
+   return;
+
+   /* delete it if not on an E-processor */
+   if (crypto_node  0  !sec_rev) {
+   fdt_del_node(blob, crypto_node);
+   return;
+   }
+
+   /* else we got called for possible uprev */
+   for (sec_idx = 0; sec_idx  ARRAY_SIZE(sec_rev_prop_list); sec_idx++)
+   if (sec_rev_prop_list[sec_idx].sec_rev == sec_rev)
+   break;
+
+   if (sec_idx == ARRAY_SIZE(sec_rev_prop_list)) {
+   puts(warning: unknown SEC revision number\n);
+   return;
+   }
+
+   val = cpu_to_fdt32(sec_rev_prop_list[sec_idx].num_channels);
+   err = fdt_setprop(blob, crypto_node, fsl,num-channels, val, 4);
+   if (err  0)
+   printf(WARNING: could not set crypto property: %s\n,
+  fdt_strerror(err));
+
+   val = cpu_to_fdt32(sec_rev_prop_list[sec_idx].descriptor_types_mask);
+   err = fdt_setprop(blob, crypto_node, fsl,descriptor-types-mask, val, 
4);
+   if (err  0)
+   printf(WARNING: could not set crypto property: %s\n,
+  fdt_strerror(err));
+
+   val = cpu_to_fdt32(sec_rev_prop_list[sec_idx].exec_units_mask);
+   err = fdt_setprop(blob, crypto_node, fsl,exec-units-mask, val, 4);
+   if (err  0)
+   printf(WARNING: could not set crypto property: %s\n,
+  fdt_strerror(err));
+
+   val = cpu_to_fdt32(sec_rev_prop_list[sec_idx].channel_fifo_len);
+   err = fdt_setprop(blob, crypto_node, fsl,channel-fifo-len, val, 4);
+   if (err  0)
+   printf(WARNING: could not set crypto property: %s\n,
+  fdt_strerror(err));
+
+   val = 0;
+   while (sec_idx = 0) {
+   p = compat_strlist + val;
+   val += sprintf(p, fsl,sec%d.%d,
+   (sec_rev_prop_list[sec_idx].sec_rev  0xff00)  8,
+   sec_rev_prop_list[sec_idx].sec_rev  0x00ff);
+   sec_idx--;
+   }
+   err = fdt_setprop(blob, crypto_node, compatible, compat_strlist, 
val);
+   if (err  0)
+   printf(WARNING: could not set crypto property: %s\n,
+  fdt_strerror(err));
+}
+#endif /* defined(CONFIG_MPC83XX) || defined(CONFIG_MPC85xx) */
diff --git a/cpu/mpc83xx/fdt.c b/cpu/mpc83xx/fdt.c
index 02c4d05..267ae6a 100644
--- a/cpu/mpc83xx/fdt.c
+++ b/cpu/mpc83xx/fdt.c
@@ -26,6 +26,7 @@
 #include common.h
 #include libfdt.h
 #include fdt_support.h
+#include asm/processor.h
 
 extern void ft_qe_setup(void *blob);
 
@@ -33,6 +34,23 @@ DECLARE_GLOBAL_DATA_PTR;
 
 void ft_cpu_setup(void *blob, bd_t *bd)
 {
+   immap_t *immr = (immap_t *)CFG_IMMR;
+   int spridr = immr-sysconf.spridr;
+
+   /*
+* delete crypto node if not on an E-processor

[U-Boot-Users] [PATCH 4/4] Change lmb to use phys_size_t/phys_addr_t

2008-06-09 Thread Becky Bruce
This updates the lmb code to use phys_size_t
and phys_addr_t instead of unsigned long.  Other code
which interacts with this code, like getenv_bootm_size()
is also updated.

Booted on MPC8641HPCN, build-tested ppc, arm, mips.

Signed-off-by: Becky Bruce [EMAIL PROTECTED]
---
 common/cmd_bootm.c |5 ++-
 common/image.c |   17 
 include/image.h|2 +-
 include/lmb.h  |   22 +---
 lib_generic/lmb.c  |   69 ++-
 lib_ppc/bootm.c|   16 +++-
 6 files changed, 71 insertions(+), 60 deletions(-)

diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index 0d67132..959689e 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -127,7 +127,8 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char 
*argv[])
ulong   os_data, os_len;
ulong   image_start, image_end;
ulong   load_start, load_end;
-   ulong   mem_start, mem_size;
+   ulong   mem_start;
+   phys_size_t mem_size;
 
struct lmb lmb;
 
@@ -141,7 +142,7 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char 
*argv[])
mem_start = getenv_bootm_low();
mem_size = getenv_bootm_size();
 
-   lmb_add(lmb, mem_start, mem_size);
+   lmb_add(lmb, (phys_addr_t)mem_start, mem_size);
 
board_lmb_reserve(lmb);
 
diff --git a/common/image.c b/common/image.c
index 9188024..ddd9e8b 100644
--- a/common/image.c
+++ b/common/image.c
@@ -435,11 +435,16 @@ ulong getenv_bootm_low(void)
 #endif
 }
 
-ulong getenv_bootm_size(void)
+phys_size_t getenv_bootm_size(void)
 {
char *s = getenv (bootm_size);
if (s) {
-   ulong tmp = simple_strtoul (s, NULL, 16);
+   phys_size_t tmp;
+#ifdef CFG_64BIT_STRTOUL
+   tmp = (phys_size_t)simple_strtoull (s, NULL, 16);
+#else
+   tmp = (phys_size_t)simple_strtoul (s, NULL, 16);
+#endif
return tmp;
}
 
@@ -1034,9 +1039,9 @@ int boot_ramdisk_high (struct lmb *lmb, ulong rd_data, 
ulong rd_len,
lmb_reserve(lmb, rd_data, rd_len);
} else {
if (initrd_high)
-   *initrd_start = lmb_alloc_base (lmb, rd_len, 
0x1000, initrd_high);
+   *initrd_start = (ulong)lmb_alloc_base (lmb, 
rd_len, 0x1000, initrd_high);
else
-   *initrd_start = lmb_alloc (lmb, rd_len, 0x1000);
+   *initrd_start = (ulong)lmb_alloc (lmb, rd_len, 
0x1000);
 
if (*initrd_start == 0) {
puts (ramdisk - allocation error\n);
@@ -1089,7 +1094,7 @@ int boot_get_cmdline (struct lmb *lmb, ulong *cmd_start, 
ulong *cmd_end,
char *cmdline;
char *s;
 
-   cmdline = (char *)lmb_alloc_base(lmb, CFG_BARGSIZE, 0xf,
+   cmdline = (char *)(ulong)lmb_alloc_base(lmb, CFG_BARGSIZE, 0xf,
 CFG_BOOTMAPSZ + bootmap_base);
 
if (cmdline == NULL)
@@ -1125,7 +1130,7 @@ int boot_get_cmdline (struct lmb *lmb, ulong *cmd_start, 
ulong *cmd_end,
  */
 int boot_get_kbd (struct lmb *lmb, bd_t **kbd, ulong bootmap_base)
 {
-   *kbd = (bd_t *)lmb_alloc_base(lmb, sizeof(bd_t), 0xf,
+   *kbd = (bd_t *)(ulong)lmb_alloc_base(lmb, sizeof(bd_t), 0xf,
  CFG_BOOTMAPSZ + bootmap_base);
if (*kbd == NULL)
return -1;
diff --git a/include/image.h b/include/image.h
index 664e51e..46138fa 100644
--- a/include/image.h
+++ b/include/image.h
@@ -379,7 +379,7 @@ int image_check_dcrc (image_header_t *hdr);
 #ifndef USE_HOSTCC
 int getenv_yesno (char *var);
 ulong getenv_bootm_low(void);
-ulong getenv_bootm_size(void);
+phys_size_t getenv_bootm_size(void);
 void memmove_wd (void *to, void *from, size_t len, ulong chunksz);
 #endif
 
diff --git a/include/lmb.h b/include/lmb.h
index cc64cbb..03d7667 100644
--- a/include/lmb.h
+++ b/include/lmb.h
@@ -17,13 +17,13 @@
 #define MAX_LMB_REGIONS 8
 
 struct lmb_property {
-   ulong base;
-   ulong size;
+   phys_addr_t base;
+   phys_size_t size;
 };
 
 struct lmb_region {
unsigned long cnt;
-   ulong size;
+   phys_size_t size;
struct lmb_property region[MAX_LMB_REGIONS+1];
 };
 
@@ -35,16 +35,18 @@ struct lmb {
 extern struct lmb lmb;
 
 extern void lmb_init(struct lmb *lmb);
-extern long lmb_add(struct lmb *lmb, ulong base, ulong size);
-extern long lmb_reserve(struct lmb *lmb, ulong base, ulong size);
-extern ulong lmb_alloc(struct lmb *lmb, ulong size, ulong align);
-extern ulong lmb_alloc_base(struct lmb *lmb, ulong size, ulong align, ulong 
max_addr);
-extern ulong __lmb_alloc_base(struct lmb *lmb, ulong size, ulong align, ulong 
max_addr);
-extern int lmb_is_reserved(struct lmb *lmb, ulong addr);
+extern long lmb_add(struct lmb *lmb, phys_addr_t base, 

[U-Boot-Users] [PATCH 1/4] Change initdram() return type to phys_size_t

2008-06-09 Thread Becky Bruce
This patch changes the return type of initdram() from long int to phys_size_t.
This is required for a couple of reasons: long int limits the amount of dram
to 2GB, and u-boot in general is moving over to phys_size_t to represent the
size of physical memory.  phys_size_t is defined as an unsigned long on almost
all current platforms.

This patch *only* changes the return type of the initdram function (in
include/common.h, as well as in each board's implementation of initdram).  It
does not actually modify the code inside the function on any of the platforms;
platforms which wish to support more than 2GB of DRAM will need to modify
their initdram() function code.

Build tested with MAKEALL for ppc, arm, mips, mips-el. Booted on powerpc
MPC8641HPCN.

Patch is too large for the list, and is located at:
http://gate.crashing.org/~galak/0001-Change-initdram-return-type-to-phys_size_t.patch


-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] [PATCH] SPI Flash: Support the ST Microelectronics M25P80 and M25P40 SPI Flash

2008-06-09 Thread Jason McMullan
This commit adds MTD support for the M25P80 (1Mx8) and the M25P40 (512kx8)
SPI Flash components from ST Microelectronics.

Tested with the M25P40, but should work for the M25P80 according
to the spec sheet.

Signed-off-by: Jason McMullan [EMAIL PROTECTED]
---
 drivers/mtd/spi/Makefile |1 +
 drivers/mtd/spi/spi_flash.c  |5 +
 drivers/mtd/spi/spi_flash_internal.h |1 +
 drivers/mtd/spi/stmicro.c|  326 ++
 4 files changed, 333 insertions(+), 0 deletions(-)
 create mode 100644 drivers/mtd/spi/stmicro.c

diff --git a/drivers/mtd/spi/Makefile b/drivers/mtd/spi/Makefile
index af6af97..01b288a 100644
--- a/drivers/mtd/spi/Makefile
+++ b/drivers/mtd/spi/Makefile
@@ -27,6 +27,7 @@ LIB   := $(obj)libspi_flash.a
 
 COBJS-$(CONFIG_SPI_FLASH)  += spi_flash.o
 COBJS-$(CONFIG_SPI_FLASH_ATMEL)+= atmel.o
+COBJS-$(CONFIG_SPI_FLASH_STMICRO) += stmicro.o
 
 COBJS  := $(COBJS-y)
 SRCS   := $(COBJS:.o=.c)
diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
index d581cb3..dd4d130 100644
--- a/drivers/mtd/spi/spi_flash.c
+++ b/drivers/mtd/spi/spi_flash.c
@@ -134,6 +134,11 @@ struct spi_flash *spi_flash_probe(unsigned int bus, 
unsigned int cs,
flash = spi_flash_probe_atmel(spi, idcode);
break;
 #endif
+#ifdef CONFIG_SPI_FLASH_STMICRO
+   case 0xff:
+   flash = spi_flash_probe_stmicro(spi, idcode);
+   break;
+#endif
default:
debug(SF: Unsupported manufacturer %02X\n, idcode[0]);
flash = NULL;
diff --git a/drivers/mtd/spi/spi_flash_internal.h 
b/drivers/mtd/spi/spi_flash_internal.h
index 1438050..e5f758e 100644
--- a/drivers/mtd/spi/spi_flash_internal.h
+++ b/drivers/mtd/spi/spi_flash_internal.h
@@ -43,3 +43,4 @@ int spi_flash_read_common(struct spi_flash *flash, const u8 
*cmd,
 /* Manufacturer-specific probe functions */
 struct spi_flash *spi_flash_probe_spansion(struct spi_slave *spi, u8 *idcode);
 struct spi_flash *spi_flash_probe_atmel(struct spi_slave *spi, u8 *idcode);
+struct spi_flash *spi_flash_probe_stmicro(struct spi_slave *spi, u8 *idcode);
diff --git a/drivers/mtd/spi/stmicro.c b/drivers/mtd/spi/stmicro.c
new file mode 100644
index 000..cb5a971
--- /dev/null
+++ b/drivers/mtd/spi/stmicro.c
@@ -0,0 +1,326 @@
+/*
+ * $Id$
+ *
+ * Copyright 2008, Network Appliance Inc.
+ * Author: Jason McMullan [EMAIL PROTECTED]
+ *
+ */
+
+#include common.h
+#include malloc.h
+#include spi_flash.h
+
+#include spi_flash_internal.h
+
+/* M25Pxx-specific commands */
+#define CMD_M25PXX_WREN0x06/* Write Enable */
+#define CMD_M25PXX_WRDI0x04/* Write Disable */
+#define CMD_M25PXX_RDSR0x05/* Read Status Register */
+#define CMD_M25PXX_WRSR0x01/* Write Status Register */
+#define CMD_M25PXX_READ0x03/* Read Data Bytes */
+#define CMD_M25PXX_FAST_READ   0x0b/* Read Data Bytes at Higher Speed */
+#define CMD_M25PXX_PP  0x02/* Page Program */
+#define CMD_M25PXX_SE  0xd8/* Sector Erase */
+#define CMD_M25PXX_BE  0xc7/* Bulk Erase */
+#define CMD_M25PXX_DP  0xb9/* Deep Power-down */
+#define CMD_M25PXX_RES 0xab/* Release from DP, and Read Signature 
*/
+
+#define STM_ID_M25P40  0x12
+#define STM_ID_M25P80  0x13
+
+#define STMICRO_SR_WIP (1  0)/* Write-in-Progress */
+
+struct stmicro_spi_flash_params {
+   uint8_t idcode1;
+   uint8_t esig;
+   /* Log2 of page size in power-of-two mode */
+   uint8_t l2_page_size;
+   uint16_tpages_per_sector;
+   uint8_t nr_sectors;
+   const char  *name;
+};
+
+struct stmicro_spi_flash {
+   const struct stmicro_spi_flash_params *params;
+   struct spi_flash flash;
+};
+
+static inline struct stmicro_spi_flash *
+to_stmicro_spi_flash(struct spi_flash *flash)
+{
+   return container_of(flash, struct stmicro_spi_flash, flash);
+}
+
+static const struct stmicro_spi_flash_params stmicro_spi_flash_table[] = {
+   {
+   .idcode1= 0xff,
+   .esig   = STM_ID_M25P40,
+   .l2_page_size   = 8,
+   .pages_per_sector   = 256,
+   .nr_sectors = 8,
+   .name   = M25P40,
+   },
+   {
+   .idcode1= 0xff,
+   .esig   = STM_ID_M25P80,
+   .l2_page_size   = 8,
+   .pages_per_sector   = 256,
+   .nr_sectors = 16,
+   .name   = M25P80,
+   },
+};
+
+static int stmicro_wait_ready(struct spi_flash *flash, unsigned long timeout)
+{
+   struct spi_slave *spi = flash-spi;
+   unsigned long timebase;
+   int ret;
+   u8 status;
+   u8 

[U-Boot-Users] [PATCH v2] FSL LAW: Keep track of LAW allocations and provide a LAW allocator

2008-06-09 Thread Kumar Gala
Make it so we keep track of which LAWs have allocated and provide
a function (set_next_law) which can allocate a LAW for us if one is
free.

In the future we will move to doing more dynamic LAW allocation
since the majority of users dont really care about what LAW number
they are at.

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

Missed 8568 in the list the first time around.  Also removed CLEAR_LAW support
completely.

 cpu/mpc85xx/cpu_init.c|   23 +---
 drivers/misc/fsl_law.c|   46 ++--
 include/asm-ppc/fsl_law.h |4 +++
 include/asm-ppc/global_data.h |3 ++
 lib_ppc/board.c   |3 +-
 5 files changed, 54 insertions(+), 25 deletions(-)

diff --git a/cpu/mpc85xx/cpu_init.c b/cpu/mpc85xx/cpu_init.c
index e3240b5..f7a3129 100644
--- a/cpu/mpc85xx/cpu_init.c
+++ b/cpu/mpc85xx/cpu_init.c
@@ -148,6 +148,12 @@ void cpu_init_early_f(void)
}
 #endif

+   /* Pointer is writable since we allocated a register for it */
+   gd = (gd_t *) (CFG_INIT_RAM_ADDR + CFG_GBL_DATA_OFFSET);
+
+   /* Clear initial global data */
+   memset ((void *) gd, 0, sizeof (gd_t));
+
init_laws();
invalidate_tlb(0);
init_tlbs();
@@ -168,12 +174,6 @@ void cpu_init_f (void)
disable_tlb(14);
disable_tlb(15);

-   /* Pointer is writable since we allocated a register for it */
-   gd = (gd_t *) (CFG_INIT_RAM_ADDR + CFG_GBL_DATA_OFFSET);
-
-   /* Clear initial global data */
-   memset ((void *) gd, 0, sizeof (gd_t));
-
 #ifdef CONFIG_CPM2
config_8560_ioports((ccsr_cpm_t *)CFG_MPC85xx_CPM_ADDR);
 #endif
@@ -254,17 +254,6 @@ void cpu_init_f (void)

 int cpu_init_r(void)
 {
-#ifdef CONFIG_CLEAR_LAW0
-#ifdef CONFIG_FSL_LAW
-   disable_law(0);
-#else
-   volatile ccsr_local_ecm_t *ecm = (void *)(CFG_MPC85xx_ECM_ADDR);
-
-   /* clear alternate boot location LAW (used for sdram, or ddr bank) */
-   ecm-lawar0 = 0;
-#endif
-#endif
-
 #if defined(CONFIG_L2_CACHE)
volatile ccsr_l2cache_t *l2cache = (void *)CFG_MPC85xx_L2_ADDR;
volatile uint cache_ctl;
diff --git a/drivers/misc/fsl_law.c b/drivers/misc/fsl_law.c
index dca6a4d..d7d6c40 100644
--- a/drivers/misc/fsl_law.c
+++ b/drivers/misc/fsl_law.c
@@ -27,8 +27,22 @@
 #include asm/fsl_law.h
 #include asm/io.h

+DECLARE_GLOBAL_DATA_PTR;
+
 #define LAWAR_EN   0x8000
-#define FSL_HW_NUM_LAWS 10 /* number of LAWs in the hw implementation */
+/* number of LAWs in the hw implementation */
+#if defined(CONFIG_MPC8540) || defined(CONFIG_MPC8541) || \
+defined(CONFIG_MPC8560) || defined(CONFIG_MPC8555)
+#define FSL_HW_NUM_LAWS 8
+#elif defined(CONFIG_MPC8548) || defined(CONFIG_MPC8544) || \
+  defined(CONFIG_MPC8568) || \
+  defined(CONFIG_MPC8641) || defined(CONFIG_MPC8610)
+#define FSL_HW_NUM_LAWS 10
+#elif defined(CONFIG_MPC8572)
+#define FSL_HW_NUM_LAWS 12
+#else
+#error FSL_HW_NUM_LAWS not defined for this platform
+#endif

 void set_law(u8 idx, phys_addr_t addr, enum law_size sz, enum law_trgt_if id)
 {
@@ -36,18 +50,34 @@ void set_law(u8 idx, phys_addr_t addr, enum law_size sz, 
enum law_trgt_if id)
volatile u32 *lawbar = base + 8 * idx;
volatile u32 *lawar = base + 8 * idx + 2;

+   gd-used_laws |= (1  idx);
+
out_be32(lawbar, addr  12);
out_be32(lawar, LAWAR_EN | ((u32)id  20) | (u32)sz);

return ;
 }

+int set_next_law(phys_addr_t addr, enum law_size sz, enum law_trgt_if id)
+{
+   u32 idx = ffz(gd-used_laws);
+
+   if (idx = FSL_HW_NUM_LAWS)
+   return -1;
+
+   set_law(idx, addr, sz, id);
+
+   return idx;
+}
+
 void disable_law(u8 idx)
 {
volatile u32 *base = (volatile u32 *)(CFG_IMMR + 0xc08);
volatile u32 *lawbar = base + 8 * idx;
volatile u32 *lawar = base + 8 * idx + 2;

+   gd-used_laws = ~(1  idx);
+
out_be32(lawar, 0);
out_be32(lawbar, 0);

@@ -75,14 +105,16 @@ void print_laws(void)
 void init_laws(void)
 {
int i;
-   u8 law_idx = 0;

-   for (i = 0; i  num_law_entries; i++) {
-   if (law_table[i].index != -1)
-   law_idx = law_table[i].index;
+   gd-used_laws = ~((1  FSL_HW_NUM_LAWS) - 1);

-   set_law(law_idx++, law_table[i].addr,
-   law_table[i].size, law_table[i].trgt_id);
+   for (i = 0; i  num_law_entries; i++) {
+   if (law_table[i].index == -1)
+   set_next_law(law_table[i].addr, law_table[i].size,
+   law_table[i].trgt_id);
+   else
+   set_law(law_table[i].index, law_table[i].addr,
+   law_table[i].size, law_table[i].trgt_id);
}

return ;
diff --git a/include/asm-ppc/fsl_law.h b/include/asm-ppc/fsl_law.h
index e955c75..6c445a4 100644
--- a/include/asm-ppc/fsl_law.h
+++ b/include/asm-ppc/fsl_law.h
@@ -6,6 

[U-Boot-Users] [PATCH] 85xx/86xx: Move to dynamic mgmt of LAWs

2008-06-09 Thread Kumar Gala
With the new LAW interface (set_next_law) we can move to letting the
system allocate which LAWs are used for what purpose.  This makes life
a bit easier going forward with the new DDR code.

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

Andy, I know this touches a few 86xx boards, but I'm 99.9% sure jdl will
just ack it so please pick this up.

- k

 board/atum8548/law.c  |   14 +++---
 board/freescale/mpc8540ads/law.c  |   10 +-
 board/freescale/mpc8541cds/law.c  |   10 +-
 board/freescale/mpc8544ds/law.c   |   16 
 board/freescale/mpc8548cds/law.c  |   16 
 board/freescale/mpc8555cds/law.c  |   10 +-
 board/freescale/mpc8560ads/law.c  |   10 +-
 board/freescale/mpc8568mds/law.c  |   12 ++--
 board/freescale/mpc8610hpcd/law.c |   18 +-
 board/freescale/mpc8641hpcn/law.c |   18 +-
 board/mpc8540eval/law.c   |6 +++---
 board/pm854/law.c |   10 +-
 board/pm856/law.c |   10 +-
 board/sbc8548/law.c   |8 
 board/sbc8560/law.c   |6 +++---
 board/sbc8641d/law.c  |   18 +-
 board/socrates/law.c  |   10 +-
 board/stxgp3/law.c|   10 +-
 board/stxssa/law.c|   12 ++--
 board/tqm85xx/law.c   |   10 +-
 cpu/mpc85xx/spd_sdram.c   |2 +-
 cpu/mpc86xx/spd_sdram.c   |6 +++---
 22 files changed, 121 insertions(+), 121 deletions(-)

diff --git a/board/atum8548/law.c b/board/atum8548/law.c
index 3606cbb..b66fd7b 100644
--- a/board/atum8548/law.c
+++ b/board/atum8548/law.c
@@ -48,14 +48,14 @@
  */

 struct law_entry law_table[] = {
-   SET_LAW_ENTRY(2, CFG_PCI1_MEM_PHYS, LAW_SIZE_512M, LAW_TRGT_IF_PCI_1),
-   SET_LAW_ENTRY(3, CFG_PCI1_IO_PHYS, LAWAR_SIZE_1M, LAW_TRGT_IF_PCI_1),
-   SET_LAW_ENTRY(4, CFG_PCI2_MEM_PHYS, LAW_SIZE_512M, LAW_TRGT_IF_PCI_2),
-   SET_LAW_ENTRY(5, CFG_PCI2_IO_PHYS, LAW_SIZE_1M, LAW_TRGT_IF_PCI_2),
-   SET_LAW_ENTRY(6, CFG_PCIE1_MEM_PHYS, LAW_SIZE_512M, LAW_TRGT_IF_PCIE_1),
-   SET_LAW_ENTRY(7, CFG_PCIE1_IO_PHYS, LAW_SIZE_1M, LAW_TRGT_IF_PCIE_1),
+   SET_LAW(CFG_PCI1_MEM_PHYS, LAW_SIZE_512M, LAW_TRGT_IF_PCI_1),
+   SET_LAW(CFG_PCI1_IO_PHYS, LAWAR_SIZE_1M, LAW_TRGT_IF_PCI_1),
+   SET_LAW(CFG_PCI2_MEM_PHYS, LAW_SIZE_512M, LAW_TRGT_IF_PCI_2),
+   SET_LAW(CFG_PCI2_IO_PHYS, LAW_SIZE_1M, LAW_TRGT_IF_PCI_2),
+   SET_LAW(CFG_PCIE1_MEM_PHYS, LAW_SIZE_512M, LAW_TRGT_IF_PCIE_1),
+   SET_LAW(CFG_PCIE1_IO_PHYS, LAW_SIZE_1M, LAW_TRGT_IF_PCIE_1),
/* LBC window - maps 256M 0xf000 - 0x */
-   SET_LAW_ENTRY(8, CFG_LBC_CACHE_BASE, LAW_SIZE_256M, LAW_TRGT_IF_LBC),
+   SET_LAW(CFG_LBC_CACHE_BASE, LAW_SIZE_256M, LAW_TRGT_IF_LBC),
 };

 int num_law_entries = ARRAY_SIZE(law_table);
diff --git a/board/freescale/mpc8540ads/law.c b/board/freescale/mpc8540ads/law.c
index 785576a..3b8bd05 100644
--- a/board/freescale/mpc8540ads/law.c
+++ b/board/freescale/mpc8540ads/law.c
@@ -46,13 +46,13 @@

 struct law_entry law_table[] = {
 #ifndef CONFIG_SPD_EEPROM
-   SET_LAW_ENTRY(1, CFG_DDR_SDRAM_BASE, LAW_SIZE_128M, LAW_TRGT_IF_DDR),
+   SET_LAW(CFG_DDR_SDRAM_BASE, LAW_SIZE_128M, LAW_TRGT_IF_DDR),
 #endif
-   SET_LAW_ENTRY(2, CFG_PCI1_MEM_PHYS, LAW_SIZE_512M, LAW_TRGT_IF_PCI),
+   SET_LAW(CFG_PCI1_MEM_PHYS, LAW_SIZE_512M, LAW_TRGT_IF_PCI),
/* This is not so much the SDRAM map as it is the whole localbus map. */
-   SET_LAW_ENTRY(3, CFG_LBC_SDRAM_BASE, LAW_SIZE_256M, LAW_TRGT_IF_LBC),
-   SET_LAW_ENTRY(4, CFG_PCI1_IO_PHYS, LAW_SIZE_1M, LAW_TRGT_IF_PCI),
-   SET_LAW_ENTRY(5, CFG_RIO_MEM_BASE, LAWAR_SIZE_512M, LAW_TRGT_IF_RIO),
+   SET_LAW(CFG_LBC_SDRAM_BASE, LAW_SIZE_256M, LAW_TRGT_IF_LBC),
+   SET_LAW(CFG_PCI1_IO_PHYS, LAW_SIZE_1M, LAW_TRGT_IF_PCI),
+   SET_LAW(CFG_RIO_MEM_BASE, LAWAR_SIZE_512M, LAW_TRGT_IF_RIO),
 };

 int num_law_entries = ARRAY_SIZE(law_table);
diff --git a/board/freescale/mpc8541cds/law.c b/board/freescale/mpc8541cds/law.c
index 0ac223c..fbf2bdc 100644
--- a/board/freescale/mpc8541cds/law.c
+++ b/board/freescale/mpc8541cds/law.c
@@ -47,12 +47,12 @@
  */

 struct law_entry law_table[] = {
-   SET_LAW_ENTRY(2, CFG_PCI1_MEM_PHYS, LAW_SIZE_512M, LAW_TRGT_IF_PCI),
-   SET_LAW_ENTRY(3, CFG_PCI2_MEM_PHYS, LAW_SIZE_512M, LAW_TRGT_IF_PCI_2),
-   SET_LAW_ENTRY(4, CFG_PCI1_IO_PHYS, LAW_SIZE_1M, LAW_TRGT_IF_PCI),
-   SET_LAW_ENTRY(5, CFG_PCI2_IO_PHYS, LAW_SIZE_1M, LAW_TRGT_IF_PCI_2),
+   SET_LAW(CFG_PCI1_MEM_PHYS, LAW_SIZE_512M, LAW_TRGT_IF_PCI),
+   SET_LAW(CFG_PCI2_MEM_PHYS, LAW_SIZE_512M, LAW_TRGT_IF_PCI_2),
+   SET_LAW(CFG_PCI1_IO_PHYS, LAW_SIZE_1M, LAW_TRGT_IF_PCI),
+   SET_LAW(CFG_PCI2_IO_PHYS, LAW_SIZE_1M, LAW_TRGT_IF_PCI_2),
/* LBC window - maps 256M 0xf000 - 0x */
-   SET_LAW_ENTRY(6, 

[U-Boot-Users] [PATCH v2] 85xx/86xx: Move to dynamic mgmt of LAWs

2008-06-09 Thread Kumar Gala
With the new LAW interface (set_next_law) we can move to letting the
system allocate which LAWs are used for what purpose.  This makes life
a bit easier going forward with the new DDR code.

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

For some reason we always disabled law0 on 86xx.  Removed that as its
a reasonable LAW to use.

 board/atum8548/law.c  |   14 +++---
 board/freescale/mpc8540ads/law.c  |   10 +-
 board/freescale/mpc8541cds/law.c  |   10 +-
 board/freescale/mpc8544ds/law.c   |   16 
 board/freescale/mpc8548cds/law.c  |   16 
 board/freescale/mpc8555cds/law.c  |   10 +-
 board/freescale/mpc8560ads/law.c  |   10 +-
 board/freescale/mpc8568mds/law.c  |   12 ++--
 board/freescale/mpc8610hpcd/law.c |   18 +-
 board/freescale/mpc8641hpcn/law.c |   18 +-
 board/mpc8540eval/law.c   |6 +++---
 board/pm854/law.c |   10 +-
 board/pm856/law.c |   10 +-
 board/sbc8548/law.c   |8 
 board/sbc8560/law.c   |6 +++---
 board/sbc8641d/law.c  |   18 +-
 board/socrates/law.c  |   10 +-
 board/stxgp3/law.c|   10 +-
 board/stxssa/law.c|   12 ++--
 board/tqm85xx/law.c   |   10 +-
 cpu/mpc85xx/spd_sdram.c   |2 +-
 cpu/mpc86xx/cpu_init.c|3 ---
 cpu/mpc86xx/spd_sdram.c   |6 +++---
 23 files changed, 121 insertions(+), 124 deletions(-)

diff --git a/board/atum8548/law.c b/board/atum8548/law.c
index 3606cbb..b66fd7b 100644
--- a/board/atum8548/law.c
+++ b/board/atum8548/law.c
@@ -48,14 +48,14 @@
  */

 struct law_entry law_table[] = {
-   SET_LAW_ENTRY(2, CFG_PCI1_MEM_PHYS, LAW_SIZE_512M, LAW_TRGT_IF_PCI_1),
-   SET_LAW_ENTRY(3, CFG_PCI1_IO_PHYS, LAWAR_SIZE_1M, LAW_TRGT_IF_PCI_1),
-   SET_LAW_ENTRY(4, CFG_PCI2_MEM_PHYS, LAW_SIZE_512M, LAW_TRGT_IF_PCI_2),
-   SET_LAW_ENTRY(5, CFG_PCI2_IO_PHYS, LAW_SIZE_1M, LAW_TRGT_IF_PCI_2),
-   SET_LAW_ENTRY(6, CFG_PCIE1_MEM_PHYS, LAW_SIZE_512M, LAW_TRGT_IF_PCIE_1),
-   SET_LAW_ENTRY(7, CFG_PCIE1_IO_PHYS, LAW_SIZE_1M, LAW_TRGT_IF_PCIE_1),
+   SET_LAW(CFG_PCI1_MEM_PHYS, LAW_SIZE_512M, LAW_TRGT_IF_PCI_1),
+   SET_LAW(CFG_PCI1_IO_PHYS, LAWAR_SIZE_1M, LAW_TRGT_IF_PCI_1),
+   SET_LAW(CFG_PCI2_MEM_PHYS, LAW_SIZE_512M, LAW_TRGT_IF_PCI_2),
+   SET_LAW(CFG_PCI2_IO_PHYS, LAW_SIZE_1M, LAW_TRGT_IF_PCI_2),
+   SET_LAW(CFG_PCIE1_MEM_PHYS, LAW_SIZE_512M, LAW_TRGT_IF_PCIE_1),
+   SET_LAW(CFG_PCIE1_IO_PHYS, LAW_SIZE_1M, LAW_TRGT_IF_PCIE_1),
/* LBC window - maps 256M 0xf000 - 0x */
-   SET_LAW_ENTRY(8, CFG_LBC_CACHE_BASE, LAW_SIZE_256M, LAW_TRGT_IF_LBC),
+   SET_LAW(CFG_LBC_CACHE_BASE, LAW_SIZE_256M, LAW_TRGT_IF_LBC),
 };

 int num_law_entries = ARRAY_SIZE(law_table);
diff --git a/board/freescale/mpc8540ads/law.c b/board/freescale/mpc8540ads/law.c
index 785576a..3b8bd05 100644
--- a/board/freescale/mpc8540ads/law.c
+++ b/board/freescale/mpc8540ads/law.c
@@ -46,13 +46,13 @@

 struct law_entry law_table[] = {
 #ifndef CONFIG_SPD_EEPROM
-   SET_LAW_ENTRY(1, CFG_DDR_SDRAM_BASE, LAW_SIZE_128M, LAW_TRGT_IF_DDR),
+   SET_LAW(CFG_DDR_SDRAM_BASE, LAW_SIZE_128M, LAW_TRGT_IF_DDR),
 #endif
-   SET_LAW_ENTRY(2, CFG_PCI1_MEM_PHYS, LAW_SIZE_512M, LAW_TRGT_IF_PCI),
+   SET_LAW(CFG_PCI1_MEM_PHYS, LAW_SIZE_512M, LAW_TRGT_IF_PCI),
/* This is not so much the SDRAM map as it is the whole localbus map. */
-   SET_LAW_ENTRY(3, CFG_LBC_SDRAM_BASE, LAW_SIZE_256M, LAW_TRGT_IF_LBC),
-   SET_LAW_ENTRY(4, CFG_PCI1_IO_PHYS, LAW_SIZE_1M, LAW_TRGT_IF_PCI),
-   SET_LAW_ENTRY(5, CFG_RIO_MEM_BASE, LAWAR_SIZE_512M, LAW_TRGT_IF_RIO),
+   SET_LAW(CFG_LBC_SDRAM_BASE, LAW_SIZE_256M, LAW_TRGT_IF_LBC),
+   SET_LAW(CFG_PCI1_IO_PHYS, LAW_SIZE_1M, LAW_TRGT_IF_PCI),
+   SET_LAW(CFG_RIO_MEM_BASE, LAWAR_SIZE_512M, LAW_TRGT_IF_RIO),
 };

 int num_law_entries = ARRAY_SIZE(law_table);
diff --git a/board/freescale/mpc8541cds/law.c b/board/freescale/mpc8541cds/law.c
index 0ac223c..fbf2bdc 100644
--- a/board/freescale/mpc8541cds/law.c
+++ b/board/freescale/mpc8541cds/law.c
@@ -47,12 +47,12 @@
  */

 struct law_entry law_table[] = {
-   SET_LAW_ENTRY(2, CFG_PCI1_MEM_PHYS, LAW_SIZE_512M, LAW_TRGT_IF_PCI),
-   SET_LAW_ENTRY(3, CFG_PCI2_MEM_PHYS, LAW_SIZE_512M, LAW_TRGT_IF_PCI_2),
-   SET_LAW_ENTRY(4, CFG_PCI1_IO_PHYS, LAW_SIZE_1M, LAW_TRGT_IF_PCI),
-   SET_LAW_ENTRY(5, CFG_PCI2_IO_PHYS, LAW_SIZE_1M, LAW_TRGT_IF_PCI_2),
+   SET_LAW(CFG_PCI1_MEM_PHYS, LAW_SIZE_512M, LAW_TRGT_IF_PCI),
+   SET_LAW(CFG_PCI2_MEM_PHYS, LAW_SIZE_512M, LAW_TRGT_IF_PCI_2),
+   SET_LAW(CFG_PCI1_IO_PHYS, LAW_SIZE_1M, LAW_TRGT_IF_PCI),
+   SET_LAW(CFG_PCI2_IO_PHYS, LAW_SIZE_1M, LAW_TRGT_IF_PCI_2),
/* LBC window - maps 256M 0xf000 - 0x */
-  

Re: [U-Boot-Users] [PATCH] 85xx: extended cpu identification

2008-06-09 Thread Kim Phillips
On Thu, 29 May 2008 03:20:08 -0500 (CDT)
Kumar Gala [EMAIL PROTECTED] wrote:

 +struct cpu_type cpu_type_list [] = {
 + CPU_TYPE_ENTRY(8533, 8533, 0),
 + CPU_TYPE_ENTRY(8533, 8533_E, CPU_FTRS_HAS_CRYPTO),
 + CPU_TYPE_ENTRY(8540, 8540, 0),
 + CPU_TYPE_ENTRY(8541, 8541, 0),
 + CPU_TYPE_ENTRY(8541, 8541_E, CPU_FTRS_HAS_CRYPTO),
 + CPU_TYPE_ENTRY(8543, 8543, 0),
 + CPU_TYPE_ENTRY(8543, 8543_E, CPU_FTRS_HAS_CRYPTO),
 + CPU_TYPE_ENTRY(8544, 8544, 0),
 + CPU_TYPE_ENTRY(8544, 8544_E, CPU_FTRS_HAS_CRYPTO),
 + CPU_TYPE_ENTRY(8545, 8545, 0),
 + CPU_TYPE_ENTRY(8545, 8545_E, CPU_FTRS_HAS_CRYPTO),
 + CPU_TYPE_ENTRY(8547, 8547_E, CPU_FTRS_HAS_CRYPTO),
 + CPU_TYPE_ENTRY(8548, 8548, 0),
 + CPU_TYPE_ENTRY(8548, 8548_E, CPU_FTRS_HAS_CRYPTO),
 + CPU_TYPE_ENTRY(8555, 8555, 0),
 + CPU_TYPE_ENTRY(8555, 8555_E, CPU_FTRS_HAS_CRYPTO),
 + CPU_TYPE_ENTRY(8560, 8560, 0),
 + CPU_TYPE_ENTRY(8567, 8567, 0),
 + CPU_TYPE_ENTRY(8567, 8567_E, CPU_FTRS_HAS_CRYPTO),
 + CPU_TYPE_ENTRY(8568, 8568, 0),
 + CPU_TYPE_ENTRY(8568, 8568_E, CPU_FTRS_HAS_CRYPTO),
 + CPU_TYPE_ENTRY(8572, 8572, 0),
 + CPU_TYPE_ENTRY(8572, 8572_E, CPU_FTRS_HAS_CRYPTO),

this seems like overkill given all we have to do is check one bit (see
IS_E_PROCESSOR macro in handle crypto node patch I just sent out).

Kim

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users