Re: [U-Boot] [PATCH 4/5] powerpc: keymile: Add a check for the PIGGY debug board

2008-11-12 Thread Heiko Schocher
Hello Ben

Ben Warren wrote:
> Heiko Schocher wrote:
>   
>> Check the presence of the PIGGY on the keymile boards mgcoge,
>> mgsuvd and kmeter1. If the PIGGY is not present, dont register
>> this Ethernet device.
>>
>> Signed-off-by: Heiko Schocher <[EMAIL PROTECTED]>
>> ---
>> 
> This looks like useful stuff to have, but I'd prefer that you put the 
> check logic in board_eth_init() rather than adding to the individual 
> device drivers.  I know the 8260 SCC driver is the older style, which 
> precludes the use of board_eth_init, but I'll convert it if you're able 
> to test.
>   

Yes, I could test such a change for you, but hmm... I am not sure, if
board_eth_init () is the right place for my purpose.
I need for every Ethernet device a selection, if this device is present or
not.
Correct me if I am wrong, but it looks like board_eth_init ()
is not made for this purpose. (Ok, I can do a specific device init
in board_eth_init (), but then we must do something, that prevents
that the device is again initialized in eth_initialize () ...

Hmm... while writing this it comes a idea in my mind:
we could move all the *_initialize functions in eth_initialize () in a
seperate function, say eth_hardware_init() and maybe making this
function "weak", so a board writer can write his own
eth_hardware_init() ... in such a function, I could check which
device is present, and only initialize the present devices ...
what do you think?

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


[U-Boot] [PATCH] [ONENAND] Add markbad function

2008-11-12 Thread Kyungmin Park
Add missing markbad function
If not, it's hang when it entered the mtd->mard_bad().

It's not against the u-boot-nand.

Signed-off-by: Kyungmin Park <[EMAIL PROTECTED]>
---
diff --git a/drivers/mtd/onenand/onenand_base.c 
b/drivers/mtd/onenand/onenand_base.c
index a54098c..0dc99be 100644
--- a/drivers/mtd/onenand/onenand_base.c
+++ b/drivers/mtd/onenand/onenand_base.c
@@ -1589,6 +1589,37 @@ int onenand_block_isbad(struct mtd_info *mtd, loff_t ofs)
 }
 
 /**
+ * onenand_default_block_markbad - [DEFAULT] mark a block bad
+ * @param mtd   MTD device structure
+ * @param ofs   offset from device start
+ *
+ * This is the default implementation, which can be overridden by
+ * a hardware specific driver.
+ */
+static int onenand_default_block_markbad(struct mtd_info *mtd, loff_t ofs)
+{
+   struct onenand_chip *this = mtd->priv;
+   struct bbm_info *bbm = this->bbm;
+   u_char buf[2] = {0, 0};
+   struct mtd_oob_ops ops = {
+   .mode = MTD_OOB_PLACE,
+   .ooblen = 2,
+   .oobbuf = buf,
+   .ooboffs = 0,
+   };
+   int block;
+
+   /* Get block number */
+   block = ((int) ofs) >> bbm->bbt_erase_shift;
+   if (bbm->bbt)
+   bbm->bbt[block >> 2] |= 0x01 << ((block & 0x03) << 1);
+
+   /* We write two bytes, so we dont have to mess with 16 bit access */
+   ofs += mtd->oobsize + (bbm->badblockpos & ~0x01);
+   return onenand_write_oob_nolock(mtd, ofs, &ops);
+}
+
+/**
  * onenand_block_markbad - [MTD Interface] Mark the block at the given offset 
as bad
  * @param mtd  MTD device structure
  * @param ofs  offset relative to mtd start
@@ -2051,6 +2082,8 @@ int onenand_scan(struct mtd_info *mtd, int maxchips)
if (!this->write_bufferram)
this->write_bufferram = onenand_write_bufferram;
 
+   if (!this->block_markbad)
+   this->block_markbad = onenand_default_block_markbad;
if (!this->scan_bbt)
this->scan_bbt = onenand_default_bbt;
 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] what's wrong when I install ELDK?

2008-11-12 Thread AA

Hi all
 
When I install the eldk in the os redhat9 which installed in vmware, 
I created a user "aaa" and the dir "/home/aaa/eldk", and run the command
"$ ./install -d /home/aaa/eldk ppc_6xx"
 
It shows that done.
 
But when I entered the dir "/home/aaa/eldk/bin",
only rmp were found, I can NOT find the xx-gcc etc tools
 
Who can tell me why it happen?
 
thanks
_
MSN 中文网,最新时尚生活资讯,白领聚集门户。
http://cn.msn.com___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Hangs up after transferring control to kernel

2008-11-12 Thread Kumar Gala

On Nov 12, 2008, at 5:48 PM, eliad lubovsky wrote:

> I am trying to boot kernel 2.6.23 on an MPC8572DS board.
> It hangs on a bootm command after decompressing the kernel and the  
> rootfs. I
> added some printings to u-boot where I can see that it transfers  
> control to
> the kernel (can be seen in the attached file).
>
> What could be the problem?

Where did you get a kernel for 8572 that is based on 2.6.23?

- k

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


[U-Boot] How to do serial pages reading in K9f1208u0b-pcb nand chip from SAMSUNG?

2008-11-12 Thread yihect
 Is someone using k9f1208u0b chip for booting u-boot??
The datasheet says that there are three ways for reading:
1, random read. Read any location of 528Bytes in a row. (Read1 and Read 2);
2, serial page read. (my question)
3, sequential row read. Read rows in a block one by one. 
 
But there is not many description on serial read in the datasheet. HOW to do 
serial pages reading when copying u-boot content from the nand chip into ram?
 ___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] sh: fix rsk7203 and MigoR out of tree build

2008-11-12 Thread Nobuhiro Iwamatsu
Hi,

2008/11/12 Jean-Christophe PLAGNIOL-VILLARD <[EMAIL PROTECTED]>:
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <[EMAIL PROTECTED]>
> ---
>  Makefile |4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index e4a184f..005b637 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -3147,7 +3147,7 @@ mimc200_config:   unconfig
>  rsk7203_config: unconfig
>@ >include/config.h
>@echo "#define CONFIG_RSK7203 1" >> include/config.h
> -   @./mkconfig -a $(@:_config=) sh sh2 rsk7203 renesas
> +   @$(MKCONFIG) -a $(@:_config=) sh sh2 rsk7203 renesas
>
>  #
>  ## sh3 (Renesas SuperH)
> @@ -3170,7 +3170,7 @@ ms7720se_config: unconfig
>  MigoR_config :   unconfig
>@mkdir -p $(obj)include
>@echo "#define CONFIG_MIGO_R 1" > $(obj)include/config.h
> -   @./mkconfig -a $(@:_config=) sh sh4 MigoR renesas
> +   @$(MKCONFIG) -a $(@:_config=) sh sh4 MigoR renesas
>
>  ms7750se_config: unconfig
>@mkdir -p $(obj)include
> --
> 1.5.6.5

Applied, thanks.

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


Re: [U-Boot] mini-pci wireless driver

2008-11-12 Thread Jean-Christophe PLAGNIOL-VILLARD
On 09:56 Thu 13 Nov , Lance Zhang wrote:
> 
> > With the Ralink chip it's not too much complicate to add wifi support.
> > You need to upload the firmware and manage the wifi configuration via
> the
> > firmware. After it will work as ant other ethernet driver.
> 
> Thank you, I will ask for the Ralink chip information from manufacturer,
> then I will try to do it as you say
Ask also to Ralink.

It will be the best solution.

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


Re: [U-Boot] mini-pci wireless driver

2008-11-12 Thread Lance Zhang

> With the Ralink chip it's not too much complicate to add wifi support.
> You need to upload the firmware and manage the wifi configuration via
the
> firmware. After it will work as ant other ethernet driver.

Thank you, I will ask for the Ralink chip information from manufacturer,
then I will try to do it as you say

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


Re: [U-Boot] mini-pci wireless driver

2008-11-12 Thread Jean-Christophe PLAGNIOL-VILLARD
On 22:56 Wed 12 Nov , Wolfgang Denk wrote:
> Dear "Lance Zhang",
> 
> In message <[EMAIL PROTECTED]> you wrote:
> > 
> > My questions are: How can I support wireless network card on U Boot?
> 
> Correct. And there is no support for TCP/IP einther, nor do  we  have
> X11  or  Gnome,  and  there is neither Eclipse nor Firefox available,
> not even OpenOffice or iSCSI support.
> 
> To make the story short: U-Boot  is  a  boot  loader,  and  a  pretty
> powerful one, but there are certain tasks where it makes sense to use
> an OS.
> 
> > I want to implement a wlan mini-pci driver, But when I see U Boot source
> > tree, there is no codes related to wireless, do you have any suggestion
> > on how to add wireless support on U Boot? Or is there any U Boot
> > branches that have already implemented wireless extension on U boot?
> 
> Don't waste your time. Use U-Boot to boot asmall configuration of
> Linux with WLAN support included, and use this to do whjat you want to
> do.

With the Ralink chip it's not too much complicate to add wifi support.
You need to upload the firmware and manage the wifi configuration via the
firmware. After it will work as ant other ethernet driver.

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


Re: [U-Boot] mini-pci wireless driver

2008-11-12 Thread David Hawkins


> Thanks for the reply, I am not really want to support the TCP/IP ,
> Wnat I do is to add the wireless network card to uboot then I can load OS
> firmware from another computer(maybe through tftp wlan)

Re-read Wolfgang's response, he gave you the recommended solution:

>> Don't waste your time. Use U-Boot to boot asmall configuration of
>> Linux with WLAN support included, and use this to do what you want to
>> do.

Boot your board with U-Boot, and have it run a stripped-down
version of Linux that understands how to run your wireless
card. Then use Linux to tftp your OS and then jump into
the tftp'd version, eg. Google kexec.

Cheers,
Dave

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


[U-Boot] [PATCH] Section name should be ".data" not "data"

2008-11-12 Thread Trent Piepho
Signed-off-by: Trent Piepho <[EMAIL PROTECTED]>
---
 drivers/i2c/fsl_i2c.c |7 +++
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/i2c/fsl_i2c.c b/drivers/i2c/fsl_i2c.c
index 281a88b..3b5c06b 100644
--- a/drivers/i2c/fsl_i2c.c
+++ b/drivers/i2c/fsl_i2c.c
@@ -38,11 +38,10 @@ DECLARE_GLOBAL_DATA_PTR;
  * runs from ROM, and we can't switch buses because we can't modify
  * the global variables.
  */
-#ifdef CONFIG_SYS_SPD_BUS_NUM
-static unsigned int i2c_bus_num __attribute__ ((section ("data"))) = 
CONFIG_SYS_SPD_BUS_NUM;
-#else
-static unsigned int i2c_bus_num __attribute__ ((section ("data"))) = 0;
+#ifndef CONFIG_SYS_SPD_BUS_NUM
+#define CONFIG_SYS_SPD_BUS_NUM 0
 #endif
+static unsigned int i2c_bus_num __attribute__ ((section (".data"))) = 
CONFIG_SYS_SPD_BUS_NUM;
 
 static unsigned int i2c_bus_speed[2] = {CONFIG_SYS_I2C_SPEED, 
CONFIG_SYS_I2C_SPEED};
 
-- 
1.5.4.1

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


Re: [U-Boot] mini-pci wireless driver

2008-11-12 Thread LanceZ

Hi Wolfgang 

Thanks for the reply, I am not really want to support the TCP/IP ,
Wnat I do is to add the wireless network card to uboot then I can load OS
firmware from another computer(maybe through tftp wlan)


wd wrote:
> 
> Dear "Lance Zhang",
> 
> In message
> <[EMAIL PROTECTED]> you
> wrote:
>> 
>> My questions are: How can I support wireless network card on U Boot?
> 
> Correct. And there is no support for TCP/IP einther, nor do  we  have
> X11  or  Gnome,  and  there is neither Eclipse nor Firefox available,
> not even OpenOffice or iSCSI support.
> 
> To make the story short: U-Boot  is  a  boot  loader,  and  a  pretty
> powerful one, but there are certain tasks where it makes sense to use
> an OS.
> 
>> I want to implement a wlan mini-pci driver, But when I see U Boot source
>> tree, there is no codes related to wireless, do you have any suggestion
>> on how to add wireless support on U Boot? Or is there any U Boot
>> branches that have already implemented wireless extension on U boot?
> 
> Don't waste your time. Use U-Boot to boot asmall configuration of
> Linux with WLAN support included, and use this to do whjat you want to
> do.
> 
> Best regards,
> 
> Wolfgang Denk
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/-U-Boot--mini-pci-wireless-driver-tp20317042p20472956.html
Sent from the Uboot - Users mailing list archive at Nabble.com.

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


[U-Boot] Hangs up after transferring control to kernel

2008-11-12 Thread eliad lubovsky
I am trying to boot kernel 2.6.23 on an MPC8572DS board.
It hangs on a bootm command after decompressing the kernel and the rootfs. I
added some printings to u-boot where I can see that it transfers control to
the kernel (can be seen in the attached file).

What could be the problem?


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


Re: [U-Boot] [PATCH] mpc83xx: increase BOOTMAPSZ to 16MB

2008-11-12 Thread Anton Vorontsov
On Wed, Nov 12, 2008 at 03:57:13PM -0600, Kim Phillips wrote:
> On Thu, 6 Nov 2008 16:31:26 +0300
> Anton Vorontsov <[EMAIL PROTECTED]> wrote:
> 
> > As space expands, so does the software. Today the kernel with built-in
> > initramfs image is likely to not fit into 8MB limit. It feels safe to
> > increase BOOTMAPSZ to 16MB, since the Linux actually maps 16MB on 6xx
> > PPCs (two BATs, 8MB each).
> > 
> > Signed-off-by: Anton Vorontsov <[EMAIL PROTECTED]>
> > ---
> > 
> > p.s. The patch for the whole tree is quite big, so let's start
> > with 83xx.
> 
> ack,

Great, thanks.

> I'm ok with this operation starting in 83xx land, but it may be
> worth investigating whether it can be made a one-shot directly with WD,
> just as the CFG_ -> CONFIG_SYS_ switch just happened.  dunno. If we
> don't hear from WD soon, I'll put this in mpc83xx's next branch.

Please don't queue this patch yet. I'll send an updated version
soon, that will also define CFG_BOOTM_LEN (so that bootm command
will able to gunzip 16MB images).

> > pp.s. Maybe we could fector out these defines into
> > include/configs/ppc6xx-common.h?
> 
> sure, but maybe that can wait until the base domain granularity becomes
> more accurately visible...

Ok, makes sense.

-- 
Anton Vorontsov
email: [EMAIL PROTECTED]
irc://irc.freenode.net/bd2
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Not able to access uboot newsgroup from thunderbird

2008-11-12 Thread Wolfgang Denk
Dear "Sriram Chadalavada",

In message <[EMAIL PROTECTED]> you wrote:
>
> My mistake Wolfang. Will not happen again. Although I am not sure why I am
> not able to access the newsgroup from Thunderbird.
> 
> I am using the free news server nntp.aioe.org. Anyone else using thunderbird
> to access the newsgroup??

This is no newsgroup. It is a mailing list actually.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [EMAIL PROTECTED]
Alliance: In international politics, the union  of  two  thieves  who
have  their hands so deeply inserted in each other's pocket that they
cannot separately plunder a third.   - Ambrose Bierce
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Makefile: use find to simplify clobber and avoid some bash problem

2008-11-12 Thread Wolfgang Denk
Dear Jean-Christophe PLAGNIOL-VILLARD,

In message <[EMAIL PROTECTED]> you wrote:
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <[EMAIL PROTECTED]>
> ---
> please try this on ubuntu
> 
> Best Regards,
> J.
>  Makefile |5 ++---
>  1 files changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 884b634..212451f 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -3280,9 +3280,8 @@ clobber:clean
>   @rm -f $(OBJS) $(obj)*.bak $(obj)ctags $(obj)etags $(obj)TAGS \
>   $(obj)cscope.* $(obj)*.*~
>   @rm -f $(obj)u-boot $(obj)u-boot.map $(obj)u-boot.hex $(ALL)
> - @rm -f 
> $(obj)tools/{crc32.c,env_embedded.c,env/crc32.c,md5.c,sha1.c,inca-swap-bytes}
> - @rm -f 
> $(obj)tools/{image.c,fdt.c,fdt_ro.c,fdt_rw.c,fdt_strerror.c,zlib.h}
> - @rm -f $(obj)tools/{fdt_wip.c,libfdt_internal.h}
> + @find $(obj)tools -name "*" -type l -print | xargs rm -f
> + @rm -f $(obj)tools/inca-swap-bytes
>   @rm -f $(obj)cpu/mpc824x/bedbug_603e.c
>   @rm -f $(obj)include/asm/proc $(obj)include/asm/arch $(obj)include/asm
>   @[ ! -d $(obj)nand_spl ] || find $(obj)nand_spl -name "*" -type l 
> -print | xargs rm -f

This will not help, we use the {...} syntax in other places, too.

Use bash.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [EMAIL PROTECTED]
The human race has one really effective weapon, and that is laughter.
 - Mark Twain
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] FAT on non standard sector size devices

2008-11-12 Thread Wolfgang Denk
Dear Igor Luri,

