Re: [U-Boot] [PATCH v2 2/3] Fix 2k page size NAND for iMX27

2009-07-17 Thread Eric Bénard
Scott Wood a écrit :
 On Wed, Jul 15, 2009 at 05:18:40PM +0200, Eric Benard wrote:
 +if (pdata-is2k) {
 +host-pagesize_2k = 1;
 +NFMS |= (1  NFMS_BIT);
 +this-badblock_pattern = smallpage_memorybased;
 
 Why are you using the small-page badblock pattern with large pages?
 
that's what Freescale is doing in its Linux BSP and it doesn't work 
without, at least on my board (8 bits width NAND):

if (!this-badblock_pattern) {
if (mtd-writesize == NAND_PAGESIZE_2KB)
this-badblock_pattern = smallpage_memorybased;
else
this-badblock_pattern = (mtd-writesize  512) ?
largepage_memorybased : smallpage_memorybased;
}

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


Re: [U-Boot] USB not working with 4.3.2 gcc compiler in u-boot 1.1.5

2009-07-17 Thread Remy Bohmer
Hello,

2009/7/17 Ben Warren biggerbadder...@gmail.com:
 virupax wrote:
 Hi

 I am using  arm-unknown-linux-gnueabi-gcc 4.3.2 compiler to compile the
 u-boot 1.1.5 for the at91sam9260 board. When i use this u-boot image usb
 start command is not detecting the connected usb stick.
 Request Sense returned 00 00 00
 Device NOT ready
    Request Sense returned 00 00 00

 If use some other old compiler to compile this u-boot, usb works fine in
 that image.

 Some pls guide me what may be the difference.


 Your version of U-boot is about 3 years old.  Nobody will be interested
 in debugging it.  Please update to the latest and see if the problem exists.

This problem is indeed solved about a year ago. It was a problem with
all gcc-4.x ARM compilers that compiled the code badly.
It was solved by refactoring the code a little, such that the compiler
produces correct output. (see the code)

So, indeed: move to the current version. (the at91sam9260-ek board is
supported by mainline, so why do you use this prehistoric version
anyway?)

Kind Regards,

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


[U-Boot] [GIT PULL] Please pull microblaze

2009-07-17 Thread Michal Simek
Hi Wolfgang,

please pull the following changes.

Thanks,
Michal


The following changes since commit bfadb17f69c256196620c32164775f063a59c34f:
  Anton Vorontsov (1):
mpc83xx: MPC837xEMDS: Use hwconfig instead of pci_external_arbiter 
variable

are available in the git repository at:

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

Michal Simek (2):
  microblaze: Removed unused variables
  microblaze: Remove ignored return type for __arch__swab16 function

 include/asm-microblaze/byteorder.h |4 +++-
 lib_microblaze/board.c |4 
 2 files changed, 3 insertions(+), 5 deletions(-)


-- 
Michal Simek, Ing. (M.Eng)
w: www.monstr.eu p: +42-0-721842854
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] ppc: Fix compile error for boards with CONFIG_DDR_ECC

2009-07-17 Thread Stefan Roese
On Wednesday 15 July 2009 07:01:08 Peter Tyser wrote:
 A bug was introduced by commit e94e460c6e8741f42dab6d8dd4b596ba5d9d79ae
 which affected non-MPC83xx/85xx/86xx ppc boards which had CONFIG_DDR_ECC
 defined and resulted in errors such as:

 Configuring for canyonlands board...
 fsl_dma.c:50:2: error: #error Freescale DMA engine not supported on your
 processor
 make[1]: *** No rule to make target `.depend', needed by `libdma.a'.  Stop.

 Signed-off-by: Peter Tyser pty...@xes-inc.com

Thanks Peter.

Wolfgang, I suggest that you pull this patch directly so that the breakage is 
fixed.

Thanks.

Best regards,
Stefan

=
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: off...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] No reply to USB related questions

2009-07-17 Thread Dushara Jayasinghe
Hi,

I've posted a few questions to the list for which I didn't get any response. 

http://www.mail-archive.com/u-boot@lists.denx.de/msg17801.html

Please let me know if I'm breaking in ML rules and I'll change my evil ways :-)

Thanks,

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


Re: [U-Boot] [PATCH] Refresh LZMA-lib to 4.65

2009-07-17 Thread rhabarber1848
Wolfgang Denk w...@denx.de wrote in
news:20090716211129.e9241832e...@gemini.denx.de: 

 Maybe lzmaBuffToBuffDecompress() stores an incorrect value in unc_len?

Hi,

this is correct, the unpatched version of lib_generic/lzma/LzmaTools.c
has this code in line 137:

*uncompressedSize = outProcessed;


I added the same code to the lzma465 patch and it works for me:

--- u-boot-2009.06.org/lib_generic/lzma/LzmaTools.c 2009-07-17 
08:12:52.0 +0200
+++ u-boot-2009.06/lib_generic/lzma/LzmaTools.c 2009-07-17 
08:15:37.0 +0200
@@ -116,6 +117,7 @@
 outStream, outProcessed,
 inStream + LZMA_DATA_OFFSET, compressedSize,
 inStream, LZMA_PROPS_SIZE, LZMA_FINISH_ANY, state, g_Alloc);
+*uncompressedSize = outProcessed;
 if (res != SZ_OK)  {
 return res;
 }


Attached you will find a patch which also includes the watchdog stuff I 
need along with the formentioned patch. I do not know if all 
WATCHDOG_RESET() calls are really necessary but I have a 66 MHz CPU here 
which takes 12s to decompress a 550kb LZMA-compressed kernel.

Cheers, rhabarber1848

=ybegin line=128 size=3334 name=u-boot-2009.06_lzma_watchdog.diff
Ž“JWŸxœJŸWŒ™™žW\ZZcXZ`X™œ‘Y–“Œ‰‘˜œ“Y–¤—‹Yv¤—‹nXJŸWŒ™™žW\ZZcXZ`Y–“Œ‰‘˜œ“Y–¤—‹Yv¤—‹nX4WWWJŸWŒ™™žW\ZZcXZ`X™œ‘Y–“Œ‰‘˜
œ“Y–¤—‹Yv¤—‹nX3\ZZcWZaW[aJZbd[\d_\XZJUZ\ZZ4UUUJŸWŒ™™žW\ZZcXZ`Y–“Œ‰‘˜œ“Y–¤—‹Yv¤—‹nX3\ZZcWZaW[aJZbd[]d\_XZZ
ZZZJUZ\ZZ4jjJW[V`JU[VcJjj4JYTJv¤—‹nXJWWJv„wkJn™Žœ4J\ZZbW[[WZ`JdJs‘™œJz‹ –™ JdJzŸŒ–“JŽ™—‹“˜JTY4J4UM“˜–ŸŽJf™˜“‘X’h4UM“˜
–ŸŽJf™——™˜X’h4UM“˜–ŸŽJf¡‹ž’Ž™‘X’h4JM“˜–ŸŽJLv¤—‹nX’L4J4JM“˜–ŸŽJfžœ“˜‘X’h4jjJW[_`V`JU[_cVcJjj4JJJs˜ž]\Jœ‹˜‘JgJšWhœ‹
˜‘e4JJJs˜ž]\J™ŽJgJšWh™Že4J4UM“JŽ“˜ŽRmyxpsq‰r‰k~mrnyqSJ¦¦JŽ“˜ŽRmyxpsq‰k~mrnyqS4U3k~mrnyq‰|o}o~RSe4UM˜Ž“4JJJŽ™4
JJJ¥4Jmv¤—‹zœ™ŒJTšœ™Œe4jjJW[a`V`JU[b\VcJjj4JJJ“JRž‹žJfJ•xŸ—v“ž}ž‹žS4JJJ¥4J£—Œ™–JgJ[e4UM“JŽ“˜ŽRmyxp
sq‰r‰k~mrnyqSJ¦¦JŽ“˜ŽRmyxpsq‰k~mrnyqS4U3k~mrnyq‰|o}o~RSe4UM˜Ž“4JŽ™J¥Jqo~‰ls~Ršœ™ŒJUJ£—Œ™–VJ£—Œ™–SJ§J¡’“–JR£
—Œ™–JfJZ¢[ZZSe4JJJ§4JJJ–4jjJW[b]V`JU[c\VcJjj4JŸ˜“‘˜ŽJ—‹ž’l£žJgJšWhŽ“…RŽ“z™JWJœšZSJUJRRŽ“z™JfJœšZSJ
iJŽ“lŸ}“¤JdJZS‡e4JŸ˜“‘˜ŽJ™JgJZ¢[ZZe4J£—Œ™–JgJ[e4UM“JŽ“˜ŽRmyxpsq‰r‰k~mrnyqSJ¦¦JŽ“˜ŽRmyxpsq‰k~m
rnyqS4U3k~mrnyq‰|o}o~RSe4UM˜Ž“4JŽ™4J¥4JJJŸ˜“‘˜ŽJŒ“že4jjJW][`V`JU]\bVcJjj4J¥4JJJ
s˜ž]\J—‹•JgJ[e4JJJŸ˜“‘˜ŽJ“JgJ[e4UM“JŽ“˜ŽRmyxpsq‰r‰k~mrnyqSJ¦¦JŽ“˜ŽRmyxpsq‰k~mrnyqS4U3k~mrnyq‰|o}o
~RSe4UM˜Ž“4JJJŽ™4JJJ¥4Jqo~‰ls~\Ršœ™ŒJUJ“VJ“VJeJVJŽ“ž‹˜J¦gJ—‹•Se4jjJW]\aV`JU]^\VcJj
j4JJJ–4JJJ¥4J˜Ÿ—n“œžl“žJWgJ•xŸ—k–“‘˜l“že4UM“JŽ“˜ŽRmyxpsq‰r‰k~mrnyqSJ¦¦JŽ“˜ŽRmyxpsq‰
k~mrnyqS4U3k~mrnyq‰|o}o~RSe4UM˜Ž“4JŽ™4J¥4JJJxy|wkvs„o4jjJW]ccV[\JU^[aV[bJjj4JJJšž
œŽ“‰žJœJgJRšžœŽ“‰žSš™JWJRšžœŽ“‰žSŽ“z™e4JJJ™˜žJl£žJT–“—JgJŽžJUJŸœv˜e4JJJŽ“z™JUgJŸœv˜e4UM“J
Ž“˜ŽRmyxpsq‰r‰k~mrnyqSJ¦¦JŽ“˜ŽRmyxpsq‰k~mrnyqS4U3k~mrnyq‰|o}o~RSe4UM˜Ž“4JJJŽ™4JTRŽžSJgJRl£žST
RŽžJUJœSe4JJJ¡’“–JRUUŽžJKgJ–“—Se4J§4J–4J¥4UM“JŽ“˜ŽRmyxpsq‰r‰k~mrnyqSJ¦¦JŽ“˜ŽR
myxpsq‰k~mrnyqS4U3k~mrnyq‰|o}o~RSe4UM˜Ž“4JJJŽ™4JJJ¥4JŽ“…Ž“z™UU‡JgJŽ“…š™‡e4jjJW^[aV`JU^^[VcJ
jj4J§4JJJ§4JJJ¡’“–JRŽ“z™JfJ–“—“žJPPJŒŸJfJŒŸv“—“žSe4UM“JŽ“˜ŽRmyxpsq‰r‰k~mrnyqSJ¦¦JŽ“˜ŽRmyxpsq‰k~mrnyqS4U3k~mr
nyq‰|o}o~RSe4UM˜Ž“4JJJxy|wkvs„oe4JJJšWhŒŸJgJŒŸe4JJJšWhœ‹˜‘JgJœ‹˜‘e4Ž“JWŸxœJŸWŒ™™žW\ZZcXZ`X™œ‘Y–“Œ‰‘˜œ“Y–¤—‹Yv¤—‹~™™–
XJŸWŒ™™žW\ZZcXZ`Y–“Œ‰‘˜œ“Y–¤—‹Yv¤—‹~™™–X4WWWJŸWŒ™™žW\ZZcXZ`X™œ‘Y–“Œ‰‘˜œ“Y–¤—‹Yv¤—‹~™™–X3\ZZcWZaW[aJZbd[\d_\XZ
JUZ\ZZ4UUUJŸWŒ™™žW\ZZcXZ`Y–“Œ‰‘˜œ“Y–¤—‹Yv¤—‹~™™–X3\ZZcWZaW[aJZbd[]d]^XZJUZ\ZZ4jjJW]`V`JU]`VaJjj4J4JM“˜–ŸŽJf™˜“‘
X’h4JM“˜–ŸŽJf™——™˜X’h4UM“˜–ŸŽJf¡‹ž’Ž™‘X’h4J4JM“ŽJmyxpsq‰v„wk4J4jjJW[[\V[ZJU[[]V[^Jjj4J4JYTJn™—šœJTY4J™Ÿžzœ
™ŽJgJ™Ÿž}“¤pŸ––e4UM“JŽ“˜ŽRmyxpsq‰r‰k~mrnyqSJ¦¦JŽ“˜ŽRmyxpsq‰k~mrnyqS4U3k~mrnyq‰|o}o~RSe4UM˜Ž“4JœJgJv¤—‹n
™ŽR4J™Ÿž}žœ‹—VJP™Ÿžzœ™ŽV4J“˜}žœ‹—JUJv„wk‰nk~k‰ypp}o~VJP™—šœŽ}“¤V4J“˜}žœ‹—VJv„wk‰z|yz}‰}
s„oVJv„wk‰psxs}r‰kxƒVJPž‹žVJP‘‰k––™Se4UTŸ˜™—šœŽ}“¤JgJ™Ÿžzœ™Že4J“JRœJKgJ}„‰yuSJJ¥4JœžŸœ˜Jœe4J
§4
=yend size=3369 crc32=ba1b8df2

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


[U-Boot] [PATCH] Add warning about upcoming removal of old Ethernet API

2009-07-17 Thread Ben Warren
Signed-off-by: Ben Warren biggerbadder...@gmail.com
---
 net/eth.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/net/eth.c b/net/eth.c
index 3d93966..8e1d692 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -500,6 +500,8 @@ char *eth_get_name (void)
 }
 #elif defined(CONFIG_CMD_NET)  !defined(CONFIG_NET_MULTI)
 
+#warning Ethernet driver is deprecated.  Please update to use CONFIG_NET_MULTI
+
 extern int at91rm9200_miiphy_initialize(bd_t *bis);
 extern int mcf52x2_miiphy_initialize(bd_t *bis);
 extern int ns7520_miiphy_initialize(bd_t *bis);
-- 
1.5.6.3

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


Re: [U-Boot] No reply to USB related questions

2009-07-17 Thread Michael Trimarchi
Hi,

Dushara Jayasinghe wrote:
 Hi,

 I've posted a few questions to the list for which I didn't get any response. 

 http://www.mail-archive.com/u-boot@lists.denx.de/msg17801.html

 Please let me know if I'm breaking in ML rules and I'll change my evil ways 
 :-)
   
I think that you can remove it, but I will take a look in linux code 
that there is some
justification of that code.
Michael
 Thanks,

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

   

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


Re: [U-Boot] No reply to USB related questions

2009-07-17 Thread Matthias Fuchs
Hi Dushara,

you posted your question just seven hours ago!
A huge part of the u-boot community is typically
in bed at the time you posted. Not everybody is in your timezone.
I wrote this email within the first 20 mintues after I
arrived at my desk this morning.

Perhaps we should introduce a u-boot callcenter :-)

So you should wait some more time. I think your observation
is interesting enough that someone will take care about it.

If you want to speed things up you could (and should) provide some more 
information (architecture/board, USB controller type, performance 
result with/without wait_ms) and even a patch to remove the delay 
for testing would be fine.

Matthias

On Friday 17 July 2009 08:52, Dushara Jayasinghe wrote:
 Hi,
 
 I've posted a few questions to the list for which I didn't get any response. 
 
 http://www.mail-archive.com/u-boot@lists.denx.de/msg17801.html
 
 Please let me know if I'm breaking in ML rules and I'll change my evil ways 
 :-)
 
 Thanks,
 
 Dushara Jayasinghe
 ___
 U-Boot mailing list
 U-Boot@lists.denx.de
 http://lists.denx.de/mailman/listinfo/u-boot
 
 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] nand: fixed failed reads on corrected ECC errors in nand_util.c

2009-07-17 Thread Valeriy Glushkov
Hi Scott,
  if (len_incl_bad == *length) {
  rval = nand_read (nand, offset, length, buffer);
 - if (rval != 0)
 - printf (NAND read from offset %llx failed %d\n,
 - offset, rval);
 -
 + if (!rval || rval == -EUCLEAN)
 + return 0;
 + printf (NAND read from offset %llx failed %d\n,
 + offset, rval);
 
 Out of curiosity, why invert the logic from if (error) print; return to if
 (!error) return; print; return?

Because it looks a bit better for me than 2 other versions.
And saves a line. :)
---
if (!rval || rval == -EUCLEAN)
  return 0;
printf (NAND read from offset %llx failed %d\n,
  offset, rval);
return rval;

if (rval  rval != -EUCLEAN) {
 printf (NAND read from offset %llx failed %d\n,
  offset, rval);
 return rval;
}
return 0;
---

if (rval  rval != -EUCLEAN)
 printf (NAND read from offset %llx failed %d\n,
  offset, rval);
else
  rval = 0;
return rval;


Best regards,
Valeriy Glushkov

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


Re: [U-Boot] [PATCH 2/6] S5PC100: SMDKC100 Board support

2009-07-17 Thread Minkyu Kang
2009/7/11 Wolfgang Denk w...@denx.de:
 Dear HeungJun Kim,

 In message 350d1ec30906250108q5949e337neb54520d6773f...@mail.gmail.com you 
 wrote:
 This patch initializes DRAM memory, OneNAND,  Board specific functions.
 Also, it includes SMDKC100 configuration file  modification of Makefile.

 Signed-off-by: HeungJun, Kim riverful@samsung.com

 ---

  Makefile                               |    5 +
  board/samsung/smdkc100/Makefile        |   54 +++
  board/samsung/smdkc100/config.mk       |   24 +++
  board/samsung/smdkc100/lowlevel_init.S |  215 
  board/samsung/smdkc100/mem_setup.S     |  197 ++
  board/samsung/smdkc100/onenand.c       |   78 ++
  board/samsung/smdkc100/smdkc100.c      |   70 +
  board/samsung/smdkc100/u-boot.lds      |   63 
  include/configs/s5pc100_smdkc100.h     |  244 
 
  9 files changed, 950 insertions(+), 0 deletions(-)
  create mode 100644 board/samsung/smdkc100/Makefile
  create mode 100644 board/samsung/smdkc100/config.mk
  create mode 100644 board/samsung/smdkc100/lowlevel_init.S
  create mode 100644 board/samsung/smdkc100/mem_setup.S
  create mode 100644 board/samsung/smdkc100/onenand.c
  create mode 100644 board/samsung/smdkc100/smdkc100.c
  create mode 100644 board/samsung/smdkc100/u-boot.lds
  create mode 100644 include/configs/s5pc100_smdkc100.h

 MAINTAINERS entry missing.

 diff --git a/board/samsung/smdkc100/onenand.c 
 b/board/samsung/smdkc100/onenand.c
 new file mode 100644
 index 000..70105a6
 --- /dev/null
 +++ b/board/samsung/smdkc100/onenand.c
 ...
 +#define DPRINTK(format, args...)                                     \
 +do {                                                                 \
 +     printk(%s[%d]:  format \n, __func__, __LINE__, ##args);     \
 +} while (0)

 Macro unused in this file, so please do not add dead code. Also,
 rather use debug().


 +int dram_init(void)
 +{
 +     DECLARE_GLOBAL_DATA_PTR;
 +
 +     gd-bd-bi_dram[0].start = PHYS_SDRAM_1;
 +     gd-bd-bi_dram[0].size = PHYS_SDRAM_1_SIZE;
 +
 +     return 0;
 +}

 Why not using get_ram_size() for auto-detection and testing?

 +void raise(void)
 +{
 +}

 Why would that be needed?


Actually this function is workaround.
because of undefined reference error

/opt/toolchains/arm-2008q3/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.2/libgcc.a(_dvmd_lnx.o):
In function `__aeabi_ldiv0':
(.text+0x8): undefined reference to `raise'

I want to solve it but can't find the reason yet.
How i can fix this problem?

thanks

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


Re: [U-Boot] [PATCH 1/3] factor out common code for matrix vision boards

2009-07-17 Thread André Schwarz
On Thu, 2009-07-16 at 22:54 +0200, Wolfgang Denk wrote:
 Dear =?ISO-8859-1?Q?Andr=E9?= Schwarz,
 
 In message 1245678391.3867.11.ca...@swa-m460 you wrote:
  
  factor out common code for Matrix Vision based boards.
  
  Signed-off-by: Andre Schwarz andre.schw...@matrix-vision.de
  ---
   board/matrix_vision/common/Makefile|   54 ++
   board/matrix_vision/common/mv_common.c |  125 
  
   board/matrix_vision/common/mv_common.h |   25 +++
   3 files changed, 204 insertions(+), 0 deletions(-)
   create mode 100644 board/matrix_vision/common/Makefile
   create mode 100644 board/matrix_vision/common/mv_common.c
   create mode 100644 board/matrix_vision/common/mv_common.h
 
 Hm... to me factor out means removing the same part of code form
 several places and adding a unique copy of it somewhere. But I see
 only added code, none removed?

yes - looks like I've chosen the wrong expression/description.
Will provide new patches with descriptions more suitable.

Regards,

André

 
 Best regards,
 
 Wolfgang Denk
 



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


Re: [U-Boot] USB not working with 4.3.2 gcc compiler in u-boot 1.1.5

2009-07-17 Thread Virupax SS
Thanks 

You are correct if i use u-boot 1.3.0 with this 4.3.2 compiler, usb works 
fine.
we have done a lot of customization on u-boot 1.1.5 and it will take a lot 
of time to do those changes to the new u-boot 1.3.0. 


can u please tell me what compiler related change is done in the new 
u-boot releases so it works with the 4.3.2 GCC compiler.In which part of 
the code it is done , is it in the makefile.


When we used 4.3.2 gcc to compile the u-boot 1.1.5 , ethernet drivers were 
not working and after making some of the variables volatile , ethernet 
driver worked fine.

i made
struct  _AT91S_RxTdDescriptor
struct _AT91S_TxTdDescriptor
volatile for the macb driver , ( driver for the inbult macb in 
at91sam9260).

For the USB driver also some variable has to be volatile , but i am not 
been able to figure out which one it should be.
I have seen using the USB analyser , Data packets are not coming out of 
the USB controller correctly. 


Thanks 







Ben Warren biggerbadder...@gmail.com 
07/17/2009 09:43 AM

To
virupax virupax...@lntemsys.com
cc
u-boot@lists.denx.de
Subject
Re: [U-Boot] USB not working with 4.3.2 gcc compiler in u-boot 1.1.5






virupax wrote:
 Hi

 I am using  arm-unknown-linux-gnueabi-gcc 4.3.2 compiler to compile the
 u-boot 1.1.5 for the at91sam9260 board. When i use this u-boot image usb
 start command is not detecting the connected usb stick.
 Request Sense returned 00 00 00
 Device NOT ready
Request Sense returned 00 00 00

 If use some other old compiler to compile this u-boot, usb works fine in
 that image.

 Some pls guide me what may be the difference.

 
Your version of U-boot is about 3 years old.  Nobody will be interested 
in debugging it.  Please update to the latest and see if the problem 
exists.

regards,
Ben

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


[U-Boot] [PATCH v1] usb: bugfix driver/usb/host/ehci-hcd.c function ehci_submit_root

2009-07-17 Thread Prafulla Wadaskar
This change is cheked in Linux source and fix found to be in sync.
This patch is tested for USB host interface on Kirkwood based
Sheevaplug platform (ARM little endian board)

Risk: the impact of this patch is not validated on big endian board.
This need to be checked...

Signed-off-by: Prafulla Wadaskar prafu...@marvell.com
---
Change log:
v1: le16_to_cpu macro removed for typeReq

 drivers/usb/host/ehci-hcd.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index bbd547b..830ae31 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -550,9 +550,9 @@ ehci_submit_root(struct usb_device *dev, unsigned long 
pipe, void *buffer,
  req-requesttype, req-requesttype,
  le16_to_cpu(req-value), le16_to_cpu(req-index));
 
-   typeReq = req-request  8 | req-requesttype;
+   typeReq = req-request | req-requesttype  8;
 
-   switch (le16_to_cpu(typeReq)) {
+   switch (typeReq) {
case DeviceRequest | USB_REQ_GET_DESCRIPTOR:
switch (le16_to_cpu(req-value)  8) {
case USB_DT_DEVICE:
-- 
1.5.3.3

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


[U-Boot] [PATCH] Add cpu_config command for PPC4xx bootstrap configuration

2009-07-17 Thread Stefan Roese
From: Dirk Eibach eib...@gdsys.de

This patch adds a generic command for programming I2C bootstrap
eeproms on PPC4xx. An implementation for Canyonlands board is
included.

The command name is intentionally chosen not to be PPC4xx specific.
This way other CPU's/SoC's can implement a similar command under
the same name, perhaps with a different syntax.

Usage on Canyonlands:

= cpu_config
Available configurations:
 600-nor - NOR  CPU: 600 PLB: 200 OPB: 100 EBC: 100
 600-nand- NAND CPU: 600 PLB: 200 OPB: 100 EBC: 100
 800-nor - NOR  CPU: 800 PLB: 200 OPB: 100 EBC: 100
 800-nand- NAND CPU: 800 PLB: 200 OPB: 100 EBC: 100
 1000-nor- NOR  CPU:1000 PLB: 200 OPB: 100 EBC: 100
 1000-nand   - NAND CPU:1000 PLB: 200 OPB: 100 EBC: 100
 1066-nor- NOR  CPU:1066 PLB: 266 OPB:  88 EBC:  88
 1066-nand   - NAND CPU:1066 PLB: 266 OPB:  88 EBC:  88
= cpu_config 600-nor
Using configuration:
 600-nor - NOR  CPU: 600 PLB: 200 OPB: 100 EBC: 100
done (dump via 'i2c md 52 0.1 10')
Reset the board for the changes to take effect

Other 4xx boards will be migrated to use this command soon
as well.

Signed-off-by: Stefan Roese s...@denx.de
Cc: Dirk Eibach eib...@gdsys.de
Cc: Matthias Fuchs matthias.fu...@esd.eu
---
 board/amcc/canyonlands/Makefile |5 +-
 board/amcc/canyonlands/bootstrap.c  |  195 ---
 board/amcc/canyonlands/cpu_config.c |   71 +
 cpu/ppc4xx/Makefile |3 +
 cpu/ppc4xx/cmd_cpu_config.c |   92 
 include/asm-ppc/ppc4xx_config.h |   42 
 include/configs/canyonlands.h   |4 +
 7 files changed, 215 insertions(+), 197 deletions(-)
 delete mode 100644 board/amcc/canyonlands/bootstrap.c
 create mode 100644 board/amcc/canyonlands/cpu_config.c
 create mode 100644 cpu/ppc4xx/cmd_cpu_config.c
 create mode 100644 include/asm-ppc/ppc4xx_config.h

diff --git a/board/amcc/canyonlands/Makefile b/board/amcc/canyonlands/Makefile
index 2aeead6..b1dfb0b 100644
--- a/board/amcc/canyonlands/Makefile
+++ b/board/amcc/canyonlands/Makefile
@@ -25,10 +25,11 @@ include $(TOPDIR)/config.mk
 
 LIB= $(obj)lib$(BOARD).a
 
-COBJS  := $(BOARD).o
-COBJS  += bootstrap.o
+COBJS-y:= $(BOARD).o
+COBJS-$(CONFIG_CMD_CPU_CONFIG) += cpu_config.o
 SOBJS  := init.o
 
+COBJS   := $(COBJS-y)
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS))
 SOBJS  := $(addprefix $(obj),$(SOBJS))
diff --git a/board/amcc/canyonlands/bootstrap.c 
b/board/amcc/canyonlands/bootstrap.c
deleted file mode 100644
index 6dc2cca..000
--- a/board/amcc/canyonlands/bootstrap.c
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
- * (C) Copyright 2008
- * Stefan Roese, DENX Software Engineering, s...@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- */
-
-#include common.h
-#include command.h
-#include i2c.h
-#include asm/io.h
-
-/*
- * NOR and NAND boot options change bytes 5, 6, 8, 9, 11. The
- * values are independent of the rest of the clock settings.
- */
-
-#define NAND_COMPATIBLE0x01
-#define NOR_COMPATIBLE  0x02
-
-#define I2C_EEPROM_ADDR 0x52
-
-static char *config_labels[] = {
-   CPU: 600 PLB: 200 OPB: 100 EBC: 100,
-   CPU: 800 PLB: 200 OPB: 100 EBC: 100,
-   CPU:1000 PLB: 200 OPB: 100 EBC: 100,
-   CPU:1066 PLB: 266 OPB:  88 EBC:  88,
-   NULL
-};
-
-static u8 boot_configs[][17] = {
-   {
-   (NAND_COMPATIBLE | NOR_COMPATIBLE),
-   0x86, 0x80, 0xce, 0x1f, 0x79, 0x80, 0x00, 0xa0, 0x40, 0x08,
-   0x23, 0x50, 0x0d, 0x05, 0x00, 0x00
-   },
-   {
-   (NAND_COMPATIBLE | NOR_COMPATIBLE),
-   0x86, 0x80, 0xba, 0x14, 0x99, 0x80, 0x00, 0xa0, 0x40, 0x08,
-   0x23, 0x50, 0x0d, 0x05, 0x00, 0x00
-   },
-   {
-   (NAND_COMPATIBLE | NOR_COMPATIBLE),
-   0x86, 0x82, 0x96, 0x19, 0xb9, 0x80, 0x00, 0xa0, 0x40, 0x08,
-   0x23, 0x50, 0x0d, 0x05, 0x00, 0x00
-   },
-   {
-   (NAND_COMPATIBLE | NOR_COMPATIBLE),
-   0x86, 0x80, 0xb3, 0x01, 0x9d, 0x80, 0x00, 0xa0, 0x40, 0x08,
-   0x23, 0x50, 0x0d, 0x05, 0x00, 0x00
-   },
-   {
-

Re: [U-Boot] [PATCH] Add cpu_config command for PPC4xx bootstrap configuration

2009-07-17 Thread Stefan Roese
On Friday 17 July 2009 11:26:03 Stefan Roese wrote:
 From: Dirk Eibach eib...@gdsys.de

Sorry, but this From: Dirk... slipped in by accident. Dirk has provided some 
parts of this framework, but the real command is more complete rewrite from 
myself. I kept Dirk's Copyright's in the header, but this patch version 
shouldn't have the authorship of Dirk.

I'll fix this in the next patch version.

Dirk, if you like I can add you s-o-b to the next patch version, since you 
contributed to this code as well. Just let me know.

Thanks.

Best regards,
Stefan

=
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: off...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Add cpu_config command for PPC4xx bootstrap configuration

2009-07-17 Thread Eibach, Dirk

 Dirk, if you like I can add you s-o-b to the next patch 
 version, since you contributed to this code as well. Just let me know.

Sure, you can list me as s-o-b.

Cheers
Dirk


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


Re: [U-Boot] No reply to USB related questions

2009-07-17 Thread Wolfgang Denk
Dear Dushara Jayasinghe,

In message de0ccffbff707949beabd4537a14acba0c1f2dc...@mailsvr you wrote:
 
 I've posted a few questions to the list for which I didn't get any response. 

Your posting is less than 24 hours old, and you did not pay your
premium support contract fee yet.

See http://catb.org/esr/faqs/smart-questions.html

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
If you can, help others. If you can't, at least don't hurt  others.
- the Dalai Lama
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Add cpu_config command for PPC4xx bootstrap configuration

2009-07-17 Thread Wolfgang Denk
Dear Stefan Roese,

In message 1247822763-20761-1-git-send-email...@denx.de you wrote:
 From: Dirk Eibach eib...@gdsys.de
 
 This patch adds a generic command for programming I2C bootstrap
 eeproms on PPC4xx. An implementation for Canyonlands board is
 included.
 
 The command name is intentionally chosen not to be PPC4xx specific.
 This way other CPU's/SoC's can implement a similar command under
 the same name, perhaps with a different syntax.
 
 Usage on Canyonlands:
 
 = cpu_config
 Available configurations:
  600-nor - NOR  CPU: 600 PLB: 200 OPB: 100 EBC: 100
  600-nand- NAND CPU: 600 PLB: 200 OPB: 100 EBC: 100
  800-nor - NOR  CPU: 800 PLB: 200 OPB: 100 EBC: 100
  800-nand- NAND CPU: 800 PLB: 200 OPB: 100 EBC: 100
  1000-nor- NOR  CPU:1000 PLB: 200 OPB: 100 EBC: 100
  1000-nand   - NAND CPU:1000 PLB: 200 OPB: 100 EBC: 100
  1066-nor- NOR  CPU:1066 PLB: 266 OPB:  88 EBC:  88
  1066-nand   - NAND CPU:1066 PLB: 266 OPB:  88 EBC:  88

Why are the lines indented by one space?

Would it be possible to also mark the current setting in this output?
Like printing an asterisk befor or after it?

 diff --git a/board/amcc/canyonlands/cpu_config.c 
 b/board/amcc/canyonlands/cpu_config.c
 new file mode 100644
 index 000..15813c4
...
 +struct ppc4xx_config ppc4xx_config_val[] = {
 + { 600-nor, NOR  CPU: 600 PLB: 200 OPB: 100 EBC: 100,
 +   {
 +   0x86, 0x80, 0xce, 0x1f, 0x79, 0x80, 0x00, 0xa0,
 +   0x40, 0x08, 0x23, 0x50, 0x0d, 0x05, 0x00, 0x00
 +   } },

Indentation by TAB, please.


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
What is mind?  No matter.  What is matter?  Never mind.
  -- Thomas Hewitt Key, 1799-1875
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/7] mxc_nand: add nand driver for MX2/MX3

2009-07-17 Thread Ilya Yanok
Hi Scott,

please review the updated patch (will be posted as a follow-up).

Scott Wood wrote:
 Please look at drivers/mtd/nand/mpc5121_nfc.c, which AFAICT is very
 similar hardware, and see if anything can be factored out into common
 code, and try to keep the rest looking the same except where the hardware
 actually differs.
   

Hmm... For now we just can't spend enough effort for this...

 +static struct nand_ecclayout nand_hw_eccoob_16 = {
 +.eccbytes = 5,
 +.eccpos = {6, 7, 8, 9, 10},
 +.oobfree = {{0, 6}, {12, 4}, }
 +};
 

 This implies the bad block marker is one byte at offset 11 (it's all
 that's left), but I don't see any override of the bad block pattern.
   

This is surely a bug. Fixed.

 +static void *mxc_nand_memcpy32(void *dest, void *source, size_t size)
 +{
 +uint32_t *s = source, *d = dest;
 +
 +size = 2;
 +while (size--)
 +*d++ = *s++;
 +return dest;
 +}
 

 This should probably be using I/O accessors (possibly raw) -- and should
 take uint32_t *, not void *.
   

Fixed.

 +/*
 + * This function requests the NANDFC to perform a read of the
 + * NAND device status and returns the current status.
 + */
 +static uint16_t get_dev_status(struct mxc_nand_host *host)
 +{
 +void __iomem *main_buf = host-regs-main_area1;
 +uint32_t store;
 +uint16_t ret, tmp;
 +/* Issue status request to NAND device */
 +
 +/* store the main area1 first word, later do recovery */
 +store = readl(main_buf);
 +/*
 + * NANDFC buffer 1 is used for device status to prevent
 + * corruption of read/write buffer on status requests.
 + */
 +writew(1, host-regs-nfc_buf_addr);
 

 But it looks like buffer 1 is used for data with large page flash.
   

Well, we save first word of the buffer and then recover it.

 Other drivers don't seem to have any problem with status reads clobbering
 the buffer...

   
 +/* This functions is used by upper layer to checks if device is ready */
 +static int mxc_nand_dev_ready(struct mtd_info *mtd)
 

 This functions is?  I'd say this comment is pretty redundant with respect
 to the function name anyway...
   

Fixed.

 +static u_char mxc_nand_read_byte(struct mtd_info *mtd)
 +{
 +struct nand_chip *nand_chip = mtd-priv;
 +struct mxc_nand_host *host = nand_chip-priv;
 +uint8_t ret = 0;
 +uint16_t col, rd_word;
 +uint16_t __iomem *main_buf =
 +(uint16_t __iomem *)host-regs-main_area0;
 +uint16_t __iomem *spare_buf =
 +(uint16_t __iomem *)host-regs-spare_area0;
 

 According to Magnus Lilja, the nand flash controller can only handle 32
 bit read/write operations, any other size will cause an abort (or
 something like that).  But now we're accessing it as 16-bit?
   

16-bit accesses work quite well. Problem was with 8-bit accesses.

 +static uint16_t mxc_nand_read_word(struct mtd_info *mtd)
 +{
 +struct nand_chip *nand_chip = mtd-priv;
 +struct mxc_nand_host *host = nand_chip-priv;
 +uint16_t col, rd_word, ret;
 +uint16_t __iomem *p;
 +
 +MTDDEBUG(MTD_DEBUG_LEVEL3,
 +  mxc_nand_read_word(col = %d)\n, host-col_addr);
 +
 +col = host-col_addr;
 +/* Adjust saved column address */
 +if (col  mtd-writesize  host-spare_only)
 +col += mtd-writesize;
 +
 +if (col  mtd-writesize) {
 +p = (uint16_t __iomem *)(host-regs-main_area0 + (col  1));
 +} else {
 +p = (uint16_t __iomem *)(host-regs-spare_area0 +
 +((col - mtd-writesize)  1));
 +}
 +
 +if (col  1) {
 +rd_word = readw(p);
 +ret = (rd_word  8)  0xff;
 +rd_word = readw(p[1]);
 +ret |= (rd_word  8)  0xff00;
 +
 

 col should never be odd if you're reading words.
   

It can be odd if previously we've read a byte.

 +/*
 + * Write data of length len to buffer buf. The data to be
 + * written on NAND Flash is first copied to RAMbuffer. After the Data Input
 + * Operation by the NFC, the data is written to NAND Flash
 + */
 +static void mxc_nand_write_buf(struct mtd_info *mtd,
 +const u_char *buf, int len)
 +{
 +struct nand_chip *nand_chip = mtd-priv;
 +struct mxc_nand_host *host = nand_chip-priv;
 +int n, col, i = 0;
 +
 +MTDDEBUG(MTD_DEBUG_LEVEL3,
 +  mxc_nand_write_buf(col = %d, len = %d)\n, host-col_addr,
 +  len);
 +
 +col = host-col_addr;
 +
 +/* Adjust saved column address */
 +if (col  mtd-writesize  host-spare_only)
 +col += mtd-writesize;
 +
 +n = mtd-writesize + mtd-oobsize - col;
 +n = min(len, n);
 +
 +MTDDEBUG(MTD_DEBUG_LEVEL3,
 +  %s:%d: col = %d, n = %d\n, __func__, __LINE__, col, n);
 +
 +while (n) {
 

 Safer to do while (n  0), especially when the code is this complex.
   

Fixed.

 +void __iomem *p;
 +
 +if (col  mtd-writesize) {
 +p = host-regs-main_area0 + 

Re: [U-Boot] USB Device Port not working in MPC8280 PowerPC

2009-07-17 Thread Wolfgang Denk
Dear Gurumurthy Gowdar,

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

   am facing problem on writing USB
 device port driver for MPC8280,when i connect it to the host PC through USB
 cable .device descriptor is happening host is setting the address but device
 configuration is not happening properly...it hangs there in USB busy
 handler.

Which exact version of U-Boot are you running?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Every program has at least one bug and can be shortened by  at  least
one instruction - from which, by induction, one can deduce that every
program can be reduced to one instruction which doesn't work.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] mxc_nand: add nand driver for MX2/MX3

2009-07-17 Thread Ilya Yanok
Driver for NFC NAND controller found on Freescale's MX2 and MX3
processors. Ported from Linux. Tested only with i.MX27 but should
works with other MX2 and MX3 processors too.

Signed-off-by: Ilya Yanok ya...@emcraft.com
---
 drivers/mtd/nand/Makefile   |1 +
 drivers/mtd/nand/mxc_nand.c |  902 +++
 2 files changed, 903 insertions(+), 0 deletions(-)
 create mode 100644 drivers/mtd/nand/mxc_nand.c

diff --git a/drivers/mtd/nand/Makefile b/drivers/mtd/nand/Makefile
index a5680e8..e068676 100644
--- a/drivers/mtd/nand/Makefile
+++ b/drivers/mtd/nand/Makefile
@@ -42,6 +42,7 @@ COBJS-$(CONFIG_NAND_FSL_ELBC) += fsl_elbc_nand.o
 COBJS-$(CONFIG_NAND_FSL_UPM) += fsl_upm.o
 COBJS-$(CONFIG_NAND_KIRKWOOD) += kirkwood_nand.o
 COBJS-$(CONFIG_NAND_MPC5121_NFC) += mpc5121_nfc.o
+COBJS-$(CONFIG_NAND_MXC) += mxc_nand.o
 COBJS-$(CONFIG_NAND_NOMADIK) += nomadik.o
 COBJS-$(CONFIG_NAND_S3C2410) += s3c2410_nand.o
 COBJS-$(CONFIG_NAND_S3C64XX) += s3c64xx.o
diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
new file mode 100644
index 000..853c718
--- /dev/null
+++ b/drivers/mtd/nand/mxc_nand.c
@@ -0,0 +1,902 @@
+/*
+ * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright 2008 Sascha Hauer, ker...@pengutronix.de
+ * Copyright 2009 Ilya Yanok, ya...@emcraft.com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+
+#include common.h
+#include nand.h
+#include linux/err.h
+#include asm/io.h
+#ifdef CONFIG_MX27
+#include asm/arch/imx-regs.h
+#endif
+
+#define DRIVER_NAME mxc_nand
+
+struct nfc_regs {
+/* NFC RAM BUFFER Main area 0 */
+   uint8_t main_area0[0x200];
+   uint8_t main_area1[0x200];
+   uint8_t main_area2[0x200];
+   uint8_t main_area3[0x200];
+/* SPARE BUFFER Spare area 0 */
+   uint8_t spare_area0[0x10];
+   uint8_t spare_area1[0x10];
+   uint8_t spare_area2[0x10];
+   uint8_t spare_area3[0x10];
+   uint8_t pad[0x5c0];
+/* NFC registers */
+   uint16_t nfc_buf_size;
+   uint16_t reserved;
+   uint16_t nfc_buf_addr;
+   uint16_t nfc_flash_addr;
+   uint16_t nfc_flash_cmd;
+   uint16_t nfc_config;
+   uint16_t nfc_ecc_status_result;
+   uint16_t nfc_rsltmain_area;
+   uint16_t nfc_rsltspare_area;
+   uint16_t nfc_wrprot;
+   uint16_t nfc_unlockstart_blkaddr;
+   uint16_t nfc_unlockend_blkaddr;
+   uint16_t nfc_nf_wrprst;
+   uint16_t nfc_config1;
+   uint16_t nfc_config2;
+};
+
+/*
+ * Set INT to 0, FCMD to 1, rest to 0 in NFC_CONFIG2 Register
+ * for Command operation
+ */
+#define NFC_CMD0x1
+
+/*
+ * Set INT to 0, FADD to 1, rest to 0 in NFC_CONFIG2 Register
+ * for Address operation
+ */
+#define NFC_ADDR   0x2
+
+/*
+ * Set INT to 0, FDI to 1, rest to 0 in NFC_CONFIG2 Register
+ * for Input operation
+ */
+#define NFC_INPUT  0x4
+
+/*
+ * Set INT to 0, FDO to 001, rest to 0 in NFC_CONFIG2 Register
+ * for Data Output operation
+ */
+#define NFC_OUTPUT 0x8
+
+/*
+ * Set INT to 0, FD0 to 010, rest to 0 in NFC_CONFIG2 Register
+ * for Read ID operation
+ */
+#define NFC_ID 0x10
+
+/*
+ * Set INT to 0, FDO to 100, rest to 0 in NFC_CONFIG2 Register
+ * for Read Status operation
+ */
+#define NFC_STATUS 0x20
+
+/*
+ * Set INT to 1, rest to 0 in NFC_CONFIG2 Register for Read
+ * Status operation
+ */
+#define NFC_INT0x8000
+
+#define NFC_SP_EN   (1  2)
+#define NFC_ECC_EN  (1  3)
+#define NFC_BIG (1  5)
+#define NFC_RST (1  6)
+#define NFC_CE  (1  7)
+#define NFC_ONE_CYCLE   (1  8)
+
+typedef enum {false, true} bool;
+
+struct mxc_nand_host {
+   struct mtd_info mtd;
+   struct nand_chip*nand;
+
+   struct nfc_regs __iomem *regs;
+   int spare_only;
+   int status_request;
+   int pagesize_2k;
+   int clk_act;
+   uint16_tcol_addr;
+};
+
+static struct mxc_nand_host mxc_host;
+static struct mxc_nand_host *host = mxc_host;
+
+/* Define delays in microsec for NAND device operations */
+#define TROP_US_DELAY   2000
+/* Macros to get byte and bit positions of ECC */
+#define COLPOS(x)  ((x)  3)

[U-Boot] [PATCH] fec_mxc: driver for FEC ethernet controller on i.MX27

2009-07-17 Thread Ilya Yanok
Signed-off-by: Ilya Yanok ya...@emcraft.com
---
 cpu/arm926ejs/mx27/generic.c |   10 +
 drivers/net/Makefile |1 +
 drivers/net/fec_mxc.c|  742 ++
 drivers/net/fec_mxc.h|  304 +
 include/netdev.h |1 +
 5 files changed, 1058 insertions(+), 0 deletions(-)
 create mode 100644 drivers/net/fec_mxc.c
 create mode 100644 drivers/net/fec_mxc.h

diff --git a/cpu/arm926ejs/mx27/generic.c b/cpu/arm926ejs/mx27/generic.c
index bcf7899..7f6fc69 100644
--- a/cpu/arm926ejs/mx27/generic.c
+++ b/cpu/arm926ejs/mx27/generic.c
@@ -20,6 +20,7 @@
 
 #include common.h
 #include div64.h
+#include netdev.h
 #include asm/io.h
 #include asm/arch/imx-regs.h
 
@@ -159,6 +160,15 @@ int print_cpuinfo (void)
 }
 #endif
 
+int cpu_eth_init(bd_t *bis)
+{
+#if defined(CONFIG_FEC_IMX27)
+   return fecimx27_initialize(bis);
+#else
+   return 0;
+#endif
+}
+
 void imx_gpio_mode(int gpio_mode)
 {
struct gpio_regs *regs = (struct gpio_regs *)IMX_GPIO_BASE;
diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index c6097c3..f92dba7 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -37,6 +37,7 @@ COBJS-$(CONFIG_DNET) += dnet.o
 COBJS-$(CONFIG_E1000) += e1000.o
 COBJS-$(CONFIG_EEPRO100) += eepro100.o
 COBJS-$(CONFIG_ENC28J60) += enc28j60.o
+COBJS-$(CONFIG_FEC_MXC) += fec_mxc.o
 COBJS-$(CONFIG_FSLDMAFEC) += fsl_mcdmafec.o mcfmii.o
 COBJS-$(CONFIG_GRETH) += greth.o
 COBJS-$(CONFIG_INCA_IP_SWITCH) += inca-ip_sw.o
diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
new file mode 100644
index 000..0589e38
--- /dev/null
+++ b/drivers/net/fec_mxc.c
@@ -0,0 +1,742 @@
+/*
+ * (C) Copyright 2009 Ilya Yanok, Emcraft Systems Ltd ya...@emcraft.com
+ * (C) Copyright 2008,2009 Eric Jarrige eric.jarr...@armadeus.org
+ * (C) Copyright 2008 Armadeus Systems nc
+ * (C) Copyright 2007 Pengutronix, Sascha Hauer s.ha...@pengutronix.de
+ * (C) Copyright 2007 Pengutronix, Juergen Beisert j.beis...@pengutronix.de
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include common.h
+#include malloc.h
+#include net.h
+#include miiphy.h
+#include fec_mxc.h
+
+#include asm/arch/clock.h
+#include asm/arch/imx-regs.h
+#include asm/io.h
+#include asm/errno.h
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#ifndef CONFIG_MII
+#error CONFIG_MII has to be defined!
+#endif
+
+#undef DEBUG
+
+struct nbuf {
+   uint8_t data[1500]; /** actual data */
+   int length; /** actual length */
+   int used;   /** buffer in use or not */
+   uint8_t head[16];   /** MAC header(6 + 6 + 2) + 2(aligned) */
+};
+
+struct fec_priv gfec = {
+   .eth   = (struct ethernet_regs *)IMX_FEC_BASE,
+   .xcv_type  = MII100,
+   .rbd_base  = NULL,
+   .rbd_index = 0,
+   .tbd_base  = NULL,
+   .tbd_index = 0,
+   .bd= NULL,
+};
+
+/*
+ * MII-interface related functions
+ */
+static int fec_miiphy_read(char *dev, uint8_t phyAddr, uint8_t regAddr,
+   uint16_t *retVal)
+{
+   struct eth_device *edev = eth_get_dev_by_name(dev);
+   struct fec_priv *fec = (struct fec_priv *)edev-priv;
+
+   uint32_t reg;   /* convenient holder for the PHY register */
+   uint32_t phy;   /* convenient holder for the PHY */
+   uint32_t start;
+
+   /*
+* reading from any PHY's register is done by properly
+* programming the FEC's MII data register.
+*/
+   writel(FEC_IEVENT_MII, fec-eth-ievent);
+   reg = regAddr  FEC_MII_DATA_RA_SHIFT;
+   phy = phyAddr  FEC_MII_DATA_PA_SHIFT;
+
+   writel(FEC_MII_DATA_ST | FEC_MII_DATA_OP_RD | FEC_MII_DATA_TA |
+   phy | reg, fec-eth-mii_data);
+
+   /*
+* wait for the related interrupt
+*/
+   start = get_timer_masked();
+   while (!(readl(fec-eth-ievent)  FEC_IEVENT_MII)) {
+   if (get_timer(start)  (CONFIG_SYS_HZ / 1000)) {
+   printf(Read MDIO failed...\n);
+   return -1;
+   }
+   }
+
+   /*
+* clear mii interrupt bit
+*/
+   writel(FEC_IEVENT_MII, fec-eth-ievent);
+
+   /*
+* it's now safe to read the PHY's register
+*/
+   *retVal = 

[U-Boot] [PATCH] imx27lite: add support for imx27lite board from LogicPD

2009-07-17 Thread Ilya Yanok
This patch adds support for i.MX27-LITEKIT development board from
LogicPD. This board uses i.MX27 SoC and has 2MB NOR flash, 64MB NAND
flash, FEC ethernet controller integrated into i.MX27.

Signed-off-by: Ilya Yanok ya...@emcraft.com
---
 MAINTAINERS |1 +
 MAKEALL |1 +
 Makefile|3 +
 board/logicpd/imx27lite/Makefile|   51 ++
 board/logicpd/imx27lite/config.mk   |1 +
 board/logicpd/imx27lite/imx27lite.c |  102 
 board/logicpd/imx27lite/lowlevel_init.S |  170 
 include/configs/imx27lite.h |  255 +++
 8 files changed, 584 insertions(+), 0 deletions(-)
 create mode 100644 board/logicpd/imx27lite/Makefile
 create mode 100644 board/logicpd/imx27lite/config.mk
 create mode 100644 board/logicpd/imx27lite/imx27lite.c
 create mode 100644 board/logicpd/imx27lite/lowlevel_init.S
 create mode 100644 include/configs/imx27lite.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 575a7ec..61ea2cf 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -533,6 +533,7 @@ George G. Davis gda...@mvista.com
gcplus  SA1100
 
 Wolfgang Denk w...@denx.de
+   imx27lite   i.MX27
qongi.MX31
 
 Thomas Elste i...@elste.org
diff --git a/MAKEALL b/MAKEALL
index 020ff73..69520fc 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -510,6 +510,7 @@ LIST_ARM9= \
cp926ejs\
cp946es \
cp966   \
+   imx27lite   \
lpd7a400\
mx1ads  \
mx1fs2  \
diff --git a/Makefile b/Makefile
index 090e645..5e95558 100644
--- a/Makefile
+++ b/Makefile
@@ -2888,6 +2888,9 @@ davinci_sonata_config :   unconfig
 davinci_dm355evm_config :  unconfig
@$(MKCONFIG) $(@:_config=) arm arm926ejs dm355evm davinci davinci
 
+imx27lite_config:  unconfig
+   @$(MKCONFIG) $(@:_config=) arm arm926ejs imx27lite logicpd mx27
+
 lpd7a400_config \
 lpd7a404_config:   unconfig
@$(MKCONFIG) $(@:_config=) arm lh7a40x lpd7a40x
diff --git a/board/logicpd/imx27lite/Makefile b/board/logicpd/imx27lite/Makefile
new file mode 100644
index 000..c404cef
--- /dev/null
+++ b/board/logicpd/imx27lite/Makefile
@@ -0,0 +1,51 @@
+#
+# (C) Copyright 2000-2004
+# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).a
+
+COBJS  := imx27lite.o
+SOBJS  := lowlevel_init.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(obj).depend $(OBJS) $(SOBJS)
+   $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
+
+clean:
+   rm -f $(SOBJS) $(OBJS)
+
+distclean: clean
+   rm -f $(LIB) core *.bak $(obj).depend
+
+#
+
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
+
diff --git a/board/logicpd/imx27lite/config.mk 
b/board/logicpd/imx27lite/config.mk
new file mode 100644
index 000..a2e7768
--- /dev/null
+++ b/board/logicpd/imx27lite/config.mk
@@ -0,0 +1 @@
+TEXT_BASE = 0xA7F0
diff --git a/board/logicpd/imx27lite/imx27lite.c 
b/board/logicpd/imx27lite/imx27lite.c
new file mode 100644
index 000..421da17
--- /dev/null
+++ b/board/logicpd/imx27lite/imx27lite.c
@@ -0,0 +1,102 @@
+/*
+ * Copyright (C) 2007 Sascha Hauer, Pengutronix
+ * Copyright (C) 2008,2009 Eric Jarrige jora...@users.sourceforge.net
+ * Copyright (C) 2009 Ilya Yanok ya...@emcraft.com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  

[U-Boot] [PATCH] mx27: rename fec_imx27 to fec_mxc

2009-07-17 Thread Ilya Yanok

Signed-off-by: Ilya Yanok ya...@emcraft.com
---
 cpu/arm926ejs/mx27/generic.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/cpu/arm926ejs/mx27/generic.c b/cpu/arm926ejs/mx27/generic.c
index b377fad..cbb6c85 100644
--- a/cpu/arm926ejs/mx27/generic.c
+++ b/cpu/arm926ejs/mx27/generic.c
@@ -165,7 +165,7 @@ int print_cpuinfo (void)
 
 int cpu_eth_init(bd_t *bis)
 {
-#if defined(CONFIG_FEC_IMX27)
+#if defined(CONFIG_FEC_MXC)
return fecimx27_initialize(bis);
 #else
return 0;
-- 
1.6.0.6

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


[U-Boot] [PATCH] jffs2: some fixes to summary support

2009-07-17 Thread Ilya Yanok
This patch fixes some issues with JFFS2 summary support in U-Boot.
1/ Summary support made compilation configurable (as summary support
considered expiremental even in Linux).
2/ Summary code can do unaligned 16-bit and 32-bit memory accesses.
We need to get data byte by byte to exclude data aborts.
3/ Make summary scan in two passes so we can safely fall back to full
scan if we found unsupported entry in the summary.

Signed-off-by: Ilya Yanok ya...@emcraft.com
---
 fs/jffs2/jffs2_1pass.c |  122 
 1 files changed, 81 insertions(+), 41 deletions(-)

diff --git a/fs/jffs2/jffs2_1pass.c b/fs/jffs2/jffs2_1pass.c
index 11b66ab..ba8ac51 100644
--- a/fs/jffs2/jffs2_1pass.c
+++ b/fs/jffs2/jffs2_1pass.c
@@ -120,6 +120,7 @@
 #include jffs2/jffs2.h
 #include jffs2/jffs2_1pass.h
 #include linux/mtd/compat.h
+#include asm/errno.h
 
 #include jffs2_private.h
 
@@ -1220,8 +1221,30 @@ jffs2_1pass_rescan_needed(struct part_info *part)
return 0;
 }
 
+#ifdef CONFIG_JFFS2_SUMMARY
+static u32 sum_get_unaligned32(u32 *ptr)
+{
+   u32 val;
+   u8 *p = (u8 *)ptr;
+
+   val = *p | (*(p + 1)  8) | (*(p + 2)  16) | (*(p + 3)  24);
+
+   return __le32_to_cpu(val);
+}
+
+static u16 sum_get_unaligned16(u16 *ptr)
+{
+   u16 val;
+   u8 *p = (u8 *)ptr;
+
+   val = *p | (*(p + 1)  8);
+
+   return __le16_to_cpu(val);
+}
+
 #define dbg_summary(...) do {} while (0);
-/* Process the stored summary information - helper function for
+/*
+ * Process the stored summary information - helper function for
  * jffs2_sum_scan_sumnode()
  */
 
@@ -1230,54 +1253,64 @@ static int jffs2_sum_process_sum_data(struct part_info 
*part, uint32_t offset,
struct b_lists *pL)
 {
void *sp;
-   int i;
+   int i, pass;
+   void *ret;
 
-   sp = summary-sum;
+   for (pass = 0; pass  2; pass++) {
+   sp = summary-sum;
 
-   for (i = 0; i  summary-sum_num; i++) {
-   dbg_summary(processing summary index %d\n, i);
+   for (i = 0; i  summary-sum_num; i++) {
+   struct jffs2_sum_unknown_flash *spu = sp;
+   dbg_summary(processing summary index %d\n, i);
 
-   switch (((struct jffs2_sum_unknown_flash *)sp)-nodetype) {
-   case JFFS2_NODETYPE_INODE: {
+   switch (sum_get_unaligned16(spu-nodetype)) {
+   case JFFS2_NODETYPE_INODE: {
struct jffs2_sum_inode_flash *spi;
-   spi = sp;
-
-   dbg_summary(Inode at 0x%08x-0x%08x\n,
-   offset + spi-offset,
-   offset + spi-offset + spi-totlen);
+   if (pass) {
+   spi = sp;
 
-   if (insert_node(pL-frag, (u32) part-offset +
-   offset + spi-offset) == NULL)
-   return -1;
+   ret = insert_node(pL-frag,
+   (u32)part-offset +
+   offset +
+   sum_get_unaligned32(
+   spi-offset));
+   if (ret == NULL)
+   return -1;
+   }
 
-   sp += JFFS2_SUMMARY_INODE_SIZE;
+   sp += JFFS2_SUMMARY_INODE_SIZE;
 
-   break;
-   }
-
-   case JFFS2_NODETYPE_DIRENT: {
-   struct jffs2_sum_dirent_flash *spd;
-   spd = sp;
-
-   dbg_summary(Dirent at 0x%08x-0x%08x\n,
-   offset + spd-offset,
-   offset + spd-offset + spd-totlen);
-
-   if (insert_node(pL-dir, (u32) part-offset +
-   offset + spd-offset) == NULL)
-   return -1;
-
-   sp += JFFS2_SUMMARY_DIRENT_SIZE(spd-nsize);
+   break;
+   }
+   case JFFS2_NODETYPE_DIRENT: {
+   struct jffs2_sum_dirent_flash *spd;
+   spd = sp;
+   if (pass) {
+   ret = insert_node(pL-dir,
+ 

Re: [U-Boot] [PATCH] Add cpu_config command for PPC4xx bootstrap configuration

2009-07-17 Thread Stefan Roese
Hi Wolfgang,

On Friday 17 July 2009 12:45:01 Wolfgang Denk wrote:
  = cpu_config
  Available configurations:
   600-nor - NOR  CPU: 600 PLB: 200 OPB: 100 EBC: 100
   600-nand- NAND CPU: 600 PLB: 200 OPB: 100 EBC: 100
   800-nor - NOR  CPU: 800 PLB: 200 OPB: 100 EBC: 100
   800-nand- NAND CPU: 800 PLB: 200 OPB: 100 EBC: 100
   1000-nor- NOR  CPU:1000 PLB: 200 OPB: 100 EBC: 100
   1000-nand   - NAND CPU:1000 PLB: 200 OPB: 100 EBC: 100
   1066-nor- NOR  CPU:1066 PLB: 266 OPB:  88 EBC:  88
   1066-nand   - NAND CPU:1066 PLB: 266 OPB:  88 EBC:  88

 Why are the lines indented by one space?

It was this way in the original bootstrap version. I can remove it if you 
prefer.

 Would it be possible to also mark the current setting in this output?
 Like printing an asterisk befor or after it?

No. Currently the implementation only checks strings and has no idea of 
frequencies. Also, not only PLL frequencies are configured in this I2C 
bootstrap EEPROM but also boot-location (NOR, NAND, PCI) and other things. So 
it's really not trivial to find/search the current configuration in this 
table.

Since 4xx prints the speed's in the bootlog, it shouldn't be too hard to find 
the current setting there (if necessary).

  +struct ppc4xx_config ppc4xx_config_val[] = {
  +   { 600-nor, NOR  CPU: 600 PLB: 200 OPB: 100 EBC: 100,
  + {
  + 0x86, 0x80, 0xce, 0x1f, 0x79, 0x80, 0x00, 0xa0,
  + 0x40, 0x08, 0x23, 0x50, 0x0d, 0x05, 0x00, 0x00
  + } },

 Indentation by TAB, please.

Ups. Will fix. Thanks.

Best regards,
Stefan

=
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: off...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] USB Device Port not working in MPC8280 PowerPC

2009-07-17 Thread Gurumurthy Gowdar
U-boot 1.3.1
ELDK 4.2

currently debugging in Code Warrior IDE. i have taken device port code from
u-boot i.e mpc8xx_udc.c   modified to suit mpc8280.

With Regards,
Gurumurthy

On Fri, Jul 17, 2009 at 4:22 PM, Wolfgang Denk w...@denx.de wrote:

 Dear Gurumurthy Gowdar,

 In message adaf92990907170335n3856a492i2b0738aa12af5...@mail.gmail.com
 you wrote:
 
am facing problem on writing USB
  device port driver for MPC8280,when i connect it to the host PC through
 USB
  cable .device descriptor is happening host is setting the address but
 device
  configuration is not happening properly...it hangs there in USB busy
  handler.

 Which exact version of U-Boot are you running?

 Best regards,

 Wolfgang Denk

 --
 DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
 HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
 Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
 Every program has at least one bug and can be shortened by  at  least
 one instruction - from which, by induction, one can deduce that every
 program can be reduced to one instruction which doesn't work.




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


Re: [U-Boot] [PATCH] Add cpu_config command for PPC4xx bootstrap configuration

2009-07-17 Thread Wolfgang Denk
Dear Stefan Roese,

In message 200907171313.37259...@denx.de you wrote:
 
  Why are the lines indented by one space?
 
 It was this way in the original bootstrap version. I can remove it if you 
 prefer.

Please do.

  Would it be possible to also mark the current setting in this output?
  Like printing an asterisk befor or after it?
 
 No. Currently the implementation only checks strings and has no idea of 
 frequencies. Also, not only PLL frequencies are configured in this I2C 
 bootstrap EEPROM but also boot-location (NOR, NAND, PCI) and other things. So 
 it's really not trivial to find/search the current configuration in this 
 table.

Umm.. I think it should be fairly trivial to read the current  EEPROM
settings and compare these against the entries in the table above?

 Since 4xx prints the speed's in the bootlog, it shouldn't be too hard to find 
 the current setting there (if necessary).

But would it not be  useful  to  be  able  to  detect  any  illegal
settings,  for  example resulting from accidentyial corruption of the
EEPROM data?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
If you're not part of the solution, then you're part of the  precipi-
tate.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] USB Device Port not working in MPC8280 PowerPC

2009-07-17 Thread Wolfgang Denk
Dear Gurumurthy Gowdar,

please do not top-post / full-quote. Make sure to read
http://www.netmeister.org/news/learn2quote.html

In message adaf92990907170415j7da24647r5cdd55180b014...@mail.gmail.com you 
wrote:
 
 U-boot 1.3.1

How about updating to current code?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
As long as we're going to reinvent the wheel again, we might as  well
try making it round this time.- Mike Dennison
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Add cpu_config command for PPC4xx bootstrap configuration

2009-07-17 Thread Stefan Roese
On Friday 17 July 2009 13:20:17 Wolfgang Denk wrote:
   Would it be possible to also mark the current setting in this output?
   Like printing an asterisk befor or after it?
 
  No. Currently the implementation only checks strings and has no idea of
  frequencies. Also, not only PLL frequencies are configured in this I2C
  bootstrap EEPROM but also boot-location (NOR, NAND, PCI) and other
  things. So it's really not trivial to find/search the current
  configuration in this table.

 Umm.. I think it should be fairly trivial to read the current  EEPROM
 settings and compare these against the entries in the table above?

OK, this could be done. Even if I don't see a real advantage here. But I'll 
add it anyway in the next patch version.

  Since 4xx prints the speed's in the bootlog, it shouldn't be too hard to
  find the current setting there (if necessary).

 But would it not be  useful  to  be  able  to  detect  any  illegal
 settings,  for  example resulting from accidentyial corruption of the
 EEPROM data?

I don't understand this. How should the code detect an illegal setting? All 
settings configured in the board specific code are valid.

Best regards,
Stefan

=
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: off...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2 v6] Make libgcc inclusion from common Makefile overridable by platform config file

2009-07-17 Thread Detlev Zundel
Hi Scott,

  You could even make it a weak symbol that stays at NULL, so any attempt 
  to call it will trap that way (assuming NULL pointers are trapped in 
  U-Boot on that architecture...).
 
 As you know, they are not.

 If you're happy with not making it debuggable, then there's no need to
 trap on the NULL -- just make sure it never happens. :-)

 I'd much rather spend the handful of bytes on at least a
 __builtin_trap(), though.

I also think that making our lifes easier is a very good thing.  Our
it's only a bootloader codebase is pretty complex already so I welcome
making it more robust.  I was kind of surprised the other day that
null-pointer jumps(*) did not result in immediate bad programmer, no
cookie this time messages but in random crashes.

Cheers
  Detlev

(*) well, actually they were jumps to _relocated_ NULL pointers, but
still ;)

-- 
I will use free software even if it is less powerful, or less reliable,
because freedom is the most important thing, and that is what the Free
Software movement is about.  How we get freedom.
   -- Richard M. Stallman
--
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: d...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2 v6] Make libgcc inclusion from common Makefile overridable by platform config file

2009-07-17 Thread Wolfgang Denk
Dear Detlev Zundel,

In message m2r5wfzh0l@ohwell.denx.de you wrote:
 
 I also think that making our lifes easier is a very good thing.  Our
 it's only a bootloader codebase is pretty complex already so I welcome
 making it more robust.  I was kind of surprised the other day that
 null-pointer jumps(*) did not result in immediate bad programmer, no
 cookie this time messages but in random crashes.

Well, what do you suggest? remember for example that booting a  Linux
kernel  means  jumping to it's entry point address - which happens to
be 0 - or is this NULL ? How do you detemine the difference?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Vulcans do not approve of violence.
-- Spock, Journey to Babel, stardate 3842.4
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Add cpu_config command for PPC4xx bootstrap configuration

2009-07-17 Thread Wolfgang Denk
Dear Stefan Roese,

In message 200907171326.25645...@denx.de you wrote:

  But would it not be  useful  to  be  able  to  detect  any  illegal
  settings,  for  example resulting from accidentyial corruption of the
  EEPROM data?
 
 I don't understand this. How should the code detect an illegal setting? All 
 settings configured in the board specific code are valid.

You  define  a  list  of  ppc4xx_config_count   known   configuration
settings;  the  data read from the EEPROM either matches one of these
then it is a known or legal setting, or it does  not  -  in  that
case  the  EEPROM contains an illegal setting. This should at least
trigger a warning message (probably including the hex values as  read
from the EEPROM).

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
The IQ of the group is the lowest IQ of a member of the group divided
by the number of people in the group.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2 v6] Make libgcc inclusion from common Makefile overridable by platform config file

2009-07-17 Thread Wolfgang Denk
Dear Detlev,

In message 20090717113714.4bf10832e...@gemini.denx.de I wrote:
 
 Well, what do you suggest? remember for example that booting a  Linux
 kernel  means  jumping to it's entry point address - which happens to
 be 0 - or is this NULL ? How do you detemine the difference?

... at least on PowerPC the EPA is 0.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
We are all agreed that your  theory  is  crazy.  The  question  which
divides  us  is  whether it is crazy enough to have a chance of being
correct. My own feeling is that it is not crazy enough.  - Niels Bohr
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Add cpu_config command for PPC4xx bootstrap configuration

2009-07-17 Thread Stefan Roese
On Friday 17 July 2009 13:40:50 Wolfgang Denk wrote:
   But would it not be  useful  to  be  able  to  detect  any  illegal
   settings,  for  example resulting from accidentyial corruption of the
   EEPROM data?
 
  I don't understand this. How should the code detect an illegal setting?
  All settings configured in the board specific code are valid.

 You  define  a  list  of  ppc4xx_config_count   known   configuration
 settings;  the  data read from the EEPROM either matches one of these
 then it is a known or legal setting, or it does  not  -  in  that
 case  the  EEPROM contains an illegal setting. This should at least
 trigger a warning message (probably including the hex values as  read
 from the EEPROM).

Ah, yes. Good idea. Will add.

Best regards,
Stefan

=
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: off...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Refresh LZMA-lib to 4.65

2009-07-17 Thread rhabarber1848
Wolfgang Denk wrote:

 Keep the update of the lzma code and the
 watchdog stuff separated in two patches - and use git-format-patch to
 create and git-send-email to post the patches, please.

Hi,

please forgive me when I am posting the patches again as binary attachments
(hopefully now readable) as I do not use git here.

Both patches are to be used for the LZMA 4.65 update proposed by
Luigi 'Comio' Mantellini.

lzma.diff
fix return size of uncompressed image

watchdog.diff
reset watchdog timer to avoid reboot during decompression on slow machines.

Cheers, rhabarber1848
diff -uNr u-boot-2009.06.org/lib_generic/lzma/LzmaTools.c u-boot-2009.06/lib_generic/lzma/LzmaTools.c
--- u-boot-2009.06.org/lib_generic/lzma/LzmaTools.c	2009-07-17 13:33:06.0 +0200
+++ u-boot-2009.06/lib_generic/lzma/LzmaTools.c	2009-07-17 13:34:19.0 +0200
@@ -116,6 +117,7 @@
 outStream, outProcessed,
 inStream + LZMA_DATA_OFFSET, compressedSize,
 inStream, LZMA_PROPS_SIZE, LZMA_FINISH_ANY, state, g_Alloc);
+*uncompressedSize = outProcessed;
 if (res != SZ_OK)  {
 return res;
 }

diff -uNr u-boot-2009.06.org/lib_generic/lzma/LzmaDec.c u-boot-2009.06/lib_generic/lzma/LzmaDec.c
--- u-boot-2009.06.org/lib_generic/lzma/LzmaDec.c	2009-07-17 13:33:06.0 +0200
+++ u-boot-2009.06/lib_generic/lzma/LzmaDec.c	2009-07-17 13:33:38.0 +0200
@@ -1,6 +1,9 @@
 /* LzmaDec.c -- LZMA Decoder
 2008-11-06 : Igor Pavlov : Public domain */
 
+#include config.h
+#include common.h
+#include watchdog.h
 #include LzmaDec.h
 
 #include string.h
@@ -156,6 +159,9 @@
   UInt32 range = p-range;
   UInt32 code = p-code;
 
+#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
+	WATCHDOG_RESET();
+#endif
   do
   {
 CLzmaProb *prob;
@@ -176,6 +182,9 @@
   if (state  kNumLitStates)
   {
 symbol = 1;
+#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
+	WATCHDOG_RESET();
+#endif
 do { GET_BIT(prob + symbol, symbol) } while (symbol  0x100);
   }
   else
@@ -183,6 +192,9 @@
 unsigned matchByte = p-dic[(dicPos - rep0) + ((dicPos  rep0) ? dicBufSize : 0)];
 unsigned offs = 0x100;
 symbol = 1;
+#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
+	WATCHDOG_RESET();
+#endif
 do
 {
   unsigned bit;
@@ -316,6 +328,9 @@
 {
   UInt32 mask = 1;
   unsigned i = 1;
+#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
+	WATCHDOG_RESET();
+#endif
   do
   {
 GET_BIT2(prob + i, i, ; , distance |= mask);
@@ -327,6 +342,9 @@
   else
   {
 numDirectBits -= kNumAlignBits;
+#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
+	WATCHDOG_RESET();
+#endif
 do
 {
   NORMALIZE
@@ -399,12 +417,18 @@
   ptrdiff_t src = (ptrdiff_t)pos - (ptrdiff_t)dicPos;
   const Byte *lim = dest + curLen;
   dicPos += curLen;
+#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
+	WATCHDOG_RESET();
+#endif
   do
 *(dest) = (Byte)*(dest + src);
   while (++dest != lim);
 }
 else
 {
+#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
+	WATCHDOG_RESET();
+#endif
   do
   {
 dic[dicPos++] = dic[pos];
@@ -417,6 +441,9 @@
 }
   }
   while (dicPos  limit  buf  bufLimit);
+#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
+	WATCHDOG_RESET();
+#endif
   NORMALIZE;
   p-buf = buf;
   p-range = range;
diff -uNr u-boot-2009.06.org/lib_generic/lzma/LzmaTools.c u-boot-2009.06/lib_generic/lzma/LzmaTools.c
--- u-boot-2009.06.org/lib_generic/lzma/LzmaTools.c	2009-07-17 13:33:06.0 +0200
+++ u-boot-2009.06/lib_generic/lzma/LzmaTools.c	2009-07-17 13:33:54.0 +0200
@@ -36,6 +36,7 @@
 
 #include config.h
 #include common.h
+#include watchdog.h
 
 #ifdef CONFIG_LZMA
 
@@ -112,6 +113,9 @@
 
 /* Decompress */
 outProcessed = outSizeFull;
+#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
+	WATCHDOG_RESET();
+#endif
 res = LzmaDecode(
 outStream, outProcessed,
 inStream + LZMA_DATA_OFFSET, compressedSize,

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


Re: [U-Boot] [PATCH] - save the server's mac address...

2009-07-17 Thread Robin Getz
On Thu 16 Jul 2009 12:56, Ben Warren pondered:
 Mike Frysinger wrote:
  On Monday 13 July 2009 16:19:51 Robin Getz wrote:

  +  CONFIG_KEEP_SERVERADDR
  +
  +  Keeps the server's MAC address, in the env 'serveraddr'
  +  for passing to bootargs (like Linux's netconsole option)
  
 
  is a config option really necessary ?  i'd say just add it for everyone
  -mike

 ACK

Does that mean you want a new patch with the ifdef removed?

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


[U-Boot] [PATCH v4] ppc4xx: Add DL-Vision 405EP board support

2009-07-17 Thread Dirk Eibach
Board support for the Guntermann  Drunck DL-Vision.

Signed-off-by: Dirk Eibach eib...@gdsys.de
---
Changes since v1:
- whitespace cleanup

Changes since v2:
- added include asm/gpio.h to board/gdsys/dlvision/dlvision.c
- added missing return statement to misc_init_r()

Changes since v3:
- fix initialization of GPIO5

 MAINTAINERS |1 +
 MAKEALL |1 +
 Makefile|3 +
 board/gdsys/dlvision/Makefile   |   51 +
 board/gdsys/dlvision/config.mk  |   24 
 board/gdsys/dlvision/dlvision.c |  137 
 board/gdsys/dlvision/u-boot.lds |  132 +++
 include/configs/dlvision.h  |  225 +++
 8 files changed, 574 insertions(+), 0 deletions(-)
 create mode 100644 board/gdsys/dlvision/Makefile
 create mode 100644 board/gdsys/dlvision/config.mk
 create mode 100644 board/gdsys/dlvision/dlvision.c
 create mode 100644 board/gdsys/dlvision/u-boot.lds
 create mode 100644 include/configs/dlvision.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 0041112..5d8440f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -135,6 +135,7 @@ Jon Diekema jon.diek...@smiths-aerospace.com
 
 Dirk Eibach eib...@gdsys.de
 
+   dlvisionPPC405EP
gdppc440etx PPC440EP/GR
neo PPC405EP
 
diff --git a/MAKEALL b/MAKEALL
index 41f1445..8ad7cbd 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -193,6 +193,7 @@ LIST_4xx=  \
csb272  \
csb472  \
DASA_SIM\
+   dlvision\
DP405   \
DU405   \
DU440   \
diff --git a/Makefile b/Makefile
index 2a06440..fda7364 100644
--- a/Makefile
+++ b/Makefile
@@ -1324,6 +1324,9 @@ csb472_config:unconfig
 DASA_SIM_config: unconfig
@$(MKCONFIG) $(@:_config=) ppc ppc4xx dasa_sim esd
 
+dlvision_config: unconfig
+   @$(MKCONFIG) $(@:_config=) ppc ppc4xx dlvision gdsys
+
 DP405_config:  unconfig
@$(MKCONFIG) $(@:_config=) ppc ppc4xx dp405 esd
 
diff --git a/board/gdsys/dlvision/Makefile b/board/gdsys/dlvision/Makefile
new file mode 100644
index 000..1270fea
--- /dev/null
+++ b/board/gdsys/dlvision/Makefile
@@ -0,0 +1,51 @@
+#
+# (C) Copyright 2007
+# Stefan Roese, DENX Software Engineering, s...@denx.de.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).a
+
+COBJS  = $(BOARD).o
+SOBJS   =
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(OBJS) $(SOBJS)
+   $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
+
+clean:
+   rm -f $(SOBJS) $(OBJS)
+
+distclean: clean
+   rm -f $(LIB) core *.bak $(obj).depend
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/gdsys/dlvision/config.mk b/board/gdsys/dlvision/config.mk
new file mode 100644
index 000..1bdf5e4
--- /dev/null
+++ b/board/gdsys/dlvision/config.mk
@@ -0,0 +1,24 @@
+#
+# (C) Copyright 2000
+# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+TEXT_BASE = 0xFFFC
diff --git a/board/gdsys/dlvision/dlvision.c b/board/gdsys/dlvision/dlvision.c
new file mode 100644

Re: [U-Boot] [PATCH] Refresh LZMA-lib to 4.65

2009-07-17 Thread Wolfgang Denk
Dear rhabarber1848,

In message h3pocf$hb...@ger.gmane.org you wrote:
 
 please forgive me when I am posting the patches again as binary attachments
 (hopefully now readable) as I do not use git here.

Pleas einclude the patch description (= commit message) with the
patch. And make sure to add your Signed-off-by: lines. These are
mandatory.


 Both patches are to be used for the LZMA 4.65 update proposed by
 Luigi 'Comio' Mantellini.
 
 lzma.diff
 fix return size of uncompressed image

This patch should be integral part of the lzma update patch, and NOT
come as separate fix. It makes no sense to add broken code.


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
For every complex problem, there is a solution that is simple,  neat,
and wrong.   -- H. L. Mencken
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] - save the server's mac address...

2009-07-17 Thread Wolfgang Denk
Dear Robin Getz,

In message 200907170753.53732.rg...@blackfin.uclinux.org you wrote:
 On Thu 16 Jul 2009 12:56, Ben Warren pondered:
  Mike Frysinger wrote:
   On Monday 13 July 2009 16:19:51 Robin Getz wrote:
 
   +CONFIG_KEEP_SERVERADDR
   +
   +Keeps the server's MAC address, in the env 'serveraddr'
   +for passing to bootargs (like Linux's netconsole option)
   
  
   is a config option really necessary ?  i'd say just add it for everyone
   -mike
 
  ACK
 
 Does that mean you want a new patch with the ifdef removed?

No!

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
In the pitiful, multipage, connection-boxed form to which  the  flow-
chart  has  today  been  elaborated, it has proved to be useless as a
design tool -- programmers draw flowcharts after, not before, writing
the programs they describe.- Fred Brooks, Jr.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Improve U-Boot Porting Guide in the README

2009-07-17 Thread Jerry Van Baren
Wolfgang Denk wrote:
 Dear Brent Cook,
 
 In message 200907161744.51888.bc...@bpointsys.com you wrote:
 This is hilarious, though I am curious what the real-world analog to 
 'return 0;' is :)
 
 This depends on the caller's context. In case of hobby projects it
 usually means be_happy(), show_others(), drink_beer() or the like,
 where in commercial contexts it means send_invoice_to_customer().
 
 Best regards,
 
 Wolfgang Denk

Good answer. :-D  Also see the second-to-last definition:

Zero is an enigmatic value. It can mean success (fclose) or failure 
(scanf). It can mean black or white. It can mean no permissions (chmod) 
or all permissions (umask). It can mean now (setjmp) or later (atexit). 
It can mean the beginning (lseek) or the end (read). It can mean myself 
(getpgrp) or child (fork). It can mean all (kill's 1st argument) or 
nothing (kill's 2nd argument). It can mean 'default' (SIG_IGN) or 'I 
don't care' (waitpid) or 'try to guess' (strtol). Indeed 0 lets you talk 
to God (setuid). Verily is 0 all things to all people.

 -- an ancient usenet posting

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


Re: [U-Boot] [PATCH] Refresh LZMA-lib to 4.65

2009-07-17 Thread Alessandro Rubini
 watchdog.diff
 reset watchdog timer to avoid reboot during decompression on slow machines.

Actually, you don't need all these ifdef, that clutter the code.

watchdog.h already include this:


/*
 * No hardware or software watchdog.
 */
#if defined(__ASSEMBLY__)
#define WATCHDOG_RESET /*XXX DO_NOT_DEL_THIS_COMMENT*/
#else
#define WATCHDOG_RESET() {}
#endif /* __ASSEMBLY__ */


So please don't ifdef around WATCHDOG_RESET

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


[U-Boot] [PATCH v2] Add cpu_config command for PPC4xx bootstrap configuration

2009-07-17 Thread Stefan Roese
This patch adds a generic command for programming I2C bootstrap
eeproms on PPC4xx. An implementation for Canyonlands board is
included.

The command name is intentionally chosen not to be PPC4xx specific.
This way other CPU's/SoC's can implement a similar command under
the same name, perhaps with a different syntax.

Usage on Canyonlands:

= cpu_config
Available configurations (I2C address 0x52):
600-nor  - NOR  CPU: 600 PLB: 200 OPB: 100 EBC: 100
600-nand - NAND CPU: 600 PLB: 200 OPB: 100 EBC: 100
800-nor  - NOR  CPU: 800 PLB: 200 OPB: 100 EBC: 100
800-nand - NAND CPU: 800 PLB: 200 OPB: 100 EBC: 100
1000-nor - NOR  CPU:1000 PLB: 200 OPB: 100 EBC: 100
1000-nand- NAND CPU:1000 PLB: 200 OPB: 100 EBC: 100
1066-nor - NOR  CPU:1066 PLB: 266 OPB:  88 EBC:  88 ***
1066-nand- NAND CPU:1066 PLB: 266 OPB:  88 EBC:  88
= cpu_config 600-nor
Using configuration:
600-nor  - NOR  CPU: 600 PLB: 200 OPB: 100 EBC: 100
done (dump via 'i2c md 52 0.1 10')
Reset the board for the changes to take effect

Other 4xx boards will be migrated to use this command soon
as well.

Signed-off-by: Stefan Roese s...@denx.de
Signed-off-by: Dirk Eibach eib...@gdsys.de
Cc: Matthias Fuchs matthias.fu...@esd.eu
---
v2:
- Patch authorship changes to Stefan
- s-o-b from Dirk added
- Added current configuration detection
- Minor coding style cleanup

 board/amcc/canyonlands/Makefile |5 +-
 board/amcc/canyonlands/bootstrap.c  |  195 ---
 board/amcc/canyonlands/cpu_config.c |   55 ++
 cpu/ppc4xx/Makefile |3 +
 cpu/ppc4xx/cmd_cpu_config.c |  127 +++
 include/asm-ppc/ppc4xx_config.h |   42 
 include/configs/canyonlands.h   |4 +
 7 files changed, 234 insertions(+), 197 deletions(-)
 delete mode 100644 board/amcc/canyonlands/bootstrap.c
 create mode 100644 board/amcc/canyonlands/cpu_config.c
 create mode 100644 cpu/ppc4xx/cmd_cpu_config.c
 create mode 100644 include/asm-ppc/ppc4xx_config.h

diff --git a/board/amcc/canyonlands/Makefile b/board/amcc/canyonlands/Makefile
index 2aeead6..b1dfb0b 100644
--- a/board/amcc/canyonlands/Makefile
+++ b/board/amcc/canyonlands/Makefile
@@ -25,10 +25,11 @@ include $(TOPDIR)/config.mk
 
 LIB= $(obj)lib$(BOARD).a
 
-COBJS  := $(BOARD).o
-COBJS  += bootstrap.o
+COBJS-y:= $(BOARD).o
+COBJS-$(CONFIG_CMD_CPU_CONFIG) += cpu_config.o
 SOBJS  := init.o
 
+COBJS   := $(COBJS-y)
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS))
 SOBJS  := $(addprefix $(obj),$(SOBJS))
diff --git a/board/amcc/canyonlands/bootstrap.c 
b/board/amcc/canyonlands/bootstrap.c
deleted file mode 100644
index 6dc2cca..000
--- a/board/amcc/canyonlands/bootstrap.c
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
- * (C) Copyright 2008
- * Stefan Roese, DENX Software Engineering, s...@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- */
-
-#include common.h
-#include command.h
-#include i2c.h
-#include asm/io.h
-
-/*
- * NOR and NAND boot options change bytes 5, 6, 8, 9, 11. The
- * values are independent of the rest of the clock settings.
- */
-
-#define NAND_COMPATIBLE0x01
-#define NOR_COMPATIBLE  0x02
-
-#define I2C_EEPROM_ADDR 0x52
-
-static char *config_labels[] = {
-   CPU: 600 PLB: 200 OPB: 100 EBC: 100,
-   CPU: 800 PLB: 200 OPB: 100 EBC: 100,
-   CPU:1000 PLB: 200 OPB: 100 EBC: 100,
-   CPU:1066 PLB: 266 OPB:  88 EBC:  88,
-   NULL
-};
-
-static u8 boot_configs[][17] = {
-   {
-   (NAND_COMPATIBLE | NOR_COMPATIBLE),
-   0x86, 0x80, 0xce, 0x1f, 0x79, 0x80, 0x00, 0xa0, 0x40, 0x08,
-   0x23, 0x50, 0x0d, 0x05, 0x00, 0x00
-   },
-   {
-   (NAND_COMPATIBLE | NOR_COMPATIBLE),
-   0x86, 0x80, 0xba, 0x14, 0x99, 0x80, 0x00, 0xa0, 0x40, 0x08,
-   0x23, 0x50, 0x0d, 0x05, 0x00, 0x00
-   },
-   {
-   (NAND_COMPATIBLE | NOR_COMPATIBLE),
-   0x86, 0x82, 0x96, 0x19, 0xb9, 0x80, 0x00, 0xa0, 0x40, 0x08,
-   0x23, 0x50, 0x0d, 0x05, 0x00, 0x00
-   },
-   {
-   (NAND_COMPATIBLE | NOR_COMPATIBLE),
-   0x86, 

[U-Boot] [U-boot][PATCH][1 of 2] AMCC ppc4xx /PLLOUTB/CPU clock/ Default bootstrap options A, B, C, D

2009-07-17 Thread Rupjyoti Sarmah
Unstable 440EPx operation due to default bootsrtap options settings.
The 440EPx fixed bootstrap options A,B,C,D sets PLL FWDVA
to a value 1 that results PLLOUTB being greater than the CPU clock
frequency. This results unstable 440EPx operation causing hang
conditions.

This is a patch fixing this problem. The patch touches two files
speed.c and cpu_init.c.

Signed off by  Rupjyoti Sarmah  rsar...@amcc.com  from Applied Micro

--


diff -uNr u-boot-2009.06/cpu/ppc4xx/cpu_init.c
u-boot-2009.06.1/cpu/ppc4xx/cpu_init.c

--- u-boot-2009.06/cpu/ppc4xx/cpu_init.c 2009-06-14 12:30:39.0 -0700

+++ u-boot-2009.06.1/cpu/ppc4xx/cpu_init.c 2009-04-30 11:00:40.0 -0700

@@ -1,337 +1,462 @@

-/*

- * (C) Copyright 2000-2007

- * Wolfgang Denk, DENX Software Engineering, w...@denx.de.

- *

- * See file CREDITS for list of people who contributed to this

- * project.

- *

- * This program is free software; you can redistribute it and/or

- * modify it under the terms of the GNU General Public License as

- * published by the Free Software Foundation; either version 2 of

- * the License, or (at your option) any later version.

- *

- * This program is distributed in the hope that it will be useful,

- * but WITHOUT ANY WARRANTY; without even the implied warranty of

- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the

- * GNU General Public License for more details.

- *

- * You should have received a copy of the GNU General Public License

- * along with this program; if not, write to the Free Software

- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,

- * MA 02111-1307 USA

- */

-

-#include common.h

-#include watchdog.h

-#include ppc4xx_enet.h

-#include asm/processor.h

-#include asm/gpio.h

-#include ppc4xx.h

-

-#if defined(CONFIG_405GP) || defined(CONFIG_405EP)

-DECLARE_GLOBAL_DATA_PTR;

-#endif

-

-#ifndef CONFIG_SYS_PLL_RECONFIG

-#define CONFIG_SYS_PLL_RECONFIG 0

-#endif

-

-void reconfigure_pll(u32 new_cpu_freq)

-{

-#if defined(CONFIG_440EPX)

- int reset_needed = 0;

- u32 reg, temp;

- u32 prbdv0, target_prbdv0, /* CLK_PRIMBD */

- fwdva, target_fwdva, fwdvb, target_fwdvb, /* CLK_PLLD */

- fbdv, target_fbdv, lfbdv, target_lfbdv,

- perdv0, target_perdv0, /* CLK_PERD */

- spcid0, target_spcid0; /* CLK_SPCID */

-

- /* Reconfigure clocks if necessary.

- * See PPC440EPx User's Manual, sections 8.2 and 14 */

- if (new_cpu_freq == 667) {

- target_prbdv0 = 2;

- target_fwdva = 2;

- target_fwdvb = 4;

- target_fbdv = 20;

- target_lfbdv = 1;

- target_perdv0 = 4;

- target_spcid0 = 4;

-

- mfcpr(clk_primbd, reg);

- temp = (reg  PRBDV_MASK)  24;

- prbdv0 = temp ? temp : 8;

- if (prbdv0 != target_prbdv0) {

- reg = ~PRBDV_MASK;

- reg |= ((target_prbdv0 == 8 ? 0 : target_prbdv0)  24);

- mtcpr(clk_primbd, reg);

- reset_needed = 1;

- }

-

- mfcpr(clk_plld, reg);

-

- temp = (reg  PLLD_FWDVA_MASK)  16;

- fwdva = temp ? temp : 16;

-

- temp = (reg  PLLD_FWDVB_MASK)  8;

- fwdvb = temp ? temp : 8;

-

- temp = (reg  PLLD_FBDV_MASK)  24;

- fbdv = temp ? temp : 32;

-

- temp = (reg  PLLD_LFBDV_MASK);

- lfbdv = temp ? temp : 64;

-

- if (fwdva != target_fwdva || fbdv != target_fbdv || lfbdv != target_lfbdv) {

- reg = ~(PLLD_FWDVA_MASK | PLLD_FWDVB_MASK |

- PLLD_FBDV_MASK | PLLD_LFBDV_MASK);

- reg |= ((target_fwdva == 16 ? 0 : target_fwdva)  16) |

- ((target_fwdvb == 8 ? 0 : target_fwdvb)  8) |

- ((target_fbdv == 32 ? 0 : target_fbdv)  24) |

- (target_lfbdv == 64 ? 0 : target_lfbdv);

- mtcpr(clk_plld, reg);

- reset_needed = 1;

- }

-

- mfcpr(clk_perd, reg);

- perdv0 = (reg  CPR0_PERD_PERDV0_MASK)  24;

- if (perdv0 != target_perdv0) {

- reg = ~CPR0_PERD_PERDV0_MASK;

- reg |= (target_perdv0  24);

- mtcpr(clk_perd, reg);

- reset_needed = 1;

- }

-

- mfcpr(clk_spcid, reg);

- temp = (reg  CPR0_SPCID_SPCIDV0_MASK)  24;

- spcid0 = temp ? temp : 4;

- if (spcid0 != target_spcid0) {

- reg = ~CPR0_SPCID_SPCIDV0_MASK;

- reg |= ((target_spcid0 == 4 ? 0 : target_spcid0)  24);

- mtcpr(clk_spcid, reg);

- reset_needed = 1;

- }

-

- /* Set reload inhibit so configuration will persist across

- * processor resets */

- mfcpr(clk_icfg, reg);

- reg = ~CPR0_ICFG_RLI_MASK;

- reg |= 1  31;

- mtcpr(clk_icfg, reg);

- }

-

- /* Reset processor if configuration changed */

- if (reset_needed) {

- __asm__ __volatile__ (sync; isync);

- mtspr(dbcr0, 0x2000);

- }

-#endif

-}

-

-/*

- * Breath some life into the CPU...

- *

- * Reconfigure PLL if necessary,

- * set up the memory map,

- * initialize a bunch of registers

- */

-void

-cpu_init_f (void)

-{

-#if defined(CONFIG_WATCHDOG) || defined(CONFIG_440GX) || defined(CONFIG_460EX)

- u32 val;

-#endif

-

- reconfigure_pll(CONFIG_SYS_PLL_RECONFIG);

-

-#if (defined(CONFIG_405EP) || defined (CONFIG_405EX)) 
!defined(CONFIG_SYS_4xx_GPIO_TABLE)

- /*

- * GPIO0 setup (select GPIO or alternate function)

- */

-#if defined(CONFIG_SYS_GPIO0_OR)

- out32(GPIO0_OR, 

[U-Boot] PATCH

2009-07-17 Thread André Schwarz
This patch adds common code usable for all Matrix Vision boards.

Signed-off-by: André Schwarz andre.schw...@matrix-vision.de
---

 board/matrix_vision/common/Makefile|   54 ++
 board/matrix_vision/common/mv_common.c |  125

 board/matrix_vision/common/mv_common.h |   25 +++
 3 files changed, 204 insertions(+), 0 deletions(-)

diff --git a/board/matrix_vision/common/Makefile
b/board/matrix_vision/common/Makefile
new file mode 100644
index 000..b496258
--- /dev/null
+++ b/board/matrix_vision/common/Makefile
@@ -0,0 +1,54 @@
+#
+# (C) Copyright 2006
+# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)board/$(VENDOR)/common)
+endif
+
+LIB= $(obj)lib$(VENDOR).a
+
+COBJS-y= mv_common.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS-y))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(obj).depend $(OBJS)
+   $(AR) $(ARFLAGS) $@ $(OBJS)
+
+clean:
+   rm -f $(SOBJS) $(OBJS)
+
+distclean: clean
+   rm -f $(LIB) core *.bak $(obj).depend
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/matrix_vision/common/mv_common.c
b/board/matrix_vision/common/mv_common.c
new file mode 100644
index 000..284de16
--- /dev/null
+++ b/board/matrix_vision/common/mv_common.c
@@ -0,0 +1,125 @@
+/*
+ * (C) Copyright 2008
+ * Andre Schwarz, Matrix Vision GmbH, andre.schw...@matrix-vision.de
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include common.h
+#include malloc.h
+#include environment.h
+#include asm/io.h
+
+DECLARE_GLOBAL_DATA_PTR;
+
+static char* entries_to_keep[] = {
+   serial#, ethaddr, eth1addr, model_info, sensor_cnt,
+   fpgadatasize, ddr_size, use_dhcp, use_static_ipaddr,
+   static_ipaddr, static_netmask, static_gateway,
+   syslog, watchdog, netboot, evo8serialnumber };
+
+#define MV_MAX_ENV_ENTRY_LENGTH64
+#define MV_KEEP_ENTRIESARRAY_SIZE(entries_to_keep)
+
+void mv_reset_environment(void)
+{
+   int i;
+   char *s[MV_KEEP_ENTRIES];
+   char entries[MV_KEEP_ENTRIES][MV_MAX_ENV_ENTRY_LENGTH];
+
+   printf(\n*** RESET ENVIRONMENT ***\n);
+
+   memset(entries, 0, MV_KEEP_ENTRIES * MV_MAX_ENV_ENTRY_LENGTH);
+   for (i = 0; i  MV_KEEP_ENTRIES; i++) {
+   s[i] = getenv(entries_to_keep[i]);
+   if (s[i]) {
+   printf(save '%s' : %s\n, entries_to_keep[i], s[i]);
+   strncpy(entries[i], s[i], MV_MAX_ENV_ENTRY_LENGTH);
+   }
+   }
+
+   gd-env_valid = 0;
+   env_relocate();
+
+   for (i = 0; i  MV_KEEP_ENTRIES; i++) {
+   if (s[i]) {
+   printf(restore '%s' : %s\n, entries_to_keep[i], s[i]);
+   setenv(entries_to_keep[i], s[i]);
+   }
+   }
+
+   saveenv();
+}
+
+int mv_load_fpga(void)
+{
+   int result;
+   size_t data_size = 0;
+   void *fpga_data = NULL;
+   char *datastr = getenv(fpgadata);
+   char *sizestr = getenv(fpgadatasize);
+
+   if (getenv(skip_fpga)) {
+   printf(found 

[U-Boot] [PATCH] cmd_i2c: bugfix: add missing brace

2009-07-17 Thread Alessandro Rubini
From: Alessandro Rubini rubini-l...@gnudd.com

The sub-command parser missed a brace, so return 0; is always
taken and no error message is diplayed if you say i2c scan
instead of i2c probe, for example.

Proper brace is added. Also, a misleading and unneeded else
is removed.

Signed-off-by: Alessandro Rubini rub...@gnudd.com.it
---
 common/cmd_i2c.c |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/cmd_i2c.c b/common/cmd_i2c.c
index ae26845..8f0fc9e 100644
--- a/common/cmd_i2c.c
+++ b/common/cmd_i2c.c
@@ -1282,17 +1282,17 @@ int do_i2c(cmd_tbl_t * cmdtp, int flag, int argc, char 
*argv[])
return do_i2c_crc(cmdtp, flag, argc, argv);
if (!strncmp(argv[0], pr, 2))
return do_i2c_probe(cmdtp, flag, argc, argv);
-   if (!strncmp(argv[0], re, 2))
+   if (!strncmp(argv[0], re, 2)) {
i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
return 0;
+   }
if (!strncmp(argv[0], lo, 2))
return do_i2c_loop(cmdtp, flag, argc, argv);
 #if defined(CONFIG_CMD_SDRAM)
if (!strncmp(argv[0], sd, 2))
return do_sdram(cmdtp, flag, argc, argv);
 #endif
-   else
-   cmd_usage(cmdtp);
+   cmd_usage(cmdtp);
return 0;
 }
 
-- 
1.6.0.2
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/2] update config for mvBC-P (MPC5200)

2009-07-17 Thread André Schwarz
This patch adds I2C support for mvBC-P and defines flash layout
matching the shipped product.

Signed-off-by: André Schwarz andre.schw...@matrix-vision.de
---

 include/configs/MVBC_P.h |   14 --
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/include/configs/MVBC_P.h b/include/configs/MVBC_P.h
index edbc701..867e8e0 100644
--- a/include/configs/MVBC_P.h
+++ b/include/configs/MVBC_P.h
@@ -68,9 +68,9 @@
 #define MV_VCI mvBlueCOUGAR-P
 #define MV_FPGA_DATA   0xff86
 #define MV_FPGA_SIZE   0x0003c886
-#define MV_KERNEL_ADDR 0xffc0
+#define MV_KERNEL_ADDR 0xffd0
 #define MV_INITRD_ADDR 0xff90
-#define MV_INITRD_LENGTH   0x0030
+#define MV_INITRD_LENGTH   0x0040
 #define MV_SCRATCH_ADDR0x
 #define MV_SCRATCH_LENGTH  MV_INITRD_LENGTH
 #define MV_SOURCE_ADDR 0xff84
@@ -105,6 +105,7 @@
 #define CONFIG_CMD_SDRAM
 #define CONFIG_CMD_PCI
 #define CONFIG_CMD_FPGA
+#define CONFIG_CMD_I2C
 
 #undef CONFIG_WATCHDOG
 
@@ -182,6 +183,7 @@
propdev_debug=0\0 \
gevss_debug=0\0   \
watchdog=1\0  \
+   sensor_cnt=1\0\

 
 #undef XMK_STR
@@ -249,6 +251,14 @@
 #define CONFIG_SYS_BOOTMAPSZ   (8  20)
 
 /*
+ * I2C configuration
+ */
+#define CONFIG_HARD_I2C1
+#define CONFIG_SYS_I2C_MODULE  1
+#define CONFIG_SYS_I2C_SPEED   86000
+#define CONFIG_SYS_I2C_SLAVE   0x7F
+
+/*
  * Ethernet configuration
  */
 #define CONFIG_NET_MULTI



MATRIX VISION GmbH, Talstrasse 16, DE-71570 Oppenweiler
Registergericht: Amtsgericht Stuttgart, HRB 271090
Geschiaeftsf�hrer: Gerhard Thullner, Werner Armingeon, Uwe Furtner, 
Hans-Joachim Reich
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 2/2] use common code for mvBC-P (MPC5200)

2009-07-17 Thread André Schwarz
This patch makes use of common code, i.e. removes
duplicate board specific code. Additionally some hard
coded numbers have been replace by definitions and an
configurable PCI latency has been added.

Signed-off-by: André Schwarz andre.schw...@matrix-vision.de
---

 board/matrix_vision/mvbc_p/mvbc_p.c  |   94
+-
 board/matrix_vision/mvbc_p/mvbc_p.h  |2 +-
 board/matrix_vision/mvbc_p/mvbc_p_autoscript |   10 ++-
 3 files changed, 24 insertions(+), 82 deletions(-)

diff --git a/board/matrix_vision/mvbc_p/mvbc_p.c
b/board/matrix_vision/mvbc_p/mvbc_p.c
index a300342..59bbb5a 100644
--- a/board/matrix_vision/mvbc_p/mvbc_p.c
+++ b/board/matrix_vision/mvbc_p/mvbc_p.c
@@ -134,23 +134,6 @@ void mvbc_init_gpio(void)
printf(sint_gpioe  : 0x%08x\n, gpio-sint_gpioe);
 }
 
-void reset_environment(void)
-{
-   char *s, sernr[64];
-
-   printf(\n*** RESET ENVIRONMENT ***\n);
-   memset(sernr, 0, sizeof(sernr));
-   s = getenv(serial#);
-   if (s) {
-   printf(found serial# : %s\n, s);
-   strncpy(sernr, s, 64);
-   }
-   gd-env_valid = 0;
-   env_relocate();
-   if (s)
-   setenv(serial#, sernr);
-}
-
 int misc_init_r(void)
 {
char *s = getenv(reset_env);
@@ -166,7 +149,7 @@ int misc_init_r(void)
return 0;
}
printf( === FACTORY RESET ===\n);
-   reset_environment();
+   mv_reset_environment();
saveenv();
 
return -1;
@@ -206,7 +189,12 @@ void flash_afterinit(ulong size)
 void pci_mvbc_fixup_irq(struct pci_controller *hose, pci_dev_t dev)
 {
unsigned char line = 0xff;
+   char *s = getenv(pci_latency);
u32 base;
+   u8 val = 0;
+
+   if (s)
+   val = simple_strtoul(s, NULL, 16);
 
if (PCI_BUS(dev) == 0) {
switch (PCI_DEV (dev)) {
@@ -216,9 +204,13 @@ void pci_mvbc_fixup_irq(struct pci_controller
*hose, pci_dev_t dev)
printf(found FPA - enable arbitration\n);
writel(0x03, (u32*)(base + 0x80c0));
writel(0xf0, (u32*)(base + 0x8080));
+   if (val)
+   pci_hose_write_config_byte(hose, dev, 
PCI_LATENCY_TIMER, val);
break;
case 0xb: /* LAN */
line = 2;
+   if (val)
+   pci_hose_write_config_byte(hose, dev, 
PCI_LATENCY_TIMER, val);
break;
case 0x1a:
break;
@@ -234,85 +226,31 @@ struct pci_controller hose = {
fixup_irq:pci_mvbc_fixup_irq
 };
 
-int mvbc_p_load_fpga(void)
-{
-   size_t data_size = 0;
-   void *fpga_data = NULL;
-   char *datastr = getenv(fpgadata);
-   char *sizestr = getenv(fpgadatasize);
-
-   if (datastr)
-   fpga_data = (void *)simple_strtoul(datastr, NULL, 16);
-   if (sizestr)
-   data_size = (size_t)simple_strtoul(sizestr, NULL, 16);
-
-   return fpga_load(0, fpga_data, data_size);
-}
-
 extern void pci_mpc5xxx_init(struct pci_controller *);
 
 void pci_init_board(void)
 {
-   char *s;
-   int load_fpga = 1;
-
mvbc_p_init_fpga();
-   s = getenv(skip_fpga);
-   if (s) {
-   printf(found 'skip_fpga' - FPGA _not_ loaded !\n);
-   load_fpga = 0;
-   }
-   if (load_fpga) {
-   printf(loading FPGA ... );
-   mvbc_p_load_fpga();
-   printf(done\n);
-   }
+   mv_load_fpga();
pci_mpc5xxx_init(hose);
 }
 
-u8 *dhcp_vendorex_prep(u8 *e)
-{
-   char *ptr;
-
-   /* DHCP vendor-class-identifier = 60 */
-   if ((ptr = getenv(dhcp_vendor-class-identifier))) {
-   *e++ = 60;
-   *e++ = strlen(ptr);
-   while (*ptr)
-   *e++ = *ptr++;
-   }
-   /* DHCP_CLIENT_IDENTIFIER = 61 */
-   if ((ptr = getenv(dhcp_client_id))) {
-   *e++ = 61;
-   *e++ = strlen(ptr);
-   while (*ptr)
-   *e++ = *ptr++;
-   }
-
-   return e;
-}
-
-u8 *dhcp_vendorex_proc (u8 *popt)
-{
-   return NULL;
-}
-
 void show_boot_progress(int val)
 {
struct mpc5xxx_gpio *gpio = (struct mpc5xxx_gpio*)MPC5XXX_GPIO;
 
switch(val) {
case 0: /* FPGA ok */
-   setbits_be32(gpio-simple_dvo, 0x80);
+   setbits_be32(gpio-simple_dvo, LED_G0);
break;
-   case 1:
-   setbits_be32(gpio-simple_dvo, 0x40);
+   case 65:
+   setbits_be32(gpio-simple_dvo, LED_G1);
break;
case 12:
-   setbits_be32(gpio-simple_dvo, 0x20);
+   setbits_be32(gpio-simple_dvo, LED_Y);
break;
case 15:
-   setbits_be32(gpio-simple_dvo, 0x10);
+   

[U-Boot] [PATCH 1/2] update config for mvBL-M7 (MPC8343)

2009-07-17 Thread André Schwarz
This patch fixes DDR-II settings and adds I2C support.


Signed-off-by: André Schwarz andre.schw...@matrix-vision.de
---

 include/configs/MVBLM7.h |   48
-
 1 files changed, 21 insertions(+), 27 deletions(-)

diff --git a/include/configs/MVBLM7.h b/include/configs/MVBLM7.h
index ac8cb57..6e347e8 100644
--- a/include/configs/MVBLM7.h
+++ b/include/configs/MVBLM7.h
@@ -47,12 +47,14 @@
 #define CONFIG_MPC8XXX_SPI
 #define CONFIG_HARD_SPI
 #define MVBLM7_MMC_CS   0x0400
+#define CONFIG_MISC_INIT_R
 
 /* I2C */
 #undef CONFIG_SOFT_I2C
 
 #define CONFIG_FSL_I2C
 #define CONFIG_I2C_MULTI_BUS
+#define CONFIG_I2C_CMD_TREE
 #define CONFIG_SYS_I2C_OFFSET  0x3000
 #define CONFIG_SYS_I2C2_OFFSET 0x3100
 
@@ -62,44 +64,36 @@
 /*
  * DDR Setup
  */
+#undef CONFIG_SPD_EEPROM
+
 #define CONFIG_SYS_DDR_BASE0x
 #define CONFIG_SYS_SDRAM_BASE  CONFIG_SYS_DDR_BASE
 #define CONFIG_SYS_DDR_SDRAM_BASE  CONFIG_SYS_DDR_BASE
 #define CONFIG_SYS_83XX_DDR_USES_CS0   1
 #define CONFIG_SYS_MEMTEST_START   (6020)
 #define CONFIG_SYS_MEMTEST_END (7020)
+#define CONFIG_VERY_BIG_RAM
 
-#define CONFIG_SYS_DDR_SDRAM_CLK_CNTL  (DDR_SDRAM_CLK_CNTL_SS_EN | \
-   DDR_SDRAM_CLK_CNTL_CLK_ADJUST_05
-
-#define CONFIG_SYS_DDR_SIZE256
+#define CONFIG_SYS_DDRCDR  0x2201
+#define CONFIG_SYS_DDR_SDRAM_CLK_CNTL  DDR_SDRAM_CLK_CNTL_CLK_ADJUST_05
 
-/* HC, 75Ohm, DDR-II, DRQ */
-#define CONFIG_SYS_DDRCDR  0x8001
-/* EN, ODT_WR, 3BA, 14row, 10col */
-#define CONFIG_SYS_DDR_CS0_CONFIG  0x80014102
-#define CONFIG_SYS_DDR_CS1_CONFIG  0x0
-#define CONFIG_SYS_DDR_CS2_CONFIG  0x0
-#define CONFIG_SYS_DDR_CS3_CONFIG  0x0
+#define CONFIG_SYS_DDR_SIZE512
 
-#define CONFIG_SYS_DDR_CS0_BNDS0x000f
-#define CONFIG_SYS_DDR_CS1_BNDS0x0
-#define CONFIG_SYS_DDR_CS2_BNDS0x0
-#define CONFIG_SYS_DDR_CS3_BNDS0x0
+#define CONFIG_SYS_DDR_CS0_CONFIG  0x80014202
 
-#define CONFIG_SYS_DDR_CLK_CNTL0x0200
+#define CONFIG_SYS_DDR_CS0_BNDS0x003f
 
-#define CONFIG_SYS_DDR_TIMING_00x00260802
-#define CONFIG_SYS_DDR_TIMING_10x2625b221
-#define CONFIG_SYS_DDR_TIMING_20x1f9820c7
-#define CONFIG_SYS_DDR_TIMING_30x
+#define CONFIG_SYS_DDR_TIMING_00x00260802
+#define CONFIG_SYS_DDR_TIMING_10x3837c322
+#define CONFIG_SYS_DDR_TIMING_20x0f9848c6
+#define CONFIG_SYS_DDR_TIMING_30x
 
-/* ~MEM_EN, SREN, DDR-II, 32_BE */
-#define CONFIG_SYS_DDR_SDRAM_CFG   0x4308
+#define CONFIG_SYS_DDR_SDRAM_CFG   0x43080008
 #define CONFIG_SYS_DDR_SDRAM_CFG2  0x00401000
-#define CONFIG_SYS_DDR_INTERVAL0x04060100
+#define CONFIG_SYS_DDR_INTERVAL0x02000100
 
-#define CONFIG_SYS_DDR_MODE0x078e0232
+#define CONFIG_SYS_DDR_MODE0x04040242
+#define CONFIG_SYS_DDR_MODE2   0x0080
 
 /* Flash */
 #define CONFIG_SYS_FLASH_CFI
@@ -405,8 +399,8 @@
 
 #define MV_CI  mvBL-M7
 #define MV_VCI mvBL-M7
-#define MV_FPGA_DATA   0xfff8
-#define MV_FPGA_SIZE   0x00076ca2
+#define MV_FPGA_DATA   0xfff4
+#define MV_FPGA_SIZE   0
 #define MV_KERNEL_ADDR 0xff81
 #define MV_INITRD_ADDR 0xffb0
 #define MV_SOURCE_ADDR 0xff804000
@@ -453,7 +447,7 @@
static_ipaddr=192.168.90.10\0 \
static_netmask=255.255.255.0\0\
static_gateway=0.0.0.0\0  \
-   initrd_name=uInitrd.mvblm7-xenorfs\0  \
+   initrd_name=uInitrd.mvBL-M7-rfs\0 \
zcip=no\0 \
netboot=yes\0 \
mvtest=Ff\0   \



MATRIX VISION GmbH, Talstrasse 16, DE-71570 Oppenweiler
Registergericht: Amtsgericht Stuttgart, HRB 271090
Geschiaeftsf�hrer: Gerhard Thullner, Werner Armingeon, Uwe Furtner, 
Hans-Joachim Reich
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [U-boot][PATCH][1 of 2] AMCC ppc4xx /PLLOUTB/CPU clock/ Default bootstrap options A, B, C, D

2009-07-17 Thread Stefan Roese
Hi Rupjyoti Sarmah,

On Friday 17 July 2009 14:41:21 Rupjyoti Sarmah wrote:
 Unstable 440EPx operation due to default bootsrtap options settings.
 The 440EPx fixed bootstrap options A,B,C,D sets PLL FWDVA
 to a value 1 that results PLLOUTB being greater than the CPU clock
 frequency. This results unstable 440EPx operation causing hang
 conditions.

 This is a patch fixing this problem. The patch touches two files
 speed.c and cpu_init.c.

 Signed off by  Rupjyoti Sarmah  rsar...@amcc.com  from Applied Micro

This patch is unusable, I'm afraid. First it can't be applied since most 
likely your mailer corrupted the output (see below) and 2nd you are removing 
the complete files and adding them back below. The patch should only include 
the real changes.

Please fix and resubmit. If possible use git send-email for this.

Thanks.

 --


 diff -uNr u-boot-2009.06/cpu/ppc4xx/cpu_init.c
 u-boot-2009.06.1/cpu/ppc4xx/cpu_init.c

 --- u-boot-2009.06/cpu/ppc4xx/cpu_init.c 2009-06-14 12:30:39.0
 -0700

 +++ u-boot-2009.06.1/cpu/ppc4xx/cpu_init.c 2009-04-30 11:00:40.0
 -0700

 @@ -1,337 +1,462 @@

 -/*

 - * (C) Copyright 2000-2007

 - * Wolfgang Denk, DENX Software Engineering, w...@denx.de.

 - *

 - * See file CREDITS for list of people who contributed to this


As you see, an empty line was added for each of your lines. Please fix.

Thanks.

Best regards,
Stefan

=
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: off...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 2/2] use common code for mvBL-M7 (MPC8343)

2009-07-17 Thread André Schwarz
This patch makes use of common code, i.e. removes duplicate board
specific code.
Fix wrong GPIO direction.

Signed-off-by: André Schwarz andre.schw...@matrix-vision.de
---


Kim,
please note that this patch depends on WD applying the add common code
patch.

Cheers,
André


 board/matrix_vision/mvblm7/mvblm7.c |   54
+++---
 board/matrix_vision/mvblm7/mvblm7.h |3 +-
 board/matrix_vision/mvblm7/pci.c|   32 ++--
 3 files changed, 29 insertions(+), 60 deletions(-)

diff --git a/board/matrix_vision/mvblm7/mvblm7.c
b/board/matrix_vision/mvblm7/mvblm7.c
index 6984af9..53d873a 100644
--- a/board/matrix_vision/mvblm7/mvblm7.c
+++ b/board/matrix_vision/mvblm7/mvblm7.c
@@ -42,8 +42,15 @@ int fixed_sdram(void)
u32 msize = 0;
u32 ddr_size;
u32 ddr_size_log2;
+   char *s = getenv(ddr_size);
 
msize = CONFIG_SYS_DDR_SIZE;
+   if (s) {
+   u32 env_ddr_size = simple_strtoul(s, NULL, 10);
+   if (env_ddr_size == 512)
+   msize = 512;
+   }
+
for (ddr_size = msize  20, ddr_size_log2 = 0;
 (ddr_size  1);
 ddr_size = ddr_size  1, ddr_size_log2++) {
@@ -63,14 +70,19 @@ int fixed_sdram(void)
im-ddr.sdram_cfg = CONFIG_SYS_DDR_SDRAM_CFG;
im-ddr.sdram_cfg2 = CONFIG_SYS_DDR_SDRAM_CFG2;
im-ddr.sdram_mode = CONFIG_SYS_DDR_MODE;
+   im-ddr.sdram_mode2 = CONFIG_SYS_DDR_MODE2;
im-ddr.sdram_interval = CONFIG_SYS_DDR_INTERVAL;
-   im-ddr.sdram_clk_cntl = CONFIG_SYS_DDR_CLK_CNTL;
+   im-ddr.sdram_clk_cntl = CONFIG_SYS_DDR_SDRAM_CLK_CNTL;
 
-   udelay(300);
+   asm(sync;isync);
+   udelay(600);
 
im-ddr.sdram_cfg |= SDRAM_CFG_MEM_EN;
 
-   return CONFIG_SYS_DDR_SIZE;
+   asm(sync;isync);
+   udelay(500);
+
+   return msize;
 }
 
 phys_size_t initdram(int board_type)
@@ -88,40 +100,22 @@ phys_size_t initdram(int board_type)
return msize * 1024 * 1024;
 }
 
-int checkboard(void)
+int misc_init_r(void)
 {
-   puts(Board: Matrix Vision mvBlueLYNX-M7\n);
-
-   return 0;
-}
+   char *s = getenv(reset_env);
 
-u8 *dhcp_vendorex_prep(u8 *e)
-{
-   char *ptr;
-
-   /* DHCP vendor-class-identifier = 60 */
-   ptr = getenv(dhcp_vendor-class-identifier);
-   if (ptr) {
-   *e++ = 60;
-   *e++ = strlen(ptr);
-   while (*ptr)
-   *e++ = *ptr++;
-   }
-   /* DHCP_CLIENT_IDENTIFIER = 61 */
-   ptr = getenv(dhcp_client_id);
-   if (ptr) {
-   *e++ = 61;
-   *e++ = strlen(ptr);
-   while (*ptr)
-   *e++ = *ptr++;
+   if (s) {
+   mv_reset_environment();
}
 
-   return e;
+   return 0;
 }
 
-u8 *dhcp_vendorex_proc(u8 *popt)
+int checkboard(void)
 {
-   return NULL;
+   puts(Board: Matrix Vision mvBlueLYNX-M7\n);
+
+   return 0;
 }
 
 #ifdef CONFIG_HARD_SPI
diff --git a/board/matrix_vision/mvblm7/mvblm7.h
b/board/matrix_vision/mvblm7/mvblm7.h
index 03e9f41..de9fec7 100644
--- a/board/matrix_vision/mvblm7/mvblm7.h
+++ b/board/matrix_vision/mvblm7/mvblm7.h
@@ -8,14 +8,13 @@
 #define FPGA_DIN0x2000
 #define FPGA_STATUS 0x1000
 #define FPGA_CONF_DONE  0x0800
-#define MMC_CS 0x0400
 
 #define WD_WDI  0x0040
 #define WD_TS   0x0020
 #define MAN_RST 0x0010
 
 #define MV_GPIO_DAT(WD_TS)
-#define MV_GPIO_OUT(FPGA_CONFIG|FPGA_DIN|FPGA_CCLK|WD_TS|WD_WDI|
MMC_CS)
+#define MV_GPIO_OUT(FPGA_CONFIG|FPGA_DIN|FPGA_CCLK|MVBLM7_MMC_CS)
 #define MV_GPIO_ODE(FPGA_CONFIG|MAN_RST)
 
 #endif
diff --git a/board/matrix_vision/mvblm7/pci.c
b/board/matrix_vision/mvblm7/pci.c
index 9f31719..3ed0b80 100644
--- a/board/matrix_vision/mvblm7/pci.c
+++ b/board/matrix_vision/mvblm7/pci.c
@@ -35,21 +35,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-int mvblm7_load_fpga(void)
-{
-   size_t data_size = 0;
-   void *fpga_data = NULL;
-   char *datastr = getenv(fpgadata);
-   char *sizestr = getenv(fpgadatasize);
-
-   if (datastr)
-   fpga_data = (void *)simple_strtoul(datastr, NULL, 16);
-   if (sizestr)
-   data_size = (size_t)simple_strtoul(sizestr, NULL, 16);
-
-   return fpga_load(0, fpga_data, data_size);
-}
-
 static struct pci_region pci_regions[] = {
{
bus_start: CONFIG_SYS_PCI1_MEM_BASE,
@@ -84,32 +69,23 @@ void pci_init_board(void)
volatile law83xx_t *pci_law;
struct pci_region *reg[] = { pci_regions };
 
-   load_fpga = 1;
immr = (immap_t *) CONFIG_SYS_IMMR;
clk = (clk83xx_t *) immr-clk;
pci_ctrl = immr-pci_ctrl;
pci_law = immr-sysconf.pcilaw;
gpio  = (volatile gpio83xx_t *)immr-gpio[0];
 
-   s = getenv(skip_fpga);
-   if (s) {
-   printf(found 'skip_fpga' - FPGA _not_ loaded !\n);
-   

Re: [U-Boot] [PATCH v2] Add cpu_config command for PPC4xx bootstrap configuration

2009-07-17 Thread Wolfgang Denk
Dear Stefan Roese,

In message 1247834006-3005-1-git-send-email...@denx.de you wrote:
 This patch adds a generic command for programming I2C bootstrap
 eeproms on PPC4xx. An implementation for Canyonlands board is
 included.
 
 The command name is intentionally chosen not to be PPC4xx specific.
 This way other CPU's/SoC's can implement a similar command under
 the same name, perhaps with a different syntax.
 
 Usage on Canyonlands:
 
 = cpu_config
 Available configurations (I2C address 0x52):
 600-nor  - NOR  CPU: 600 PLB: 200 OPB: 100 EBC: 100
 600-nand - NAND CPU: 600 PLB: 200 OPB: 100 EBC: 100
 800-nor  - NOR  CPU: 800 PLB: 200 OPB: 100 EBC: 100
 800-nand - NAND CPU: 800 PLB: 200 OPB: 100 EBC: 100
 1000-nor - NOR  CPU:1000 PLB: 200 OPB: 100 EBC: 100
 1000-nand- NAND CPU:1000 PLB: 200 OPB: 100 EBC: 100
 1066-nor - NOR  CPU:1066 PLB: 266 OPB:  88 EBC:  88 ***
 1066-nand- NAND CPU:1066 PLB: 266 OPB:  88 EBC:  88

I like that!

 diff --git a/cpu/ppc4xx/cmd_cpu_config.c b/cpu/ppc4xx/cmd_cpu_config.c
 new file mode 100644
 index 000..9701dbb
 --- /dev/null
 +++ b/cpu/ppc4xx/cmd_cpu_config.c
...
 +static int do_cpu_config(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 +{
...
 + if (cur_config_nr == -1) {
 + printf(Warning: The I2C bootstrap EEPROM values don't match 
 any
 + of the available config options!\n);

This message doesn't fit into a single line. Please shorten or make 2
lines.


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
The so-called desktop metaphor of today's workstations  is  instead
an  airplane-seat  metaphor.  Anyone who has shuffled a lap full of
papers while seated between two portly passengers will recognize  the
difference -- one can see only a very few things at once.
   - Fred Brooks, Jr.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] PATCH

2009-07-17 Thread Wolfgang Denk
Dear =?ISO-8859-1?Q?Andr=E9?= Schwarz,

In message 1247834498.3953.34.ca...@swa-m460 you wrote:
 This patch adds common code usable for all Matrix Vision boards.
 
 Signed-off-by: Andr=C3=A9 Schwarz andre.schw...@matrix-vision.de
 ---
 
  board/matrix_vision/common/Makefile|   54 ++
  board/matrix_vision/common/mv_common.c |  125
 
  board/matrix_vision/common/mv_common.h |   25 +++
  3 files changed, 204 insertions(+), 0 deletions(-)

No. Please see my previous review comments.

The patches that add common code and that remove this common code from
the multiple places where it was before should be merged into one
atomic change.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Far back in the mists of ancient time, in the great and glorious days
of the former Galactic Empire, life was wild, rich  and  largely  tax
free. - Douglas Adams, _The Hitchhiker's Guide to the Galaxy_
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/2] use common code for mvBL-M7 (MPC8343)

2009-07-17 Thread Wolfgang Denk
Dear =?ISO-8859-1?Q?Andr=E9?= Schwarz,

In message 1247836512.3953.70.ca...@swa-m460 you wrote:
 This patch makes use of common code, i.e. removes duplicate board
 specific code.
 Fix wrong GPIO direction.

Please split this in two patches, and fold the use common code part
into the add common code patch.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
If all the Chinese simultaneously jumped into the Pacific  off  a  10
foot platform erected 10 feet off their coast, it would cause a tidal
wave that would destroy everything in this country west of Nebraska.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] ARM Cortex A8: Move OMAP3 specific reset handler to OMAP3 code

2009-07-17 Thread Dirk Behme
Minkyu Kang wrote:
 Dear Jean and Dirk,
 
  cpu/arm_cortexa8/omap3/lowlevel_init.S |   12 
  cpu/arm_cortexa8/start.S   |   14 --
  2 files changed, 12 insertions(+), 14 deletions(-)

 Index: u-boot-arm/cpu/arm_cortexa8/omap3/lowlevel_init.S
 ===
 --- u-boot-arm.orig/cpu/arm_cortexa8/omap3/lowlevel_init.S
 +++ u-boot-arm/cpu/arm_cortexa8/omap3/lowlevel_init.S
 @@ -181,6 +181,18 @@ lowlevel_init:
/* back to arch calling code */
mov pc, lr
  +.global reset_cpu
 +reset_cpu:
 +  ldr r1, rstctl  @ get addr for global reset
 +  @ reg
 +  mov r3, #0x2@ full reset pll + mpu
 +  str r3, [r1]@ force reset
 +  mov r0, r0
 +_loop_forever:
 +  b   _loop_forever
 +rstctl:
 +  .word   PRM_RSTCTRL
 +
 please move this to reset.S other wise fine
 Most probably your idea is that each file should only contain
 functionality which fits 100% (120%?) what the file name implies (?).
 While from general point of view this is correct, it makes no sense to
 create new files again and again just to follow this rule. We already
 created a cache.c on your request, now you request a new file reset.S
 for ~5 assembly lines. This new file would contain more comments (e.g.
 GPL header) than useful code.
 the idea is different here
 I want to have only code in lowlevel_init.S that can be disable by
 CONFIG_SKIP_LOWLEVEL_INIT and do it via Makefile
 Looking at recent OMAP3 lowlevel_init.S most probably some other stuff
 has to be moved to make this work, too. So for the moment, the
 cleanest way is to move above reset_cpu to low_levelinit.S. And then
 later, after thorough investigation and testing, move the stuff needed
 for your idea to an appropriate place. This move will be consistent
 then and will avoid polluting source tree with unnecessary files until
 then.

 So let's do it in two steps:

 a) Now, move reset_cpu to lowlevel_init.S so that Riverful can go on
 with his work

 b) Later, move everything necessary in one consistent patch set while
 you implement your CONFIG_SKIP_LOWLEVEL_INIT via Makefile idea

 
 As you known riverful and me prepare the new SOC (s5pc100) patch.
 so, we've been waiting for this issue to be resolved.
 Please let me know how do you solve this problem.
 
 I think... as Wolfgang said.. it would be better make new file.

Do you like to send a patch for this?

 I hope to be progressed this issue :)

Me too :)

Best regards

Dirk

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


[U-Boot] Pull request: u-boot-video

2009-07-17 Thread Anatolij Gustschin
Dear Wolfgang,

The following changes since commit bfadb17f69c256196620c32164775f063a59c34f:
  Anton Vorontsov (1):
mpc83xx: MPC837xEMDS: Use hwconfig instead of pci_external_arbiter 
variable

are available in the git repository at:

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

Anatolij Gustschin (3):
  video: mb862xx: fix coding style and remove dead code
  video: mb862xx: use macros instead of magic numbers
  video: mb862xx: replace printf with puts

Matthias Weisser (1):
  Added support for splash screen positioning

 README  |   20 +++
 common/lcd.c|   39 ++-
 drivers/video/cfb_console.c |   36 ++-
 drivers/video/mb862xx.c |  271 +++
 include/mb862xx.h   |   69 +++
 5 files changed, 304 insertions(+), 131 deletions(-)

Best regards,
Anatolij

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


[U-Boot] [PATCH v3] Add cpu_config command for PPC4xx bootstrap configuration

2009-07-17 Thread Stefan Roese
This patch adds a generic command for programming I2C bootstrap
eeproms on PPC4xx. An implementation for Canyonlands board is
included.

The command name is intentionally chosen not to be PPC4xx specific.
This way other CPU's/SoC's can implement a similar command under
the same name, perhaps with a different syntax.

Usage on Canyonlands:

= cpu_config
Available configurations (I2C address 0x52):
600-nor  - NOR  CPU: 600 PLB: 200 OPB: 100 EBC: 100
600-nand - NAND CPU: 600 PLB: 200 OPB: 100 EBC: 100
800-nor  - NOR  CPU: 800 PLB: 200 OPB: 100 EBC: 100
800-nand - NAND CPU: 800 PLB: 200 OPB: 100 EBC: 100
1000-nor - NOR  CPU:1000 PLB: 200 OPB: 100 EBC: 100
1000-nand- NAND CPU:1000 PLB: 200 OPB: 100 EBC: 100
1066-nor - NOR  CPU:1066 PLB: 266 OPB:  88 EBC:  88 ***
1066-nand- NAND CPU:1066 PLB: 266 OPB:  88 EBC:  88
= cpu_config 600-nor
Using configuration:
600-nor  - NOR  CPU: 600 PLB: 200 OPB: 100 EBC: 100
done (dump via 'i2c md 52 0.1 10')
Reset the board for the changes to take effect

Other 4xx boards will be migrated to use this command soon
as well.

Signed-off-by: Stefan Roese s...@denx.de
Signed-off-by: Dirk Eibach eib...@gdsys.de
Cc: Matthias Fuchs matthias.fu...@esd.eu
---
v3:
- Line length of one printf reduced

v2:
- Patch authorship changes to Stefan
- s-o-b from Dirk added
- Added current configuration detection
- Minor coding style cleanup

 board/amcc/canyonlands/Makefile |5 +-
 board/amcc/canyonlands/bootstrap.c  |  195 ---
 board/amcc/canyonlands/cpu_config.c |   55 ++
 cpu/ppc4xx/Makefile |3 +
 cpu/ppc4xx/cmd_cpu_config.c |  127 +++
 include/asm-ppc/ppc4xx_config.h |   42 
 include/configs/canyonlands.h   |4 +
 7 files changed, 234 insertions(+), 197 deletions(-)
 delete mode 100644 board/amcc/canyonlands/bootstrap.c
 create mode 100644 board/amcc/canyonlands/cpu_config.c
 create mode 100644 cpu/ppc4xx/cmd_cpu_config.c
 create mode 100644 include/asm-ppc/ppc4xx_config.h

diff --git a/board/amcc/canyonlands/Makefile b/board/amcc/canyonlands/Makefile
index 2aeead6..b1dfb0b 100644
--- a/board/amcc/canyonlands/Makefile
+++ b/board/amcc/canyonlands/Makefile
@@ -25,10 +25,11 @@ include $(TOPDIR)/config.mk
 
 LIB= $(obj)lib$(BOARD).a
 
-COBJS  := $(BOARD).o
-COBJS  += bootstrap.o
+COBJS-y:= $(BOARD).o
+COBJS-$(CONFIG_CMD_CPU_CONFIG) += cpu_config.o
 SOBJS  := init.o
 
+COBJS   := $(COBJS-y)
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS))
 SOBJS  := $(addprefix $(obj),$(SOBJS))
diff --git a/board/amcc/canyonlands/bootstrap.c 
b/board/amcc/canyonlands/bootstrap.c
deleted file mode 100644
index 6dc2cca..000
--- a/board/amcc/canyonlands/bootstrap.c
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
- * (C) Copyright 2008
- * Stefan Roese, DENX Software Engineering, s...@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- */
-
-#include common.h
-#include command.h
-#include i2c.h
-#include asm/io.h
-
-/*
- * NOR and NAND boot options change bytes 5, 6, 8, 9, 11. The
- * values are independent of the rest of the clock settings.
- */
-
-#define NAND_COMPATIBLE0x01
-#define NOR_COMPATIBLE  0x02
-
-#define I2C_EEPROM_ADDR 0x52
-
-static char *config_labels[] = {
-   CPU: 600 PLB: 200 OPB: 100 EBC: 100,
-   CPU: 800 PLB: 200 OPB: 100 EBC: 100,
-   CPU:1000 PLB: 200 OPB: 100 EBC: 100,
-   CPU:1066 PLB: 266 OPB:  88 EBC:  88,
-   NULL
-};
-
-static u8 boot_configs[][17] = {
-   {
-   (NAND_COMPATIBLE | NOR_COMPATIBLE),
-   0x86, 0x80, 0xce, 0x1f, 0x79, 0x80, 0x00, 0xa0, 0x40, 0x08,
-   0x23, 0x50, 0x0d, 0x05, 0x00, 0x00
-   },
-   {
-   (NAND_COMPATIBLE | NOR_COMPATIBLE),
-   0x86, 0x80, 0xba, 0x14, 0x99, 0x80, 0x00, 0xa0, 0x40, 0x08,
-   0x23, 0x50, 0x0d, 0x05, 0x00, 0x00
-   },
-   {
-   (NAND_COMPATIBLE | NOR_COMPATIBLE),
-   0x86, 0x82, 0x96, 0x19, 0xb9, 0x80, 0x00, 0xa0, 0x40, 0x08,
-   0x23, 0x50, 0x0d, 0x05, 0x00, 0x00
-   },
-   {
-   (NAND_COMPATIBLE 

[U-Boot] [PATCH v2] create and use common code for Matrix Vision boards

2009-07-17 Thread André Schwarz
This patch adds and uses common code for all Matrix Vision boards.

Signed-off-by: André Schwarz andre.schw...@matrix-vision.de
---



 board/matrix_vision/common/Makefile|   54 ++
 board/matrix_vision/common/mv_common.c |  125

 board/matrix_vision/common/mv_common.h |   25 +++
 board/matrix_vision/mvbc_p/mvbc_p.c|   75 +---
 board/matrix_vision/mvblm7/mvblm7.c|   38 +++---
 board/matrix_vision/mvblm7/pci.c   |   32 +---
 include/configs/MVBC_P.h   |   14 +++-
 include/configs/MVBLM7.h   |   48 ++---
 8 files changed, 253 insertions(+), 158 deletions(-)

diff --git a/board/matrix_vision/common/Makefile
b/board/matrix_vision/common/Makefile
new file mode 100644
index 000..b496258
--- /dev/null
+++ b/board/matrix_vision/common/Makefile
@@ -0,0 +1,54 @@
+#
+# (C) Copyright 2006
+# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)board/$(VENDOR)/common)
+endif
+
+LIB= $(obj)lib$(VENDOR).a
+
+COBJS-y= mv_common.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS-y))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(obj).depend $(OBJS)
+   $(AR) $(ARFLAGS) $@ $(OBJS)
+
+clean:
+   rm -f $(SOBJS) $(OBJS)
+
+distclean: clean
+   rm -f $(LIB) core *.bak $(obj).depend
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/matrix_vision/common/mv_common.c
b/board/matrix_vision/common/mv_common.c
new file mode 100644
index 000..284de16
--- /dev/null
+++ b/board/matrix_vision/common/mv_common.c
@@ -0,0 +1,125 @@
+/*
+ * (C) Copyright 2008
+ * Andre Schwarz, Matrix Vision GmbH, andre.schw...@matrix-vision.de
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include common.h
+#include malloc.h
+#include environment.h
+#include asm/io.h
+
+DECLARE_GLOBAL_DATA_PTR;
+
+static char* entries_to_keep[] = {
+   serial#, ethaddr, eth1addr, model_info, sensor_cnt,
+   fpgadatasize, ddr_size, use_dhcp, use_static_ipaddr,
+   static_ipaddr, static_netmask, static_gateway,
+   syslog, watchdog, netboot, evo8serialnumber };
+
+#define MV_MAX_ENV_ENTRY_LENGTH64
+#define MV_KEEP_ENTRIESARRAY_SIZE(entries_to_keep)
+
+void mv_reset_environment(void)
+{
+   int i;
+   char *s[MV_KEEP_ENTRIES];
+   char entries[MV_KEEP_ENTRIES][MV_MAX_ENV_ENTRY_LENGTH];
+
+   printf(\n*** RESET ENVIRONMENT ***\n);
+
+   memset(entries, 0, MV_KEEP_ENTRIES * MV_MAX_ENV_ENTRY_LENGTH);
+   for (i = 0; i  MV_KEEP_ENTRIES; i++) {
+   s[i] = getenv(entries_to_keep[i]);
+   if (s[i]) {
+   printf(save '%s' : %s\n, entries_to_keep[i], s[i]);
+   strncpy(entries[i], s[i], MV_MAX_ENV_ENTRY_LENGTH);
+   }
+   }
+
+   gd-env_valid = 0;
+   env_relocate();
+
+   for (i = 0; i  MV_KEEP_ENTRIES; i++) {
+   if (s[i]) {
+   printf(restore '%s' : %s\n, entries_to_keep[i], s[i]);
+   setenv(entries_to_keep[i], s[i]);
+   }
+ 

Re: [U-Boot] [PATCH] fec_mxc: driver for FEC ethernet controller on i.MX27

2009-07-17 Thread Ben Warren
Hi Ilya,

On Fri, Jul 17, 2009 at 3:57 AM, Ilya Yanok ya...@emcraft.com wrote:

 Signed-off-by: Ilya Yanok ya...@emcraft.com
 ---
  cpu/arm926ejs/mx27/generic.c |   10 +
  drivers/net/Makefile |1 +
  drivers/net/fec_mxc.c|  742
 ++
  drivers/net/fec_mxc.h|  304 +
  include/netdev.h |1 +
  5 files changed, 1058 insertions(+), 0 deletions(-)
  create mode 100644 drivers/net/fec_mxc.c
  create mode 100644 drivers/net/fec_mxc.h

 diff --git a/cpu/arm926ejs/mx27/generic.c b/cpu/arm926ejs/mx27/generic.c
 index bcf7899..7f6fc69 100644
 --- a/cpu/arm926ejs/mx27/generic.c
 +++ b/cpu/arm926ejs/mx27/generic.c
 @@ -20,6 +20,7 @@

  #include common.h
  #include div64.h
 +#include netdev.h
  #include asm/io.h
  #include asm/arch/imx-regs.h

 @@ -159,6 +160,15 @@ int print_cpuinfo (void)
  }
  #endif

 +int cpu_eth_init(bd_t *bis)
 +{
 +#if defined(CONFIG_FEC_IMX27)
 +   return fecimx27_initialize(bis);
 +#else
 +   return 0;
 +#endif
 +}
 +


The main reason why this was rejected previously was because you needlessly
restricted the scope to imx27, when there are other CPUs that apparently
share this FEC.  I see you've changed the name of the driver to something
more appropriately generic, but why not the name of the initialization
function?

Please rationalize this.  If you do so, I'll make sure to get the driver in
this release.

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


Re: [U-Boot] [PATCH 1/2] update config for mvBL-M7 (MPC8343)

2009-07-17 Thread Heiko Schocher
Hello André,

André Schwarz wrote:
 This patch fixes DDR-II settings and adds I2C support.
 
 
 Signed-off-by: André Schwarz andre.schw...@matrix-vision.de
 ---
 
  include/configs/MVBLM7.h |   48
 -
  1 files changed, 21 insertions(+), 27 deletions(-)
 
 diff --git a/include/configs/MVBLM7.h b/include/configs/MVBLM7.h
 index ac8cb57..6e347e8 100644
 --- a/include/configs/MVBLM7.h
 +++ b/include/configs/MVBLM7.h
 @@ -47,12 +47,14 @@
  #define CONFIG_MPC8XXX_SPI
  #define CONFIG_HARD_SPI
  #define MVBLM7_MMC_CS   0x0400
 +#define CONFIG_MISC_INIT_R

So misc_init_r () gets called, but I didn;t find this in your
patch? May I miss something ...

  /* I2C */
  #undef CONFIG_SOFT_I2C
  

please add #define CONFIG_HARD_I2C, without, I think, this never
works.

  #define CONFIG_FSL_I2C
  #define CONFIG_I2C_MULTI_BUS
 +#define CONFIG_I2C_CMD_TREE

no longer needed.

  #define CONFIG_SYS_I2C_OFFSET0x3000
  #define CONFIG_SYS_I2C2_OFFSET   0x3100
  
 @@ -62,44 +64,36 @@
  /*
   * DDR Setup
   */
 +#undef   CONFIG_SPD_EEPROM
 +
  #define CONFIG_SYS_DDR_BASE  0x
  #define CONFIG_SYS_SDRAM_BASECONFIG_SYS_DDR_BASE
  #define CONFIG_SYS_DDR_SDRAM_BASECONFIG_SYS_DDR_BASE
  #define CONFIG_SYS_83XX_DDR_USES_CS0 1
  #define CONFIG_SYS_MEMTEST_START (6020)
  #define CONFIG_SYS_MEMTEST_END   (7020)
 +#define CONFIG_VERY_BIG_RAM
  
 -#define CONFIG_SYS_DDR_SDRAM_CLK_CNTL(DDR_SDRAM_CLK_CNTL_SS_EN | \
 - DDR_SDRAM_CLK_CNTL_CLK_ADJUST_05
 -
 -#define CONFIG_SYS_DDR_SIZE  256
 +#define CONFIG_SYS_DDRCDR0x2201
 +#define CONFIG_SYS_DDR_SDRAM_CLK_CNTLDDR_SDRAM_CLK_CNTL_CLK_ADJUST_05
  
 -/* HC, 75Ohm, DDR-II, DRQ */
 -#define CONFIG_SYS_DDRCDR0x8001
 -/* EN, ODT_WR, 3BA, 14row, 10col */
 -#define CONFIG_SYS_DDR_CS0_CONFIG0x80014102
 -#define CONFIG_SYS_DDR_CS1_CONFIG0x0
 -#define CONFIG_SYS_DDR_CS2_CONFIG0x0
 -#define CONFIG_SYS_DDR_CS3_CONFIG0x0
 +#define CONFIG_SYS_DDR_SIZE  512
  
 -#define CONFIG_SYS_DDR_CS0_BNDS  0x000f
 -#define CONFIG_SYS_DDR_CS1_BNDS  0x0
 -#define CONFIG_SYS_DDR_CS2_BNDS  0x0
 -#define CONFIG_SYS_DDR_CS3_BNDS  0x0
 +#define CONFIG_SYS_DDR_CS0_CONFIG0x80014202
  
 -#define CONFIG_SYS_DDR_CLK_CNTL  0x0200
 +#define CONFIG_SYS_DDR_CS0_BNDS  0x003f
  
 -#define CONFIG_SYS_DDR_TIMING_0  0x00260802
 -#define CONFIG_SYS_DDR_TIMING_1  0x2625b221
 -#define CONFIG_SYS_DDR_TIMING_2  0x1f9820c7
 -#define CONFIG_SYS_DDR_TIMING_3  0x
 +#define CONFIG_SYS_DDR_TIMING_0  0x00260802
 +#define CONFIG_SYS_DDR_TIMING_1  0x3837c322
 +#define CONFIG_SYS_DDR_TIMING_2  0x0f9848c6
 +#define CONFIG_SYS_DDR_TIMING_3  0x
  
 -/* ~MEM_EN, SREN, DDR-II, 32_BE */
 -#define CONFIG_SYS_DDR_SDRAM_CFG 0x4308
 +#define CONFIG_SYS_DDR_SDRAM_CFG 0x43080008
  #define CONFIG_SYS_DDR_SDRAM_CFG20x00401000
 -#define CONFIG_SYS_DDR_INTERVAL  0x04060100
 +#define CONFIG_SYS_DDR_INTERVAL  0x02000100
  
 -#define CONFIG_SYS_DDR_MODE  0x078e0232
 +#define CONFIG_SYS_DDR_MODE  0x04040242
 +#define CONFIG_SYS_DDR_MODE2 0x0080
  
  /* Flash */
  #define CONFIG_SYS_FLASH_CFI
 @@ -405,8 +399,8 @@
  
  #define MV_CImvBL-M7
  #define MV_VCI   mvBL-M7
 -#define MV_FPGA_DATA 0xfff8
 -#define MV_FPGA_SIZE 0x00076ca2
 +#define MV_FPGA_DATA 0xfff4
 +#define MV_FPGA_SIZE 0
  #define MV_KERNEL_ADDR   0xff81
  #define MV_INITRD_ADDR   0xffb0
  #define MV_SOURCE_ADDR   0xff804000
 @@ -453,7 +447,7 @@
   static_ipaddr=192.168.90.10\0 \
   static_netmask=255.255.255.0\0\
   static_gateway=0.0.0.0\0  \
 - initrd_name=uInitrd.mvblm7-xenorfs\0  \
 + initrd_name=uInitrd.mvBL-M7-rfs\0 \
   zcip=no\0 \
   netboot=yes\0 \
   mvtest=Ff\0   \
 
 
 
 MATRIX VISION GmbH, Talstrasse 16, DE-71570 Oppenweiler
 Registergericht: Amtsgericht Stuttgart, HRB 271090
 Geschiaeftsf�hrer: Gerhard Thullner, Werner Armingeon, Uwe Furtner, 
 Hans-Joachim Reich
 
 
 
 
 ___
 U-Boot mailing list
 U-Boot@lists.denx.de
 http://lists.denx.de/mailman/listinfo/u-boot

bye
Heiko
-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list

Re: [U-Boot] CONFIG_API, EABI and raise()

2009-07-17 Thread Piotr Zięcik
Wednesday 15 July 2009 18:09:30 Mike Frysinger napisał(a):
  CONFIG_API worked fine for ARM builds some time ago, and this breakage
  seems like a recent development.

 or, it still works fine if your toolchain doesnt suck and isnt broken
 -mike

I have done some research and mike is right. We are using ELDK 4.2
which provides gnueabi compiler only. While compilng U-Boot,
-mabi=apcs-gnu switch forces APCS and as U-Boot uses this ABI.

However API demo application requires libgcc, which is avaible
in gnueabi version only and cannot be linked with objects, which use APCS.

Demo application is linked correctly on ELDK 4.1, which does not provide 
gnueabi tollchain.

-- 
Best Regards,
Piotr Zięcik
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Net patches and the merge window

2009-07-17 Thread Ben Warren
Hello,
The merge window for release 2009.08 is scheduled to close in 2 days.  I'll
very soon be going away for the weekend and probably won't have internet
access until after the merge window closes.

As long as the first spin of a network-related patch is posted by the end of
Sunday, California time, it and any iterations will be considered for
inclusion.

In general, I'm pretty awful (isn't the English language wonderful?) at
responding quickly to patch submissions.  Please don't mistake the lack of a
timely response for being ignored.

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


Re: [U-Boot] [PATCH 1/2] update config for mvBL-M7 (MPC8343)

2009-07-17 Thread André Schwarz
Heiko,

this patch is no longer valid since I already posted v2.

But your comments are correct ...

Will wait for WD's comments and send v3.


Regards,
André

On Fri, 2009-07-17 at 16:15 +0200, Heiko Schocher wrote:
 Hello André,
 
 André Schwarz wrote:
  This patch fixes DDR-II settings and adds I2C support.
  
  
  Signed-off-by: André Schwarz andre.schw...@matrix-vision.de
  ---
  
   include/configs/MVBLM7.h |   48
  -
   1 files changed, 21 insertions(+), 27 deletions(-)
  
  diff --git a/include/configs/MVBLM7.h b/include/configs/MVBLM7.h
  index ac8cb57..6e347e8 100644
  --- a/include/configs/MVBLM7.h
  +++ b/include/configs/MVBLM7.h
  @@ -47,12 +47,14 @@
   #define CONFIG_MPC8XXX_SPI
   #define CONFIG_HARD_SPI
   #define MVBLM7_MMC_CS   0x0400
  +#define CONFIG_MISC_INIT_R
 
 So misc_init_r () gets called, but I didn;t find this in your
 patch? May I miss something ...

It's included in the other common code patch.

 
   /* I2C */
   #undef CONFIG_SOFT_I2C
   
 
 please add #define CONFIG_HARD_I2C, without, I think, this never
 works.

ok.

 
   #define CONFIG_FSL_I2C
   #define CONFIG_I2C_MULTI_BUS
  +#define CONFIG_I2C_CMD_TREE
 
 no longer needed.

ok.

 
   #define CONFIG_SYS_I2C_OFFSET  0x3000
   #define CONFIG_SYS_I2C2_OFFSET 0x3100
   
  @@ -62,44 +64,36 @@
   /*
* DDR Setup
*/
  +#undef CONFIG_SPD_EEPROM
  +
   #define CONFIG_SYS_DDR_BASE0x
   #define CONFIG_SYS_SDRAM_BASE  CONFIG_SYS_DDR_BASE
   #define CONFIG_SYS_DDR_SDRAM_BASE  CONFIG_SYS_DDR_BASE
   #define CONFIG_SYS_83XX_DDR_USES_CS0   1
   #define CONFIG_SYS_MEMTEST_START   (6020)
   #define CONFIG_SYS_MEMTEST_END (7020)
  +#define CONFIG_VERY_BIG_RAM
   
  -#define CONFIG_SYS_DDR_SDRAM_CLK_CNTL  (DDR_SDRAM_CLK_CNTL_SS_EN | \
  -   DDR_SDRAM_CLK_CNTL_CLK_ADJUST_05
  -
  -#define CONFIG_SYS_DDR_SIZE256
  +#define CONFIG_SYS_DDRCDR  0x2201
  +#define CONFIG_SYS_DDR_SDRAM_CLK_CNTL  DDR_SDRAM_CLK_CNTL_CLK_ADJUST_05
   
  -/* HC, 75Ohm, DDR-II, DRQ */
  -#define CONFIG_SYS_DDRCDR  0x8001
  -/* EN, ODT_WR, 3BA, 14row, 10col */
  -#define CONFIG_SYS_DDR_CS0_CONFIG  0x80014102
  -#define CONFIG_SYS_DDR_CS1_CONFIG  0x0
  -#define CONFIG_SYS_DDR_CS2_CONFIG  0x0
  -#define CONFIG_SYS_DDR_CS3_CONFIG  0x0
  +#define CONFIG_SYS_DDR_SIZE512
   
  -#define CONFIG_SYS_DDR_CS0_BNDS0x000f
  -#define CONFIG_SYS_DDR_CS1_BNDS0x0
  -#define CONFIG_SYS_DDR_CS2_BNDS0x0
  -#define CONFIG_SYS_DDR_CS3_BNDS0x0
  +#define CONFIG_SYS_DDR_CS0_CONFIG  0x80014202
   
  -#define CONFIG_SYS_DDR_CLK_CNTL0x0200
  +#define CONFIG_SYS_DDR_CS0_BNDS0x003f
   
  -#define CONFIG_SYS_DDR_TIMING_00x00260802
  -#define CONFIG_SYS_DDR_TIMING_10x2625b221
  -#define CONFIG_SYS_DDR_TIMING_20x1f9820c7
  -#define CONFIG_SYS_DDR_TIMING_30x
  +#define CONFIG_SYS_DDR_TIMING_00x00260802
  +#define CONFIG_SYS_DDR_TIMING_10x3837c322
  +#define CONFIG_SYS_DDR_TIMING_20x0f9848c6
  +#define CONFIG_SYS_DDR_TIMING_30x
   
  -/* ~MEM_EN, SREN, DDR-II, 32_BE */
  -#define CONFIG_SYS_DDR_SDRAM_CFG   0x4308
  +#define CONFIG_SYS_DDR_SDRAM_CFG   0x43080008
   #define CONFIG_SYS_DDR_SDRAM_CFG2  0x00401000
  -#define CONFIG_SYS_DDR_INTERVAL0x04060100
  +#define CONFIG_SYS_DDR_INTERVAL0x02000100
   
  -#define CONFIG_SYS_DDR_MODE0x078e0232
  +#define CONFIG_SYS_DDR_MODE0x04040242
  +#define CONFIG_SYS_DDR_MODE2   0x0080
   
   /* Flash */
   #define CONFIG_SYS_FLASH_CFI
  @@ -405,8 +399,8 @@
   
   #define MV_CI  mvBL-M7
   #define MV_VCI mvBL-M7
  -#define MV_FPGA_DATA   0xfff8
  -#define MV_FPGA_SIZE   0x00076ca2
  +#define MV_FPGA_DATA   0xfff4
  +#define MV_FPGA_SIZE   0
   #define MV_KERNEL_ADDR 0xff81
   #define MV_INITRD_ADDR 0xffb0
   #define MV_SOURCE_ADDR 0xff804000
  @@ -453,7 +447,7 @@
  static_ipaddr=192.168.90.10\0 \
  static_netmask=255.255.255.0\0\
  static_gateway=0.0.0.0\0  \
  -   initrd_name=uInitrd.mvblm7-xenorfs\0  \
  +   initrd_name=uInitrd.mvBL-M7-rfs\0 \
  zcip=no\0 \
  netboot=yes\0 \
  mvtest=Ff\0   \
  
  
  
  MATRIX VISION GmbH, Talstrasse 16, DE-71570 Oppenweiler
  Registergericht: Amtsgericht Stuttgart, HRB 271090
  Geschiaeftsf�hrer: Gerhard Thullner, Werner Armingeon, Uwe Furtner, 
  Hans-Joachim Reich
  
  
  

Re: [U-Boot] [PATCH 1/2] update config for mvBL-M7 (MPC8343)

2009-07-17 Thread Heiko Schocher
Hello André,

André Schwarz wrote:
 Heiko,
 
 this patch is no longer valid since I already posted v2.

Ah, ok.

 But your comments are correct ...
 
 Will wait for WD's comments and send v3.

OK, one more minor comment ...

 On Fri, 2009-07-17 at 16:15 +0200, Heiko Schocher wrote:
 Hello André,

 André Schwarz wrote:
 This patch fixes DDR-II settings and adds I2C support.


 Signed-off-by: André Schwarz andre.schw...@matrix-vision.de
 ---

  include/configs/MVBLM7.h |   48
 -
  1 files changed, 21 insertions(+), 27 deletions(-)

 diff --git a/include/configs/MVBLM7.h b/include/configs/MVBLM7.h
 index ac8cb57..6e347e8 100644
 --- a/include/configs/MVBLM7.h
 +++ b/include/configs/MVBLM7.h
 @@ -47,12 +47,14 @@
  #define CONFIG_MPC8XXX_SPI
  #define CONFIG_HARD_SPI
  #define MVBLM7_MMC_CS   0x0400
 +#define CONFIG_MISC_INIT_R
 So misc_init_r () gets called, but I didn;t find this in your
 patch? May I miss something ...
 
 It's included in the other common code patch.

Hmm... but this will break git-bisect compatibility, and if we
have such a tool for searching bugs, we should make patches which
are git bisect compatible ... so please look, that patches compile
clean ...

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


[U-Boot] [PATCH] api: Fix broken build on ARM.

2009-07-17 Thread Piotr Ziecik
This patch fixes broken build introduced by commit
84bf7ca522e94ec402a1264b01971b924b7e268f (api: remove un-needed
ifdef CONFIG_API already handle by the Makefile).

Signed-off-by: Piotr Ziecik ko...@semihalf.com
---
 api/api_platform-arm.c |2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/api/api_platform-arm.c b/api/api_platform-arm.c
index fffaa1e..e65a180 100644
--- a/api/api_platform-arm.c
+++ b/api/api_platform-arm.c
@@ -53,5 +53,3 @@ int platform_sys_info(struct sys_info *si)
 
return 1;
 }
-
-#endif /* CONFIG_API */
-- 
1.6.3.1

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


Re: [U-Boot] [PATCH v3] Add cpu_config command for PPC4xx bootstrap configuration

2009-07-17 Thread Wolfgang Denk
Dear Stefan Roese,

In message 1247838836-20340-1-git-send-email...@denx.de you wrote:
 This patch adds a generic command for programming I2C bootstrap
 eeproms on PPC4xx. An implementation for Canyonlands board is
 included.
 
 The command name is intentionally chosen not to be PPC4xx specific.
 This way other CPU's/SoC's can implement a similar command under
 the same name, perhaps with a different syntax.
...
  board/amcc/canyonlands/Makefile |5 +-
  board/amcc/canyonlands/bootstrap.c  |  195 
 ---
  board/amcc/canyonlands/cpu_config.c |   55 ++
  cpu/ppc4xx/Makefile |3 +
  cpu/ppc4xx/cmd_cpu_config.c |  127 +++
  include/asm-ppc/ppc4xx_config.h |   42 
  include/configs/canyonlands.h   |4 +
  7 files changed, 234 insertions(+), 197 deletions(-)
  delete mode 100644 board/amcc/canyonlands/bootstrap.c
  create mode 100644 board/amcc/canyonlands/cpu_config.c
  create mode 100644 cpu/ppc4xx/cmd_cpu_config.c
  create mode 100644 include/asm-ppc/ppc4xx_config.h

Acked-by: Wolfgang Denk w...@denx.de


Stefan, as this is mostly 4xx-related I suggest you run this through
the ppc_4xx repo.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
I wish Captain Vimes were here. He wouldn't have  known  what  to  do
either, but he's got a much better vocabulary to be baffled in.
 - Terry Pratchett, _Guards! Guards!_
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] update config for mvBL-M7 (MPC8343)

2009-07-17 Thread André Schwarz
On Fri, 2009-07-17 at 16:32 +0200, Heiko Schocher wrote:
 Hello André,
 
 André Schwarz wrote:
  Heiko,
  
  this patch is no longer valid since I already posted v2.
 
 Ah, ok.
 
  But your comments are correct ...
  
  Will wait for WD's comments and send v3.
 
 OK, one more minor comment ...
 
  On Fri, 2009-07-17 at 16:15 +0200, Heiko Schocher wrote:
  Hello André,
 
  André Schwarz wrote:
  This patch fixes DDR-II settings and adds I2C support.
 
 
  Signed-off-by: André Schwarz andre.schw...@matrix-vision.de
  ---
 
   include/configs/MVBLM7.h |   48
  -
   1 files changed, 21 insertions(+), 27 deletions(-)
 
  diff --git a/include/configs/MVBLM7.h b/include/configs/MVBLM7.h
  index ac8cb57..6e347e8 100644
  --- a/include/configs/MVBLM7.h
  +++ b/include/configs/MVBLM7.h
  @@ -47,12 +47,14 @@
   #define CONFIG_MPC8XXX_SPI
   #define CONFIG_HARD_SPI
   #define MVBLM7_MMC_CS   0x0400
  +#define CONFIG_MISC_INIT_R
  So misc_init_r () gets called, but I didn;t find this in your
  patch? May I miss something ...
  
  It's included in the other common code patch.
 
 Hmm... but this will break git-bisect compatibility, and if we
 have such a tool for searching bugs, we should make patches which
 are git bisect compatible ... so please look, that patches compile
 clean ...

yes - that's what WD has been complaining ... it's now a single patch.

 
 bye
 Heiko



MATRIX VISION GmbH, Talstrasse 16, DE-71570 Oppenweiler
Registergericht: Amtsgericht Stuttgart, HRB 271090
Geschiaeftsf�hrer: Gerhard Thullner, Werner Armingeon, Uwe Furtner, 
Hans-Joachim Reich
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] update config for mvBL-M7 (MPC8343)

2009-07-17 Thread Wolfgang Denk
Dear =?ISO-8859-1?Q?Andr=E9?= Schwarz,

In message 1247840636.3953.78.ca...@swa-m460 you wrote:

   +#define CONFIG_MISC_INIT_R
  
  So misc_init_r () gets called, but I didn;t find this in your
  patch? May I miss something ...

 It's included in the other common code patch.

You must not break things that belong together logically into separate
patches - this would break bisectability.

If the common code patch adds misc_init_r(), it must also include
the config file change that makes it use this code.

Did you run MAKEALL after applying each of your patches, one by one?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Alles Gescheite ist schon gedacht worden, man muß nur versuchen,
es noch einmal zu denken.  -- Goethe, Maximen und Reflexionen
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3] Add cpu_config command for PPC4xx bootstrap configuration

2009-07-17 Thread Stefan Roese
On Friday 17 July 2009 16:39:35 Wolfgang Denk wrote:
 Acked-by: Wolfgang Denk w...@denx.de


 Stefan, as this is mostly 4xx-related I suggest you run this through
 the ppc_4xx repo.

OK, will do. Thanks.

Best regards,
Stefan

=
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: off...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] net: sync env ethaddr to device enetaddr in eth_init()

2009-07-17 Thread Andrzej Wolski
 In the previous enetaddr refactoring, the assumption with commit 56b555a644
 was that the eth layer would handle the env - device enetaddr syncing.
 This was not the case as eth_initialize() is called only once and the sync
 occurs there.  So make sure the eth_init() function does the env - device
 sync with every network init.
 
 Reported-by: Andrzej Wolski awol...@poczta.fm
 Signed-off-by: Mike Frysinger vap...@gentoo.org
 ---
 Andrzej: please try this patch instead for your macb troubles

Now it works fine. Thanks!

Andrzej Wolski




--
Rowerem do pracy? Czemu nie!
Kliknij  http://link.interia.pl/f2256

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


Re: [U-Boot] [PATCH 1/2] update config for mvBL-M7 (MPC8343)

2009-07-17 Thread André Schwarz
On Fri, 2009-07-17 at 16:44 +0200, Wolfgang Denk wrote:
 Dear =?ISO-8859-1?Q?Andr=E9?= Schwarz,
 
 In message 1247840636.3953.78.ca...@swa-m460 you wrote:
 
+#define CONFIG_MISC_INIT_R
   
   So misc_init_r () gets called, but I didn;t find this in your
   patch? May I miss something ...
 
  It's included in the other common code patch.
 
 You must not break things that belong together logically into separate
 patches - this would break bisectability.

yes of course.
I expected everybody to discard the patchset completely after your
rejection/comments.

The follow-up [PATCH v2] create and use common code for Matrix Vision
boards includes both the config and the code move in order to be
atomic/bisectable.

If there are no further objections I'll submit v3 adressing Heiko's
comments and fixing a warning due to missing #include statement.

Both board binaries compile and work as expected.


Sorry for the trouble - I'm not an everyday git user ... still trying to
improve ;-)


Regards,
André

 
 If the common code patch adds misc_init_r(), it must also include
 the config file change that makes it use this code.
 
 Did you run MAKEALL after applying each of your patches, one by one?
 
 Best regards,
 
 Wolfgang Denk
 



MATRIX VISION GmbH, Talstrasse 16, DE-71570 Oppenweiler
Registergericht: Amtsgericht Stuttgart, HRB 271090
Geschiaeftsf�hrer: Gerhard Thullner, Werner Armingeon, Uwe Furtner, 
Hans-Joachim Reich
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v3] create and use common code for Matrix Vision boards

2009-07-17 Thread André Schwarz
This patch adds and uses common code for all Matrix Vision boards.

Signed-off-by: André Schwarz andre.schw...@matrix-vision.de
---

Heiko's comments have been addressed and common/mv_common.h has been
included where needed.


 board/matrix_vision/common/Makefile|   54 ++
 board/matrix_vision/common/mv_common.c |  125

 board/matrix_vision/common/mv_common.h |   25 +++
 board/matrix_vision/mvbc_p/mvbc_p.c|   76 +---
 board/matrix_vision/mvblm7/mvblm7.c|   38 +++---
 board/matrix_vision/mvblm7/pci.c   |   35 ++
 include/configs/MVBC_P.h   |   14 +++-
 include/configs/MVBLM7.h   |   49 +
 8 files changed, 254 insertions(+), 162 deletions(-)

diff --git a/board/matrix_vision/common/Makefile
b/board/matrix_vision/common/Makefile
new file mode 100644
index 000..b496258
--- /dev/null
+++ b/board/matrix_vision/common/Makefile
@@ -0,0 +1,54 @@
+#
+# (C) Copyright 2006
+# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)board/$(VENDOR)/common)
+endif
+
+LIB= $(obj)lib$(VENDOR).a
+
+COBJS-y= mv_common.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS-y))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(obj).depend $(OBJS)
+   $(AR) $(ARFLAGS) $@ $(OBJS)
+
+clean:
+   rm -f $(SOBJS) $(OBJS)
+
+distclean: clean
+   rm -f $(LIB) core *.bak $(obj).depend
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/matrix_vision/common/mv_common.c
b/board/matrix_vision/common/mv_common.c
new file mode 100644
index 000..284de16
--- /dev/null
+++ b/board/matrix_vision/common/mv_common.c
@@ -0,0 +1,125 @@
+/*
+ * (C) Copyright 2008
+ * Andre Schwarz, Matrix Vision GmbH, andre.schw...@matrix-vision.de
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include common.h
+#include malloc.h
+#include environment.h
+#include asm/io.h
+
+DECLARE_GLOBAL_DATA_PTR;
+
+static char* entries_to_keep[] = {
+   serial#, ethaddr, eth1addr, model_info, sensor_cnt,
+   fpgadatasize, ddr_size, use_dhcp, use_static_ipaddr,
+   static_ipaddr, static_netmask, static_gateway,
+   syslog, watchdog, netboot, evo8serialnumber };
+
+#define MV_MAX_ENV_ENTRY_LENGTH64
+#define MV_KEEP_ENTRIESARRAY_SIZE(entries_to_keep)
+
+void mv_reset_environment(void)
+{
+   int i;
+   char *s[MV_KEEP_ENTRIES];
+   char entries[MV_KEEP_ENTRIES][MV_MAX_ENV_ENTRY_LENGTH];
+
+   printf(\n*** RESET ENVIRONMENT ***\n);
+
+   memset(entries, 0, MV_KEEP_ENTRIES * MV_MAX_ENV_ENTRY_LENGTH);
+   for (i = 0; i  MV_KEEP_ENTRIES; i++) {
+   s[i] = getenv(entries_to_keep[i]);
+   if (s[i]) {
+   printf(save '%s' : %s\n, entries_to_keep[i], s[i]);
+   strncpy(entries[i], s[i], MV_MAX_ENV_ENTRY_LENGTH);
+   }
+   }
+
+   gd-env_valid = 0;
+   env_relocate();
+
+   for (i = 0; i  MV_KEEP_ENTRIES; i++) {
+   if (s[i]) {
+   printf(restore '%s' : %s\n, 

Re: [U-Boot] [PATCH] mx27: rename fec_imx27 to fec_mxc

2009-07-17 Thread Wolfgang Denk
Dear Ilya Yanok,

In message 1247828504-9806-1-git-send-email-ya...@emcraft.com you wrote:
 
 Signed-off-by: Ilya Yanok ya...@emcraft.com
 ---
  cpu/arm926ejs/mx27/generic.c |2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
 
 diff --git a/cpu/arm926ejs/mx27/generic.c b/cpu/arm926ejs/mx27/generic.c
 index b377fad..cbb6c85 100644
 --- a/cpu/arm926ejs/mx27/generic.c
 +++ b/cpu/arm926ejs/mx27/generic.c
 @@ -165,7 +165,7 @@ int print_cpuinfo (void)
  
  int cpu_eth_init(bd_t *bis)
  {
 -#if defined(CONFIG_FEC_IMX27)
 +#if defined(CONFIG_FEC_MXC)
   return fecimx27_initialize(bis);

See Ben's comment - renaming the CONFIG_ variable but leaving
fecimx27_initialize() makes no sense.


And this should be no separate patch, but squashed into the patch
that adds the cpu_eth_init() code.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
The trouble with doing something right the first time is that nobody
appreciates how difficult it was.- Walt West
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/4] 86xx: Rename ccsr_ddr's sdram_mode_1, sdram_cfg_1 fields

2009-07-17 Thread Peter Tyser
Rename sdram_mode_1 to sdram_mode and sdram_cfg_1 to sdram_cfg to match
the 86xx user's manual and other Freescale architectures

Signed-off-by: Peter Tyser pty...@xes-inc.com
---
 board/freescale/mpc8610hpcd/mpc8610hpcd.c |4 ++--
 board/freescale/mpc8641hpcn/mpc8641hpcn.c |6 +++---
 board/sbc8641d/sbc8641d.c |   12 ++--
 cpu/mpc86xx/ddr-8641.c|4 ++--
 include/asm-ppc/immap_86xx.h  |4 ++--
 5 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/board/freescale/mpc8610hpcd/mpc8610hpcd.c 
b/board/freescale/mpc8610hpcd/mpc8610hpcd.c
index a85ebea..419b2c1 100644
--- a/board/freescale/mpc8610hpcd/mpc8610hpcd.c
+++ b/board/freescale/mpc8610hpcd/mpc8610hpcd.c
@@ -154,7 +154,7 @@ phys_size_t fixed_sdram(void)
ddr-timing_cfg_0 = 0x00260802;
ddr-timing_cfg_1 = 0x3935d322;
ddr-timing_cfg_2 = 0x14904cc8;
-   ddr-sdram_mode_1 = 0x00480432;
+   ddr-sdram_mode = 0x00480432;
ddr-sdram_mode_2 = 0x;
ddr-sdram_interval = 0x06180fff; /* 0x06180100; */
ddr-sdram_data_init = 0xDEADBEEF;
@@ -170,7 +170,7 @@ phys_size_t fixed_sdram(void)
 
udelay(500);
 
-   ddr-sdram_cfg_1 = 0xc300; /* 0xe3008000;*/
+   ddr-sdram_cfg = 0xc300; /* 0xe3008000;*/
 
 
 #if defined(CONFIG_ECC_INIT_VIA_DDRCONTROLLER)
diff --git a/board/freescale/mpc8641hpcn/mpc8641hpcn.c 
b/board/freescale/mpc8641hpcn/mpc8641hpcn.c
index 7422e6b..545997c 100644
--- a/board/freescale/mpc8641hpcn/mpc8641hpcn.c
+++ b/board/freescale/mpc8641hpcn/mpc8641hpcn.c
@@ -91,7 +91,7 @@ fixed_sdram(void)
ddr-timing_cfg_0 = CONFIG_SYS_DDR_TIMING_0;
ddr-timing_cfg_1 = CONFIG_SYS_DDR_TIMING_1;
ddr-timing_cfg_2 = CONFIG_SYS_DDR_TIMING_2;
-   ddr-sdram_mode_1 = CONFIG_SYS_DDR_MODE_1;
+   ddr-sdram_mode = CONFIG_SYS_DDR_MODE_1;
ddr-sdram_mode_2 = CONFIG_SYS_DDR_MODE_2;
ddr-sdram_interval = CONFIG_SYS_DDR_INTERVAL;
ddr-sdram_data_init = CONFIG_SYS_DDR_DATA_INIT;
@@ -109,9 +109,9 @@ fixed_sdram(void)
 
 #if defined (CONFIG_DDR_ECC)
/* Enable ECC checking */
-   ddr-sdram_cfg_1 = (CONFIG_SYS_DDR_CONTROL | 0x2000);
+   ddr-sdram_cfg = (CONFIG_SYS_DDR_CONTROL | 0x2000);
 #else
-   ddr-sdram_cfg_1 = CONFIG_SYS_DDR_CONTROL;
+   ddr-sdram_cfg = CONFIG_SYS_DDR_CONTROL;
ddr-sdram_cfg_2 = CONFIG_SYS_DDR_CONTROL2;
 #endif
asm(sync; isync);
diff --git a/board/sbc8641d/sbc8641d.c b/board/sbc8641d/sbc8641d.c
index c39d2c0..f118a6e 100644
--- a/board/sbc8641d/sbc8641d.c
+++ b/board/sbc8641d/sbc8641d.c
@@ -127,9 +127,9 @@ long int fixed_sdram (void)
ddr-timing_cfg_0 = CONFIG_SYS_DDR_TIMING_0;
ddr-timing_cfg_1 = CONFIG_SYS_DDR_TIMING_1;
ddr-timing_cfg_2 = CONFIG_SYS_DDR_TIMING_2;
-   ddr-sdram_cfg_1 = CONFIG_SYS_DDR_CFG_1A;
+   ddr-sdram_cfg = CONFIG_SYS_DDR_CFG_1A;
ddr-sdram_cfg_2 = CONFIG_SYS_DDR_CFG_2;
-   ddr-sdram_mode_1 = CONFIG_SYS_DDR_MODE_1;
+   ddr-sdram_mode = CONFIG_SYS_DDR_MODE_1;
ddr-sdram_mode_2 = CONFIG_SYS_DDR_MODE_2;
ddr-sdram_mode_cntl = CONFIG_SYS_DDR_MODE_CTL;
ddr-sdram_interval = CONFIG_SYS_DDR_INTERVAL;
@@ -140,7 +140,7 @@ long int fixed_sdram (void)
 
udelay (500);
 
-   ddr-sdram_cfg_1 = CONFIG_SYS_DDR_CFG_1B;
+   ddr-sdram_cfg = CONFIG_SYS_DDR_CFG_1B;
asm (sync; isync);
 
udelay (500);
@@ -158,9 +158,9 @@ long int fixed_sdram (void)
ddr-timing_cfg_0 = CONFIG_SYS_DDR2_TIMING_0;
ddr-timing_cfg_1 = CONFIG_SYS_DDR2_TIMING_1;
ddr-timing_cfg_2 = CONFIG_SYS_DDR2_TIMING_2;
-   ddr-sdram_cfg_1 = CONFIG_SYS_DDR2_CFG_1A;
+   ddr-sdram_cfg = CONFIG_SYS_DDR2_CFG_1A;
ddr-sdram_cfg_2 = CONFIG_SYS_DDR2_CFG_2;
-   ddr-sdram_mode_1 = CONFIG_SYS_DDR2_MODE_1;
+   ddr-sdram_mode = CONFIG_SYS_DDR2_MODE_1;
ddr-sdram_mode_2 = CONFIG_SYS_DDR2_MODE_2;
ddr-sdram_mode_cntl = CONFIG_SYS_DDR2_MODE_CTL;
ddr-sdram_interval = CONFIG_SYS_DDR2_INTERVAL;
@@ -171,7 +171,7 @@ long int fixed_sdram (void)
 
udelay (500);
 
-   ddr-sdram_cfg_1 = CONFIG_SYS_DDR2_CFG_1B;
+   ddr-sdram_cfg = CONFIG_SYS_DDR2_CFG_1B;
asm (sync; isync);
 
udelay (500);
diff --git a/cpu/mpc86xx/ddr-8641.c b/cpu/mpc86xx/ddr-8641.c
index 51d0102..b8f2c93 100644
--- a/cpu/mpc86xx/ddr-8641.c
+++ b/cpu/mpc86xx/ddr-8641.c
@@ -56,7 +56,7 @@ void fsl_ddr_set_memctl_regs(const fsl_ddr_cfg_regs_t *regs,
out_be32(ddr-timing_cfg_1, regs-timing_cfg_1);
out_be32(ddr-timing_cfg_2, regs-timing_cfg_2);
out_be32(ddr-sdram_cfg_2, regs-ddr_sdram_cfg_2);
-   out_be32(ddr-sdram_mode_1, regs-ddr_sdram_mode);
+   out_be32(ddr-sdram_mode, regs-ddr_sdram_mode);
out_be32(ddr-sdram_mode_2, regs-ddr_sdram_mode_2);
out_be32(ddr-sdram_mode_cntl, regs-ddr_sdram_md_cntl);
out_be32(ddr-sdram_interval, regs-ddr_sdram_interval);
@@ -74,7 +74,7 @@ 

[U-Boot] [PATCH 4/4] 85xx, 86xx: Add common board_add_ram_info()

2009-07-17 Thread Peter Tyser
Previously, 85xx and 86xx boards would display DRAM information on
bootup such as:

...
I2C:   ready
DRAM:
Memory controller interleaving enabled: Bank interleaving!
 2 GB
FLASH: 256 MB
...

This patch moves the printing of the DRAM controller configuration to a
common board_add_ram_info() function which prints out DDR type, width,
CAS latency, and ECC mode.  It also makes the DDR interleaving
information print out in a more sane manner:

...
I2C:   ready
DRAM:   2 GB (DDR2, 64-bit, CL=4, ECC on)
   DDR Controller Interleaving Mode: bank
FLASH: 256 MB
...

Signed-off-by: Peter Tyser pty...@xes-inc.com
---
 cpu/mpc8xxx/ddr/main.c |   43 +
 cpu/mpc8xxx/ddr/util.c |   96 
 2 files changed, 98 insertions(+), 41 deletions(-)

diff --git a/cpu/mpc8xxx/ddr/main.c b/cpu/mpc8xxx/ddr/main.c
index 6dae26b..faa1af9 100644
--- a/cpu/mpc8xxx/ddr/main.c
+++ b/cpu/mpc8xxx/ddr/main.c
@@ -162,28 +162,9 @@ int step_assign_addresses(fsl_ddr_info_t *pinfo,
j++;
}
}
-   if (j == 2) {
+   if (j == 2)
*memctl_interleaving = 1;
 
-   printf(\nMemory controller interleaving enabled: );
-
-   switch (pinfo-memctl_opts[0].memctl_interleaving_mode) {
-   case FSL_DDR_CACHE_LINE_INTERLEAVING:
-   printf(Cache-line interleaving!\n);
-   break;
-   case FSL_DDR_PAGE_INTERLEAVING:
-   printf(Page interleaving!\n);
-   break;
-   case FSL_DDR_BANK_INTERLEAVING:
-   printf(Bank interleaving!\n);
-   break;
-   case FSL_DDR_SUPERBANK_INTERLEAVING:
-   printf(Super bank interleaving\n);
-   default:
-   break;
-   }
-   }
-
/* Check that all controllers are rank interleaving. */
j = 0;
for (i = 0; i  CONFIG_NUM_DDR_CONTROLLERS; i++) {
@@ -191,29 +172,9 @@ int step_assign_addresses(fsl_ddr_info_t *pinfo,
j++;
}
}
-   if (j == 2) {
+   if (j == 2)
*rank_interleaving = 1;
 
-   printf(Bank(chip-select) interleaving enabled: );
-
-   switch (pinfo-memctl_opts[0].ba_intlv_ctl 
-   FSL_DDR_CS0_CS1_CS2_CS3) {
-   case FSL_DDR_CS0_CS1_CS2_CS3:
-   printf(CS0+CS1+CS2+CS3\n);
-   break;
-   case FSL_DDR_CS0_CS1:
-   printf(CS0+CS1\n);
-   break;
-   case FSL_DDR_CS2_CS3:
-   printf(CS2+CS3\n);
-   break;
-   case FSL_DDR_CS0_CS1_AND_CS2_CS3:
-   printf(CS0+CS1 and CS2+CS3\n);
-   default:
-   break;
-   }
-   }
-
if (*memctl_interleaving) {
unsigned long long addr, total_mem_per_ctlr = 0;
/*
diff --git a/cpu/mpc8xxx/ddr/util.c b/cpu/mpc8xxx/ddr/util.c
index 70dbee0..61c0af8 100644
--- a/cpu/mpc8xxx/ddr/util.c
+++ b/cpu/mpc8xxx/ddr/util.c
@@ -107,3 +107,99 @@ __attribute__((weak, alias(__fsl_ddr_set_lawbar))) void
 fsl_ddr_set_lawbar(const common_timing_params_t *memctl_common_params,
 unsigned int memctl_interleaved,
 unsigned int ctrl_num);
+
+void board_add_ram_info(int use_default)
+{
+#if defined(CONFIG_MPC85xx)
+   volatile ccsr_ddr_t *ddr = (void *)(CONFIG_SYS_MPC85xx_DDR_ADDR);
+#elif defined(CONFIG_MPC86xx)
+   volatile ccsr_ddr_t *ddr = (void *)(CONFIG_SYS_MPC86xx_DDR_ADDR);
+#endif
+#if (CONFIG_NUM_DDR_CONTROLLERS  1)
+   uint32_t cs0_config = in_be32(ddr-cs0_config);
+#endif
+   uint32_t sdram_cfg = in_be32(ddr-sdram_cfg);
+   int cas_lat;
+
+   puts( (DDR);
+   switch ((sdram_cfg  SDRAM_CFG_SDRAM_TYPE_MASK) 
+   SDRAM_CFG_SDRAM_TYPE_SHIFT) {
+   case SDRAM_TYPE_DDR1:
+   puts(1);
+   break;
+   case SDRAM_TYPE_DDR2:
+   puts(2);
+   break;
+   case SDRAM_TYPE_DDR3:
+   puts(3);
+   break;
+   default:
+   puts(?);
+   break;
+   }
+
+   if (sdram_cfg  SDRAM_CFG_32_BE)
+   puts(, 32-bit);
+   else
+   puts(, 64-bit);
+
+   /* Calculate CAS latency based on timing cfg values */
+   cas_lat = ((in_be32(ddr-timing_cfg_1)  16)  0xf) + 1;
+   if ((in_be32(ddr-timing_cfg_3)  12)  1)
+   cas_lat += (8  1);
+   printf(, CL=%d, cas_lat  1);
+   if (cas_lat  0x1)
+   puts(.5);
+
+   if (sdram_cfg  SDRAM_CFG_ECC_EN)
+   puts(, ECC on));
+   else
+   puts(, ECC off));
+
+#if (CONFIG_NUM_DDR_CONTROLLERS  1)
+   if 

[U-Boot] [PATCH 3/4] tqm85xx: Remove board_add_ram_info()

2009-07-17 Thread Peter Tyser
This is in preparation for adding one common 8xxx board_add_ram_info()
function for all 8xxx boards

Signed-off-by: Peter Tyser pty...@xes-inc.com
---
 board/tqc/tqm85xx/sdram.c |   33 +++--
 1 files changed, 3 insertions(+), 30 deletions(-)

diff --git a/board/tqc/tqm85xx/sdram.c b/board/tqc/tqm85xx/sdram.c
index 6d73a88..503c5e5 100644
--- a/board/tqc/tqm85xx/sdram.c
+++ b/board/tqc/tqm85xx/sdram.c
@@ -374,31 +374,6 @@ long int sdram_setup (int casl)
return (i  N_DDR_CS_CONF) ? ddr_cs_conf[i].size : 0;
 }
 
-void board_add_ram_info (int use_default)
-{
-   int casl;
-
-   if (use_default)
-   casl = CONFIG_DDR_DEFAULT_CL;
-   else
-   casl = cas_latency ();
-
-   puts ( (CL=);
-   switch (casl) {
-   case 20:
-   puts (2));
-   break;
-
-   case 25:
-   puts (2.5));
-   break;
-
-   case 30:
-   puts (3));
-   break;
-   }
-}
-
 phys_size_t initdram (int board_type)
 {
long dram_size = 0;
@@ -438,11 +413,9 @@ phys_size_t initdram (int board_type)
/*
 * Try again with default CAS latency
 */
-   puts (Problem with CAS lantency);
-   board_add_ram_info (1);
-   puts (, using default CL!\n);
-   casl = CONFIG_DDR_DEFAULT_CL;
-   dram_size = sdram_setup (casl);
+   printf (Problem with CAS lantency, using default CL %d/10!\n,
+   CONFIG_DDR_DEFAULT_CL);
+   dram_size = sdram_setup (CONFIG_DDR_DEFAULT_CL);
puts (   );
}
 
-- 
1.6.2.1

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


[U-Boot] [PATCH 2/4] xes: Remove 8xxx board_add_ram_info() function

2009-07-17 Thread Peter Tyser
This is in preparation for adding one common 8xxx board_add_ram_info()
fuction for all 8xxx boards

Signed-off-by: Peter Tyser pty...@xes-inc.com
---
 board/xes/common/fsl_8xxx_ddr.c |   53 ---
 1 files changed, 0 insertions(+), 53 deletions(-)

diff --git a/board/xes/common/fsl_8xxx_ddr.c b/board/xes/common/fsl_8xxx_ddr.c
index ec64efa..81ee70d 100644
--- a/board/xes/common/fsl_8xxx_ddr.c
+++ b/board/xes/common/fsl_8xxx_ddr.c
@@ -44,56 +44,3 @@ phys_size_t initdram(int board_type)
 
return dram_size;
 }
-
-#if defined(CONFIG_DDR_ECC) || (CONFIG_NUM_DDR_CONTROLLERS  1)
-void board_add_ram_info(int use_default)
-{
-#if (CONFIG_NUM_DDR_CONTROLLERS  1)
-#if defined(CONFIG_MPC85xx)
-   volatile ccsr_ddr_t *ddr1 = (void *)(CONFIG_SYS_MPC85xx_DDR_ADDR);
-#elif defined(CONFIG_MPC86xx)
-   volatile immap_t *immap = (immap_t *)CONFIG_SYS_IMMR;
-   volatile ccsr_ddr_t *ddr1 = immap-im_ddr1;
-#endif
-#endif
-
-   puts( ();
-
-#if (CONFIG_NUM_DDR_CONTROLLERS  1)
-   /* Print interleaving information */
-   if (ddr1-cs0_config  0x2000) {
-   switch ((ddr1-cs0_config  24)  0xf) {
-   case 0:
-   puts(cache line);
-   break;
-   case 1:
-   puts(page);
-   break;
-   case 2:
-   puts(bank);
-   break;
-   case 3:
-   puts(super-bank);
-   break;
-   default:
-   puts(invalid);
-   break;
-   }
-   } else {
-   puts(no);
-   }
-
-   puts( interleaving);
-#endif
-
-#if (CONFIG_NUM_DDR_CONTROLLERS  1)  defined(CONFIG_DDR_ECC)
-   puts(, );
-#endif
-
-#if defined(CONFIG_DDR_ECC)
-   puts(ECC enabled);
-#endif
-
-   puts());
-}
-#endif /* CONFIG_DDR_ECC || CONFIG_NUM_DDR_CONTROLLERS  1 */
-- 
1.6.2.1

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


Re: [U-Boot] [PATCH] mx27: rename fec_imx27 to fec_mxc

2009-07-17 Thread Ilya Yanok
Hi Wolfgang,

Wolfgang Denk wrote:
 Signed-off-by: Ilya Yanok ya...@emcraft.com
 ---
  cpu/arm926ejs/mx27/generic.c |2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)

 diff --git a/cpu/arm926ejs/mx27/generic.c b/cpu/arm926ejs/mx27/generic.c
 index b377fad..cbb6c85 100644
 --- a/cpu/arm926ejs/mx27/generic.c
 +++ b/cpu/arm926ejs/mx27/generic.c
 @@ -165,7 +165,7 @@ int print_cpuinfo (void)
  
  int cpu_eth_init(bd_t *bis)
  {
 -#if defined(CONFIG_FEC_IMX27)
 +#if defined(CONFIG_FEC_MXC)
  return fecimx27_initialize(bis);
 

 See Ben's comment - renaming the CONFIG_ variable but leaving
 fecimx27_initialize() makes no sense.
   

Yes. That's my fault. I'll fix this and repost the patches.

 And this should be no separate patch, but squashed into the patch
 that adds the cpu_eth_init() code.
   

Surely. I'll fix this too.

Regards, Ilya.

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


Re: [U-Boot] [PATCHv3 3/3] 83xx, kmeter1: added NAND support

2009-07-17 Thread Scott Wood
On Fri, Jul 17, 2009 at 07:05:03AM +0200, Heiko Schocher wrote:
 Hmm... this is the third patch of a patchset, so it apply cleanly, if
 the other 2 patches are first applied ... or should I base this patch
 against current nand-flash tree, because this patch goes through your
 tree?

Ah, I missed that.  It's generally preferred, when possible, to not mix
custodians in a single patchset -- if you can separate out the NAND
driver into its own standalone patch (that doesn't touch any board
configs), that'd be ideal.  Otherwise, it'll have to wait until the
prerequisite patches are merged (or at least acked) by the relevant
custodian.

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


Re: [U-Boot] [PATCH v3] Add cpu_config command for PPC4xx bootstrap configuration

2009-07-17 Thread Kumar Gala

On Jul 17, 2009, at 8:53 AM, Stefan Roese wrote:

 This patch adds a generic command for programming I2C bootstrap
 eeproms on PPC4xx. An implementation for Canyonlands board is
 included.

 The command name is intentionally chosen not to be PPC4xx specific.
 This way other CPU's/SoC's can implement a similar command under
 the same name, perhaps with a different syntax.

 Usage on Canyonlands:

 = cpu_config
 Available configurations (I2C address 0x52):
 600-nor  - NOR  CPU: 600 PLB: 200 OPB: 100 EBC: 100
 600-nand - NAND CPU: 600 PLB: 200 OPB: 100 EBC: 100
 800-nor  - NOR  CPU: 800 PLB: 200 OPB: 100 EBC: 100
 800-nand - NAND CPU: 800 PLB: 200 OPB: 100 EBC: 100
 1000-nor - NOR  CPU:1000 PLB: 200 OPB: 100 EBC: 100
 1000-nand- NAND CPU:1000 PLB: 200 OPB: 100 EBC: 100
 1066-nor - NOR  CPU:1066 PLB: 266 OPB:  88 EBC:  88 ***
 1066-nand- NAND CPU:1066 PLB: 266 OPB:  88 EBC:  88
 = cpu_config 600-nor
 Using configuration:
 600-nor  - NOR  CPU: 600 PLB: 200 OPB: 100 EBC: 100
 done (dump via 'i2c md 52 0.1 10')
 Reset the board for the changes to take effect

 Other 4xx boards will be migrated to use this command soon
 as well.

 Signed-off-by: Stefan Roese s...@denx.de
 Signed-off-by: Dirk Eibach eib...@gdsys.de
 Cc: Matthias Fuchs matthias.fu...@esd.eu

we could use something similar on some of the FSL SoCs.  What about  
renaming this chip_config?  When I see cpu I think of just CPU cores.

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


Re: [U-Boot] [PATCH 4/7] mxc_nand: add nand driver for MX2/MX3

2009-07-17 Thread Scott Wood
On Fri, Jul 17, 2009 at 02:48:38PM +0400, Ilya Yanok wrote:
 Scott Wood wrote:
  Please look at drivers/mtd/nand/mpc5121_nfc.c, which AFAICT is very
  similar hardware, and see if anything can be factored out into common
  code, and try to keep the rest looking the same except where the hardware
  actually differs.

 
 Hmm... For now we just can't spend enough effort for this...

Understood -- but I have to grumble about it regardless. :-)

  +/*
  + * This function requests the NANDFC to perform a read of the
  + * NAND device status and returns the current status.
  + */
  +static uint16_t get_dev_status(struct mxc_nand_host *host)
  +{
  +  void __iomem *main_buf = host-regs-main_area1;
  +  uint32_t store;
  +  uint16_t ret, tmp;
  +  /* Issue status request to NAND device */
  +
  +  /* store the main area1 first word, later do recovery */
  +  store = readl(main_buf);
  +  /*
  +   * NANDFC buffer 1 is used for device status to prevent
  +   * corruption of read/write buffer on status requests.
  +   */
  +  writew(1, host-regs-nfc_buf_addr);
  
 
  But it looks like buffer 1 is used for data with large page flash.

 
 Well, we save first word of the buffer and then recover it.

So then there's no longer any special reason to use buffer 1 for status,
and that comment is misleading...

  Other drivers don't seem to have any problem with status reads clobbering
  the buffer...

What's different about this hardware in that regard?  I'm wondering if
you're being more tolerant than you need to be of status requests coming
in at odd times.

  According to Magnus Lilja, the nand flash controller can only handle 32
  bit read/write operations, any other size will cause an abort (or
  something like that).  But now we're accessing it as 16-bit?

 
 16-bit accesses work quite well. Problem was with 8-bit accesses.

OK.  But in that case I'd think it would have been simpler to use 16-bit
accesses rather than 32-bit when emulating byte accesses in
read_buf()/write_buf().

  col should never be odd if you're reading words.

 
 It can be odd if previously we've read a byte.

I don't think that accesses will ever be mixed in that way -- correct me
if I'm wrong.

In fact, I only see one use of read_word, which is to read the bad block
marker.

  +  host-pagesize_2k = 0;
  
 
  So large page is currently unsupported?

 
 Linux driver was fixed recently and now it claims to support 2K page
 size... I've added all needed fixes but I can understand how this driver
 should detect the pagesize... Linux driver calls nand_scan_ident()
 itself for this... Do you think I can calls nand_scan_ident() from my
 board_nand_init() function?

No, at the moment you should probably just hard code it in the board
config file.  I need to find some time to rework the NAND init mechanism
to be driven more from platform code so that it can split up
nand_scan_ident() and nand_scan_tail().

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


[U-Boot] Using Uboot to communicate a PCI device.

2009-07-17 Thread Darshan Vasisht
Dear sir,
   I am using U-boot as a Boot loader for booting Cavium Octeon Processor.
My current requirement is to implement Octeon as the PCI bus arbiter i.e.
Octeon as a PCI host.
Octeon will be responsible for bringing up other processor like Wintegra
Winpath Network processor i.e in turn boot the Winpath NP.
Octeon will be connected to Winpath over a 32-bit PCI bus.
*How can i develop an Uboot application which communicates through Octeon
over the PCI bus to Wintegra device such that it transfers data to Winpath
device memory address?*
*What are the prerequisites i need to write a U-Boot Application to
communicate over a PCI bus to talk to a PCI device?*
According to my understanding, i need a Winpath Device Driver that needs to
be at U-Boot location to communicate to the device over a PCI bus which i
need to add to the /Drivers folder path in U-boot Code.
Assuming that i have the Driver code for Winpath Device.. how should i
proceed further to initiate communication over a PCI bus?
I am new to PCI and U-boot, Please guide me through the procedure.
If you have any example wherein U-boot is used to talk to a *PCI
device*i.e. do a read/write to device's memory location, then please
share that
example with me.
If you have any Internet link which explains similar example then please do
share with me.
Thanks in advance.
Regards,
Darshan
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3] Add cpu_config command for PPC4xx bootstrap configuration

2009-07-17 Thread Stefan Roese
On Friday 17 July 2009 17:38:13 Kumar Gala wrote:
 On Jul 17, 2009, at 8:53 AM, Stefan Roese wrote:
  This patch adds a generic command for programming I2C bootstrap
  eeproms on PPC4xx. An implementation for Canyonlands board is
  included.
 
  The command name is intentionally chosen not to be PPC4xx specific.
  This way other CPU's/SoC's can implement a similar command under
  the same name, perhaps with a different syntax.
 
  Usage on Canyonlands:
 
  = cpu_config
  Available configurations (I2C address 0x52):
  600-nor  - NOR  CPU: 600 PLB: 200 OPB: 100 EBC: 100
  600-nand - NAND CPU: 600 PLB: 200 OPB: 100 EBC: 100
  800-nor  - NOR  CPU: 800 PLB: 200 OPB: 100 EBC: 100
  800-nand - NAND CPU: 800 PLB: 200 OPB: 100 EBC: 100
  1000-nor - NOR  CPU:1000 PLB: 200 OPB: 100 EBC: 100
  1000-nand- NAND CPU:1000 PLB: 200 OPB: 100 EBC: 100
  1066-nor - NOR  CPU:1066 PLB: 266 OPB:  88 EBC:  88 ***
  1066-nand- NAND CPU:1066 PLB: 266 OPB:  88 EBC:  88
  = cpu_config 600-nor
  Using configuration:
  600-nor  - NOR  CPU: 600 PLB: 200 OPB: 100 EBC: 100
  done (dump via 'i2c md 52 0.1 10')
  Reset the board for the changes to take effect
 
  Other 4xx boards will be migrated to use this command soon
  as well.
 
  Signed-off-by: Stefan Roese s...@denx.de
  Signed-off-by: Dirk Eibach eib...@gdsys.de
  Cc: Matthias Fuchs matthias.fu...@esd.eu

 we could use something similar on some of the FSL SoCs.  What about
 renaming this chip_config?  When I see cpu I think of just CPU cores.

chip_config is fine for me as well. If nobody objects or suggest something 
else, I'll send a new patch version in a days or two.

Best regards,
Stefan

=
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: off...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2] net: tsec - fix dereferencing type-punned pointer will break strict-aliasing rules warning

2009-07-17 Thread Kim Phillips
fix this gcc 4.4 warning:

tsec.c: In function 'tsec_init':
tsec.c:200: warning: dereferencing type-punned pointer will break 
strict-aliasing rules

Signed-off-by: Kim Phillips kim.phill...@freescale.com
---
this is the endian-correct version

 drivers/net/tsec.c |5 -
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c
index 63fc02e..5dc05e5 100644
--- a/drivers/net/tsec.c
+++ b/drivers/net/tsec.c
@@ -197,7 +197,10 @@ int tsec_init(struct eth_device *dev, bd_t * bd)
for (i = 0; i  MAC_ADDR_LEN; i++) {
tmpbuf[MAC_ADDR_LEN - 1 - i] = dev-enetaddr[i];
}
-   regs-macstnaddr1 = *((uint *) (tmpbuf));
+   tempval = (tmpbuf[0]  24) | (tmpbuf[1]  16) | (tmpbuf[2]  8) |
+ tmpbuf[3];
+
+   regs-macstnaddr1 = tempval;
 
tempval = *((uint *) (tmpbuf + 4));
 
-- 
1.6.3.3

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


Re: [U-Boot] [PATCH 1/2] update config for mvBL-M7 (MPC8343)

2009-07-17 Thread Kim Phillips
On Fri, 17 Jul 2009 16:54:40 +0200
André Schwarz andre.schw...@matrix-vision.de wrote:

 If there are no further objections I'll submit v3 adressing Heiko's
 comments and fixing a warning due to missing #include statement.

please do.

 Both board binaries compile and work as expected.
 
 Sorry for the trouble - I'm not an everyday git user ... still trying to
 improve ;-)

we all are ;)

I mean: trying to improve ;)

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


[U-Boot] [PATCH] mpc83xx: fix duplicate MONITOR_LEN definition caused by merge foo

2009-07-17 Thread Kim Phillips
commits 4a9932a4364b548773bc131bf85e24a2ec15f2b0 and
c9646ed758804fa1fa6c1425369a4eee5d618b1d merged and generated this build
error:

Configuring for MPC837XERDB board...
In file included from /home/r1aaha/git/u-boot/include/config.h:3,
 from include/common.h:35:
/home/r1aaha/git/u-boot/include/configs/MPC837XERDB.h:233:1: warning: 
CONFIG_SYS_MONITOR_LEN redefined
/home/r1aaha/git/u-boot/include/configs/MPC837XERDB.h:232:1: warning: this is 
the location of the previous definition

take the larger value of the two, to allow for -mmultiple-broken compilers,
such as gcc 4.4.

Signed-off-by: Kim Phillips kim.phill...@freescale.com
---
 include/configs/MPC837XERDB.h |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/include/configs/MPC837XERDB.h b/include/configs/MPC837XERDB.h
index 807a534..9132718 100644
--- a/include/configs/MPC837XERDB.h
+++ b/include/configs/MPC837XERDB.h
@@ -230,7 +230,6 @@
 #endif
 
 #define CONFIG_SYS_MONITOR_LEN (384 * 1024) /* Reserve 384 kB for Mon 
*/
-#define CONFIG_SYS_MONITOR_LEN (320 * 1024) /* Reserve 320 kB for Mon 
*/
 #define CONFIG_SYS_MALLOC_LEN  (512 * 1024) /* Reserved for malloc */
 
 /*
-- 
1.6.3.3

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


Re: [U-Boot] USB Device Port not working in MPC8280 PowerPC

2009-07-17 Thread Gurumurthy Gowdar
updating to Current code which version? is there any drivers for MPC8280 USB
host  Device ports.

regards,
gurumurthy



On Fri, Jul 17, 2009 at 4:51 PM, Wolfgang Denk w...@denx.de wrote:

 Dear Gurumurthy Gowdar,

 please do not top-post / full-quote. Make sure to read
 http://www.netmeister.org/news/learn2quote.html

 In message adaf92990907170415j7da24647r5cdd55180b014...@mail.gmail.com
 you wrote:
 
  U-boot 1.3.1

 How about updating to current code?

 Best regards,

 Wolfgang Denk

 --
 DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
 HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
 Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
 As long as we're going to reinvent the wheel again, we might as  well
 try making it round this time.- Mike Dennison




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


Re: [U-Boot] [PATCH v3] Add cpu_config command for PPC4xx bootstrap configuration

2009-07-17 Thread Wolfgang Denk
Dear Stefan Roese,

In message 200907171905.07765...@denx.de you wrote:

  we could use something similar on some of the FSL SoCs.  What about
  renaming this chip_config?  When I see cpu I think of just CPU cores.
 
 chip_config is fine for me as well. If nobody objects or suggest something 
 else, I'll send a new patch version in a days or two.

OK with me, too.

Best regards,

Wolfgang Denk

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


Re: [U-Boot] USB Device Port not working in MPC8280 PowerPC

2009-07-17 Thread Wolfgang Denk
Dear Gurumurthy Gowdar,

please do not ignore hints given to you:

Please do not top-post / full-quote. Make sure to read
http://www.netmeister.org/news/learn2quote.html

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

 updating to Current code which version? is there any drivers for MPC8280 USB
 host  Device ports.

Curent code is either v2009.06 or top of tree from git repository.

And no, AFAIKT there are no USB drivers for the MPC8280 in U-Boot.

But why are you asking? I thought you had somethin written yourself -
didn't you ask about problems with USB in U-Boot? So  you  must  have
had some driver added to U-Boot?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Any sufficiently advanced technology is indistinguishable from magic.
Clarke's Third Law   - _Profiles of the Future_ (1962; rev. 1973)
  ``Hazards of Prophecy: The Failure of Imagination''
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] ppc4xx: Enable support for 64bit printf on all PPC4xx variants

2009-07-17 Thread Wolfgang Denk
Dear Stefan Roese,

In message 200907090654.02336...@denx.de you wrote:
 
 Then please grep for #define CONFIG_ in the include directory. You will be 
 surprised how many of these defines there are outside of the include/configs 
 directory.

This is no excuse for adding even more such code.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Never put off until tomorrow what you can put off indefinitely.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/4]: arm: Kirkwood: Set MAC address during registration for kirkwood egiga

2009-07-17 Thread Wolfgang Denk
Dear Simon Kagstrom,

In message 20090713101307.30d3d...@marrow.netinsight.se you wrote:

 OK, so until ARM has moved to the device tree approach (and from LKML I
 see there is some vocal opposition to this), we'd still need to resort
 to some driver-specific hack [with Linux support] for this?

Driver-specific hack or fix yes - but in Linux, not in U-Boot.

 Or is it OK to do some board-specific hack to initialize it like
 
   board/atmel/at91rm9200ek/misc.c
 
 does it?

I this driver does something like this, then it should ne fixed.

 Coming from a PowerPC-setting, I must say I miss the device trees
 though :-)

Me, too. Let's keep the fingers crossed that gcl makes fast progress.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
I didn't know it was impossible when I did it.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/3] fix: missing autoconfig.mk from general Makefile

2009-07-17 Thread Wolfgang Denk
Dear Jean-Christophe PLAGNIOL-VILLARD,

In message 1243107758-4528-1-git-send-email-plagn...@jcrosoft.com you wrote:
 at the first run of make we generate the autoconf.mk and autoconf.mk.dep
 if not already the case and we currently include only to .dep
 
 in order to use these autogenerated value we need to include it also evenif
 it's include in config.mk but it's done before there generation
 
 Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagn...@jcrosoft.com
 ---
  Makefile |1 +
  1 files changed, 1 insertions(+), 0 deletions(-)

Appied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
A Chairman was as necessary to a Board planet  as  the  zero  was  in
mathematics, but being a zero had big disadvantages...
 - Terry Pratchett, _The Dark Side of the Sun_
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] config.mk: Remove $(PCI_CLOCK) reference

2009-07-17 Thread Wolfgang Denk
Dear Shinya Kuribayashi,

In message 4a3cb586.1010...@pobox.com you wrote:
 The following commit introduced $(PCI_CLOCK) reference so that
 we could tweak `PCI_66M' definition via an environment variable.
 
  commit f046ccd15c8bc9613bfd72916b761a127d36e5c6
  Author: Eran Liberty libe...@freescale.com
  Date:   Thu Jul 28 10:08:46 2005 -0500
 
  * Patch by Eran Liberty
Add support for the Freescale MPC8349ADS board.
 
 But I suggest a removal of it for the following reasons:
 
 * In 2006, MPC8349ADS was merged into MPC8349EMDS port,
   and it seems that MPC8349EMDS port is PCI_66M free.
 
 * OTOH, PCI_66M is used by MPC832XEMDS an MPC8360EMDS ports,
   but they don't need $(PCI_CLOCK) environment variable at all.
   PCI_66M is automatically configured via $(BOARD)_config names
   with the help of $(findstring _66_,$@).
 
 * Unfortunately $(PCI_CLOCK) has been undocumented anywhere,
   so only a few people know the existence of it these days.
 
 * Keep config.mk independent from $(BOARD) as much as possible.
 
 Signed-off-by: Shinya Kuribayashi skuri...@pobox.com
 ---
  config.mk |4 
  1 files changed, 0 insertions(+), 4 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Killing is stupid; useless!
-- McCoy, A Private Little War, stardate 4211.8
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Support for Calao USB A9263 board based on AT91SAM9263 CPU

2009-07-17 Thread Wolfgang Denk
Dear Thomas Petazzoni,

In message 20090715163557.08b58...@surf you wrote:
 Support for the Calao USB A9263 board
  
 The Calao USB A9263 board is a board manufactured and sold by Calao
 Systems http://www.calao-systems.com. Its components are very
 similar to the AT91SAM9263EK board, so its configuration is based on
 the configuration of this board. There are however some differences:
 different clocks, no LCD, etc.
  
 Signed-off-by: Thomas Petazzoni thomas.petazz...@free-electrons.com
 
 ---
...
  MAKEALL   |1 
  Makefile  |3 
  board/calao/usb-a9263/Makefile|   56 
  board/calao/usb-a9263/config.mk   |1 
  board/calao/usb-a9263/led.c   |   44 ++
  board/calao/usb-a9263/partition.c |   37 +
  board/calao/usb-a9263/usb-a9263.c |  193 
  include/configs/usb-a9263.h   |  186 ++
  8 files changed, 521 insertions(+)

Entries to maintainers is missing.

 +int dram_init(void)
 +{
 + gd-bd-bi_dram[0].start = PHYS_SDRAM;
 + gd-bd-bi_dram[0].size = PHYS_SDRAM_SIZE;
 + return 0;
 +}

Any specific reason for not using autosizing and testing via
get_ram_size() ?

 diff --git a/include/configs/usb-a9263.h b/include/configs/usb-a9263.h
 new file mode 100644
 index 000..b670f5f
 --- /dev/null
 +++ b/include/configs/usb-a9263.h
...
 +/* bootstrap + u-boot + env in dataflash on CS0 */
 +#define CONFIG_ENV_IS_IN_DATAFLASH   1
 +#define CONFIG_SYS_MONITOR_BASE  (CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0)
 +#define CONFIG_ENV_OFFSET0x2000
 +#define CONFIG_ENV_ADDR  (CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0 + 
 CONFIG_ENV_OFFSET)

Line too long. Please fix globally.


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
[Doctors and Bartenders], We both get the same two kinds of customers
-- the living and the dying.
-- Dr. Boyce, The Menagerie (The Cage), stardate unknown
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] - add dns

2009-07-17 Thread Robin Getz
On 04 Oct 2008 Pieter posted a dns implementation for U-Boot.

http://www.mail-archive.com/u-boot-us...@lists.sourceforge.net/msg10216.html

 DNS can be enabled by setting CFG_CMD_DNS. After performing a query, the
 serverip environment var is updated.

 Probably there are some cosmetic issues with the patch. Unfortunatly I do
 not have the time to correct these. So if anybody else likes DNS support in
 U-Boot and has the time, feel free to patch it in the main tree.

Here it is again - slightly modified  smaller:
  - update to 2009-06 (Pieter's patch was for U-Boot 1.2.0)
  - run through checkpatch, and clean up style issues
  - remove packet from stack
  - cleaned up some comments
  - failure returns much faster (if server responds, don't wait for timeout)
  - use built in functions (memcpy) rather than byte copy.

bfin dhcp
BOOTP broadcast 1
DHCP client bound to address 192.168.0.4
bfin dns pool.ntp.org
69.36.241.112
bfin sntp $(serverip)
Date: 2009-07-17 Time: 19:16:51
bfin dns www.google.com
64.233.161.147
bfin ping $(serverip)
Using Blackfin EMAC device
host 64.233.161.147 is alive

Signed-off-by: Robin Getz rg...@blackfin.uclinux.org
Signed-off-by: Pieter Voorthuijsen pieter.voorthuij...@prodrive.nl


 common/cmd_net.c  |   32 
 include/configs/bfin_adi_common.h |7
 include/net.h |4
 net/Makefile  |1
 net/dns.c |  213 
 net/dns.h |   38 
 net/net.c |   20 ++
 7 files changed, 314 insertions(+), 1 deletion(-)

---

Index: include/net.h
===
--- include/net.h   (revision 1968)
+++ include/net.h   (working copy)
@@ -361,6 +361,10 @@
 /* from net/net.c */
 extern charBootFile[128];  /* Boot File name   
*/
 
+#if defined(CONFIG_CMD_DNS)
+extern char NetDNSResolve[255];/* The host to resolve  
*/
+#endif
+
 #if defined(CONFIG_CMD_PING)
 extern IPaddr_tNetPingIP;  /* the ip address to 
ping   */
 #endif
Index: include/configs/bfin_adi_common.h
===
--- include/configs/bfin_adi_common.h   (revision 1968)
+++ include/configs/bfin_adi_common.h   (working copy)
@@ -13,6 +13,13 @@
 # if ADI_CMDS_NETWORK
 #  define CONFIG_CMD_DHCP
 #  define CONFIG_CMD_PING
+#  define CONFIG_BOOTP_DNS
+#  define CONFIG_BOOTP_DNS2
+#  define CONFIG_CMD_DNS
+#  ifdef CONFIG_RTC_BFIN
+#   define CONFIG_CMD_SNTP
+#   define CONFIG_BOOTP_NTPSERVER
+#  endif
 #  ifdef CONFIG_BFIN_MAC
 #   define CONFIG_CMD_MII
 #  endif
Index: net/dns.c
===
--- net/dns.c   (revision 0)
+++ net/dns.c   (revision 0)
@@ -0,0 +1,213 @@
+/*
+ * DNS support driver
+ *
+ * Copyright (c) 2008 Pieter Voorthuijsen pieter.voorthuij...@prodrive.nl
+ * Copyright (c) 2009 Robin Getz rg...@blackfin.uclinux.org
+ *
+ * This is a simple DNS implementation for U-Boot. It will use the first IP
+ * in the DNS response as NetServerIP. This can then be used for any other
+ * network related activities.
+ *
+ * The packet handling is partly based on TADNS, original copyrights
+ * follow below.
+ *
+ */
+
+/*
+ * Copyright (c) 2004-2005 Sergey Lyubka vale...@gmail.com
+ *
+ * THE BEER-WARE LICENSE (Revision 42):
+ * Sergey Lyubka wrote this file.  As long as you retain this notice you
+ * can do whatever you want with this stuff. If we meet some day, and you think
+ * this stuff is worth it, you can buy me a beer in return.
+ */
+
+#include common.h
+#include command.h
+#include net.h
+
+#include dns.h
+
+char NetDNSResolve[255]; /* The host to resolve  */
+
+static int DnsOurPort;
+
+static void
+DnsSend(void)
+{
+   struct header *header;
+   int n, name_len;
+   uchar *p, *pkt;
+   const char *s;
+   const char *name;
+   enum dns_query_type qtype = DNS_A_RECORD;
+
+   name = NetDNSResolve;
+   pkt = p = (uchar *)(NetTxPacket + NetEthHdrSize() + IP_HDR_SIZE);
+
+   /* Prepare DNS packet header */
+   header   = (struct header *) pkt;
+   header-tid  = 1;
+   header-flags= htons(0x100);/* standard query */
+   header-nqueries = htons(1);/* Just one query */
+   header-nanswers = 0;
+   header-nauth= 0;
+   header-nother   = 0;
+
+   /* Encode DNS name */
+   name_len = strlen(name);
+   p = (uchar *) header-data;/* For encoding host name into packet */
+
+   do {
+   s = strchr(name, '.');
+   if (!s)
+   s = name + name_len;
+
+   n = s - name;   /* Chunk length */
+   *p++ = n;   /* Copy length  */
+   memcpy(p, name, n); /* Copy chunk   */
+   

Re: [U-Boot] [PATCH v3] Add cpu_config command for PPC4xx bootstrap configuration

2009-07-17 Thread Matthias Fuchs
Please see one comment below

On Friday 17 July 2009 15:53:56 Stefan Roese wrote:
 This patch adds a generic command for programming I2C bootstrap
 eeproms on PPC4xx. An implementation for Canyonlands board is
 included.

 The command name is intentionally chosen not to be PPC4xx specific.
 This way other CPU's/SoC's can implement a similar command under
 the same name, perhaps with a different syntax.

 Usage on Canyonlands:

 = cpu_config
 Available configurations (I2C address 0x52):
 600-nor  - NOR  CPU: 600 PLB: 200 OPB: 100 EBC: 100
 600-nand - NAND CPU: 600 PLB: 200 OPB: 100 EBC: 100
 800-nor  - NOR  CPU: 800 PLB: 200 OPB: 100 EBC: 100
 800-nand - NAND CPU: 800 PLB: 200 OPB: 100 EBC: 100
 1000-nor - NOR  CPU:1000 PLB: 200 OPB: 100 EBC: 100
 1000-nand- NAND CPU:1000 PLB: 200 OPB: 100 EBC: 100
 1066-nor - NOR  CPU:1066 PLB: 266 OPB:  88 EBC:  88 ***
 1066-nand- NAND CPU:1066 PLB: 266 OPB:  88 EBC:  88
 = cpu_config 600-nor
 Using configuration:
 600-nor  - NOR  CPU: 600 PLB: 200 OPB: 100 EBC: 100
 done (dump via 'i2c md 52 0.1 10')
 Reset the board for the changes to take effect

 Other 4xx boards will be migrated to use this command soon
 as well.

 Signed-off-by: Stefan Roese s...@denx.de
 Signed-off-by: Dirk Eibach eib...@gdsys.de
 Cc: Matthias Fuchs matthias.fu...@esd.eu
 ---
 v3:
 - Line length of one printf reduced

 v2:
 - Patch authorship changes to Stefan
 - s-o-b from Dirk added
 - Added current configuration detection
 - Minor coding style cleanup

  board/amcc/canyonlands/Makefile |5 +-
  board/amcc/canyonlands/bootstrap.c  |  195
 --- board/amcc/canyonlands/cpu_config.c |  
 55 ++
  cpu/ppc4xx/Makefile |3 +
  cpu/ppc4xx/cmd_cpu_config.c |  127 +++
  include/asm-ppc/ppc4xx_config.h |   42 
  include/configs/canyonlands.h   |4 +
  7 files changed, 234 insertions(+), 197 deletions(-)
  delete mode 100644 board/amcc/canyonlands/bootstrap.c
  create mode 100644 board/amcc/canyonlands/cpu_config.c
  create mode 100644 cpu/ppc4xx/cmd_cpu_config.c
  create mode 100644 include/asm-ppc/ppc4xx_config.h

 diff --git a/board/amcc/canyonlands/Makefile
 b/board/amcc/canyonlands/Makefile index 2aeead6..b1dfb0b 100644
 --- a/board/amcc/canyonlands/Makefile
 +++ b/board/amcc/canyonlands/Makefile
 @@ -25,10 +25,11 @@ include $(TOPDIR)/config.mk

  LIB  = $(obj)lib$(BOARD).a

 -COBJS:= $(BOARD).o
 -COBJS+= bootstrap.o
 +COBJS-y  := $(BOARD).o
 +COBJS-$(CONFIG_CMD_CPU_CONFIG) += cpu_config.o
  SOBJS:= init.o

 +COBJS   := $(COBJS-y)
  SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
  OBJS := $(addprefix $(obj),$(COBJS))
  SOBJS:= $(addprefix $(obj),$(SOBJS))
 diff --git a/board/amcc/canyonlands/bootstrap.c
 b/board/amcc/canyonlands/bootstrap.c deleted file mode 100644
 index 6dc2cca..000
 --- a/board/amcc/canyonlands/bootstrap.c
 +++ /dev/null
 @@ -1,195 +0,0 @@
 -/*
 - * (C) Copyright 2008
 - * Stefan Roese, DENX Software Engineering, s...@denx.de.
 - *
 - * See file CREDITS for list of people who contributed to this
 - * project.
 - *
 - * This program is free software; you can redistribute it and/or
 - * modify it under the terms of the GNU General Public License as
 - * published by the Free Software Foundation; either version 2 of
 - * the License, or (at your option) any later version.
 - *
 - * This program is distributed in the hope that it will be useful,
 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 - * GNU General Public License for more details.
 - *
 - * You should have received a copy of the GNU General Public License
 - * along with this program; if not, write to the Free Software
 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 - * MA 02111-1307 USA
 - *
 - */
 -
 -#include common.h
 -#include command.h
 -#include i2c.h
 -#include asm/io.h
 -
 -/*
 - * NOR and NAND boot options change bytes 5, 6, 8, 9, 11. The
 - * values are independent of the rest of the clock settings.
 - */
 -
 -#define NAND_COMPATIBLE  0x01
 -#define NOR_COMPATIBLE  0x02
 -
 -#define I2C_EEPROM_ADDR 0x52
 -
 -static char *config_labels[] = {
 - CPU: 600 PLB: 200 OPB: 100 EBC: 100,
 - CPU: 800 PLB: 200 OPB: 100 EBC: 100,
 - CPU:1000 PLB: 200 OPB: 100 EBC: 100,
 - CPU:1066 PLB: 266 OPB:  88 EBC:  88,
 - NULL
 -};
 -
 -static u8 boot_configs[][17] = {
 - {
 - (NAND_COMPATIBLE | NOR_COMPATIBLE),
 - 0x86, 0x80, 0xce, 0x1f, 0x79, 0x80, 0x00, 0xa0, 0x40, 0x08,
 - 0x23, 0x50, 0x0d, 0x05, 0x00, 0x00
 - },
 - {
 - (NAND_COMPATIBLE | NOR_COMPATIBLE),
 - 0x86, 0x80, 0xba, 0x14, 0x99, 0x80, 0x00, 0xa0, 0x40, 0x08,
 - 0x23, 0x50, 0x0d, 0x05, 0x00, 0x00
 - },
 - {
 - (NAND_COMPATIBLE | 

Re: [U-Boot] [PATCH] eth_receive(): Do not assume that caller always wants full packet.

2009-07-17 Thread Wolfgang Denk
Dear Marcel Moolenaar,

In message 018c5018-f1ce-4e30-9239-93c118cff...@mac.com you wrote:
 
 It seems to me that these questions stem from an assumption
 about how applications are written. That is, I always interpret

This is actually correct. The basic assumption I  make,  and  request
others  to  make too, is that we are working on a boot loader. If you
compare finctionality with other boot  loaders  you  realize  quickly
that  we  are  stretching  this  concept  pretty  far - but there are
certain limits.

Things like more complex network protocols simply have no place in  a
boot loader. If you need something like that, then forget the API for
standalone  applications  and boot an OS instead. It's much faster to
develop, and much more flexible.

 these questions as an inquiry into the use of an API so as to
 argue about how an API is used, rather than how the API should
 behave. Personally, I don't think this is the right approach
 when discussing an API, because it the API comes with an assumed
 use case.

There is an assumed use case: things simple enough to fit into a boot
loader.

 As to the porting issues you were asking about: the FreeBSD boot
 loader runs in many environments: PC BIOS, EFI, Open Firmware,
 U-Boot, ARC (obsolete), etc.

Which of these environments provide an API  as  you  are  asking  for
here?

 As for the number of buffers: we need 1 for ARP. A small one I
 might add. However, BOOTP/DHCP also needs a buffer. That's one
 more. TFTP needs a buffer. etc, etc...

Um... do these have to be separate buffers? Or would a single shared
buffer be sufficient, too?

We already have code in U-Boot that performs ARP, and BOOTP/DHCP, and
TFTP. Why don't you use that code,  instead  of  only  the  low-level
primitives like packet receive?


[Note that I am _not_ trying to just ask provocant questions. I'm
really trying to understand your problem.]

 The question as to how many buffers we need cannot really be
 answered without digressing in why don't you restructure your
 code so that you only need 1. It all depends on how code is
 organized, designed, modularized or combined. In the case of
 the FreeBSD loader we a few places to change. This does not
 include all the non-open features that people have added to the
 loader.

I must admit that I'm not too eager to add complexity  to  code  that
can  be  simple for U-Boot's own needs just to support some non-open
features ...


 The U-Boot APIs were intended and designed to work with any
 application. More to the point: they we designed, implemented

...with any application running in the context and the restrictions of
a boot loader. There has never been any intention to provide a runtime
environment for complex things like an OS.

 Ok, there's bug. Or at least a scenario that wasn't really
 thought about or considered. The pivotal application, key
 in designing and implementing the APIs, shows that the API
 in U-Boot can hang. [The hang being caused by the reception
 of a packet that is larger than the buffer the application
 provides]. There are 2 simple fixed that would fix the API:
 1) just drop the packet. 2) return a truncated packet.

Agreed. Both will change the behaviour of the current, common network
code. Mike asked if there is any risk involved with  such  a  change,
and if we not better used a new function for this purpose.

 However, I'm currently in a discussion that suggests that
 the application should use bigger buffers. That strikes me
 as odd, because by intend and design the API was to support
 the application without requiring it to use bigger buffers.

We're not talking about design of the API, but about changes  to  the
U-Boot core network code.

 Put differently: by requiring the application to use bigger
 buffers, the API ipso-facto stops supporting the one app
 it was designed to support. Is this a good way to fix an
 otherwise minor problem?

Hm... needing to change the core just  to  satisfy  the  needs  of  a
single  user  with  exotic  requirements  is something I don't decide
quickly. At minimum I want to understand the need for the change, and
be sure that it has no negative impact on other  users  of  the  same
code.

 To conclude:
 I'm happy with an API change, whether it's dropping the
 packet or returning a truncated one. Personally I favor
 the truncation, because we're dealing with raw packets
 and the application is expected to make sure it received
 a proper packet to begin with.
 
 Changing the semantics of the API and require all
 applications to allocate a bigger buffer to handle this
 is not a solution in my opinion.

You see just your use case, I try to see the  whole  U-Boot  project.
From  my point of view your requirement is not a change of the API to
standalone applications, but a change to core functionality on behalf
of a single user with exotic requirements.

 In any case: the final verdict is with the U-Boot community.
 I stated my case and look forward to the resolution so that
 I can 

Re: [U-Boot] [PATCH] cmd_mmc: make curr_device static

2009-07-17 Thread Wolfgang Denk
Dear Mike Frysinger,

In message 1245029722-14514-1-git-send-email-vap...@gentoo.org you wrote:
 The curr_device variable isn't used outside of cmd_mmc, so mark it static
 to avoid conflicts with other pieces of code (like sata which also exports
 a curr_device).  Otherwise we end up with stuff like:
 common/libcommon.a(cmd_sata.o):(.data.curr_device+0x0):
   multiple definition of `curr_device'
 common/libcommon.a(cmd_mmc.o):(.data.curr_device+0x0): first defined here
 
 Signed-off-by: Mike Frysinger vap...@gentoo.org
 ---
  common/cmd_mmc.c |2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
You're dead, Jim.
-- McCoy, Amok Time, stardate 3372.7
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] sata: namespace curr_device variable

2009-07-17 Thread Wolfgang Denk
Dear Mike Frysinger,

In message 1245029722-14514-2-git-send-email-vap...@gentoo.org you wrote:
 The curr_device variable really should be namespaced with a sata_ prefix
 since it is only used by the sata code.  It also avoids random conflicts
 with other pieces of code (like cmd_mmc):
 common/libcommon.a(cmd_sata.o):(.data.curr_device+0x0):
   multiple definition of `curr_device'
 common/libcommon.a(cmd_mmc.o):(.data.curr_device+0x0): first defined here
 
 Signed-off-by: Mike Frysinger vap...@gentoo.org
 ---
  common/cmd_sata.c|   24 
  drivers/block/ata_piix.c |6 +++---
  2 files changed, 15 insertions(+), 15 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
A man is not complete until he is married -- then he is finished.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


  1   2   >