In message <[EMAIL PROTECTED]> you wrote:
> SGkgYWxsIQoKSSBoYXZlIGRvbmUgc29tZSBjaGFuZ2VzIHN1Z2VzdGVkIGJ5IFJlbXkgQm9obWUg
> YW5kIGZpbmFsbHkgdGhlCmZvbGxvd2luZyBwYXRjaCBhZGRzIEZBVCBzdXBwb3J0IG9uIGRldmlj
> ZXMgb2YgQU5ZIHNlY3RvciBzaXplLgoKSSBoYXZlIG9ubHkgdGVzdGVkIG9uIG91ciBjdXN0b20g
> Ym9hcmQgd2l0aCB1LWJvb3QgMS4xLjYgdmVyc2lvbi4gSQp3b3VsZCBhcHByZWNpYXRlIGlmIHNv
> bWVvbmUgY291bGQgdGVzdCB0aGlzIHBhdGNoIG9uIGxhdGVzdCB2ZXJzaW9uLgoKVGhhbmtzLgoK
> U2lnbmVkLW9mZi1ieTogSWdvciBMdXJpIDxpbHVyaUBhb3Rlay5lcz4KCmRpZmYgLS1naXQgYS9p
> bmNsdWRlL2ZhdC5oIGIvaW5jbHVkZS9mYXQuaAppbmRleCA1OWRlM2ZiLi5kYWQyZTNkIDEwMDY0
> NAotLS0gYS9pbmNsdWRlL2ZhdC5oCisrKyBiL2luY2x1ZGUvZmF0LmgKQEAgLTMxLDIwICszMSwx
> MiBAQAogCiAjZGVmaW5lIENPTkZJR19TVVBQT1JUX1ZGQVQKIAotI2RlZmluZSBTRUNUT1JfU0la
> RSBGU19CTE9DS19TSVpFCi0KLSNkZWZpbmUgRlNfQkxPQ0tfU0laRSA1MTIKLQotI2lmIEZTX0JM
> T0NLX1NJWkUgIT0gU0VDVE9SX1NJWkUKLSNlcnJvciBGU19CTE9DS19TSVpFICE9IFNFQ1RPUl9T
> SVpFIC0gVGhpcyBjb2RlIG5lZWRzIHRvIGJlIGZpeGVkIQotI2VuZGlmCi0KICNkZWZpbmUgTUFY
> X0NMVVNUU0laRQk2NTUzNgotI2RlZmluZSBESVJFTlRTUEVSQkxPQ0sJKEZTX0JMT0NLX1NJWkUv
> c2l6ZW9mKGRpcl9lbnRyeSkpCi0jZGVmaW5lIERJUkVOVFNQRVJDTFVTVAooKG15ZGF0YS0+Y2x1
> c3Rfc2l6ZSpTRUNUT1JfU0laRSkvc2l6ZW9mKGRpcl9lbnRyeSkpCisjZGVmaW5lIERJUkVOVFNQ
> RVJCTE9DSwkobXlkYXRhLT5zZWN0b3Jfc2l6ZS9zaXplb2YoZGlyX2VudHJ5KSkKKyNkZWZpbmUg
> RElSRU5UU1BFUkNMVVNUCigobXlkYXRhLT5jbHVzdF9zaXplKm15ZGF0YS0+c2VjdG9yX3NpemUp
> L3NpemVvZihkaXJfZW50cnkpKQogCiAjZGVmaW5lIEZBVEJVRkJMT0NLUwk2Ci0jZGVmaW5lIEZB
> VEJVRlNJWkUJKEZTX0JMT0NLX1NJWkUqRkFUQlVGQkxPQ0tTKQorI2RlZmluZSBGQVRCVUZTSVpF
> CSAgICAobXlkYXRhLT5zZWN0b3Jfc2l6ZSpGQVRCVUZCTE9DS1MpCiAjZGVmaW5lIEZBVDEyQlVG
> U0laRQkoKEZBVEJVRlNJWkUqMikvMykKICNkZWZpbmUgRkFUMTZCVUZTSVpFCShGQVRCVUZTSVpF
> LzIpCiAjZGVmaW5lIEZBVDMyQlVGU0laRQkoRkFUQlVGU0laRS80KQpAQCAtMTgyLDggKzE3NCw5
> IEBAIHR5cGVkZWYgc3RydWN0IGRpcl9zbG90IHsKICAqIChzZWUgRkFUMzIgYWNjZXNzZXMpCiAg
> Ki8KIHR5cGVkZWYgc3RydWN0IHsKLQlfX3U4CWZhdGJ1ZltGQVRCVUZTSVpFXTsgLyogQ3VycmVu
> dCBGQVQgYnVmZmVyICovCisJX191OAkqZmF0YnVmOyAvKiBDdXJyZW50IEZBVCBidWZmZXIgKi8K
> IAlpbnQJZmF0c2l6ZTsJLyogU2l6ZSBvZiBGQVQgaW4gYml0cyAqLworCV9fdTE2CXNlY3Rvcl9z
> aXplOwkvKiBTZWN0b3Igc2l6ZSAqLwogCV9fdTE2CWZhdGxlbmd0aDsJLyogTGVuZ3RoIG9mIEZB
> VCBpbiBzZWN0b3JzICovCiAJX191MTYJZmF0X3NlY3Q7CS8qIFN0YXJ0aW5nIHNlY3RvciBvZiB0
> aGUgRkFUICovCiAJX191MTYJcm9vdGRpcl9zZWN0OwkvKiBTdGFydCBzZWN0b3Igb2Ygcm9vdCBk
> aXJlY3RvcnkgKi8KCgpkaWZmIC0tZ2l0IGEvZnMvZmF0L2ZhdC5jIGIvZnMvZmF0L2ZhdC5jCmlu
> ZGV4IDJmMGJkOGMuLmMyNGYwMDkgMTAwNjQ0Ci0tLSBhL2ZzL2ZhdC9mYXQuYworKysgYi9mcy9m
> YXQvZmF0LmMKQEAgLTMwLDYgKzMwLDcgQEAKICNpbmNsdWRlIDxmYXQuaD4KICNpbmNsdWRlIDxh
> c20vYnl0ZW9yZGVyLmg+CiAjaW5jbHVkZSA8cGFydC5oPgorI2luY2x1ZGUgPG1hbGxvYy5oPgog
> CiAvKgogICogQ29udmVydCBhIHN0cmluZyB0byBsb3dlcmNhc2UuCkBAIC02NywxMiArNjgsMTcg
> QEAgaW50IGRpc2tfcmVhZCAoX191MzIgc3RhcnRibG9jaywgX191MzIgZ2V0c2l6ZSwgX191OAoq
> IGJ1ZnB0cikKIGludAogZmF0X3JlZ2lzdGVyX2RldmljZShibG9ja19kZXZfZGVzY190ICpkZXZf
> ZGVzYywgaW50IHBhcnRfbm8pCiB7Ci0JdW5zaWduZWQgY2hhciBidWZmZXJbU0VDVE9SX1NJWkVd
> OworCXVuc2lnbmVkIGNoYXIgKmJ1ZmZlcjsKIAlkaXNrX3BhcnRpdGlvbl90IGluZm87CiAKIAlp
> ZiAoIWRldl9kZXNjLT5ibG9ja19yZWFkKQogCQlyZXR1cm4gLTE7Ci0JY3VyX2RldiA9IGRldl9k
> ZXNjOworCWN1cl9kZXY9ZGV2X2Rlc2M7CisJCisJYnVmZmVyID0gbWFsbG9jIChjdXJfZGV2LT5i
> bGtzeik7CisJaWYoYnVmZmVyID09IE5VTEwpCisJICAgCXJldHVybigtMSk7CisJCiAJLyogY2hl
> Y2sgaWYgd2UgaGF2ZSBhIE1CUiAob24gZmxvcHBpZXMgd2UgaGF2ZSBvbmx5IGEgUEJSKSAqLwog
> CWlmIChkZXZfZGVzYy0+YmxvY2tfcmVhZCAoZGV2X2Rlc2MtPmRldiwgMCwgMSwgKHVsb25nICop
> IGJ1ZmZlcikgIT0gMSkKewogCQlwcmludGYgKCIqKiBDYW4ndCByZWFkIGZyb20gZGV2aWNlICVk
> ICoqXG4iLCBkZXZfZGVzYy0+ZGV2KTsKQEAgLTExOCw2ICsxMjQsNyBAQCBmYXRfcmVnaXN0ZXJf
> ZGV2aWNlKGJsb2NrX2Rldl9kZXNjX3QgKmRldl9kZXNjLCBpbnQKcGFydF9ubykKIAkJY3VyX3Bh
> cnQgPSAxOwogCX0KICNlbmRpZgorCWZyZWUoYnVmZmVyKTsKIAlyZXR1cm4gMDsKIH0KIApAQCAt
> MjIwLDEyICsyMjcsMTIgQEAgZ2V0X2ZhdGVudChmc2RhdGEgKm15ZGF0YSwgX191MzIgZW50cnkp
> CiAKIAkvKiBSZWFkIGEgbmV3IGJsb2NrIG9mIEZBVCBlbnRyaWVzIGludG8gdGhlIGNhY2hlLiAq
> LwogCWlmIChidWZudW0gIT0gbXlkYXRhLT5mYXRidWZudW0pIHsKLQkJaW50IGdldHNpemUgPSBG
> QVRCVUZTSVpFL0ZTX0JMT0NLX1NJWkU7CisJCWludCBnZXRzaXplID0gRkFUQlVGU0laRS9teWRh
> dGEtPnNlY3Rvcl9zaXplOwogCQlfX3U4ICpidWZwdHIgPSBteWRhdGEtPmZhdGJ1ZjsKIAkJX191
> MzIgZmF0bGVuZ3RoID0gbXlkYXRhLT5mYXRsZW5ndGg7CiAJCV9fdTMyIHN0YXJ0YmxvY2sgPSBi
> dWZudW0gKiBGQVRCVUZCTE9DS1M7CiAKLQkJZmF0bGVuZ3RoICo9IFNFQ1RPUl9TSVpFOwkvKiBX
> ZSB3YW50IGl0IGluIGJ5dGVzIG5vdyAqLworCQlmYXRsZW5ndGggKj0gbXlkYXRhLT5zZWN0b3Jf
> c2l6ZTsJLyogV2Ugd2FudCBpdCBpbiBieXRlcyBub3cgKi8KIAkJc3RhcnRibG9jayArPSBteWRh
> dGEtPmZhdF9zZWN0OwkvKiBPZmZzZXQgZnJvbSBzdGFydCBvZiBkaXNrICovCiAKIAkJaWYgKGdl
> dHNpemUgPiBmYXRsZW5ndGgpIGdldHNpemUgPSBmYXRsZW5ndGg7CkBAIC0zMDAsMjAgKzMwNywy
> NSBAQCBnZXRfY2x1c3Rlcihmc2RhdGEgKm15ZGF0YSwgX191MzIgY2x1c3RudW0sIF9fdTgKKmJ1
> ZmZlciwgdW5zaWduZWQgbG9uZyBzaXplKQogCX0KIAogCUZBVF9EUFJJTlQoImdjIC0gY2x1c3Ru
> dW06ICVkLCBzdGFydHNlY3Q6ICVkXG4iLCBjbHVzdG51bSwgc3RhcnRzZWN0KTsKLQlpZiAoZGlz
> a19yZWFkKHN0YXJ0c2VjdCwgc2l6ZS9GU19CTE9DS19TSVpFICwgYnVmZmVyKSA8IDApIHsKKwlp
> ZiAoZGlza19yZWFkKHN0YXJ0c2VjdCwgc2l6ZS9t

Re: [U-Boot] mini-pci wireless driver

2008-11-12 Thread Wolfgang Denk
Dear "Lance Zhang",

In message <[EMAIL PROTECTED]> you wrote:
> 
> My questions are: How can I support wireless network card on U Boot?

Correct. And there is no support for TCP/IP einther, nor do  we  have
X11  or  Gnome,  and  there is neither Eclipse nor Firefox available,
not even OpenOffice or iSCSI support.

To make the story short: U-Boot  is  a  boot  loader,  and  a  pretty
powerful one, but there are certain tasks where it makes sense to use
an OS.

> I want to implement a wlan mini-pci driver, But when I see U Boot source
> tree, there is no codes related to wireless, do you have any suggestion
> on how to add wireless support on U Boot? Or is there any U Boot
> branches that have already implemented wireless extension on U boot?

Don't waste your time. Use U-Boot to boot asmall configuration of
Linux with WLAN support included, and use this to do whjat you want to
do.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [EMAIL PROTECTED]
   There is enough for the need of everyone in this world,
   but not for the greed of everyone. - Mahatma Gandhi
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] mpc83xx: increase BOOTMAPSZ to 16MB

2008-11-12 Thread Kim Phillips
On Thu, 6 Nov 2008 16:31:26 +0300
Anton Vorontsov <[EMAIL PROTECTED]> wrote:

> As space expands, so does the software. Today the kernel with built-in
> initramfs image is likely to not fit into 8MB limit. It feels safe to
> increase BOOTMAPSZ to 16MB, since the Linux actually maps 16MB on 6xx
> PPCs (two BATs, 8MB each).
> 
> Signed-off-by: Anton Vorontsov <[EMAIL PROTECTED]>
> ---
> 
> p.s. The patch for the whole tree is quite big, so let's start
> with 83xx.

ack, I'm ok with this operation starting in 83xx land, but it may be
worth investigating whether it can be made a one-shot directly with WD,
just as the CFG_ -> CONFIG_SYS_ switch just happened.  dunno. If we
don't hear from WD soon, I'll put this in mpc83xx's next branch.

> pp.s. Maybe we could fector out these defines into
> include/configs/ppc6xx-common.h?

sure, but maybe that can wait until the base domain granularity becomes
more accurately visible...I just took a look - I can't seem to find a
single non-coldfire board that doesn't set BOOTMAPSZ to 8MB (coldfire
boards set it to SDRAM_BASE + SDRAM_SIZE).  Anyway, I it looks like a
single patch might fit on this mailling list.

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


Re: [U-Boot] [PATCH-OMAP3] OMAP3: Update ARM's if then else logic in examples Makefile

2008-11-12 Thread Wolfgang Denk
Dear [EMAIL PROTECTED],

In message <[EMAIL PROTECTED]> you wrote:
> Update ARM's if then else logic.
> 
> ---
>  examples/Makefile |6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)

Hm... wouldn't it make  sense  to  explicitely  state  against  which
repository this patch (and all other of your patches) was (were) made
resp. where you want to have it added? For mainline, it just wouldn't
work (as you probably know).

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [EMAIL PROTECTED]
: 1.  What is the possibility of this being added in the future?
In the near future, the probability is close to zero. In the  distant
future, I'll be dead, and posterity can do whatever they like... :-)
  - lwall
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] samsung 1GB nand flash

2008-11-12 Thread Scott Wood
chandan wrote:
> I am using 1GB nand flash K9F1G08 flash series with SAM
> 9263microcontroller. Here I am not able load the U boot in to the
> board.because 1GB nand flash not defined in the nand.h and nand.c
> .how to make changes in the code and where.Please educate on this
> issue.

The NAND device ID table is in drivers/mtd/nand/nand_ids.c.

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


Re: [U-Boot] [PATCH] mpc83xx: New board support SIMPC8313

2008-11-12 Thread Scott Wood
Ron Madrid wrote:
>>> +*((u32 *)(CFG_IMMR + addr)) = data;
>> use the out_be32 i/o memory accessor and friends please (here and
>> elsewhere in the patch).
>>
> 
> I am trying to resolve this last issue with your review and replacing
> all of the i/o memory accesses with in/out_be* has caused my
> code to inflate by about 200 bytes, and now I'm over the 4K limit 
> by about 160 bytes for the 8313 bootstrap.  Without trying to
> squeeze my code is there anything that could be done to shrink
> my code?

Use raw accessors and make sure that explicit barriers are used where 
needed.

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


[U-Boot] samsung 1GB nand flash

2008-11-12 Thread chandan
Hello,

 I am using 1GB nand flash K9F1G08 flash series with SAM 9263microcontroller. 
Here I am not able load the U boot in to the board.because 1GB nand flash not 
defined in the nand.h and nand.c .how to make changes in the code and 
where.Please educate on this issue.

on the hyper terminal i can see the NAND flsh ID details
 Matter is most urgent.

Thanks & reagrds,
Chandan ___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] mpc83xx: New board support SIMPC8313

2008-11-12 Thread Ron Madrid
> 
> > +*((u32 *)(CFG_IMMR + addr)) = data;
> 
> use the out_be32 i/o memory accessor and friends please (here and
> elsewhere in the patch).
> 

I am trying to resolve this last issue with your review and replacing
all of the i/o memory accesses with in/out_be* has caused my
code to inflate by about 200 bytes, and now I'm over the 4K limit 
by about 160 bytes for the 8313 bootstrap.  Without trying to
squeeze my code is there anything that could be done to shrink
my code?

Ron

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


Re: [U-Boot] [PATCH V2] cmd_bdinfo: move implementation to arch instead of common

2008-11-12 Thread Jean-Christophe PLAGNIOL-VILLARD
On 14:55 Wed 12 Nov , Mike Frysinger wrote:
> On Wed, Nov 12, 2008 at 2:45 PM, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > On 14:36 Wed 12 Nov , Mike Frysinger wrote:
> >> On Wed, Nov 12, 2008 at 2:13 PM, Jean-Christophe PLAGNIOL-VILLARD wrote:
> >> > introduce two new weak functions board_bdinfo and soc_bdinfo to allow 
> >> > board and
> >> > soc to print more information
> >>
> >> there seems to be things that all arches print ... like memory and
> >> flash information.  perhaps that should be left in the common
> >> bdinfo().
> >
> > I've prefered to let arch print this how they wish
> >
> >> > +void arch_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
> >> > +   if(soc_bdinfo)
> >> > +   if(board_bdinfo)
> >>
> >> you've got random whitespace damage all over this patch ...
> >
> > I known, but I not suposed to fix PPC whitespace in the patch
> > I've an other one when everyone will agree on this one
> 
> i wasnt talking about PPC whitespace.  i was talking about code you
> added.  the code in the common bdinfo.c did not exist until you added
> it.  the function decls in the arch bdinfo.c's did not exist until you
> added them.

sorry do see what you talk about

please show in the patch

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


Re: [U-Boot] [PATCH V2] cmd_bdinfo: move implementation to arch instead of common

2008-11-12 Thread Mike Frysinger
On Wed, Nov 12, 2008 at 2:45 PM, Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 14:36 Wed 12 Nov , Mike Frysinger wrote:
>> On Wed, Nov 12, 2008 at 2:13 PM, Jean-Christophe PLAGNIOL-VILLARD wrote:
>> > introduce two new weak functions board_bdinfo and soc_bdinfo to allow 
>> > board and
>> > soc to print more information
>>
>> there seems to be things that all arches print ... like memory and
>> flash information.  perhaps that should be left in the common
>> bdinfo().
>
> I've prefered to let arch print this how they wish
>
>> > +void arch_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
>> > +   if(soc_bdinfo)
>> > +   if(board_bdinfo)
>>
>> you've got random whitespace damage all over this patch ...
>
> I known, but I not suposed to fix PPC whitespace in the patch
> I've an other one when everyone will agree on this one

i wasnt talking about PPC whitespace.  i was talking about code you
added.  the code in the common bdinfo.c did not exist until you added
it.  the function decls in the arch bdinfo.c's did not exist until you
added them.
-mike
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V2] cmd_bdinfo: move implementation to arch instead of common

2008-11-12 Thread Jean-Christophe PLAGNIOL-VILLARD
On 14:36 Wed 12 Nov , Mike Frysinger wrote:
> On Wed, Nov 12, 2008 at 2:13 PM, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > introduce two new weak functions board_bdinfo and soc_bdinfo to allow board 
> > and
> > soc to print more information
> 
> there seems to be things that all arches print ... like memory and
> flash information.  perhaps that should be left in the common
> bdinfo().

I've prefered to let arch print this how they wish

> > +void arch_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
> > +   if(soc_bdinfo)
> > +   if(board_bdinfo)
> 
> you've got random whitespace damage all over this patch ...

I known, but I not suposed to fix PPC whitespace in the patch
I've an other one when everyone will agree on this one

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


Re: [U-Boot] [PATCH V2] cmd_bdinfo: move implementation to arch instead of common

2008-11-12 Thread Mike Frysinger
On Wed, Nov 12, 2008 at 2:13 PM, Jean-Christophe PLAGNIOL-VILLARD wrote:
> introduce two new weak functions board_bdinfo and soc_bdinfo to allow board 
> and
> soc to print more information

there seems to be things that all arches print ... like memory and
flash information.  perhaps that should be left in the common
bdinfo().

> +void board_bdinfo(cmd_tbl_t *, int, int, char **) __attribute((weak));
> +void soc_bdinfo(cmd_tbl_t *, int, int, char **) __attribute((weak));

__attribute__

> +void arch_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
> +   if(soc_bdinfo)
> +   if(board_bdinfo)

you've got random whitespace damage all over this patch ...

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


[U-Boot] Not able to access uboot newsgroup from thunderbird

2008-11-12 Thread Sriram Chadalavada
My mistake Wolfang. Will not happen again. Although I am not sure why I am
not able to access the newsgroup from Thunderbird.

I am using the free news server nntp.aioe.org. Anyone else using thunderbird
to access the newsgroup??

Regards,
Ram

On Sat, Nov 8, 2008 at 1:23 AM, Wolfgang Denk <[EMAIL PROTECTED]> wrote:

> Dear "Sriram Chadalavada",
>
> In message <[EMAIL PROTECTED]>
> you wrote:
> >
> >   I have a Cirrus Logic EDB7312 prototype evaluation board and
> want
>
> This has nothing to do with . Please do not hijack other
> threads!
>
> > to port uboot to it. Is the newsgroup still functional? I was not able to
> > access it via thunderbird.
>
> It's the official mailing list for U-Boot, and of course it's active.
>
> > On Fri, Nov 7, 2008 at 3:23 PM, Duy-Ky Nguyen <[EMAIL PROTECTED]
> >wrote:
> >
> ...
>
> Please do not top-pos / full-quote.
>
> Please read http://www.netmeister.org/news/learn2quote.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: [EMAIL PROTECTED]
> We, the unwilling, led by the unknowing, are doing the impossible for
> the ungrateful. We have done so much, for so long, with so little, we
> are now qualified to do anything with nothing.
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] FAT on non standard sector size devices

2008-11-12 Thread Remy Bohmer
Hello Luri,

2008/11/12 Igor Luri <[EMAIL PROTECTED]>:
> Hi all!
>
> I have done some changes sugested by Remy Bohme and finally the
> following patch adds FAT support on devices of ANY sector size.
>
> I have only tested on our custom board with u-boot 1.1.6 version. I
> would appreciate if someone could test this patch on latest version.

I will try to find a gap tomorrow to test it on mainline.
I will keep you informed!

Kind Regards,

Remy


>
> Thanks.
>
> Signed-off-by: Igor Luri <[EMAIL PROTECTED]>
>
> diff --git a/include/fat.h b/include/fat.h
> index 59de3fb..dad2e3d 100644
> --- a/include/fat.h
> +++ b/include/fat.h
> @@ -31,20 +31,12 @@
>
>  #define CONFIG_SUPPORT_VFAT
>
> -#define SECTOR_SIZE FS_BLOCK_SIZE
> -
> -#define FS_BLOCK_SIZE 512
> -
> -#if FS_BLOCK_SIZE != SECTOR_SIZE
> -#error FS_BLOCK_SIZE != SECTOR_SIZE - This code needs to be fixed!
> -#endif
> -
>  #define MAX_CLUSTSIZE  65536
> -#define DIRENTSPERBLOCK(FS_BLOCK_SIZE/sizeof(dir_entry))
> -#define DIRENTSPERCLUST
> ((mydata->clust_size*SECTOR_SIZE)/sizeof(dir_entry))
> +#define DIRENTSPERBLOCK(mydata->sector_size/sizeof(dir_entry))
> +#define DIRENTSPERCLUST
> ((mydata->clust_size*mydata->sector_size)/sizeof(dir_entry))
>
>  #define FATBUFBLOCKS   6
> -#define FATBUFSIZE (FS_BLOCK_SIZE*FATBUFBLOCKS)
> +#define FATBUFSIZE (mydata->sector_size*FATBUFBLOCKS)
>  #define FAT12BUFSIZE   ((FATBUFSIZE*2)/3)
>  #define FAT16BUFSIZE   (FATBUFSIZE/2)
>  #define FAT32BUFSIZE   (FATBUFSIZE/4)
> @@ -182,8 +174,9 @@ typedef struct dir_slot {
>  * (see FAT32 accesses)
>  */
>  typedef struct {
> -   __u8fatbuf[FATBUFSIZE]; /* Current FAT buffer */
> +   __u8*fatbuf; /* Current FAT buffer */
>int fatsize;/* Size of FAT in bits */
> +   __u16   sector_size;/* Sector size */
>__u16   fatlength;  /* Length of FAT in sectors */
>__u16   fat_sect;   /* Starting sector of the FAT */
>__u16   rootdir_sect;   /* Start sector of root directory */
>
>
> diff --git a/fs/fat/fat.c b/fs/fat/fat.c
> index 2f0bd8c..c24f009 100644
> --- a/fs/fat/fat.c
> +++ b/fs/fat/fat.c
> @@ -30,6 +30,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>
>  /*
>  * Convert a string to lowercase.
> @@ -67,12 +68,17 @@ int disk_read (__u32 startblock, __u32 getsize, __u8
> * bufptr)
>  int
>  fat_register_device(block_dev_desc_t *dev_desc, int part_no)
>  {
> -   unsigned char buffer[SECTOR_SIZE];
> +   unsigned char *buffer;
>disk_partition_t info;
>
>if (!dev_desc->block_read)
>return -1;
> -   cur_dev = dev_desc;
> +   cur_dev=dev_desc;
> +
> +   buffer = malloc (cur_dev->blksz);
> +   if(buffer == NULL)
> +   return(-1);
> +
>/* check if we have a MBR (on floppies we have only a PBR) */
>if (dev_desc->block_read (dev_desc->dev, 0, 1, (ulong *) buffer) != 1)
> {
>printf ("** Can't read from device %d **\n", dev_desc->dev);
> @@ -118,6 +124,7 @@ fat_register_device(block_dev_desc_t *dev_desc, int
> part_no)
>cur_part = 1;
>}
>  #endif
> +   free(buffer);
>return 0;
>  }
>
> @@ -220,12 +227,12 @@ get_fatent(fsdata *mydata, __u32 entry)
>
>/* Read a new block of FAT entries into the cache. */
>if (bufnum != mydata->fatbufnum) {
> -   int getsize = FATBUFSIZE/FS_BLOCK_SIZE;
> +   int getsize = FATBUFSIZE/mydata->sector_size;
>__u8 *bufptr = mydata->fatbuf;
>__u32 fatlength = mydata->fatlength;
>__u32 startblock = bufnum * FATBUFBLOCKS;
>
> -   fatlength *= SECTOR_SIZE;   /* We want it in bytes now */
> +   fatlength *= mydata->sector_size;   /* We want it in 
> bytes now */
>startblock += mydata->fat_sect; /* Offset from start of disk */
>
>if (getsize > fatlength) getsize = fatlength;
> @@ -300,20 +307,25 @@ get_cluster(fsdata *mydata, __u32 clustnum, __u8
> *buffer, unsigned long size)
>}
>
>FAT_DPRINT("gc - clustnum: %d, startsect: %d\n", clustnum, startsect);
> -   if (disk_read(startsect, size/FS_BLOCK_SIZE , buffer) < 0) {
> +   if (disk_read(startsect, size/mydata->sector_size , buffer) < 0) {
>FAT_DPRINT("Error reading data\n");
>return -1;
>}
> -   if(size % FS_BLOCK_SIZE) {
> -   __u8 tmpbuf[FS_BLOCK_SIZE];
> -   idx= size/FS_BLOCK_SIZE;
> +   if(size % mydata->sector_size) {
> +   __u8 * tmpbuf;
> +
> +   tmpbuf = (__u8*) malloc(mydata->sector_size);
> +   if(tmpbuf == NULL)
> +   return(-1);
> +   idx= size/mydata->sector_size;
>if (disk_read(startsect + idx, 1, tmpbuf) < 0) {
>FAT_DPRINT("Error reading data\n");
>return -1;
>}
> - 

Re: [U-Boot] [PATCH v3] OneNAND: Bad block aware read/write command support

2008-11-12 Thread Stefan Roese
On Wednesday 12 November 2008, Scott Wood wrote:
> On Wed, Nov 12, 2008 at 01:47:24PM +0100, Stefan Roese wrote:
> > Update OneNAND command to support bad block awareness.
> > Also change the OneNAND command style to better match the
> > NAND version.
> >
> > Signed-off-by: Stefan Roese <[EMAIL PROTECTED]>
> > Acked-by: Kyungmin Park <[EMAIL PROTECTED]>
> > ---
> > Scott, I looked at merging this code with the NAND command code, but the
> > differences are too big for my taste.
>
> Understood for now, though long-term we should try to eliminate the
> differences that aren't rooted in hardware, and abstract into driver code
> the ones that are.

Ack.

> Applied to u-boot-nand-flash/next (despite a few long lines).

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: [EMAIL PROTECTED]
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH V2] cmd_bdinfo: move implementation to arch instead of common

2008-11-12 Thread Jean-Christophe PLAGNIOL-VILLARD
introduce two new weak functions board_bdinfo and soc_bdinfo to allow board and
soc to print more information

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <[EMAIL PROTECTED]>
---
 common/cmd_bdinfo.c |  504 ++-
 include/bdinfo.h|   54 +
 lib_arm/Makefile|1 +
 lib_arm/bdinfo.c|   58 ++
 lib_avr32/Makefile  |1 +
 lib_avr32/bdinfo.c  |   50 +
 lib_blackfin/Makefile   |1 +
 lib_blackfin/bdinfo.c   |   57 ++
 lib_i386/Makefile   |1 +
 lib_i386/bdinfo.c   |   50 +
 lib_m68k/Makefile   |1 +
 lib_m68k/bdinfo.c   |   83 
 lib_microblaze/Makefile |1 +
 lib_microblaze/bdinfo.c |   54 +
 lib_mips/Makefile   |1 +
 lib_mips/bdinfo.c   |   50 +
 lib_nios/Makefile   |1 +
 lib_nios/bdinfo.c   |   49 +
 lib_nios2/Makefile  |1 +
 lib_nios2/bdinfo.c  |   57 ++
 lib_ppc/Makefile|1 +
 lib_ppc/bdinfo.c|  119 +++
 lib_sh/Makefile |1 +
 lib_sh/bdinfo.c |   50 +
 lib_sparc/Makefile  |   13 +-
 lib_sparc/bdinfo.c  |   64 ++
 26 files changed, 872 insertions(+), 451 deletions(-)
 rewrite common/cmd_bdinfo.c (90%)
 create mode 100644 include/bdinfo.h
 create mode 100644 lib_arm/bdinfo.c
 create mode 100644 lib_avr32/bdinfo.c
 create mode 100644 lib_blackfin/bdinfo.c
 create mode 100644 lib_i386/bdinfo.c
 create mode 100644 lib_m68k/bdinfo.c
 create mode 100644 lib_microblaze/bdinfo.c
 create mode 100644 lib_mips/bdinfo.c
 create mode 100644 lib_nios/bdinfo.c
 create mode 100644 lib_nios2/bdinfo.c
 create mode 100644 lib_ppc/bdinfo.c
 create mode 100644 lib_sh/bdinfo.c
 create mode 100644 lib_sparc/bdinfo.c

diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c
dissimilarity index 90%
index 087eda7..63cb6dc 100644
--- a/common/cmd_bdinfo.c
+++ b/common/cmd_bdinfo.c
@@ -1,447 +1,57 @@
-/*
- * (C) Copyright 2003
- * Wolfgang Denk, DENX Software Engineering, [EMAIL PROTECTED]
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-/*
- * Boot support
- */
-#include 
-#include 
-#include/* for print_IPaddr */
-
-DECLARE_GLOBAL_DATA_PTR;
-
-static void print_num(const char *, ulong);
-
-#ifndef CONFIG_ARM /* PowerPC and other */
-static void print_lnum(const char *, u64);
-
-#ifdef CONFIG_PPC
-static void print_str(const char *, const char *);
-
-int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
-{
-   int i;
-   bd_t *bd = gd->bd;
-   char buf[32];
-
-#ifdef DEBUG
-   print_num ("bd address",(ulong)bd   );
-#endif
-   print_num ("memstart",  bd->bi_memstart );
-   print_lnum ("memsize",  bd->bi_memsize  );
-   print_num ("flashstart",bd->bi_flashstart   );
-   print_num ("flashsize", bd->bi_flashsize);
-   print_num ("flashoffset",   bd->bi_flashoffset  );
-   print_num ("sramstart", bd->bi_sramstart);
-   print_num ("sramsize",  bd->bi_sramsize );
-#if defined(CONFIG_5xx)  || defined(CONFIG_8xx) || \
-defined(CONFIG_8260) || defined(CONFIG_E500)
-   print_num ("immr_base", bd->bi_immr_base);
-#endif
-   print_num ("bootflags", bd->bi_bootflags);
-#if defined(CONFIG_405GP) || defined(CONFIG_405CR) || \
-defined(CONFIG_405EP) || defined(CONFIG_XILINX_405) || \
-defined(CONFIG_440EP) || defined(CONFIG_440GR) || \
-defined(CONFIG_440EPX) || defined(CONFIG_440GRX) ||\
-defined(CONFIG_440SP) || defined(CONFIG_440SPE)
-   print_str ("procfreq",  strmhz(buf, bd->bi_procfreq));
-   print_str ("plb_busfreq",   strmhz(buf, bd->bi_plb_busfreq));
-#if defined(CONFIG_405GP) || defined(CONFIG_405EP) || 
defined(CONFIG_XILINX_405) || \
-defined(CONFIG_440EP) || defined(CONFIG_440GR) || defined(CONFIG_440SPE) 
|| \
-defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
-   print_str ("pci_busfreq",   strmhz(buf, bd->bi_pci_busfreq));
-#endif
-#else  /* ! CONFIG_405GP, CONFIG_405CR, CONFIG_405EP, CONFIG_XILINX_405, 
CONFIG_440EP CONFIG_440GR */
-#if defined(CONFIG_CPM2)
-   print_str ("vco",   strmhz(buf, bd->bi_vco));
- 

[U-Boot] [PATCH] Remove unneeded CONFIG_SHELL references

2008-11-12 Thread Peter Tyser
Make should be using the bash shell by default which makes
CONFIG_SHELL unnecessary

Signed-off-by: Peter Tyser <[EMAIL PROTECTED]>
---
I noticed this after submitting "Use bash for default GNU
Make shell application", let me know if I should
roll both these into 1 patch.

This patch needs to be applied on top of "Use bash for
default GNU Make shell application".

 Makefile  |3 +--
 config.mk |9 ++---
 2 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/Makefile b/Makefile
index cf82551..ec32fba 100644
--- a/Makefile
+++ b/Makefile
@@ -372,8 +372,7 @@ $(U_BOOT_ONENAND):  $(ONENAND_IPL) $(obj)u-boot.bin 
$(obj)include/autoconf.mk
 
 $(VERSION_FILE):
@( printf '#define U_BOOT_VERSION "U-Boot %s%s"\n' 
"$(U_BOOT_VERSION)" \
-'$(shell $(CONFIG_SHELL) $(TOPDIR)/tools/setlocalversion 
$(TOPDIR))' \
-) > [EMAIL PROTECTED]
+'$(shell $(TOPDIR)/tools/setlocalversion $(TOPDIR))' ) > 
[EMAIL PROTECTED]
@cmp -s $@ [EMAIL PROTECTED] && rm -f [EMAIL PROTECTED] || mv 
-f [EMAIL PROTECTED] $@
 
 gdbtools:
diff --git a/config.mk b/config.mk
index 5a9334c..bd813f1 100644
--- a/config.mk
+++ b/config.mk
@@ -46,10 +46,6 @@ PLATFORM_LDFLAGS =
 
 #
 
-CONFIG_SHELL   := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
-   else if [ -x /bin/bash ]; then echo /bin/bash; \
-   else echo sh; fi ; fi)
-
 ifeq ($(HOSTOS)-$(HOSTARCH),darwin-ppc)
 HOSTCC = cc
 else
@@ -204,9 +200,8 @@ endif
 
 #
 
-export CONFIG_SHELL HPATH HOSTCC HOSTCFLAGS CROSS_COMPILE \
-   AS LD CC CPP AR NM STRIP OBJCOPY OBJDUMP \
-   MAKE
+export HPATH HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC CPP AR NM STRIP \
+   OBJCOPY OBJDUMP MAKE
 export TEXT_BASE PLATFORM_CPPFLAGS PLATFORM_RELFLAGS CPPFLAGS CFLAGS AFLAGS
 
 #
-- 
1.6.0.2.GIT

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


[U-Boot] [PATCH] Use bash for default GNU Make shell application

2008-11-12 Thread Peter Tyser
Some Make script commands rely on bash-specific features so
default to bash for the SHELL variable with a fallback to the
standard sh shell

Signed-off-by: Peter Tyser <[EMAIL PROTECTED]>
---
Commands such as these from the top-level Makefile failed
on my Ubuntu 7.04 system which has the sh shell as a symlink
to /bin/dash:
@rm -f $(obj)tools/{fdt_wip.c,libfdt_internal.h}

Eugene O'Brien caught the same issue in this thread:
http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/48047/focus=48048

 Makefile |7 ++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index d8b1f58..cf82551 100644
--- a/Makefile
+++ b/Makefile
@@ -44,7 +44,12 @@ HOSTARCH := $(shell uname -m | \
 HOSTOS := $(shell uname -s | tr '[:upper:]' '[:lower:]' | \
sed -e 's/\(cygwin\).*/cygwin/')
 
-export HOSTARCH HOSTOS
+# Set shell to bash if possible, otherwise fall back to sh
+SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
+   else if [ -x /bin/bash ]; then echo /bin/bash; \
+   else echo sh; fi; fi)
+
+export HOSTARCH HOSTOS SHELL
 
 # Deal with colliding definitions from tcsh etc.
 VENDOR=
-- 
1.6.0.2.GIT

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


Re: [U-Boot] [PATCH] Makefile: use find to simplify clobber and avoid some bash problem

2008-11-12 Thread Peter Tyser
On Wed, 2008-11-12 at 13:16 -0500, Jerry Van Baren wrote:
> Jean-Christophe PLAGNIOL-VILLARD wrote:
> > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <[EMAIL PROTECTED]>
> > ---
> > please try this on ubuntu
> > 
> > Best Regards,
> > J.
> >  Makefile |5 ++---
> >  1 files changed, 2 insertions(+), 3 deletions(-)
> > 
> > diff --git a/Makefile b/Makefile
> > index 884b634..212451f 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -3280,9 +3280,8 @@ clobber:  clean
> > @rm -f $(OBJS) $(obj)*.bak $(obj)ctags $(obj)etags $(obj)TAGS \
> > $(obj)cscope.* $(obj)*.*~
> > @rm -f $(obj)u-boot $(obj)u-boot.map $(obj)u-boot.hex $(ALL)
> > -   @rm -f 
> > $(obj)tools/{crc32.c,env_embedded.c,env/crc32.c,md5.c,sha1.c,inca-swap-bytes}
> > -   @rm -f 
> > $(obj)tools/{image.c,fdt.c,fdt_ro.c,fdt_rw.c,fdt_strerror.c,zlib.h}
> > -   @rm -f $(obj)tools/{fdt_wip.c,libfdt_internal.h}
> > +   @find $(obj)tools -name "*" -type l -print | xargs rm -f
> > +   @rm -f $(obj)tools/inca-swap-bytes
> > @rm -f $(obj)cpu/mpc824x/bedbug_603e.c
> > @rm -f $(obj)include/asm/proc $(obj)include/asm/arch $(obj)include/asm
> > @[ ! -d $(obj)nand_spl ] || find $(obj)nand_spl -name "*" -type l 
> > -print | xargs rm -f
> 
> Oooo, you have a risk of removing symlinks that you didn't mean to. 
> Works today, what about tomorrow?
> 
> This was discussed previously, but not pushed to fruition:
> 
> 
> My vote is (a) use bash specifically and keep the bashisms.

Thanks for the link Jerry, I should have googled before looking into the
issue:)  Based on your comments and the previous discussion I'll send a
patch for option (a) shortly.

Best,
Peter


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


Re: [U-Boot] [PATCH] cmd_bdinfo: move implementation to arch instead of common

2008-11-12 Thread Mike Frysinger
On Wed, Nov 12, 2008 at 1:08 PM, Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 12:55 Wed 12 Nov , Mike Frysinger wrote:
>> On Wed, Nov 12, 2008 at 11:31 AM, Jean-Christophe PLAGNIOL-VILLARD wrote:
>> >> > Is this a good idea?  It takes one centralized mess (that is deprecated,
>> >> > but we don't have a good track record of death after deprecation) and
>> >> > spreads it out over a bunch of files.  Reminds me of cancer.  :-(
>> >> >
>> >> > The centralized mess had no duplication of code, but a lot of #ifdef
>> >> > ugly.  This patch trades off the removal of most of the #ifdef ugly for
>> >> > a lot of duplication.  Which is the lesser of two evils?
>> >> >
>> >> > If you continue down the fragmentation path, would it work to keep the
>> >> > primary bdinfo command (cmd_bdinfo.c) and add two weak function calls to
>> >> > it that processor families and boards can hook to add in their extra
>> >> > processor- and board-specific stuff?  This may result in some
>> >> > rearrangement of the print output (which I don't view as a problem, but
>> >> > manual writers might not like it).  It also results in some additional
>> >> > obscurity since a processor/board porter needs to understand that there
>> >> > is an additional hook to grab for customization.
>> >>
>> >> i think the split version proposed is a lot nicer than the current
>> >> one, but going the route of having an arch hook would be best.  i dont
>> >> think we even need a weak function ... force every arch to implement
>> >> *something*.
>> >
>> > It's the case
>> > The idea is to allow soc and board to allow them to print more info
>>
>> so you have one hard arch hook and one weak board hook.  every
>
> two weak hook

there's no point in making the arch one weak if every arch implements
it.  you simply add useless overhead.

> to allow board AND soc to print more info

which is exactly what i said
-mike
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] mpc8641: fix address-cells default in old .dts detection

2008-11-12 Thread Jon Loeliger
On Mon, 2008-11-10 at 19:45 -0600, Becky Bruce wrote:
> address-cells defaults to 2, not 1; so in the unlikely
> event that it isn't specified, this patch is required
> for correct operation.
> 
> Signed-off-by: Becky Bruce <[EMAIL PROTECTED]>
> ---

Applied and pushed out.


Wolfgang,

I added this to my custodian repo, so it will be
present in the pull-request I sent out a few days ago.

Thanks,
jdl


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


Re: [U-Boot] [PATCH] Makefile: use find to simplify clobber and avoid some bash problem

2008-11-12 Thread Mike Frysinger
On Wed, Nov 12, 2008 at 1:16 PM, Jerry Van Baren wrote:
> Jean-Christophe PLAGNIOL-VILLARD wrote:
>> - @rm -f 
>> $(obj)tools/{crc32.c,env_embedded.c,env/crc32.c,md5.c,sha1.c,inca-swap-bytes}
>> - @rm -f 
>> $(obj)tools/{image.c,fdt.c,fdt_ro.c,fdt_rw.c,fdt_strerror.c,zlib.h}
>> - @rm -f $(obj)tools/{fdt_wip.c,libfdt_internal.h}
>> + @find $(obj)tools -name "*" -type l -print | xargs rm -f
>> + @rm -f $(obj)tools/inca-swap-bytes
>
> My vote is (a) use bash specifically and keep the bashisms.

indeed.  brace expansion is prob one of my favorite features of bash ;).
-mike
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Makefile: use find to simplify clobber and avoid some bash problem

2008-11-12 Thread Peter Tyser
On Wed, 2008-11-12 at 19:06 +0100, Jean-Christophe PLAGNIOL-VILLARD
wrote:
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <[EMAIL PROTECTED]>
> ---
> please try this on ubuntu
> 
> Best Regards,
> J.
>  Makefile |5 ++---
>  1 files changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 884b634..212451f 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -3280,9 +3280,8 @@ clobber:clean
>   @rm -f $(OBJS) $(obj)*.bak $(obj)ctags $(obj)etags $(obj)TAGS \
>   $(obj)cscope.* $(obj)*.*~
>   @rm -f $(obj)u-boot $(obj)u-boot.map $(obj)u-boot.hex $(ALL)
> - @rm -f 
> $(obj)tools/{crc32.c,env_embedded.c,env/crc32.c,md5.c,sha1.c,inca-swap-bytes}
> - @rm -f 
> $(obj)tools/{image.c,fdt.c,fdt_ro.c,fdt_rw.c,fdt_strerror.c,zlib.h}
> - @rm -f $(obj)tools/{fdt_wip.c,libfdt_internal.h}
> + @find $(obj)tools -name "*" -type l -print | xargs rm -f
> + @rm -f $(obj)tools/inca-swap-bytes
>   @rm -f $(obj)cpu/mpc824x/bedbug_603e.c
>   @rm -f $(obj)include/asm/proc $(obj)include/asm/arch $(obj)include/asm
>   @[ ! -d $(obj)nand_spl ] || find $(obj)nand_spl -name "*" -type l 
> -print | xargs rm -f

That should work, I had tried the same thing with 'find ./ -lname "*"'.
I hesitated to use that in case someone had a symlink in their tools
directory that they didn't want cleaned up by make clobber.  I'm not
sure why someone would have those symlinks hanging around, but who am I
to judge what other people do:)

Thanks,
Peter

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


Re: [U-Boot] [PATCH] Makefile: use find to simplify clobber and avoid some bash problem

2008-11-12 Thread Jerry Van Baren
Jean-Christophe PLAGNIOL-VILLARD wrote:
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <[EMAIL PROTECTED]>
> ---
> please try this on ubuntu
> 
> Best Regards,
> J.
>  Makefile |5 ++---
>  1 files changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 884b634..212451f 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -3280,9 +3280,8 @@ clobber:clean
>   @rm -f $(OBJS) $(obj)*.bak $(obj)ctags $(obj)etags $(obj)TAGS \
>   $(obj)cscope.* $(obj)*.*~
>   @rm -f $(obj)u-boot $(obj)u-boot.map $(obj)u-boot.hex $(ALL)
> - @rm -f 
> $(obj)tools/{crc32.c,env_embedded.c,env/crc32.c,md5.c,sha1.c,inca-swap-bytes}
> - @rm -f 
> $(obj)tools/{image.c,fdt.c,fdt_ro.c,fdt_rw.c,fdt_strerror.c,zlib.h}
> - @rm -f $(obj)tools/{fdt_wip.c,libfdt_internal.h}
> + @find $(obj)tools -name "*" -type l -print | xargs rm -f
> + @rm -f $(obj)tools/inca-swap-bytes
>   @rm -f $(obj)cpu/mpc824x/bedbug_603e.c
>   @rm -f $(obj)include/asm/proc $(obj)include/asm/arch $(obj)include/asm
>   @[ ! -d $(obj)nand_spl ] || find $(obj)nand_spl -name "*" -type l 
> -print | xargs rm -f

Oooo, you have a risk of removing symlinks that you didn't mean to. 
Works today, what about tomorrow?

This was discussed previously, but not pushed to fruition:


My vote is (a) use bash specifically and keep the bashisms.

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


Re: [U-Boot] [PATCH] Makefile: use find to simplify clobber and avoid some bash problem

2008-11-12 Thread Mike Frysinger
On Wed, Nov 12, 2008 at 1:06 PM, Jean-Christophe PLAGNIOL-VILLARD wrote:
> -   @rm -f 
> $(obj)tools/{crc32.c,env_embedded.c,env/crc32.c,md5.c,sha1.c,inca-swap-bytes}
> -   @rm -f 
> $(obj)tools/{image.c,fdt.c,fdt_ro.c,fdt_rw.c,fdt_strerror.c,zlib.h}
> -   @rm -f $(obj)tools/{fdt_wip.c,libfdt_internal.h}
> +   @find $(obj)tools -name "*" -type l -print | xargs rm -f
> +   @rm -f $(obj)tools/inca-swap-bytes

your changelog makes no sense.  the problem is that brace expansion is
not in POSIX and so it'll fail on systems that do not use bash by
default (like Ubuntu).  please put a real explanation into your
changelog.

you should use `find ... -print0 | xargs -0 ...` or `find ... -exec
... {} +`.  using `find ... -print | xargs ...` is broken.
-mike
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] cmd_bdinfo: move implementation to arch instead of common

2008-11-12 Thread Jean-Christophe PLAGNIOL-VILLARD
On 12:55 Wed 12 Nov , Mike Frysinger wrote:
> On Wed, Nov 12, 2008 at 11:31 AM, Jean-Christophe PLAGNIOL-VILLARD wrote:
> >> > Is this a good idea?  It takes one centralized mess (that is deprecated,
> >> > but we don't have a good track record of death after deprecation) and
> >> > spreads it out over a bunch of files.  Reminds me of cancer.  :-(
> >> >
> >> > The centralized mess had no duplication of code, but a lot of #ifdef
> >> > ugly.  This patch trades off the removal of most of the #ifdef ugly for
> >> > a lot of duplication.  Which is the lesser of two evils?
> >> >
> >> > If you continue down the fragmentation path, would it work to keep the
> >> > primary bdinfo command (cmd_bdinfo.c) and add two weak function calls to
> >> > it that processor families and boards can hook to add in their extra
> >> > processor- and board-specific stuff?  This may result in some
> >> > rearrangement of the print output (which I don't view as a problem, but
> >> > manual writers might not like it).  It also results in some additional
> >> > obscurity since a processor/board porter needs to understand that there
> >> > is an additional hook to grab for customization.
> >>
> >> i think the split version proposed is a lot nicer than the current
> >> one, but going the route of having an arch hook would be best.  i dont
> >> think we even need a weak function ... force every arch to implement
> >> *something*.
> >
> > It's the case
> > The idea is to allow soc and board to allow them to print more info
> 
> so you have one hard arch hook and one weak board hook.  every
two weak hook to allow board AND soc to print more info

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


[U-Boot] [PATCH] Makefile: use find to simplify clobber and avoid some bash problem

2008-11-12 Thread Jean-Christophe PLAGNIOL-VILLARD
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <[EMAIL PROTECTED]>
---
please try this on ubuntu

Best Regards,
J.
 Makefile |5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 884b634..212451f 100644
--- a/Makefile
+++ b/Makefile
@@ -3280,9 +3280,8 @@ clobber:  clean
@rm -f $(OBJS) $(obj)*.bak $(obj)ctags $(obj)etags $(obj)TAGS \
$(obj)cscope.* $(obj)*.*~
@rm -f $(obj)u-boot $(obj)u-boot.map $(obj)u-boot.hex $(ALL)
-   @rm -f 
$(obj)tools/{crc32.c,env_embedded.c,env/crc32.c,md5.c,sha1.c,inca-swap-bytes}
-   @rm -f 
$(obj)tools/{image.c,fdt.c,fdt_ro.c,fdt_rw.c,fdt_strerror.c,zlib.h}
-   @rm -f $(obj)tools/{fdt_wip.c,libfdt_internal.h}
+   @find $(obj)tools -name "*" -type l -print | xargs rm -f
+   @rm -f $(obj)tools/inca-swap-bytes
@rm -f $(obj)cpu/mpc824x/bedbug_603e.c
@rm -f $(obj)include/asm/proc $(obj)include/asm/arch $(obj)include/asm
@[ ! -d $(obj)nand_spl ] || find $(obj)nand_spl -name "*" -type l 
-print | xargs rm -f
-- 
1.5.6.5

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


Re: [U-Boot] [PATCH] cmd_bdinfo: move implementation to arch instead of common

2008-11-12 Thread Mike Frysinger
On Wed, Nov 12, 2008 at 11:31 AM, Jean-Christophe PLAGNIOL-VILLARD wrote:
>> > Is this a good idea?  It takes one centralized mess (that is deprecated,
>> > but we don't have a good track record of death after deprecation) and
>> > spreads it out over a bunch of files.  Reminds me of cancer.  :-(
>> >
>> > The centralized mess had no duplication of code, but a lot of #ifdef
>> > ugly.  This patch trades off the removal of most of the #ifdef ugly for
>> > a lot of duplication.  Which is the lesser of two evils?
>> >
>> > If you continue down the fragmentation path, would it work to keep the
>> > primary bdinfo command (cmd_bdinfo.c) and add two weak function calls to
>> > it that processor families and boards can hook to add in their extra
>> > processor- and board-specific stuff?  This may result in some
>> > rearrangement of the print output (which I don't view as a problem, but
>> > manual writers might not like it).  It also results in some additional
>> > obscurity since a processor/board porter needs to understand that there
>> > is an additional hook to grab for customization.
>>
>> i think the split version proposed is a lot nicer than the current
>> one, but going the route of having an arch hook would be best.  i dont
>> think we even need a weak function ... force every arch to implement
>> *something*.
>
> It's the case
> The idea is to allow soc and board to allow them to print more info

so you have one hard arch hook and one weak board hook.  every
lib_/ needs to implement a bdinfo hook.
-mike
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] PATCH add support for cheflux board

2008-11-12 Thread Ben Warren
Giulio,

Giulio Benetti wrote:
> Add support for cheflux board
>
> diff -urpN -X cheflux-exclude u-boot.orig/board/micronova/cheflux/cheflux.c 
> u-boot/board/micronova/cheflux/cheflux.c
> --- u-boot.orig/board/micronova/cheflux/cheflux.c 1970-01-01 
> 01:00:00.0 +0100
> +++ u-boot/board/micronova/cheflux/cheflux.c  2008-11-12 12:49:06.0 
> +0100
Please re-post your patchset using git tools (I'm especially interested 
in diffstat) so we can tell from the top of the patch which files are 
being impacted.

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


Re: [U-Boot] [PATCH 4/5] powerpc: keymile: Add a check for the PIGGY debug board

2008-11-12 Thread Ben Warren
Hi Heiko,

Heiko Schocher wrote:
> Check the presence of the PIGGY on the keymile boards mgcoge,
> mgsuvd and kmeter1. If the PIGGY is not present, dont register
> this Ethernet device.
>
> Signed-off-by: Heiko Schocher <[EMAIL PROTECTED]>
> ---
This looks like useful stuff to have, but I'd prefer that you put the 
check logic in board_eth_init() rather than adding to the individual 
device drivers.  I know the 8260 SCC driver is the older style, which 
precludes the use of board_eth_init, but I'll convert it if you're able 
to test.

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


Re: [U-Boot] [PATCH v3] OneNAND: Bad block aware read/write command support

2008-11-12 Thread Scott Wood
On Wed, Nov 12, 2008 at 01:47:24PM +0100, Stefan Roese wrote:
> Update OneNAND command to support bad block awareness.
> Also change the OneNAND command style to better match the
> NAND version.
> 
> Signed-off-by: Stefan Roese <[EMAIL PROTECTED]>
> Acked-by: Kyungmin Park <[EMAIL PROTECTED]>
> ---
> Scott, I looked at merging this code with the NAND command code, but the
> differences are too big for my taste.

Understood for now, though long-term we should try to eliminate the
differences that aren't rooted in hardware, and abstract into driver code
the ones that are.

Applied to u-boot-nand-flash/next (despite a few long lines).

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


[U-Boot] GNU Make shell application

2008-11-12 Thread Peter Tyser
Hello,
I noticed on my Ubuntu 7.04 system that when I did a 'make clobber' the
tools directory was still littered with symlinks that should have been
removed.  It looks like commands such as the following in the Makefiles
fail:
@rm -f 
$(obj)tools/{crc32.c,env_embedded.c,env/crc32.c,md5.c,sha1.c,inca-swap-bytes}
@rm -f(obj)tools/{image.c,fdt.c,fdt_ro.c,fdt_rw.c,fdt_strerror.c,zlib.h}
@rm -f $(obj)tools/{fdt_wip.c,libfdt_internal.h}

On Ubuntu 7.04 /bin/sh is a symlink to /bin/dash ordinarily.  By default
Make uses /bin/sh as its shell.  Dash doesn't support the {abc,xyz}
convention so all the symlinks in the above Make commands fail silently.

As a fix, would people prefer that bash be used by Make by default?
Adding something like this (stolen from Linux) to the top-level Makefile
should work:
# Set shell to bash if possible, otherwise fall back to sh
SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
else if [ -x /bin/bash ]; then echo /bin/bash; \
else echo sh; fi; fi)

Or would they prefer the Make commands are updated not to use the
{abc,xyz} convention?

Thanks,
Peter

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


[U-Boot] [PATCH-OMAP3] OMAP3: Clean up system information

2008-11-12 Thread dirk . behme
Clean up system info:

- Move board dependent config to board header
- Clean up code and remove unused code

Signed-off-by: Dirk Behme <[EMAIL PROTECTED]>

---
 board/omap3/beagle/beagle.h|6 +
 board/omap3/evm/evm.h  |6 +
 board/omap3/overo/overo.h  |6 +
 cpu/arm_cortexa8/omap3/board.c |7 +-
 cpu/arm_cortexa8/omap3/sys_info.c  |  102 -
 include/asm-arm/arch-omap3/sys_proto.h |4 -
 6 files changed, 39 insertions(+), 92 deletions(-)

Index: u-boot-arm/board/omap3/beagle/beagle.h
===
--- u-boot-arm.orig/board/omap3/beagle/beagle.h
+++ u-boot-arm/board/omap3/beagle/beagle.h
@@ -26,8 +26,14 @@
 const omap3_sysinfo sysinfo = {
SDP_3430_V1,
SDP_3430_V2,
+   DDR_STACKED,
"3530",
"OMAP3 Beagle board",
+#if defined(CONFIG_ENV_IS_IN_ONENAND)
+   "OneNAND",
+#else
+   "NAND",
+#endif
 };
 
 /*
Index: u-boot-arm/board/omap3/evm/evm.h
===
--- u-boot-arm.orig/board/omap3/evm/evm.h
+++ u-boot-arm/board/omap3/evm/evm.h
@@ -26,8 +26,14 @@
 const omap3_sysinfo sysinfo = {
OMAP3EVM_V1,
OMAP3EVM_V2,
+   DDR_DISCRETE,
"35X-Family",
"OMAP3 EVM board",
+#if defined(CONFIG_ENV_IS_IN_ONENAND)
+   "OneNAND",
+#else
+   "NAND",
+#endif
 };
 
 static int setup_net_chip(void);
Index: u-boot-arm/board/omap3/overo/overo.h
===
--- u-boot-arm.orig/board/omap3/overo/overo.h
+++ u-boot-arm/board/omap3/overo/overo.h
@@ -26,8 +26,14 @@
 const omap3_sysinfo sysinfo = {
SDP_3430_V1,
SDP_3430_V2,
+   DDR_STACKED,
"3503",
"Gumstix Overo board",
+#if defined(CONFIG_ENV_IS_IN_ONENAND)
+   "OneNAND",
+#else
+   "NAND",
+#endif
 };
 
 /*
Index: u-boot-arm/cpu/arm_cortexa8/omap3/board.c
===
--- u-boot-arm.orig/cpu/arm_cortexa8/omap3/board.c
+++ u-boot-arm/cpu/arm_cortexa8/omap3/board.c
@@ -44,6 +44,8 @@
 #define UNLOCK_2 0x
 #define UNLOCK_3 0x
 
+extern omap3_sysinfo sysinfo;
+
 /**
  * Routine: delay
  * Description: spinning delay to use before udelay works
@@ -265,10 +267,9 @@ int dram_init(void)
 {
DECLARE_GLOBAL_DATA_PTR;
unsigned int size0 = 0, size1 = 0;
-   u32 mtype, btype;
+   u32 btype;
 
btype = get_board_type();
-   mtype = get_mem_type();
 
display_board_info(btype);
 
@@ -277,7 +278,7 @@ int dram_init(void)
 * where it can be started.  Early init code will init
 * memory on CS0.
 */
-   if ((mtype == DDR_COMBO) || (mtype == DDR_STACKED)) {
+   if ((sysinfo.mtype == DDR_COMBO) || (sysinfo.mtype == DDR_STACKED)) {
do_sdrc_init(SDRC_CS1_OSET, NOT_EARLY);
make_cs1_contiguous();
}
Index: u-boot-arm/cpu/arm_cortexa8/omap3/sys_info.c
===
--- u-boot-arm.orig/cpu/arm_cortexa8/omap3/sys_info.c
+++ u-boot-arm/cpu/arm_cortexa8/omap3/sys_info.c
@@ -34,28 +34,6 @@
 extern omap3_sysinfo sysinfo;
 static u32 *gpmc_base = (u32 *)GPMC_BASE;
 
-/**
- * get_gpmc0_type()
- ***/
-u32 get_gpmc0_type(void)
-{
-#if defined(CONFIG_ENV_IS_IN_ONENAND)
-   return 1; /* OneNAND */
-#else
-   return 2; /* NAND */
-#endif
-}
-
-/
- * get_cpu_type() - low level get cpu type
- * - no C globals yet.
- /
-u32 get_cpu_type(void)
-{
-   /* fixme, need to get register defines for OMAP3 */
-   return CPU_3430;
-}
-
 /**
  * get_cpu_rev(void) - extract version info
  **/
@@ -81,24 +59,11 @@ u32 get_cpu_rev(void)
  /
 u32 is_mem_sdr(void)
 {
-   volatile u32 *burst = (volatile u32 *) (SDRC_MR_0 + SDRC_CS0_OSET);
-   if (*burst == SDP_SDRC_MR_0_SDR)
+   if (readl(SDRC_MR_0 + SDRC_CS0_OSET) == SDP_SDRC_MR_0_SDR)
return 1;
return 0;
 }
 
-/***
- * get_mem_type() - identify type of mDDR part used.
- ***/
-u32 get_mem_type(void)
-{
-#if defined(CONFIG_OMAP3_BEAGLE) || defined(CONFIG_OVERO)
-   return DDR_STACKED;
-#else
-   return DDR_DISCRETE;
-#endif
-}
-
 /***
  * get_cs0_size() - get size of chip select 0/1
  

Re: [U-Boot] [PATCH] cmd_bdinfo: move implementation to arch instead of common

2008-11-12 Thread Jean-Christophe PLAGNIOL-VILLARD
 >
> > Hi Jean-Christophe,
> >
> > Is this a good idea?  It takes one centralized mess (that is deprecated,
> > but we don't have a good track record of death after deprecation) and
> > spreads it out over a bunch of files.  Reminds me of cancer.  :-(
> >
> > The centralized mess had no duplication of code, but a lot of #ifdef
> > ugly.  This patch trades off the removal of most of the #ifdef ugly for
> > a lot of duplication.  Which is the lesser of two evils?
> >
> > If you continue down the fragmentation path, would it work to keep the
> > primary bdinfo command (cmd_bdinfo.c) and add two weak function calls to
> > it that processor families and boards can hook to add in their extra
> > processor- and board-specific stuff?  This may result in some
> > rearrangement of the print output (which I don't view as a problem, but
> > manual writers might not like it).  It also results in some additional
> > obscurity since a processor/board porter needs to understand that there
> > is an additional hook to grab for customization.
> 
> i think the split version proposed is a lot nicer than the current
> one, but going the route of having an arch hook would be best.  i dont
> think we even need a weak function ... force every arch to implement
> *something*.
It's the case
The idea is to allow soc and board to allow them to print more info

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


Re: [U-Boot] PATCH macb fix phy address

2008-11-12 Thread Giulio Benetti
Il Wednesday 12 November 2008 16:43:46 Jean-Christophe PLAGNIOL-VILLARD ha 
scritto:
> On 16:32 Wed 12 Nov , michael wrote:
> > Hi,
> >
> > Jean-Christophe PLAGNIOL-VILLARD wrote:
> >>> Signed-off-by: Giulio Benetti <[EMAIL PROTECTED]>
> >>
> >> please move to the comment
> >>
> >> Best Regards,
> >> J.
> >> ___
> >> U-Boot mailing list
> >> U-Boot@lists.denx.de
> >> http://lists.denx.de/mailman/listinfo/u-boot
> >
> > Is there another patch on testing for the avr32?
> >
> > Re: [U-Boot] [PATCH 06/10] AVR32: macb - Search for PHY id
>
> I still not like to increase u-boot size I steel.
> I must be an option
>
> Best Regards,
> J.

But it compiles with macb.c that is the same for AT91SAMx and AVR32.

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


Re: [U-Boot] [PATCH] FAT on non standard sector size devices

2008-11-12 Thread Igor Luri
Hi all!

I have done some changes sugested by Remy Bohme and finally the
following patch adds FAT support on devices of ANY sector size.

I have only tested on our custom board with u-boot 1.1.6 version. I
would appreciate if someone could test this patch on latest version.

Thanks.

Signed-off-by: Igor Luri <[EMAIL PROTECTED]>

diff --git a/include/fat.h b/include/fat.h
index 59de3fb..dad2e3d 100644
--- a/include/fat.h
+++ b/include/fat.h
@@ -31,20 +31,12 @@
 
 #define CONFIG_SUPPORT_VFAT
 
-#define SECTOR_SIZE FS_BLOCK_SIZE
-
-#define FS_BLOCK_SIZE 512
-
-#if FS_BLOCK_SIZE != SECTOR_SIZE
-#error FS_BLOCK_SIZE != SECTOR_SIZE - This code needs to be fixed!
-#endif
-
 #define MAX_CLUSTSIZE  65536
-#define DIRENTSPERBLOCK(FS_BLOCK_SIZE/sizeof(dir_entry))
-#define DIRENTSPERCLUST
((mydata->clust_size*SECTOR_SIZE)/sizeof(dir_entry))
+#define DIRENTSPERBLOCK(mydata->sector_size/sizeof(dir_entry))
+#define DIRENTSPERCLUST
((mydata->clust_size*mydata->sector_size)/sizeof(dir_entry))
 
 #define FATBUFBLOCKS   6
-#define FATBUFSIZE (FS_BLOCK_SIZE*FATBUFBLOCKS)
+#define FATBUFSIZE (mydata->sector_size*FATBUFBLOCKS)
 #define FAT12BUFSIZE   ((FATBUFSIZE*2)/3)
 #define FAT16BUFSIZE   (FATBUFSIZE/2)
 #define FAT32BUFSIZE   (FATBUFSIZE/4)
@@ -182,8 +174,9 @@ typedef struct dir_slot {
  * (see FAT32 accesses)
  */
 typedef struct {
-   __u8fatbuf[FATBUFSIZE]; /* Current FAT buffer */
+   __u8*fatbuf; /* Current FAT buffer */
int fatsize;/* Size of FAT in bits */
+   __u16   sector_size;/* Sector size */
__u16   fatlength;  /* Length of FAT in sectors */
__u16   fat_sect;   /* Starting sector of the FAT */
__u16   rootdir_sect;   /* Start sector of root directory */


diff --git a/fs/fat/fat.c b/fs/fat/fat.c
index 2f0bd8c..c24f009 100644
--- a/fs/fat/fat.c
+++ b/fs/fat/fat.c
@@ -30,6 +30,7 @@
 #include 
 #include 
 #include 
+#include 
 
 /*
  * Convert a string to lowercase.
@@ -67,12 +68,17 @@ int disk_read (__u32 startblock, __u32 getsize, __u8
* bufptr)
 int
 fat_register_device(block_dev_desc_t *dev_desc, int part_no)
 {
-   unsigned char buffer[SECTOR_SIZE];
+   unsigned char *buffer;
disk_partition_t info;
 
if (!dev_desc->block_read)
return -1;
-   cur_dev = dev_desc;
+   cur_dev=dev_desc;
+   
+   buffer = malloc (cur_dev->blksz);
+   if(buffer == NULL)
+   return(-1);
+   
/* check if we have a MBR (on floppies we have only a PBR) */
if (dev_desc->block_read (dev_desc->dev, 0, 1, (ulong *) buffer) != 1)
{
printf ("** Can't read from device %d **\n", dev_desc->dev);
@@ -118,6 +124,7 @@ fat_register_device(block_dev_desc_t *dev_desc, int
part_no)
cur_part = 1;
}
 #endif
+   free(buffer);
return 0;
 }
 
@@ -220,12 +227,12 @@ get_fatent(fsdata *mydata, __u32 entry)
 
/* Read a new block of FAT entries into the cache. */
if (bufnum != mydata->fatbufnum) {
-   int getsize = FATBUFSIZE/FS_BLOCK_SIZE;
+   int getsize = FATBUFSIZE/mydata->sector_size;
__u8 *bufptr = mydata->fatbuf;
__u32 fatlength = mydata->fatlength;
__u32 startblock = bufnum * FATBUFBLOCKS;
 
-   fatlength *= SECTOR_SIZE;   /* We want it in bytes now */
+   fatlength *= mydata->sector_size;   /* We want it in bytes 
now */
startblock += mydata->fat_sect; /* Offset from start of disk */
 
if (getsize > fatlength) getsize = fatlength;
@@ -300,20 +307,25 @@ get_cluster(fsdata *mydata, __u32 clustnum, __u8
*buffer, unsigned long size)
}
 
FAT_DPRINT("gc - clustnum: %d, startsect: %d\n", clustnum, startsect);
-   if (disk_read(startsect, size/FS_BLOCK_SIZE , buffer) < 0) {
+   if (disk_read(startsect, size/mydata->sector_size , buffer) < 0) {
FAT_DPRINT("Error reading data\n");
return -1;
}
-   if(size % FS_BLOCK_SIZE) {
-   __u8 tmpbuf[FS_BLOCK_SIZE];
-   idx= size/FS_BLOCK_SIZE;
+   if(size % mydata->sector_size) {
+   __u8 * tmpbuf;
+   
+   tmpbuf = (__u8*) malloc(mydata->sector_size);
+   if(tmpbuf == NULL)
+   return(-1);
+   idx= size/mydata->sector_size;
if (disk_read(startsect + idx, 1, tmpbuf) < 0) {
FAT_DPRINT("Error reading data\n");
return -1;
}
-   buffer += idx*FS_BLOCK_SIZE;
+   buffer += idx*mydata->sector_size;
 
-   memcpy(buffer, tmpbuf, size % FS_BLOCK_SIZE);
+   memcpy(buffer, tmpbuf, size % mydata->sector_size);
+   free(tmpbuf);
return 0;
}
 
@@ -331,7 +343,7 @@ get_contents(fsdata *mydata, dir_entry *dentptr

Re: [U-Boot] [PATCH] cmd_bdinfo: move implementation to arch instead of common

2008-11-12 Thread Mike Frysinger
On Wed, Nov 12, 2008 at 9:02 AM, Jerry Van Baren wrote:
> Jean-Christophe PLAGNIOL-VILLARD wrote:
>> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <[EMAIL PROTECTED]>
>> ---
>> apply after my precedent fix for cmd_bdinfo
>>
>> Best Regards,
>> J.
>>  common/Makefile |1 -
>>  common/cmd_bdinfo.c |  447 
>> ---
>>  include/common.h|   15 ++
>>  lib_arm/Makefile|1 +
>>  lib_arm/bdinfo.c|   69 
>>  lib_avr32/Makefile  |1 +
>>  lib_avr32/bdinfo.c  |   62 +++
>>  lib_blackfin/Makefile   |1 +
>>  lib_blackfin/bdinfo.c   |   68 +++
>>  lib_i386/Makefile   |1 +
>>  lib_i386/bdinfo.c   |   62 +++
>>  lib_m68k/Makefile   |1 +
>>  lib_m68k/bdinfo.c   |  101 +++
>>  lib_microblaze/Makefile |1 +
>>  lib_microblaze/bdinfo.c |   65 +++
>>  lib_mips/Makefile   |1 +
>>  lib_mips/bdinfo.c   |   62 +++
>>  lib_nios/Makefile   |1 +
>>  lib_nios/bdinfo.c   |   61 +++
>>  lib_nios2/Makefile  |1 +
>>  lib_nios2/bdinfo.c  |   71 
>>  lib_ppc/Makefile|1 +
>>  lib_ppc/bdinfo.c|  141 +++
>>  lib_sh/Makefile |1 +
>>  lib_sh/bdinfo.c |   62 +++
>>  lib_sparc/Makefile  |   13 +-
>>  lib_sparc/bdinfo.c  |   78 
>
> Hi Jean-Christophe,
>
> Is this a good idea?  It takes one centralized mess (that is deprecated,
> but we don't have a good track record of death after deprecation) and
> spreads it out over a bunch of files.  Reminds me of cancer.  :-(
>
> The centralized mess had no duplication of code, but a lot of #ifdef
> ugly.  This patch trades off the removal of most of the #ifdef ugly for
> a lot of duplication.  Which is the lesser of two evils?
>
> If you continue down the fragmentation path, would it work to keep the
> primary bdinfo command (cmd_bdinfo.c) and add two weak function calls to
> it that processor families and boards can hook to add in their extra
> processor- and board-specific stuff?  This may result in some
> rearrangement of the print output (which I don't view as a problem, but
> manual writers might not like it).  It also results in some additional
> obscurity since a processor/board porter needs to understand that there
> is an additional hook to grab for customization.

i think the split version proposed is a lot nicer than the current
one, but going the route of having an arch hook would be best.  i dont
think we even need a weak function ... force every arch to implement
*something*.
-mike
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] PATCH macb fix phy address

2008-11-12 Thread michael
Hi,

Jean-Christophe PLAGNIOL-VILLARD wrote:
>
>>
>> Signed-off-by: Giulio Benetti <[EMAIL PROTECTED]>
>>
> please move to the comment
>
> Best Regards,
> J.
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>

Is there another patch on testing for the avr32?

Re: [U-Boot] [PATCH 06/10] AVR32: macb - Search for PHY id

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


Re: [U-Boot] PATCH macb fix phy address

2008-11-12 Thread Jean-Christophe PLAGNIOL-VILLARD
On 16:32 Wed 12 Nov , michael wrote:
> Hi,
>
> Jean-Christophe PLAGNIOL-VILLARD wrote:
>>
>>>
>>> Signed-off-by: Giulio Benetti <[EMAIL PROTECTED]>
>>>
>> please move to the comment
>>
>> Best Regards,
>> J.
>> ___
>> U-Boot mailing list
>> U-Boot@lists.denx.de
>> http://lists.denx.de/mailman/listinfo/u-boot
>>
>
> Is there another patch on testing for the avr32?
>
> Re: [U-Boot] [PATCH 06/10] AVR32: macb - Search for PHY id
I still not like to increase u-boot size I steel.
I must be an option

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


Re: [U-Boot] mini-pci wireless driver

2008-11-12 Thread John W. Linville
On Wed, Nov 12, 2008 at 11:11:29AM +0800, Lance Zhang wrote:
> I am sorry about the format.
> 
> My questions are: How can I support wireless network card on U Boot?
> 
> I want to implement a wlan mini-pci driver, But when I see U Boot
> source tree, there is no codes related to wireless, do you have any
> suggestion on how to add wireless support on U Boot? Or is there any
> U Boot branches that have already implemented wireless extension on
> U boot?

It's going to depend on lot on your hardware.  Some wireless hardware
does all or most of the wireless bits in firmware (e.g. prism2).
Drivers for such hardware look a lot like ethernet drivers.

Other hardware expects a lot of help with the wireless bits from the
host CPU (e.g. ath5k).  For hardware like that, you will need to add
something like the mac80211 stack from Linux.  That will be a tons
of work...

Hth!

John
-- 
John W. LinvilleLinux should be at the core
[EMAIL PROTECTED]   of your literate lifestyle.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] bootlimit for arm? watchdog?

2008-11-12 Thread Frans Meulenbroeks
Hi,

I am looking for a mechanism to reboot into an alternative kernel in case of 
problems. While reading the doc I stumbled upon the bootlimit feature, with 
which I probably can do what I need to.
However: one problem. My system is an ARM system, and the manual says bootlimit 
is only for PPC.
Would this be difficult to add (or maybe does it exist already)?

One other thing that could help me is watchdog.
I saw on the email list that watchdog is supported, but the manual does not 
list it (or I really need new glasses). Is this a board specific feature?
Any further info or pointer to info is greatly appreciated.

Thanks alot!

Frans


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


Re: [U-Boot] PATCH macb fix phy address

2008-11-12 Thread Giulio Benetti
Il Wednesday 12 November 2008 15:42:34 Jean-Christophe PLAGNIOL-VILLARD ha 
scritto:
> On 13:01 Wed 12 Nov , Giulio Benetti wrote:
> > - Fixed finding phyter address
> > - Added searching for other addresses if not found
> >
> > diff -urpN -X macb-exclude u-boot.orig/drivers/net/macb.c
> > u-boot/drivers/net/macb.c
> > --- u-boot.orig/drivers/net/macb.c  2008-08-12 16:08:38.0 +0200
> > +++ u-boot/drivers/net/macb.c   2008-11-12 12:51:16.0 +0100
> > @@ -1,5 +1,7 @@
> >  /*
> >   * Copyright (C) 2005-2006 Atmel Corporation
> > + * Giulio Benetti <[EMAIL PROTECTED]>
> > + * Micronova srl <[EMAIL PROTECTED]>
>
> please remove, you do not do enough modification to add your copyright

Ok

>
> >   *
> >   * 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
> > @@ -84,6 +86,8 @@ struct macb_dma_desc {
> >  #define TXBUF_WRAP 0x4000
> >  #define TXBUF_USED 0x8000
> >
> > +#define MAX_PHY_ADDRESS_NUMBER 32
> > +
> >  struct macb_device {
> > void*regs;
> >
> > @@ -325,8 +329,18 @@ static int macb_phy_init(struct macb_dev
> > int i;
> >
> > /* Check if the PHY is up to snuff... */
> > -   phy_id = macb_mdio_read(macb, MII_PHYSID1);
> > -   if (phy_id == 0x) {
> > +   printf("%s: Finding PHYs\n", netdev->name);
> > +
> > +   for(i = 0; i < MAX_PHY_ADDRESS_NUMBER; i++) {
> > +   lpa = macb_mdio_read(macb, MII_LPA);
> > +   phy_id = macb_mdio_read(macb, MII_PHYSID1);
> > +   if ((phy_id != 0x) && (lpa != 0x)) {
> > +   break;
> > +   }
> > +   macb->phy_addr++;
> > +   }
> > +
> > +   if(i >= MAX_PHY_ADDRESS_NUMBER) {
>
> please make this as an option

Ok, but I think that there's a bug (phy_id != 0x) should be (phy_id != 
0x), i've just controlled.

>
> > printf("%s: No PHY present\n", netdev->name);
> > return 0;
> > }
> >
> > Signed-off-by: Giulio Benetti <[EMAIL PROTECTED]>
>
> please move to the comment

Ok

>
> Best Regards,
> J.

As soon as possible I send you new patch

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


Re: [U-Boot] [PATCH] cmd_bdinfo: move implementation to arch instead of common

2008-11-12 Thread Jean-Christophe PLAGNIOL-VILLARD
Hi Jerry,

On 09:02 Wed 12 Nov , Jerry Van Baren wrote:
> Jean-Christophe PLAGNIOL-VILLARD wrote:
>> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <[EMAIL PROTECTED]>
>> ---
>> apply after my precedent fix for cmd_bdinfo
>>
>> Best Regards,
>> J.
>>  common/Makefile |1 -
>>  common/cmd_bdinfo.c |  447 
>> ---
>>  include/common.h|   15 ++
>>  lib_arm/Makefile|1 +
>>  lib_arm/bdinfo.c|   69 
>>  lib_avr32/Makefile  |1 +
>>  lib_avr32/bdinfo.c  |   62 +++
>>  lib_blackfin/Makefile   |1 +
>>  lib_blackfin/bdinfo.c   |   68 +++
>>  lib_i386/Makefile   |1 +
>>  lib_i386/bdinfo.c   |   62 +++
>>  lib_m68k/Makefile   |1 +
>>  lib_m68k/bdinfo.c   |  101 +++
>>  lib_microblaze/Makefile |1 +
>>  lib_microblaze/bdinfo.c |   65 +++
>>  lib_mips/Makefile   |1 +
>>  lib_mips/bdinfo.c   |   62 +++
>>  lib_nios/Makefile   |1 +
>>  lib_nios/bdinfo.c   |   61 +++
>>  lib_nios2/Makefile  |1 +
>>  lib_nios2/bdinfo.c  |   71 
>>  lib_ppc/Makefile|1 +
>>  lib_ppc/bdinfo.c|  141 +++
>>  lib_sh/Makefile |1 +
>>  lib_sh/bdinfo.c |   62 +++
>>  lib_sparc/Makefile  |   13 +-
>>  lib_sparc/bdinfo.c  |   78 
>
> Hi Jean-Christophe,
>
> Is this a good idea?  It takes one centralized mess (that is deprecated,  
> but we don't have a good track record of death after deprecation) and  
> spreads it out over a bunch of files.  Reminds me of cancer.  :-(

As you said it's a mess of ifdef this files and it's hard to understand and
to be sure which part we modify.
By splitting it, it will simplify arch implementation and maintaining.
BTW the header are already split for each in 'include/asm-arch/global_data.h'

>
> The centralized mess had no duplication of code, but a lot of #ifdef  
> ugly. 
in the c implmentation maybe but we already have in the header
>This patch trades off the removal of most of the #ifdef ugly for  
> a lot of duplication.  Which is the lesser of two evils?
Only 4 archs share actually the same code avr32, i386, mips and sh
which actually I've plan to modify for sh soon

>
> If you continue down the fragmentation path, would it work to keep the  
> primary bdinfo command (cmd_bdinfo.c) and add two weak function calls to  
> it that processor families and boards can hook to add in their extra  
> processor- and board-specific stuff? 
why not in this case we will avoid a lots of ifdef
> This may result in some  
> rearrangement of the print output (which I don't view as a problem, but  
> manual writers might not like it). 
I prefer to have customizable code and update a manual than have hard 
maintaining code.
> It also results in some additional  
> obscurity since a processor/board porter needs to understand that there  
> is an additional hook to grab for customization.
We may need to write a guideline

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


Re: [U-Boot] PATCH macb fix phy address

2008-11-12 Thread Jean-Christophe PLAGNIOL-VILLARD
On 13:01 Wed 12 Nov , Giulio Benetti wrote:
> - Fixed finding phyter address
> - Added searching for other addresses if not found
> 
> diff -urpN -X macb-exclude u-boot.orig/drivers/net/macb.c 
> u-boot/drivers/net/macb.c
> --- u-boot.orig/drivers/net/macb.c2008-08-12 16:08:38.0 +0200
> +++ u-boot/drivers/net/macb.c 2008-11-12 12:51:16.0 +0100
> @@ -1,5 +1,7 @@
>  /*
>   * Copyright (C) 2005-2006 Atmel Corporation
> + * Giulio Benetti <[EMAIL PROTECTED]>
> + * Micronova srl <[EMAIL PROTECTED]>
please remove, you do not do enough modification to add your copyright
>   *
>   * 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
> @@ -84,6 +86,8 @@ struct macb_dma_desc {
>  #define TXBUF_WRAP   0x4000
>  #define TXBUF_USED   0x8000
>  
> +#define MAX_PHY_ADDRESS_NUMBER   32
> +
>  struct macb_device {
>   void*regs;
>  
> @@ -325,8 +329,18 @@ static int macb_phy_init(struct macb_dev
>   int i;
>  
>   /* Check if the PHY is up to snuff... */
> - phy_id = macb_mdio_read(macb, MII_PHYSID1);
> - if (phy_id == 0x) {
> + printf("%s: Finding PHYs\n", netdev->name);
> +
> + for(i = 0; i < MAX_PHY_ADDRESS_NUMBER; i++) {
> + lpa = macb_mdio_read(macb, MII_LPA);
> + phy_id = macb_mdio_read(macb, MII_PHYSID1);
> + if ((phy_id != 0x) && (lpa != 0x)) {
> + break;
> + }
> + macb->phy_addr++;
> + }
> +
> + if(i >= MAX_PHY_ADDRESS_NUMBER) {

please make this as an option
>   printf("%s: No PHY present\n", netdev->name);
>   return 0;
>   }
> 
> Signed-off-by: Giulio Benetti <[EMAIL PROTECTED]>
> 
please move to the comment

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


Re: [U-Boot] [PATCH] cmd_bdinfo: move implementation to arch instead of common

2008-11-12 Thread Jerry Van Baren
Jean-Christophe PLAGNIOL-VILLARD wrote:
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <[EMAIL PROTECTED]>
> ---
> apply after my precedent fix for cmd_bdinfo
> 
> Best Regards,
> J.
>  common/Makefile |1 -
>  common/cmd_bdinfo.c |  447 
> ---
>  include/common.h|   15 ++
>  lib_arm/Makefile|1 +
>  lib_arm/bdinfo.c|   69 
>  lib_avr32/Makefile  |1 +
>  lib_avr32/bdinfo.c  |   62 +++
>  lib_blackfin/Makefile   |1 +
>  lib_blackfin/bdinfo.c   |   68 +++
>  lib_i386/Makefile   |1 +
>  lib_i386/bdinfo.c   |   62 +++
>  lib_m68k/Makefile   |1 +
>  lib_m68k/bdinfo.c   |  101 +++
>  lib_microblaze/Makefile |1 +
>  lib_microblaze/bdinfo.c |   65 +++
>  lib_mips/Makefile   |1 +
>  lib_mips/bdinfo.c   |   62 +++
>  lib_nios/Makefile   |1 +
>  lib_nios/bdinfo.c   |   61 +++
>  lib_nios2/Makefile  |1 +
>  lib_nios2/bdinfo.c  |   71 
>  lib_ppc/Makefile|1 +
>  lib_ppc/bdinfo.c|  141 +++
>  lib_sh/Makefile |1 +
>  lib_sh/bdinfo.c |   62 +++
>  lib_sparc/Makefile  |   13 +-
>  lib_sparc/bdinfo.c  |   78 

Hi Jean-Christophe,

Is this a good idea?  It takes one centralized mess (that is deprecated, 
but we don't have a good track record of death after deprecation) and 
spreads it out over a bunch of files.  Reminds me of cancer.  :-(

The centralized mess had no duplication of code, but a lot of #ifdef 
ugly.  This patch trades off the removal of most of the #ifdef ugly for 
a lot of duplication.  Which is the lesser of two evils?

If you continue down the fragmentation path, would it work to keep the 
primary bdinfo command (cmd_bdinfo.c) and add two weak function calls to 
it that processor families and boards can hook to add in their extra 
processor- and board-specific stuff?  This may result in some 
rearrangement of the print output (which I don't view as a problem, but 
manual writers might not like it).  It also results in some additional 
obscurity since a processor/board porter needs to understand that there 
is an additional hook to grab for customization.

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


Re: [U-Boot] [PATCH] FAT on non standard sector size devices

2008-11-12 Thread Igor Luri
> Please only sent patches inline, see http://lwn.net/Articles/139918/

Sorry.

> Why hardcode this size to 8192, cant it be malloced somehow?
> Is there a check that detects if the size is getting bigger than 8192
> to prevent segfaults?
> 
In read_bootsectandvi function already isn't known device sector size, so I 
define quite large sector size of 8 Kbyte. 

It can be malloced if I get the sector size of the device from 
block_dev_desc_t. I am going to double check it, and if 
it works, I'll send the definitive patch.

> Some weird characters here... Is this change what you want?

Sorry, I don't know how I have changed thouse caracters, I will correct this 
too.



Thanks.



-- 
Igor Luri
R&D Software Department
Fagor Aotek S. Coop.
P. O. Box 144
E-20500 Mondragón-Arrasate
Tel.++34 943 71 92 00 
++34 943 71 92 01 (Ext. 44268)
Fax.++34 943 79 92 03
www.aotek.es
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] PATCH macb fix phy address

2008-11-12 Thread michael
Hi,

In the past I think the same thing but:

Giulio Benetti wrote:
> - Fixed finding phyter address
> - Added searching for other addresses if not found
>
> diff -urpN -X macb-exclude u-boot.orig/drivers/net/macb.c 
> u-boot/drivers/net/macb.c
> --- u-boot.orig/drivers/net/macb.c2008-08-12 16:08:38.0 +0200
> +++ u-boot/drivers/net/macb.c 2008-11-12 12:51:16.0 +0100
> @@ -1,5 +1,7 @@
>  /*
>   * Copyright (C) 2005-2006 Atmel Corporation
> + * Giulio Benetti <[EMAIL PROTECTED]>
> + * Micronova srl <[EMAIL PROTECTED]>
>   *
>   * 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
> @@ -84,6 +86,8 @@ struct macb_dma_desc {
>  #define TXBUF_WRAP   0x4000
>  #define TXBUF_USED   0x8000
>  
> +#define MAX_PHY_ADDRESS_NUMBER   32
> +
>  struct macb_device {
>   void*regs;
>  
> @@ -325,8 +329,18 @@ static int macb_phy_init(struct macb_dev
>   int i;
>  
>   /* Check if the PHY is up to snuff... */
> - phy_id = macb_mdio_read(macb, MII_PHYSID1);
> - if (phy_id == 0x) {
> + printf("%s: Finding PHYs\n", netdev->name);
> +
> + for(i = 0; i < MAX_PHY_ADDRESS_NUMBER; i++) {
> + lpa = macb_mdio_read(macb, MII_LPA);
> + phy_id = macb_mdio_read(macb, MII_PHYSID1);
> + if ((phy_id != 0x) && (lpa != 0x)) {
> + break;
> + }
> + macb->phy_addr++;
> + }
> +
> + if(i >= MAX_PHY_ADDRESS_NUMBER) {
>   printf("%s: No PHY present\n", netdev->name);
>   return 0;
>   }
>
> Signed-off-by: Giulio Benetti <[EMAIL PROTECTED]>
>   
mii info

report that information. ex (take in a past mail)
PHY 0x10: OUI = 0x5043, Model = 0x08, Rev = 0x07,  10baseT, HDX
PHY 0x11: OUI = 0x5043, Model = 0x08, Rev = 0x07,  10baseT, HDX
PHY 0x12: OUI = 0x5043, Model = 0x08, Rev = 0x07,  10baseT, HDX
PHY 0x13: OUI = 0x5043, Model = 0x08, Rev = 0x07, 100baseT, FDX
PHY 0x14: OUI = 0x5043, Model = 0x08, Rev = 0x07,  10baseT, HDX
PHY 0x15: OUI = 0x, Model = 0x00, Rev = 0x00,  10baseT, HDX
PHY 0x16: OUI = 0x, Model = 0x00, Rev = 0x00,  10baseT, HDX

what code autodetect code pick? And if you have ghost PHYs in the list?

Regards Michael


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


[U-Boot] [PATCH v3] OneNAND: Bad block aware read/write command support

2008-11-12 Thread Stefan Roese
Update OneNAND command to support bad block awareness.
Also change the OneNAND command style to better match the
NAND version.

Signed-off-by: Stefan Roese <[EMAIL PROTECTED]>
Acked-by: Kyungmin Park <[EMAIL PROTECTED]>
---
Scott, I looked at merging this code with the NAND command code, but the
differences are too big for my taste.

v3:
- Removed mtd assignment which doesn't work on platforms with
  problem upon relocation (PPC, MIPS)

v2:
- Removed the bad block marking when an erase/read/write access to a block
  fails
- More cleanup's

 common/cmd_onenand.c |  530 +++---
 1 files changed, 420 insertions(+), 110 deletions(-)

diff --git a/common/cmd_onenand.c b/common/cmd_onenand.c
index 8d87b78..6a2c924 100644
--- a/common/cmd_onenand.c
+++ b/common/cmd_onenand.c
@@ -1,7 +1,7 @@
 /*
  *  U-Boot command for OneNAND support
  *
- *  Copyright (C) 2005-2007 Samsung Electronics
+ *  Copyright (C) 2005-2008 Samsung Electronics
  *  Kyungmin Park <[EMAIL PROTECTED]>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -11,6 +11,7 @@
 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -18,159 +19,468 @@
 
 #include 
 
-extern struct mtd_info onenand_mtd;
-extern struct onenand_chip onenand_chip;
+static struct mtd_info *mtd;
+
+static loff_t next_ofs;
+static loff_t skip_ofs;
+
+static inline int str2long(char *p, ulong *num)
+{
+   char *endptr;
+
+   *num = simple_strtoul(p, &endptr, 16);
+   return (*p != '\0' && *endptr == '\0') ? 1 : 0;
+}
+
+static int arg_off_size(int argc, char *argv[], ulong *off, size_t *size)
+{
+   if (argc >= 1) {
+   if (!(str2long(argv[0], off))) {
+   printf("'%s' is not a number\n", argv[0]);
+   return -1;
+   }
+   } else {
+   *off = 0;
+   }
+
+   if (argc >= 2) {
+   if (!(str2long(argv[1], (ulong *)size))) {
+   printf("'%s' is not a number\n", argv[1]);
+   return -1;
+   }
+   } else {
+   *size = mtd->size - *off;
+   }
+
+   if ((*off + *size) > mtd->size) {
+   printf("total chip size (0x%x) exceeded!\n", mtd->size);
+   return -1;
+   }
+
+   if (*size == mtd->size)
+   puts("whole chip\n");
+   else
+   printf("offset 0x%lx, size 0x%x\n", *off, *size);
+
+   return 0;
+}
+
+static int onenand_block_read(loff_t from, size_t len,
+ size_t *retlen, u_char *buf, int oob)
+{
+   struct onenand_chip *this = mtd->priv;
+   int blocks = (int) len >> this->erase_shift;
+   int blocksize = (1 << this->erase_shift);
+   loff_t ofs = from;
+   struct mtd_oob_ops ops = {
+   .retlen = 0,
+   };
+   int ret;
+
+   if (oob)
+   ops.ooblen = blocksize;
+   else
+   ops.len = blocksize;
+
+   while (blocks) {
+   ret = mtd->block_isbad(mtd, ofs);
+   if (ret) {
+   printk("Bad blocks %d at 0x%x\n",
+  (u32)(ofs >> this->erase_shift), (u32)ofs);
+   ofs += blocksize;
+   continue;
+   }
+
+   if (oob)
+   ops.oobbuf = buf;
+   else
+   ops.datbuf = buf;
+
+   ops.retlen = 0;
+   ret = mtd->read_oob(mtd, ofs, &ops);
+   if (ret) {
+   printk("Read failed 0x%x, %d\n", (u32)ofs, ret);
+   ofs += blocksize;
+   continue;
+   }
+   ofs += blocksize;
+   buf += blocksize;
+   blocks--;
+   *retlen += ops.retlen;
+   }
+
+   return 0;
+}
+
+static int onenand_block_write(loff_t to, size_t len,
+  size_t *retlen, const u_char * buf)
+{
+   struct onenand_chip *this = mtd->priv;
+   int blocks = len >> this->erase_shift;
+   int blocksize = (1 << this->erase_shift);
+   loff_t ofs;
+   size_t _retlen = 0;
+   int ret;
+
+   if (to == next_ofs) {
+   next_ofs = to + len;
+   to += skip_ofs;
+   } else {
+   next_ofs = to + len;
+   skip_ofs = 0;
+   }
+   ofs = to;
+
+   while (blocks) {
+   ret = mtd->block_isbad(mtd, ofs);
+   if (ret) {
+   printk("Bad blocks %d at 0x%x\n",
+  (u32)(ofs >> this->erase_shift), (u32)ofs);
+   skip_ofs += blocksize;
+   goto next;
+   }
+
+   ret = mtd->write(mtd, ofs, blocksize, &_retlen, buf);
+   if (ret) {
+   printk("Write failed 0x%x, %d", (u32)ofs, ret);
+   skip

[U-Boot] [PATCH] Add support for boards where the NOR FLASH is not memory-mapped

2008-11-12 Thread Stefan Roese
This patch adds the CONFIG_FLASH_NOT_MEM_MAPPED define which can be
used on boards where the NOR FLASH is not memory-mapped and
special accessor functions are needed to access the NOR FLASH.
This affects the memory commands (cmd_mem.c) and the environment
(env_flash.c).

Boards using CONFIG_FLASH_NOT_MEM_MAPPED need to additionally specify
CONFIG_FLASH_BASE and CONFIG_FLASH_END so that the NOR FLASH region
can be detected.

This will be used by the upcoming VCTH board support.

Signed-off-by: Stefan Roese <[EMAIL PROTECTED]>
---
 common/cmd_mem.c|   66 +++---
 common/env_flash.c  |   61 +--
 lib_generic/crc32.c |   11 
 3 files changed, 110 insertions(+), 28 deletions(-)

diff --git a/common/cmd_mem.c b/common/cmd_mem.c
index d7666c2..f545f6a 100644
--- a/common/cmd_mem.c
+++ b/common/cmd_mem.c
@@ -43,6 +43,43 @@
 #define PRINTF(fmt,args...)
 #endif
 
+#if defined(CONFIG_HAS_DATAFLASH)
+#define CONFIG_FLASH_NOT_MEM_MAPPED
+#define OK DATAFLASH_OK
+#endif
+
+#if !defined(OK)
+#define OK 1
+#endif
+
+void *board_flash_read_memcpy(void *__to, __const__ void *__from, int n);
+
+#if defined(CONFIG_FLASH_NOT_MEM_MAPPED)
+static inline int flash_read(void *__to, __const__ void *__from, int n)
+{
+#if defined(CONFIG_HAS_DATAFLASH)
+   return read_dataflash(__from, n, __to);
+#elif defined(CONFIG_FLASH_NOT_MEM_MAPPED)
+   if ((addr2info((u32)__from) != NULL))
+   board_flash_read_memcpy(__to, __from, n);
+   else
+   memcpy(__to, __from, n);
+   return OK;
+#endif
+}
+#endif /* defined(CONFIG_FLASH_NOT_MEM_MAPPED) */
+
+static inline int is_flash_addr(u32 addr)
+{
+#if defined(CONFIG_HAS_DATAFLASH)
+   return addr_dataflash(addr);
+#elif defined(CONFIG_FLASH_NOT_MEM_MAPPED)
+   return (addr2info(addr) != NULL);
+#else
+   return 1;
+#endif
+}
+
 static int mod_mem(cmd_tbl_t *, int, int, int, char *[]);
 
 /* Display values from last command.
@@ -63,7 +100,7 @@ static   ulong   base_address = 0;
 int do_mem_md ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
ulong   addr, length;
-#if defined(CONFIG_HAS_DATAFLASH)
+#if defined(CONFIG_FLASH_NOT_MEM_MAPPED)
ulong   nbytes, linebytes;
 #endif
int size;
@@ -100,7 +137,7 @@ int do_mem_md ( cmd_tbl_t *cmdtp, int flag, int argc, char 
*argv[])
length = simple_strtoul(argv[2], NULL, 16);
}
 
-#if defined(CONFIG_HAS_DATAFLASH)
+#if defined(CONFIG_FLASH_NOT_MEM_MAPPED)
/* Print the lines.
 *
 * We buffer all read data, so we can make sure data is read only
@@ -112,10 +149,13 @@ int do_mem_md ( cmd_tbl_t *cmdtp, int flag, int argc, 
char *argv[])
void* p;
linebytes = (nbytes>DISP_LINE_LEN)?DISP_LINE_LEN:nbytes;
 
-   rc = read_dataflash(addr, (linebytes/size)*size, linebuf);
-   p = (rc == DATAFLASH_OK) ? linebuf : (void*)addr;
+   rc = flash_read(linebuf, (void *)addr, (linebytes/size)*size);
+   p = (rc == OK) ? linebuf : (void *)addr;
print_buffer(addr, p, size, linebytes/size, DISP_LINE_LEN/size);
 
+   /* Clear rc, otherwise command repeat doesn't work */
+   rc = 0;
+
nbytes -= linebytes;
addr += linebytes;
if (ctrlc()) {
@@ -294,9 +334,9 @@ int do_mem_cmp (cmd_tbl_t *cmdtp, int flag, int argc, char 
*argv[])
 
count = simple_strtoul(argv[3], NULL, 16);
 
-#ifdef CONFIG_HAS_DATAFLASH
-   if (addr_dataflash(addr1) | addr_dataflash(addr2)){
-   puts ("Comparison with DataFlash space not supported.\n\r");
+#ifdef CONFIG_FLASH_NOT_MEM_MAPPED
+   if (is_flash_addr(addr1) || is_flash_addr(addr2)) {
+   puts ("Comparison with FLASH space not supported.\n\r");
return 0;
}
 #endif
@@ -385,11 +425,7 @@ int do_mem_cp ( cmd_tbl_t *cmdtp, int flag, int argc, char 
*argv[])
 
 #ifndef CONFIG_SYS_NO_FLASH
/* check if we are copying to Flash */
-   if ( (addr2info(dest) != NULL)
-#ifdef CONFIG_HAS_DATAFLASH
-  && (!addr_dataflash(dest))
-#endif
-  ) {
+   if (is_flash_addr(dest)) {
int rc;
 
puts ("Copy to Flash... ");
@@ -1010,9 +1046,9 @@ mod_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int 
argc, char *argv[])
addr += base_address;
}
 
-#ifdef CONFIG_HAS_DATAFLASH
-   if (addr_dataflash(addr)){
-   puts ("Can't modify DataFlash in place. Use cp instead.\n\r");
+#ifdef CONFIG_FLASH_NOT_MEM_MAPPED
+   if (is_flash_addr(addr)) {
+   puts ("Can't modify FLASH in place. Use cp instead.\n\r");
return 0;
}
 #endif
diff --git a/common/env_flash.c b/common/env_flash.c
index 75ee8dd..9c53ec0 100644
--- a/common/env_flash.c
+++ b/common/env_flash.c
@@ -85,9 

[U-Boot] [PATCH] cfi_flash: Make all flash access functions weak

2008-11-12 Thread Stefan Roese
This patch defines all flash access functions as weak so that
they can be overridden by board specific versions.

This will be used by the upcoming VCTH board support where the NOR
FLASH unfortunately can't be accessed memory-mapped. Special
accessor functions are needed here.

Signed-off-by: Stefan Roese <[EMAIL PROTECTED]>
---
 drivers/mtd/cfi_flash.c |   21 ++---
 1 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c
index 24e9b9f..4d82a51 100644
--- a/drivers/mtd/cfi_flash.c
+++ b/drivers/mtd/cfi_flash.c
@@ -209,38 +209,38 @@ struct cfi_pri_hdr {
u8  minor_version;
 } __attribute__((packed));
 
-static void flash_write8(u8 value, void *addr)
+static void __flash_write8(u8 value, void *addr)
 {
__raw_writeb(value, addr);
 }
 
-static void flash_write16(u16 value, void *addr)
+static void __flash_write16(u16 value, void *addr)
 {
__raw_writew(value, addr);
 }
 
-static void flash_write32(u32 value, void *addr)
+static void __flash_write32(u32 value, void *addr)
 {
__raw_writel(value, addr);
 }
 
-static void flash_write64(u64 value, void *addr)
+static void __flash_write64(u64 value, void *addr)
 {
/* No architectures currently implement __raw_writeq() */
*(volatile u64 *)addr = value;
 }
 
-static u8 flash_read8(void *addr)
+static u8 __flash_read8(void *addr)
 {
return __raw_readb(addr);
 }
 
-static u16 flash_read16(void *addr)
+static u16 __flash_read16(void *addr)
 {
return __raw_readw(addr);
 }
 
-static u32 flash_read32(void *addr)
+static u32 __flash_read32(void *addr)
 {
return __raw_readl(addr);
 }
@@ -251,6 +251,13 @@ static u64 __flash_read64(void *addr)
return *(volatile u64 *)addr;
 }
 
+void flash_write8(u8 value, void *addr)__attribute__((weak, 
alias("__flash_write8")));
+void flash_write16(u16 value, void *addr)__attribute__((weak, 
alias("__flash_write16")));
+void flash_write32(u32 value, void *addr)__attribute__((weak, 
alias("__flash_write32")));
+void flash_write64(u64 value, void *addr)__attribute__((weak, 
alias("__flash_write64")));
+u8 flash_read8(void *addr)__attribute__((weak, alias("__flash_read8")));
+u16 flash_read16(void *addr)__attribute__((weak, alias("__flash_read16")));
+u32 flash_read32(void *addr)__attribute__((weak, alias("__flash_read32")));
 u64 flash_read64(void *addr)__attribute__((weak, alias("__flash_read64")));
 
 /*---
-- 
1.6.0.4

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


[U-Boot] [PATCH] net: smc911x: Make register read/write functions weak

2008-11-12 Thread Stefan Roese
This patch changes the reg_read/_write to smc911x_reg_read/_write
and defines then as weak so that they can be overridden by board
specific version.

This will be used by the upcoming VCTH board support.

Signed-off-by: Stefan Roese <[EMAIL PROTECTED]>
---
 drivers/net/smc911x.c |   77 +---
 1 files changed, 40 insertions(+), 37 deletions(-)

diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c
index 648c94c..6c5a4b3 100644
--- a/drivers/net/smc911x.c
+++ b/drivers/net/smc911x.c
@@ -34,21 +34,24 @@
 #endif
 
 #if defined (CONFIG_DRIVER_SMC911X_32_BIT)
-static inline u32 reg_read(u32 addr)
+static inline u32 __smc911x_reg_read(u32 addr)
 {
return *(volatile u32*)addr;
 }
-static inline void reg_write(u32 addr, u32 val)
+u32 smc911x_reg_read(u32 addr) __attribute__((weak, 
alias("__smc911x_reg_read")));
+
+static inline void __smc911x_reg_write(u32 addr, u32 val)
 {
*(volatile u32*)addr = val;
 }
+void smc911x_reg_write(u32 addr, u32 val) __attribute__((weak, 
alias("__smc911x_reg_write")));
 #elif defined (CONFIG_DRIVER_SMC911X_16_BIT)
-static inline u32 reg_read(u32 addr)
+static inline u32 smc911x_reg_read(u32 addr)
 {
volatile u16 *addr_16 = (u16 *)addr;
return ((*addr_16 & 0x) | (*(addr_16 + 1) << 16));
 }
-static inline void reg_write(u32 addr, u32 val)
+static inline void smc911x_reg_write(u32 addr, u32 val)
 {
*(volatile u16*)addr = (u16)val;
*(volatile u16*)(addr + 2) = (u16)(val >> 16);
@@ -58,9 +61,9 @@ static inline void reg_write(u32 addr, u32 val)
 #endif /* CONFIG_DRIVER_SMC911X_16_BIT */
 
 u32 pkt_data_pull(u32 addr) \
-   __attribute__ ((weak, alias ("reg_read")));
+   __attribute__ ((weak, alias ("smc911x_reg_read")));
 void pkt_data_push(u32 addr, u32 val) \
-   __attribute__ ((weak, alias ("reg_write")));
+   __attribute__ ((weak, alias ("smc911x_reg_write")));
 
 #define mdelay(n)   udelay((n)*1000)
 
@@ -407,22 +410,22 @@ static const struct chip_id chip_ids[] =  {
 
 u32 smc911x_get_mac_csr(u8 reg)
 {
-   while (reg_read(MAC_CSR_CMD) & MAC_CSR_CMD_CSR_BUSY)
+   while (smc911x_reg_read(MAC_CSR_CMD) & MAC_CSR_CMD_CSR_BUSY)
;
-   reg_write(MAC_CSR_CMD, MAC_CSR_CMD_CSR_BUSY | MAC_CSR_CMD_R_NOT_W | 
reg);
-   while (reg_read(MAC_CSR_CMD) & MAC_CSR_CMD_CSR_BUSY)
+   smc911x_reg_write(MAC_CSR_CMD, MAC_CSR_CMD_CSR_BUSY | 
MAC_CSR_CMD_R_NOT_W | reg);
+   while (smc911x_reg_read(MAC_CSR_CMD) & MAC_CSR_CMD_CSR_BUSY)
;
 
-   return reg_read(MAC_CSR_DATA);
+   return smc911x_reg_read(MAC_CSR_DATA);
 }
 
 void smc911x_set_mac_csr(u8 reg, u32 data)
 {
-   while (reg_read(MAC_CSR_CMD) & MAC_CSR_CMD_CSR_BUSY)
+   while (smc911x_reg_read(MAC_CSR_CMD) & MAC_CSR_CMD_CSR_BUSY)
;
-   reg_write(MAC_CSR_DATA, data);
-   reg_write(MAC_CSR_CMD, MAC_CSR_CMD_CSR_BUSY | reg);
-   while (reg_read(MAC_CSR_CMD) & MAC_CSR_CMD_CSR_BUSY)
+   smc911x_reg_write(MAC_CSR_DATA, data);
+   smc911x_reg_write(MAC_CSR_CMD, MAC_CSR_CMD_CSR_BUSY | reg);
+   while (smc911x_reg_read(MAC_CSR_CMD) & MAC_CSR_CMD_CSR_BUSY)
;
 }
 
@@ -496,10 +499,10 @@ static int smc911x_phy_reset(void)
 {
u32 reg;
 
-   reg = reg_read(PMT_CTRL);
+   reg = smc911x_reg_read(PMT_CTRL);
reg &= ~0xf030;
reg |= PMT_CTRL_PHY_RST;
-   reg_write(PMT_CTRL, reg);
+   smc911x_reg_write(PMT_CTRL, reg);
 
mdelay(100);
 
@@ -541,13 +544,13 @@ static void smc911x_reset(void)
int timeout;
 
/* Take out of PM setting first */
-   if (reg_read(PMT_CTRL) & PMT_CTRL_READY) {
+   if (smc911x_reg_read(PMT_CTRL) & PMT_CTRL_READY) {
/* Write to the bytetest will take out of powerdown */
-   reg_write(BYTE_TEST, 0x0);
+   smc911x_reg_write(BYTE_TEST, 0x0);
 
timeout = 10;
 
-   while (timeout-- && !(reg_read(PMT_CTRL) & PMT_CTRL_READY))
+   while (timeout-- && !(smc911x_reg_read(PMT_CTRL) & 
PMT_CTRL_READY))
udelay(10);
if (!timeout) {
printf(DRIVERNAME
@@ -557,12 +560,12 @@ static void smc911x_reset(void)
}
 
/* Disable interrupts */
-   reg_write(INT_EN, 0);
+   smc911x_reg_write(INT_EN, 0);
 
-   reg_write(HW_CFG, HW_CFG_SRST);
+   smc911x_reg_write(HW_CFG, HW_CFG_SRST);
 
timeout = 1000;
-   while (timeout-- && reg_read(E2P_CMD) & E2P_CMD_EPC_BUSY)
+   while (timeout-- && smc911x_reg_read(E2P_CMD) & E2P_CMD_EPC_BUSY)
udelay(10);
 
if (!timeout) {
@@ -572,23 +575,23 @@ static void smc911x_reset(void)
 
/* Reset the FIFO level and flow control settings */
smc911x_set_mac_csr(FLOW, FLOW_FCPT | FLOW_FCEN);
-   reg_write(AFC_CFG, 0x0050287F);
+   smc911x_reg_write(AFC_CFG, 0x0050287F);
 
/* Set to LED outputs */

[U-Boot] [PATCH] serial: Add vcth UART driver

2008-11-12 Thread Stefan Roese
This patch adds the UART driver for the upcoming VCTH board support.

Signed-off-by: Stefan Roese <[EMAIL PROTECTED]>
---
 drivers/serial/Makefile |1 +
 drivers/serial/vcth.c   |  121 +++
 2 files changed, 122 insertions(+), 0 deletions(-)
 create mode 100755 drivers/serial/vcth.c

diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
index eafe543..17235ff 100644
--- a/drivers/serial/Makefile
+++ b/drivers/serial/Makefile
@@ -38,6 +38,7 @@ COBJS-$(CONFIG_PL011_SERIAL) += serial_pl01x.o
 COBJS-$(CONFIG_XILINX_UARTLITE) += serial_xuartlite.o
 COBJS-$(CONFIG_SCIF_CONSOLE) += serial_sh.o
 COBJS-$(CONFIG_USB_TTY) += usbtty.o
+COBJS-$(CONFIG_VCTH_SERIAL) += vcth.o
 
 COBJS  := $(sort $(COBJS-y))
 SRCS   := $(COBJS:.o=.c)
diff --git a/drivers/serial/vcth.c b/drivers/serial/vcth.c
new file mode 100755
index 000..2c847d0
--- /dev/null
+++ b/drivers/serial/vcth.c
@@ -0,0 +1,121 @@
+/*
+ * (C) Copyright 2008 Stefan Roese <[EMAIL PROTECTED]>, DENX Software 
Engineering
+ *
+ * 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 
+#include 
+#include 
+
+#define UART_1_BASE0xBF89C000
+
+#defineUART_RBR_OFF0x00/* receiver buffer reg  
*/
+#defineUART_THR_OFF0x00/* transmit holding  reg
*/
+#defineUART_DLL_OFF0x00/* divisor latch low reg
*/
+#defineUART_IER_OFF0x04/* interrupt enable reg 
*/
+#defineUART_DLH_OFF0x04/* receiver buffer reg  
*/
+#defineUART_FCR_OFF0x08/* fifo control register
*/
+#defineUART_LCR_OFF0x0c/* line control register
*/
+#defineUART_MCR_OFF0x10/* modem control register   
*/
+#defineUART_LSR_OFF0x14/* line status register 
*/
+#defineUART_MSR_OFF0x18/* modem status register
*/
+#defineUART_SCR_OFF0x1c/* scratch pad register 
*/
+
+#define UART_RCV_DATA_RDY  0x01/* Data Received*/
+#define UART_XMT_HOLD_EMPTY0x20
+#define UART_TRANSMIT_EMPTY0x40
+
+/* 7 bit on line control reg. enalbing rw to dll and dlh */
+#define UART_LCR_DLAB  0x0080
+
+#define UART___9600_BDR0x84
+#define UART__19200_BDR0x42
+#define UART_115200_BDR0x08
+
+#define UART_DIS_ALL_INTER 0x00/* disable all interrupts   */
+
+#define UART_5DATA_BITS0x  /*   5 [bits]  1.5 bits   2 
*/
+#define UART_6DATA_BITS0x0001  /*   6 [bits]  1   bits   2 
*/
+#define UART_7DATA_BITS0x0002  /*   7 [bits]  1   bits   2 
*/
+#define UART_8DATA_BITS0x0003  /*   8 [bits]  1   bits   2 
*/
+
+static void vcth_uart_set_baud_rate(u32 address, u32 dh, u32 dl)
+{
+   u32 val = __raw_readl(UART_1_BASE + UART_LCR_OFF);
+
+   /* set 7 bit on 1 */
+   val |= UART_LCR_DLAB;
+   __raw_writel(val, UART_1_BASE + UART_LCR_OFF);
+
+   __raw_writel(dl, UART_1_BASE + UART_DLL_OFF);
+   __raw_writel(dh, UART_1_BASE + UART_DLH_OFF);
+
+   /* set 7 bit on 0 */
+   val &= ~UART_LCR_DLAB;
+   __raw_writel(val, UART_1_BASE + UART_LCR_OFF);
+
+   return;
+}
+
+int serial_init(void)
+{
+   __raw_writel(UART_DIS_ALL_INTER, UART_1_BASE + UART_IER_OFF);
+   vcth_uart_set_baud_rate(UART_1_BASE, 0, UART_115200_BDR);
+   __raw_writel(UART_8DATA_BITS, UART_1_BASE + UART_LCR_OFF);
+
+   return 0;
+}
+
+void serial_setbrg(void)
+{
+   /*
+* Baudrate change not supported currently, fixed to 115200 baud
+*/
+}
+
+void serial_putc(const char c)
+{
+   if (c == '\n')
+   serial_putc('\r');
+
+   while (!(UART_XMT_HOLD_EMPTY & __raw_readl(UART_1_BASE + UART_LSR_OFF)))
+   ;
+
+   __raw_writel(c, UART_1_BASE + UART_THR_OFF);
+}
+
+void serial_puts(const char *s)
+{
+   while (*s)
+   serial_putc(*s++);
+}
+
+int serial_getc(void)
+{
+   while (!(UART_RCV_DATA_RDY & __raw_readl(UART_1_BASE + UART_LSR_OFF)))
+   ;
+
+   return __raw_readl(UART_1_BASE + UART_RBR_OFF) & 0xff;

[U-Boot] [PATCH] MIPS: Add board_early_init_f() to init_sequence

2008-11-12 Thread Stefan Roese
This patch adds the board_early_init_f() call to the MIPS init
sequence. A weak dummy implementation is also added which can be
overridden by a board specific version.

This will be used by the upcoming VCTH board support.

Signed-off-by: Stefan Roese <[EMAIL PROTECTED]>
---
 lib_mips/board.c |   10 ++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/lib_mips/board.c b/lib_mips/board.c
index 77e1cc8..01dda69 100644
--- a/lib_mips/board.c
+++ b/lib_mips/board.c
@@ -70,6 +70,15 @@ static ulong mem_malloc_brk;
  */
 unsigned long mips_io_port_base = -1;
 
+int __board_early_init_f(void)
+{
+   /*
+* Nothing to do in this dummy implementation
+*/
+   return 0;
+}
+int board_early_init_f(void) __attribute__((weak, 
alias("__board_early_init_f")));
+
 /*
  * The Malloc area is immediately below the monitor copy in DRAM
  */
@@ -167,6 +176,7 @@ static int init_baudrate (void)
 typedef int (init_fnc_t) (void);
 
 init_fnc_t *init_sequence[] = {
+   board_early_init_f,
timer_init,
env_init,   /* initialize environment */
 #ifdef CONFIG_INCA_IP
-- 
1.6.0.4

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


[U-Boot] [PATCH] MIPS: Add onenand_init() to board.c and move nand_init()

2008-11-12 Thread Stefan Roese
This patch adds a call to onenand_init() for OneNAND support and moves
the nand_init() call to an earlier place, so that the environment can
be used from NAND and OneNAND.

Signed-off-by: Stefan Roese <[EMAIL PROTECTED]>
---
 lib_mips/board.c |   15 ++-
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/lib_mips/board.c b/lib_mips/board.c
index 01dda69..1ccdc4a 100644
--- a/lib_mips/board.c
+++ b/lib_mips/board.c
@@ -29,6 +29,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -387,6 +388,15 @@ void board_init_r (gd_t *id, ulong dest_addr)
mem_malloc_init();
malloc_bin_reloc();
 
+#ifdef CONFIG_CMD_NAND
+   puts ("NAND:  ");
+   nand_init ();   /* go init the NAND */
+#endif
+
+#if defined(CONFIG_CMD_ONENAND)
+   onenand_init();
+#endif
+
/* relocate environment function pointers etc. */
env_relocate();
 
@@ -428,11 +438,6 @@ void board_init_r (gd_t *id, ulong dest_addr)
}
 #endif
 
-#ifdef CONFIG_CMD_NAND
-   puts ("NAND:  ");
-   nand_init ();   /* go init the NAND */
-#endif
-
 #ifdef CONFIG_CMD_SPI
puts ("SPI:   ");
spi_init ();/* go init the SPI */
-- 
1.6.0.4

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


[U-Boot] [PATCH] MIPS: Add CONFIG_SKIP_LOWLEVEL_INIT and flush dcache upon relocation

2008-11-12 Thread Stefan Roese
This patch adds the CONFIG_SKIP_LOWLEVEL_INIT option to start.S. This
enables support for boards where the lowlevel initialization is
already done when U-Boot runs (e.g. via OnChip ROM).

Also the data cache will be flushed upon relocation. This is missing
in the current implementation.

All this will be used in the upcoming VCTH board support.

Signed-off-by: Stefan Roese <[EMAIL PROTECTED]>
---
 cpu/mips/start.S |   19 ++-
 1 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/cpu/mips/start.S b/cpu/mips/start.S
index 6a22302..5b71b00 100644
--- a/cpu/mips/start.S
+++ b/cpu/mips/start.S
@@ -243,9 +243,11 @@ reset:
mtc0zero, CP0_COUNT
mtc0zero, CP0_COMPARE
 
+#if !defined(CONFIG_SKIP_LOWLEVEL_INIT)
/* CONFIG0 register */
li  t0, CONF_CM_UNCACHED
mtc0t0, CP0_CONFIG
+#endif /* !CONFIG_SKIP_LOWLEVEL_INIT */
 
/* Initialize $gp.
 */
@@ -255,6 +257,7 @@ reset:
 1:
lw  gp, 0(ra)
 
+#if !defined(CONFIG_SKIP_LOWLEVEL_INIT)
/* Initialize any external memory.
 */
la  t9, lowlevel_init
@@ -271,6 +274,7 @@ reset:
 */
li  t0, CONF_CM_CACHABLE_NONCOHERENT
mtc0t0, CP0_CONFIG
+#endif /* !CONFIG_SKIP_LOWLEVEL_INIT */
 
/* Set up temporary stack.
 */
@@ -323,6 +327,14 @@ relocate_code:
 * t1 = target address
 * t2 = source end address
 */
+
+   /*
+* Save destination address and size for later usage in flush_cache()
+*/
+   movet7, a1  /* save gd in t7*/
+   movea0, t1  /* a0 <-- destination addr  */
+   sub a1, t2, t0  /* a1 <-- size  */
+
/* On the purple board we copy the code earlier in a special way
 * in order to solve flash problems
 */
@@ -338,6 +350,11 @@ relocate_code:
/* If caches were enabled, we would have to flush them here.
 */
 
+   /* a0 & a1 are already set up for flush_cache(start, size) */
+   la  t9, flush_cache
+   jalrt9
+   nop
+
/* Jump to where we've relocated ourselves.
 */
addit0, a2, in_ram - _start
@@ -387,7 +404,7 @@ in_ram:
bltlt1, t2, 1b
sw  zero, 0(t1) /* delay slot   */
 
-   movea0, a1
+   movea0, t7  /* a0 <-- gd*/
la  t9, board_init_r
jr  t9
movea1, a2  /* delay slot   */
-- 
1.6.0.4

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


[U-Boot] PATCH add support for cheflux board

2008-11-12 Thread Giulio Benetti
Add support for cheflux board

diff -urpN -X cheflux-exclude u-boot.orig/board/micronova/cheflux/cheflux.c 
u-boot/board/micronova/cheflux/cheflux.c
--- u-boot.orig/board/micronova/cheflux/cheflux.c   1970-01-01 
01:00:00.0 +0100
+++ u-boot/board/micronova/cheflux/cheflux.c2008-11-12 12:49:06.0 
+0100
@@ -0,0 +1,328 @@
+/*
+ * (C) Copyright 2007-2008
+ * Stelian Pop <[EMAIL PROTECTED]>
+ * Lead Tech Design 
+ *
+ * Giulio Benetti <[EMAIL PROTECTED]>
+ * Micronova srl <[EMAIL PROTECTED]>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#if defined(CONFIG_RESET_PHY_R) && defined(CONFIG_MACB)
+#include 
+#endif
+
+DECLARE_GLOBAL_DATA_PTR;
+
+/* - 
*/
+/*
+ * Miscelaneous platform dependent initialisations
+ */
+
+static void cheflux_serial_hw_init(void)
+{
+#ifdef CONFIG_USART0
+   at91_set_A_periph(AT91_PIN_PA26, 1);/* TXD0 */
+   at91_set_A_periph(AT91_PIN_PA27, 0);/* RXD0 */
+   at91_sys_write(AT91_PMC_PCER, 1 << AT91_ID_US0);
+#endif
+
+#ifdef CONFIG_USART1
+   at91_set_A_periph(AT91_PIN_PD0, 1); /* TXD1 */
+   at91_set_A_periph(AT91_PIN_PD1, 0); /* RXD1 */
+   at91_sys_write(AT91_PMC_PCER, 1 << AT91_ID_US1);
+#endif
+
+#ifdef CONFIG_USART2
+   at91_set_A_periph(AT91_PIN_PD2, 1); /* TXD2 */
+   at91_set_A_periph(AT91_PIN_PD3, 0); /* RXD2 */
+   at91_sys_write(AT91_PMC_PCER, 1 << AT91_ID_US2);
+#endif
+
+#ifdef CONFIG_USART3   /* DBGU */
+   at91_set_A_periph(AT91_PIN_PC30, 0);/* DRXD */
+   at91_set_A_periph(AT91_PIN_PC31, 1);/* DTXD */
+   at91_sys_write(AT91_PMC_PCER, 1 << AT91_ID_SYS);
+#endif
+}
+
+#ifdef CONFIG_CMD_NAND
+static void cheflux_nand_hw_init(void)
+{
+   unsigned long csa;
+
+   /* Enable CS3 */
+   csa = at91_sys_read(AT91_MATRIX_EBI0CSA);
+   at91_sys_write(AT91_MATRIX_EBI0CSA,
+  csa | AT91_MATRIX_EBI0_CS3A_SMC_SMARTMEDIA);
+
+   /* Configure SMC CS3 for NAND/SmartMedia */
+   at91_sys_write(AT91_SMC_SETUP(3),
+  AT91_SMC_NWESETUP_(1) | AT91_SMC_NCS_WRSETUP_(0) |
+  AT91_SMC_NRDSETUP_(1) | AT91_SMC_NCS_RDSETUP_(0));
+   at91_sys_write(AT91_SMC_PULSE(3),
+  AT91_SMC_NWEPULSE_(3) | AT91_SMC_NCS_WRPULSE_(3) |
+  AT91_SMC_NRDPULSE_(3) | AT91_SMC_NCS_RDPULSE_(3));
+   at91_sys_write(AT91_SMC_CYCLE(3),
+  AT91_SMC_NWECYCLE_(5) | AT91_SMC_NRDCYCLE_(5));
+   at91_sys_write(AT91_SMC_MODE(3),
+  AT91_SMC_READMODE | AT91_SMC_WRITEMODE |
+  AT91_SMC_EXNWMODE_DISABLE |
+#ifdef CFG_NAND_DBW_16
+  AT91_SMC_DBW_16 |
+#else /* CFG_NAND_DBW_8 */
+  AT91_SMC_DBW_8 |
+#endif
+  AT91_SMC_TDF_(2));
+
+   at91_sys_write(AT91_PMC_PCER, 1 << AT91SAM9263_ID_PIOA |
+ 1 << AT91SAM9263_ID_PIOCDE);
+
+   /* Configure RDY/BSY */
+   at91_set_gpio_input(AT91_PIN_PA22, 1);
+
+   /* Enable NandFlash */
+   at91_set_gpio_output(AT91_PIN_PD15, 1);
+}
+#endif
+
+#ifdef CONFIG_HAS_DATAFLASH
+static void cheflux_spi_hw_init(void)
+{
+   at91_set_B_periph(AT91_PIN_PA5, 0); /* SPI0_NPCS0 */
+
+   at91_set_B_periph(AT91_PIN_PA0, 0); /* SPI0_MISO */
+   at91_set_B_periph(AT91_PIN_PA1, 0); /* SPI0_MOSI */
+   at91_set_B_periph(AT91_PIN_PA2, 0); /* SPI0_SPCK */
+
+   /* Enable clock */
+   at91_sys_write(AT91_PMC_PCER, 1 << AT91SAM9263_ID_SPI0);
+}
+#endif
+
+#ifdef CONFIG_MACB
+static void cheflux_macb_hw_init(void)
+{
+   /* Enable clock */
+   at91_sys_write(AT91_PMC_PCER, 1 << AT91SAM9263_ID_EMAC);
+
+   writel(pin_to_mask(AT91_PIN_PC22) |
+  pin_to_mask(AT91_PIN_PC23) |
+  pin_to_mask(AT91_PIN_PC25) |
+  pin_to_mask(AT91_PIN_PC27),
+  pin_to_controller(AT91_PIN_PC0) + PIO_PUDR);
+   writel(pin_to_mask(AT91_

[U-Boot] PATCH macb fix phy address

2008-11-12 Thread Giulio Benetti
- Fixed finding phyter address
- Added searching for other addresses if not found

diff -urpN -X macb-exclude u-boot.orig/drivers/net/macb.c 
u-boot/drivers/net/macb.c
--- u-boot.orig/drivers/net/macb.c  2008-08-12 16:08:38.0 +0200
+++ u-boot/drivers/net/macb.c   2008-11-12 12:51:16.0 +0100
@@ -1,5 +1,7 @@
 /*
  * Copyright (C) 2005-2006 Atmel Corporation
+ * Giulio Benetti <[EMAIL PROTECTED]>
+ * Micronova srl <[EMAIL PROTECTED]>
  *
  * 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
@@ -84,6 +86,8 @@ struct macb_dma_desc {
 #define TXBUF_WRAP 0x4000
 #define TXBUF_USED 0x8000
 
+#define MAX_PHY_ADDRESS_NUMBER 32
+
 struct macb_device {
void*regs;
 
@@ -325,8 +329,18 @@ static int macb_phy_init(struct macb_dev
int i;
 
/* Check if the PHY is up to snuff... */
-   phy_id = macb_mdio_read(macb, MII_PHYSID1);
-   if (phy_id == 0x) {
+   printf("%s: Finding PHYs\n", netdev->name);
+
+   for(i = 0; i < MAX_PHY_ADDRESS_NUMBER; i++) {
+   lpa = macb_mdio_read(macb, MII_LPA);
+   phy_id = macb_mdio_read(macb, MII_PHYSID1);
+   if ((phy_id != 0x) && (lpa != 0x)) {
+   break;
+   }
+   macb->phy_addr++;
+   }
+
+   if(i >= MAX_PHY_ADDRESS_NUMBER) {
printf("%s: No PHY present\n", netdev->name);
return 0;
}

Signed-off-by: Giulio Benetti <[EMAIL PROTECTED]>

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


Re: [U-Boot] [PATCH] FAT on non standard sector size devices

2008-11-12 Thread Remy Bohmer
Hello Igor,

2008/11/12 Igor Luri <[EMAIL PROTECTED]>:
> Hi all!
>
> There are USB devices with sector size different than 512 bytes. In
> fact, I have one with 2048 bytes per sector:
>
> scsi0 : SCSI emulation for USB Mass Storage devices
>  Vendor: ChipsBnk  Model: Flash DiskRev: 4.00
>  Type:   Direct-Access  ANSI SCSI revision: 02
> Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0
> SCSI device sda: 129124 2048-byte hdwr sectors (264 MB)
> sda: Write Protect is off
> Partition check:
>  sda: sda1 sda2 sda3 sda4
>
> U-boot FAT filesystem code supposes that sector size is always 512
> bytes, consecuently fatload and fatls commands ends up with a
> segmentation fault.
>
> Attached patches adds FAT support on devices with sector size up to 8192
> bytes.

Please only sent patches inline, see http://lwn.net/Articles/139918/
for more info

> I have only tested on our custom board with u-boot 1.1.6 version. I
> would aprpeciate if someone could test this patch on latest version.

I just looked at it (not tested it yet), and I have some comments:

> - unsigned char buffer[SECTOR_SIZE];
> + unsigned char buffer[8192];
>   disk_partition_t info;

Why hardcode this size to 8192, cant it be malloced somehow?
Is there a check that detects if the size is getting bigger than 8192
to prevent segfaults?

>   if (!dev_desc->block_read)
> @@ -184,7 +185,7 @@ static void get_name (dir_entry *dirent, char *s_name)
>   if (*s_name == DELETED_FLAG)
>   *s_name = '\0';
>   else if (*s_name == aRING)
> - *s_name = 'å';
> + *s_name = '�';

Some weird characters here... Is this change what you want?


Kind Regards,

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


[U-Boot] [PATCH] FAT on non standard sector size devices

2008-11-12 Thread Igor Luri
Hi all!

There are USB devices with sector size different than 512 bytes. In
fact, I have one with 2048 bytes per sector:

scsi0 : SCSI emulation for USB Mass Storage devices
  Vendor: ChipsBnk  Model: Flash DiskRev: 4.00
  Type:   Direct-Access  ANSI SCSI revision: 02
Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0
SCSI device sda: 129124 2048-byte hdwr sectors (264 MB)
sda: Write Protect is off
Partition check:
 sda: sda1 sda2 sda3 sda4

U-boot FAT filesystem code supposes that sector size is always 512
bytes, consecuently fatload and fatls commands ends up with a
segmentation fault.

Attached patches adds FAT support on devices with sector size up to 8192
bytes.

I have only tested on our custom board with u-boot 1.1.6 version. I
would aprpeciate if someone could test this patch on latest version.

Thanks.


Signed-off-by: Igor Luri <[EMAIL PROTECTED]>


-- 
Igor Luri
R&D Software Department
Fagor Aotek S. Coop.
P. O. Box 144
E-20500 Mondragón-Arrasate
Tel.++34 943 71 92 00 
++34 943 71 92 01 (Ext. 44268)
Fax.++34 943 79 92 03
www.aotek.es


0001-Add-support-for-non-standard-sector-size-devices.patch
Description: application/mbox


0002-Add-support-for-non-standard-sector-size-devices.patch
Description: application/mbox
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] LXT971 ethernet on MCF5485

2008-11-12 Thread raul . moreno

Thanks for your asnwer.

I got to solve the problem. I had a pair of mistakes related to the mapping
and netmask.
Now the ethernet is working right and I can use both FECs.

Regards,

Raúl Moreno



"Liew Tsi Chung" <[EMAIL PROTECTED]>
"Liew Tsi Chung"
10/11/2008 15:33

   
 Para:   <[EMAIL PROTECTED]>, 
 

   
 cc:
   

   
 Asunto: RE: [U-Boot] LXT971 ethernet on MCF5485
   

   





Hi,

 What does it tell when you typed "mii info"? Does it reports
100M on 100Mib base network, or does it take a while then reports 10M?
In mii_discover_phy(), undefined the ET_DEBUG to make sure it recognized
the ethernet phy device. Some simple check lists, GPIOs - which FEC are
you using 1 or 2? Do you have ipaddr, netmask, gatewayip, and serverip
set? Do you have CONFIG_M548x and CONFIG_FSLDMAFEC defined in your board
configuration file?

Regards,
TsiChung


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


[U-Boot] [PATCH] jffs2: rename devices_init () in common/jffs2.c

2008-11-12 Thread Heiko Schocher
rename devices_init () in common/jffs2.c to
jffs2_devices_init (), because there is also a
devices_init () in common/devices.c.

Signed-off-by: Heiko Schocher <[EMAIL PROTECTED]>
---
 common/cmd_jffs2.c |   14 +++---
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/common/cmd_jffs2.c b/common/cmd_jffs2.c
index 791a572..c2caade 100644
--- a/common/cmd_jffs2.c
+++ b/common/cmd_jffs2.c
@@ -1056,7 +1056,7 @@ static int device_parse(const char *const mtd_dev, const 
char **ret, struct mtd_
  *
  * @return 0 on success, 1 otherwise
  */
-static int devices_init(void)
+static int jffs2_devices_init(void)
 {
last_parts[0] = '\0';
current_dev = NULL;
@@ -1471,12 +1471,12 @@ static int parse_mtdparts(const char *const mtdparts)
DEBUGF("\n---parse_mtdparts---\nmtdparts = %s\n\n", p);

/* delete all devices and partitions */
-   if (devices_init() != 0) {
+   if (jffs2_devices_init() != 0) {
printf("could not initialise device list\n");
return err;
}

-   /* re-read 'mtdparts' variable, devices_init may be updating env */
+   /* re-read 'mtdparts' variable, jffs2_devices_init may be updating env 
*/
p = getenv("mtdparts");

if (strncmp(p, "mtdparts=", 9) != 0) {
@@ -1698,7 +1698,7 @@ int mtdparts_init(void)
ids_changed = 1;

if (parse_mtdids(ids) != 0) {
-   devices_init();
+   jffs2_devices_init();
return 1;
}

@@ -1731,7 +1731,7 @@ int mtdparts_init(void)

/* mtdparts variable was reset to NULL, delete all devices/partitions */
if (!parts && (last_parts[0] != '\0'))
-   return devices_init();
+   return jffs2_devices_init();

/* do not process current partition if mtdparts variable is null */
if (!parts)
@@ -2105,8 +2105,8 @@ int do_jffs2_mtdparts(cmd_tbl_t *cmdtp, int flag, int 
argc, char *argv[])

setenv("mtdparts", NULL);

-   /* devices_init() calls current_save() */
-   return devices_init();
+   /* jffs2_devices_init() calls current_save() */
+   return jffs2_devices_init();
}
}

-- 
1.5.6.1

-- 
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 5/5] powerpc, keymile boards: extract identical config options

2008-11-12 Thread Heiko Schocher
This patch extracts the identical config options for the
keymile boards mgcoge, mgsuvd and kmeter1 in a new
common config file keymile-common.h.

Signed-off-by: Heiko Schocher <[EMAIL PROTECTED]>
---
 include/configs/keymile-common.h |  113 ++
 include/configs/kmeter1.h|   82 +--
 include/configs/mgcoge.h |   62 +
 include/configs/mgsuvd.h |   82 +---
 4 files changed, 120 insertions(+), 219 deletions(-)
 create mode 100644 include/configs/keymile-common.h

diff --git a/include/configs/keymile-common.h b/include/configs/keymile-common.h
new file mode 100644
index 000..d70bc48
--- /dev/null
+++ b/include/configs/keymile-common.h
@@ -0,0 +1,113 @@
+/*
+ * (C) Copyright 2008
+ * Heiko Schocher, DENX Software Engineering, [EMAIL PROTECTED]
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __CONFIG_KEYMILE_H
+#define __CONFIG_KEYMILE_H
+
+/* Do boardspecific init for all boards */
+#define CONFIG_BOARD_EARLY_INIT_R   1
+
+#if defined(CONFIG_MGCOGE) || defined(CONFIG_MGSUVD)
+#define CONFIG_BOOTCOUNT_LIMIT
+#endif
+
+/*
+ * Command line configuration.
+ */
+#include 
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_ECHO
+#define CONFIG_CMD_IMMAP
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_PING
+
+/* should go away, if kmeter I2C support is enabled */
+#if defined(CONFIG_MGCOGE) || defined(CONFIG_MGSUVD)
+#define CONFIG_CMD_DTT
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_I2C
+#endif
+
+#undef CONFIG_WATCHDOG /* disable platform specific watchdog */
+
+#define CONFIG_BOOTCOMMAND "run net_nfs"
+#define CONFIG_BOOTDELAY   5   /* autoboot after 5 seconds */
+#undef CONFIG_BOOTARGS /* the boot command will set bootargs */
+
+/*
+ * Miscellaneous configurable options
+ */
+#define CONFIG_SYS_HUSH_PARSER
+#define CONFIG_SYS_PROMPT_HUSH_PS2 "> "
+#define CONFIG_SYS_LONGHELP/* undef to save memory */
+#define CONFIG_SYS_PROMPT  "=> "   /* Monitor Command Prompt   */
+#if defined(CONFIG_CMD_KGDB)
+#define CONFIG_SYS_CBSIZE  1024/* Console I/O Buffer Size  */
+#else
+#define CONFIG_SYS_CBSIZE  256 /* Console I/O Buffer Size  */
+#endif
+#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16) 
/* Print Buffer Size  */
+#define CONFIG_SYS_MAXARGS 16  /* max number of command args */
+#define CONFIG_SYS_BARGSIZECONFIG_SYS_CBSIZE   /* Boot 
Argument Buffer Size  */
+#define CONFIG_CMDLINE_EDITING 1   /* add command line history 
*/
+
+/* should go away, if kmeter I2C support is enabled */
+#if defined(CONFIG_MGCOGE) || defined(CONFIG_MGSUVD)
+#define CONFIG_HUSH_INIT_VAR   1
+#endif
+
+#define CONFIG_SYS_ALT_MEMTEST /* memory test, takes time */
+#define CONFIG_SYS_MEMTEST_START   0x0010  /* memtest works on */
+#define CONFIG_SYS_MEMTEST_END 0x00f0  /* 1 ... 15 MB in DRAM  
*/
+
+#define CONFIG_SYS_LOAD_ADDR   0x10/* default load address 
*/
+
+#define CONFIG_SYS_HZ  1000/* decrementer freq: 1 ms ticks 
*/
+
+#define CONFIG_BAUDRATE115200
+#define CONFIG_SYS_BAUDRATE_TABLE  { 9600, 19200, 38400, 57600, 115200, 
230400 }
+
+#define CONFIG_LOADS_ECHO  1   /* echo on for serial download */
+#define CONFIG_SYS_LOADS_BAUD_CHANGE   1   /* allow baudrate change */
+
+/*
+ * How to get access to the slot ID.  Put this here to make it easy
+ * to modify in a centralized location.  This is used in the HDLC
+ * driver to set the MAC.
+*/
+#define CONFIG_CHECK_ETHERNET_PRESENT  1
+#define CONFIG_SYS_SLOT_ID_BASECONFIG_SYS_PIGGY_BASE
+#define CONFIG_SYS_SLOT_ID_OFF (0x07)  /* register offset */
+#define CONFIG_SYS_SLOT_ID_MASK(0x3f)  /* mask for slot ID 
bits */
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+#endif /* __CONFIG_KEYMILE_H */
diff --git a/include/configs/k

[U-Boot] [PATCH 4/5] powerpc: keymile: Add a check for the PIGGY debug board

2008-11-12 Thread Heiko Schocher
Check the presence of the PIGGY on the keymile boards mgcoge,
mgsuvd and kmeter1. If the PIGGY is not present, dont register
this Ethernet device.

Signed-off-by: Heiko Schocher <[EMAIL PROTECTED]>
---
 board/keymile/common/common.c   |   16 ++--
 board/keymile/kmeter1/Makefile  |6 --
 board/keymile/kmeter1/kmeter1.c |7 ++-
 board/keymile/mgcoge/mgcoge.c   |9 +++--
 board/keymile/mgsuvd/mgsuvd.c   |8 +++-
 cpu/mpc8260/ether_scc.c |8 
 cpu/mpc8xx/scc.c|6 ++
 drivers/qe/uec.c|7 +++
 include/configs/kmeter1.h   |   10 ++
 include/configs/mgcoge.h|   11 +++
 include/configs/mgsuvd.h|   10 ++
 include/net.h   |4 +++-
 12 files changed, 93 insertions(+), 9 deletions(-)

diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c
index a4cf24c..54c8730 100644
--- a/board/keymile/common/common.c
+++ b/board/keymile/common/common.c
@@ -22,10 +22,14 @@
  */

 #include 
+#if defined(CONFIG_MGCOGE)
 #include 
+#endif
 #include 
 #include 
 #include 
+#include 
+#include 

 #if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT)
 #include 
@@ -33,8 +37,6 @@

 #if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C)
 #include 
-#endif
-#include 

 extern int i2c_soft_read_pin (void);

@@ -495,6 +497,7 @@ void i2c_init_board(void)
 #endif
 }
 #endif
+#endif

 #if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT)
 int fdt_set_node_and_value (void *blob,
@@ -521,3 +524,12 @@ int fdt_set_node_and_value (void *blob,
return ret;
 }
 #endif
+
+#if defined(CONFIG_CHECK_ETHERNET_PRESENT)
+int ethernet_present (int index)
+{
+   int ret;
+   ret = in_8((u8 *)CONFIG_SYS_PIGGY_BASE + CONFIG_SYS_SLOT_ID_OFF) & 0x80;
+   return ret;
+}
+#endif
diff --git a/board/keymile/kmeter1/Makefile b/board/keymile/kmeter1/Makefile
index 88b79f3..12a1518 100644
--- a/board/keymile/kmeter1/Makefile
+++ b/board/keymile/kmeter1/Makefile
@@ -22,12 +22,14 @@
 #

 include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../common)
+endif

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

-COBJS-y += $(BOARD).o
+COBJS  += $(BOARD).o ../common/common.o

-COBJS  := $(COBJS-y)
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS))
 SOBJS  := $(addprefix $(obj),$(SOBJS))
diff --git a/board/keymile/kmeter1/kmeter1.c b/board/keymile/kmeter1/kmeter1.c
index f9a59a6..03f5dda 100644
--- a/board/keymile/kmeter1/kmeter1.c
+++ b/board/keymile/kmeter1/kmeter1.c
@@ -141,7 +141,12 @@ phys_size_t initdram (int board_type)

 int checkboard (void)
 {
-   puts ("Board: Keymile kmeter1\n");
+   puts ("Board: Keymile kmeter1");
+#if defined(CONFIG_CHECK_ETHERNET_PRESENT)
+   if (ethernet_present (0))
+   puts (" with PIGGY.");
+#endif
+   puts ("\n");
return 0;
 }

diff --git a/board/keymile/mgcoge/mgcoge.c b/board/keymile/mgcoge/mgcoge.c
index 3683417..98a4d43 100644
--- a/board/keymile/mgcoge/mgcoge.c
+++ b/board/keymile/mgcoge/mgcoge.c
@@ -25,6 +25,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 

 #if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT)
@@ -285,8 +286,12 @@ phys_size_t initdram (int board_type)

 int checkboard(void)
 {
-   puts ("Board: mgcoge\n");
-
+   puts ("Board: Keymile mgcoge");
+#if defined(CONFIG_CHECK_ETHERNET_PRESENT)
+   if (ethernet_present (0))
+   puts (" with PIGGY.");
+#endif
+   puts ("\n");
return 0;
 }

diff --git a/board/keymile/mgsuvd/mgsuvd.c b/board/keymile/mgsuvd/mgsuvd.c
index 3726acf..eb4c285 100644
--- a/board/keymile/mgsuvd/mgsuvd.c
+++ b/board/keymile/mgsuvd/mgsuvd.c
@@ -22,6 +22,7 @@
  */
 #include 
 #include 
+#include 
 #include 

 #if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT)
@@ -60,7 +61,12 @@ const uint sdram_table[] =

 int checkboard (void)
 {
-   puts ("Board: Keymile mgsuvd\n");
+   puts ("Board: Keymile mgsuvd");
+#if defined(CONFIG_CHECK_ETHERNET_PRESENT)
+   if (ethernet_present (0))
+   puts (" with PIGGY.");
+#endif
+   puts ("\n");
return (0);
 }

diff --git a/cpu/mpc8260/ether_scc.c b/cpu/mpc8260/ether_scc.c
index c65f0e0..a79d56c 100644
--- a/cpu/mpc8260/ether_scc.c
+++ b/cpu/mpc8260/ether_scc.c
@@ -191,6 +191,14 @@ int eth_init(bd_t *bis)
 scc_enet_t *pram_ptr;
 uint dpaddr;

+#if defined(CONFIG_CHECK_ETHERNET_PRESENT)
+   if (ethernet_present (CONFIG_ETHER_INDEX) == 0) {
+   printf("Ethernet index: %d not present.\n",
+  CONFIG_ETHER_INDEX);
+   return -1;
+   }
+#endif
+
 rxIdx = 0;
 txIdx = 0;

diff --git a/cpu/mpc8xx/scc.c b/cpu/mpc8xx/scc.c
index effb967..4be4d89 100644
--- a/cpu/mpc8xx/scc.c
+++ b/cpu/mpc8xx/scc.c
@@ -74,6 +74,12 @@ int scc_initialize(bd_t *bis)
 {
struct eth_device* dev;

+#if defined(CONFIG_CHECK_ETHERN

[U-Boot] [PATCH 3/5] powerpc: 83xx: add support for the kmeter1 board

2008-11-12 Thread Heiko Schocher
This patch adds support for the kmeter1 board from Keymile,
based on a Freescale MPC8360 CPU.

- serial console on UART 1
- 256 MB DDR2 RAM
- 64 MB NOR Flash
- Ethernet RMII Mode over UCC4
- PHY SMSC LAN8700

Signed-off-by: Heiko Schocher <[EMAIL PROTECTED]>
---
 MAINTAINERS |1 +
 MAKEALL |1 +
 Makefile|3 +
 board/keymile/kmeter1/Makefile  |   51 
 board/keymile/kmeter1/config.mk |   24 ++
 board/keymile/kmeter1/kmeter1.c |  153 
 include/configs/kmeter1.h   |  521 +++
 7 files changed, 754 insertions(+), 0 deletions(-)
 create mode 100644 board/keymile/kmeter1/Makefile
 create mode 100644 board/keymile/kmeter1/config.mk
 create mode 100644 board/keymile/kmeter1/kmeter1.c
 create mode 100644 include/configs/kmeter1.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 127604b..4086831 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -374,6 +374,7 @@ Heiko Schocher <[EMAIL PROTECTED]>

ids8247 MPC8247
jupiter MPC5200
+   kmeter1 MPC8360
mgcoge  MPC8247
mgsuvd  MPC852
mucmc52 MPC5200
diff --git a/MAKEALL b/MAKEALL
index dbed268..a4e38ce 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -326,6 +326,7 @@ LIST_8260=" \
 #

 LIST_83xx="\
+   kmeter1 \
MPC8313ERDB_33  \
MPC8313ERDB_NAND_66 \
MPC8315ERDB \
diff --git a/Makefile b/Makefile
index e4a184f..ba3591e 100644
--- a/Makefile
+++ b/Makefile
@@ -2175,6 +2175,9 @@ TASREG_config :   unconfig
 ## MPC83xx Systems
 #

+kmeter1_config: unconfig
+   @$(MKCONFIG) kmeter1 ppc mpc83xx kmeter1 keymile
+
 MPC8313ERDB_33_config \
 MPC8313ERDB_66_config \
 MPC8313ERDB_NAND_33_config \
diff --git a/board/keymile/kmeter1/Makefile b/board/keymile/kmeter1/Makefile
new file mode 100644
index 000..88b79f3
--- /dev/null
+++ b/board/keymile/kmeter1/Makefile
@@ -0,0 +1,51 @@
+#
+# (C) Copyright 2006
+# Wolfgang Denk, DENX Software Engineering, [EMAIL PROTECTED]
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).a
+
+COBJS-y += $(BOARD).o
+
+COBJS  := $(COBJS-y)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+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/keymile/kmeter1/config.mk b/board/keymile/kmeter1/config.mk
new file mode 100644
index 000..20f298b
--- /dev/null
+++ b/board/keymile/kmeter1/config.mk
@@ -0,0 +1,24 @@
+#
+# (C) Copyright 2008
+# Heiko Schocher, DENX Software Engineering, [EMAIL PROTECTED]
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+TEXT_BASE = 0xF000
diff --git a/board/keymile/kmeter1/kmeter1.c b/board/keymile/kmeter1/kmeter1.c
new file mode 100644
index 000..f9a59a6
--- /dev/null
+++ b/board/keymile/kmeter1/kmeter1.c
@@ -0,0 +

[U-Boot] [PATCH 2/5] powerpc: 83xx: add missing TIMING_CFG1_CASLAT_* defines

2008-11-12 Thread Heiko Schocher
Signed-off-by: Heiko Schocher <[EMAIL PROTECTED]>
---
 include/mpc83xx.h |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/include/mpc83xx.h b/include/mpc83xx.h
index a2c0ed9..43553f5 100644
--- a/include/mpc83xx.h
+++ b/include/mpc83xx.h
@@ -887,7 +887,9 @@
 #define TIMING_CFG1_WRTORD_SHIFT   0
 #define TIMING_CFG1_CASLAT_20  0x0003  /* CAS latency = 2.0 */
 #define TIMING_CFG1_CASLAT_25  0x0004  /* CAS latency = 2.5 */
-#define TIMING_CFG1_CASLAT_30  0x0005  /* CAS latency = 2.5 */
+#define TIMING_CFG1_CASLAT_30  0x0005  /* CAS latency = 3.0 */
+#define TIMING_CFG1_CASLAT_35  0x0006  /* CAS latency = 3.5 */
+#define TIMING_CFG1_CASLAT_40  0x0007  /* CAS latency = 4.0 */

 /* TIMING_CFG_2 - DDR SDRAM Timing Configuration 2
  */
-- 
1.5.6.1

-- 
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 1/5] powerpc: 83xx: support for the SMSC LAN8700 PHY

2008-11-12 Thread Heiko Schocher
Signed-off-by: Heiko Schocher <[EMAIL PROTECTED]>
---
 drivers/qe/uec_phy.c |   59 ++
 1 files changed, 59 insertions(+), 0 deletions(-)

diff --git a/drivers/qe/uec_phy.c b/drivers/qe/uec_phy.c
index 2243d3b..c03eb12 100644
--- a/drivers/qe/uec_phy.c
+++ b/drivers/qe/uec_phy.c
@@ -533,6 +533,55 @@ static void dm9161_close (struct uec_mii_info *mii_info)
 {
 }

+static int smsc_config_aneg (struct uec_mii_info *mii_info)
+{
+   return 0;
+}
+
+static int smsc_read_status (struct uec_mii_info *mii_info)
+{
+   u16 status;
+   int err;
+
+   /* Update the link, but return if there
+* was an error */
+   err = genmii_update_link (mii_info);
+   if (err)
+   return err;
+
+   /* If the link is up, read the speed and duplex */
+   /* If we aren't autonegotiating, assume speeds
+* are as set */
+   if (mii_info->autoneg && mii_info->link) {
+   int val;
+
+   status = phy_read (mii_info, 0x1f);
+   val = (status & 0x1c) >> 2;
+   
+   switch (val) {
+   case 1:
+   mii_info->duplex = DUPLEX_HALF;
+   mii_info->speed = SPEED_10;
+   break;
+   case 5:
+   mii_info->duplex = DUPLEX_FULL;
+   mii_info->speed = SPEED_10;
+   break;
+   case 2:
+   mii_info->duplex = DUPLEX_HALF;
+   mii_info->speed = SPEED_100;
+   break;
+   case 6:
+   mii_info->duplex = DUPLEX_FULL;
+   mii_info->speed = SPEED_100;
+   break;
+   }
+   mii_info->pause = 0;
+   }
+
+   return 0;
+}
+
 static struct phy_info phy_info_dm9161 = {
.phy_id = 0x0181b880,
.phy_id_mask = 0x0ff0,
@@ -577,6 +626,15 @@ static struct phy_info phy_info_bcm5481 = {
.init = bcm_init,
 };

+static struct phy_info phy_info_smsclan8700 = {
+   .phy_id = 0x0007c0c0,
+   .phy_id_mask = 0xfff0,
+   .name = "SMSC LAN",
+   .features = MII_BASIC_FEATURES,
+   .config_aneg = smsc_config_aneg,
+   .read_status = smsc_read_status,
+};
+
 static struct phy_info phy_info_genmii = {
.phy_id = 0x,
.phy_id_mask = 0x,
@@ -591,6 +649,7 @@ static struct phy_info *phy_info[] = {
&phy_info_dm9161a,
&phy_info_marvell,
&phy_info_bcm5481,
+   &phy_info_smsclan8700,
&phy_info_genmii,
NULL
 };
-- 
1.5.6.1

-- 
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 0/5] powerpc: 83xx: add support for the 8360 based kmeter1 board.

2008-11-12 Thread Heiko Schocher
This patch series adds support for the keymile board kmeter1
based on a MPC8360 CPU from freescale.

The patches 1/5 - 3/5 are adding the basic support for this
board. The patches 4/5 and 5/5 do some common cleanups for
the keymile boards.

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] Re : java virtual machine on embedded systems

2008-11-12 Thread Sebastien Jean
Hi there,

Looks like testosterone jumping out out the box !
Don't be so cruel guys.
Even if this question has probably nothing to do on this list because it is
not related with uboot itsels, you should demonstrate some kind of respect
and nevertheless try to answer this question if you can.

"UBoot linux Java" is not a buzzword. Stacking such software parts are a
classic job when trying to set up a flexible runtime for embedded devices.
Don't be hardware-centric. Maybe you sense nostalgia about C64 or other 80's
devices where you had to fight against the machine (i am nostalgic too)

So, to answer this question :

if you want to set up a JVM on top of uboot+linux for an embedded device,
you can implement a JVM from scratch. It is possible but as hard as useless.
You'd better cross-compile
an open source JVM for your device, such as JamVM which is very popular (you
will have to make it work with GNU Classpath).

Have a nice day !
Baz

> /me wonders what the one has to do with the other.
> ...
> They are buzzwords chained together in a sentence that sounds like
>English, and yet is totally meaningless.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot