Re: [U-Boot-Users] [PATCH 6/8] ColdFire: Add MCF547x_8x FEC driver

2008-01-14 Thread Liew Tsi Chung
Ben,

Yes. I agree the function name is not very descriptive. Will
mcdmafec_initialize() work (mcdma - multi-channel dma)? I can't name it
specific to coldfire, because this driver will also work on MPC8220.

Regards,
TsiChung


> diff --git a/net/eth.c b/net/eth.c
> index 5d9e9c1..fd3dc85 100644
> --- a/net/eth.c
> +++ b/net/eth.c
> @@ -61,6 +61,7 @@ extern int uec_initialize(int);  extern int 
> bfin_EMAC_initialize(bd_t *);  extern int 
> atstk1000_eth_initialize(bd_t *);  extern int 
> mcffec_initialize(bd_t*);
> +extern int fecdma_initialize(bd_t*);
>   

Can you pick a more descriptive name than fecdma, please. At the very
least it should be mcffecdma so we know it's Coldfire.

>  
>  #ifdef CONFIG_API
>  extern void (*push_packet)(volatile void *, int); @@ -272,6 +273,9 @@

> int eth_initialize(bd_t *bis)  #if defined(CONFIG_MCFFEC)
>   mcffec_initialize(bis);
>  #endif
> +#if defined(CONFIG_FSLDMAFEC)
> + fecdma_initialize(bis);
> +#endif
>  
>   if (!eth_devices) {
>   puts ("No ethernet found.\n");
>   


-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH] ColdFire: Add modules header files

2008-01-14 Thread Liew Tsi Chung
Wolfgang,

I created a coldfire folder under asm-m68k, 6 modules were relocated to 
the new directory. I re-send some of the patches.

Do I have to resubmit all the patches or just the affected patches from 
the changes?

Regards,
TsiChung 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Saturday, January 12, 2008 8:08 AM
To: Liew Tsi Chung
Cc: u-boot
Subject: Re: [U-Boot-Users] [PATCH] ColdFire: Add modules header files

In message <[EMAIL PROTECTED]> you wrote:
> ColdFire: Add modules header files
> 
> Signed-off-by: TsiChungLiew <[EMAIL PROTECTED]>
> ---
>  include/asm-m68k/crossbar.h |   79 
>  include/asm-m68k/dspi.h |  156 +++
>  include/asm-m68k/edma.h |  177 +++
>  include/asm-m68k/flexbus.h  |   98 
>  include/asm-m68k/lcd.h  |  213 
> +++
>  include/asm-m68k/ssi.h  |  175 +++
>  6 files changed, 898 insertions(+), 0 deletions(-)  create mode 
> 100644 include/asm-m68k/crossbar.h  create mode 100644 
> include/asm-m68k/dspi.h  create mode 100644 include/asm-m68k/edma.h  
> create mode 100644 include/asm-m68k/flexbus.h  create mode 100644 
> include/asm-m68k/lcd.h  create mode 100644 include/asm-m68k/ssi.h

I understand that these are ColdFire specific files, which are probably not 
relevant to other, non-CF m68k systems?

I think this should be visible from the file name. How about creating a 
directory ofr ColdFire related headers  so  we  don't  pollute  the global name 
space too much?

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] 
Another dream that failed.  There's nothing sadder.
-- Kirk, "This side of Paradise", stardate 3417.3

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH 1/8] ColdFire: Add MCF547x_8x cpu arch

2008-01-14 Thread Liew Tsi Chung
Guennadi,

> At least this patch seems line-wrapped to me. Above is just one
example.

Will change to git-send-email, that should take care of it.


>Is this really the correct comment here? I see the code is copied 
>from lib_m68k/time.c. Isn't lib_m68k going to be linked with this 
>board? Won't symbols conflict then? Obviously they don't, as you 
>are running this code, just I don't see immediately how this 
>works. And if CONFIG_SLTTMR is not defined, looks like get_timer 
>will be undefined, right? Is this the intended behaviour?

The MCF547x_8x is a bit different from the rest of the Coldfire, it does
not have dtimer nor pit. The only timer it has are slicetimer and
general purpose timer. There won't be a conflict if any two or any three
of these CONFIG_SLTTMR, CONFIG_MCFTMR or CONFIG_MCFPIT are defined as
the same time.

The only conflict functions are get_tbclk and get_ticks in slicetimer.c.
I will remove them at once.

Regards,
TsiChung

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH 2/2] ColdFire: Add M5373EVB platformsupport - 2

2008-01-15 Thread Liew Tsi Chung
Fixed it. It is in drivers/rtc/mcfrtc.c

Thanks. 

Regards,
TsiChung

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] resend [PATCH 2/8] ColdFire: Add MCF547x_8x related header files

2008-01-15 Thread Liew Tsi Chung
Ben, 

> If your driver is in /drivers/net, its header shouldn't be in 
> architecture-specific land. I'm not crazy about putting it in 
> /drivers/net either, but that seems to be the norm so let's do 
> that for now and maybe move it somewhere else later.

I prefer fec.h to stay in asm-m68k, and yes I agreed on other to move
somewhere else later.

> Minor point, but please make these all line up nicely :) 
> Everywhere in this patch, please.

Fixed.

Thanks.

Regards,
TsiChung

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH] ColdFire: Add modules header files

2008-01-15 Thread Liew Tsi Chung
Wolfgang,

>You probably want to rebase your poatches against current top of 
>tree anyway, and for reviewing it would be easier, too, if 
>youreposted the whole batch.

Done and resubmitted the patches. It is based on top of commit 
5dd372a23d12003276dddf7f9604154fd522ae73

Thanks.

Regards,
TsiChung

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] ColdFire patches

2008-01-16 Thread Liew Tsi Chung
Wolfgang,

Are all the ColdFire patches ok to commit?

Thanks.

Regards,
TsiChung


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] ColdFire patches

2008-01-16 Thread Liew Tsi Chung
Ben,

Are you referring to fecdma_initialize() in
drivers/net/fsl_mcdmafec.c and net/eth.c? If it is, the changes had
applied. You and I agreed on last email that renamed to
mcdmafec_initialize().

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

Regards,
TsiChung

-Original Message-
From: Ben Warren [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, January 16, 2008 3:50 PM
To: Liew Tsi Chung
Cc: [EMAIL PROTECTED]; U-Boot-Users; Rigby John
Subject: Re: [U-Boot-Users] ColdFire patches

Liew Tsi Chung wrote:
> Wolfgang,
>
>   Are all the ColdFire patches ok to commit?
>
>   Thanks.
>
> Regards,
> TsiChung
>
>
>   
Waiting for you to make the functions in the ethernet driver static.

regards,
Ben
> --
> --- This SF.net email is sponsored by: Microsoft Defy all challenges. 
> Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
> ___
> U-Boot-Users mailing list
> U-Boot-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/u-boot-users
>
>   


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] ColdFire patches

2008-01-16 Thread Liew Tsi Chung
Resend. Ignore the first patch. 

-Original Message-
From: Ben Warren [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, January 16, 2008 4:17 PM
To: Liew Tsi Chung
Cc: [EMAIL PROTECTED]; U-Boot-Users; Rigby John
Subject: Re: [U-Boot-Users] ColdFire patches

Liew Tsi Chung wrote:
> Ben,
>
>   Are you referring to fecdma_initialize() in 
> drivers/net/fsl_mcdmafec.c and net/eth.c? If it is, the changes had 
> applied. You and I agreed on last email that renamed to 
> mcdmafec_initialize().
>   
In the new file, drivers/net/fsl_mcdmafec.c, most of the functions, such as 
setFecDuplexSpeed(), fec_send() and so on, are private to the driver (i.e. have 
file scope), and should be declared as static to avoid name space confusion.

In addition, the function name setFecDuplexSpeed() goes against the coding 
standard.  It should be set_fec_duplex_speed().

regards,
Ben



-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] u-boot on M5275EVB?

2008-01-16 Thread Liew Tsi Chung
David,
 
> Also, can anyone tell me the differences between U-boot 1.1.6 and 
> 1.3.1?

There are many changes since 1.1.6. It is better start off the development from 
1.3.1 than from 1.1.6.
 
>Are you saying that I can use the exact same code for the M5275EVB 
> as the M5272C3?

After comparing 5272 and 5271, 5271 is the closest 5275. You cannot use exactly 
the same code base, a few modifies/adds code here and there.
 
> Changed this line in include/asm-m68k/immap.h: #ifdef
> CONFIG_M5272 to #ifdef CONFIG_M5272 || CONFIG_M5275 

#if defined(CONFIG_M5271) || defined(CONFIG_M5275)
 
> make[1]: Entering directory `/home/david/u-boot/cpu/mcf52x2' 
> start.S:61:43: error: operator '==' has no left operand

Did you add the code and accidently left out something?

Got the board today. Will probably look at it later.
 
Regards,
TsiChung

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] resend#3 [PATCH 6/8] ColdFire: Add MCF547x_8x FEC driver

2008-01-17 Thread Liew Tsi Chung
Ben,

> Right, so there's no need to mention them in C code. Less is 
> more, as they say.
Agree.

So, everything ok now?

Regards,
TsiChung

-Original Message-
From: Ben Warren [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 17, 2008 12:27 PM
To: Liew Tsi Chung
Cc: U-Boot-Users; Wolfgang Denx; Rigby John
Subject: Re: [U-Boot-Users] resend#3 [PATCH 6/8] ColdFire: Add
MCF547x_8x FEC driver

Liew Tsi Chung wrote:
> Ben,
>
>   The prototypes have place in include/asm-m68k/fsl_mcdmafec.h.
>
> Regards,
> TsiChung
>
>   
Right, so there's no need to mention them in C code. Less is more, as
they say.

regards,
Ben

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] FW: resend#4 [PATCH 6/8] ColdFire: Add MCF547x_8x FEC driver

2008-01-17 Thread Liew Tsi Chung
Ben,

> I haven't seen the patch that removes the prototypes, but it's 
> quite possible I looked past it. In a previous e-mail I added a
> 'signed-off-by' that John Rigby can add to the patch commit. I 
> consider this to be a Coldfire patch because it's dependent on 
> other patches in the series and I have no way of testing it.

Here is the one of the two copied from my email box, it will reach
u-boot-mailinglist later (not sure how long).

Regards,
TsiChung

-----Original Message-
From: Liew Tsi Chung 
Sent: Thursday, January 17, 2008 11:20 AM
To: U-Boot-Users
Cc: Wolfgang Denx; Rigby John; Liew Tsi Chung
Subject: resend#4 [PATCH 6/8] ColdFire: Add MCF547x_8x FEC driver

Signed-off-by: TsiChungLiew <[EMAIL PROTECTED]>
---
 drivers/net/Makefile   |1 +
 drivers/net/fsl_mcdmafec.c |  571

 net/eth.c  |4 +
 3 files changed, 576 insertions(+), 0 deletions(-)  create mode 100644
drivers/net/fsl_mcdmafec.c

diff --git a/drivers/net/Makefile b/drivers/net/Makefile index
41e1bde..b9723fa 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -33,6 +33,7 @@ COBJS-y += dm9000x.o
 COBJS-y += e1000.o
 COBJS-y += eepro100.o
 COBJS-y += enc28j60.o
+COBJS-y += fsl_mcdmafec.o
 COBJS-y += inca-ip_sw.o
 COBJS-y += ks8695eth.o
 COBJS-y += lan91c96.o
diff --git a/drivers/net/fsl_mcdmafec.c b/drivers/net/fsl_mcdmafec.c new
file mode 100644 index 000..38cf85b
--- /dev/null
+++ b/drivers/net/fsl_mcdmafec.c
@@ -0,0 +1,571 @@
+/*
+ * (C) Copyright 2000-2004
+ * Wolfgang Denk, DENX Software Engineering, [EMAIL PROTECTED]
+ *
+ * (C) Copyright 2007 Freescale Semiconductor, Inc.
+ * TsiChung Liew ([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 
+
+#ifdef CONFIG_FSLDMAFEC
+#undef ET_DEBUG
+#undef MII_DEBUG
+
+/* Ethernet Transmit and Receive Buffers */
+#define DBUF_LENGTH1520
+#define PKT_MAXBUF_SIZE1518
+#define PKT_MINBUF_SIZE64
+#define PKT_MAXBLR_SIZE1536
+#define LAST_PKTBUFSRX PKTBUFSRX - 1
+#define BD_ENET_RX_W_E (BD_ENET_RX_WRAP | BD_ENET_RX_EMPTY)
+#define BD_ENET_TX_RDY_LST (BD_ENET_TX_READY | BD_ENET_TX_LAST)
+#define FIFO_ERRSTAT   (FIFO_STAT_RXW | FIFO_STAT_UF |
FIFO_STAT_OF)
+
+/* RxBD bits definitions */
+#define BD_ENET_RX_ERR (BD_ENET_RX_LG | BD_ENET_RX_NO | BD_ENET_RX_CR |
\
+BD_ENET_RX_OV | BD_ENET_RX_TR)
+
+#if defined(CONFIG_CMD_NET) && defined(CONFIG_NET_MULTI) #include 
+ #include 
+
+#include "MCD_dma.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
+struct fec_info_dma fec_info[] = {
+#ifdef CFG_FEC0_IOBASE
+   {
+0, /* index */
+CFG_FEC0_IOBASE,   /* io base */
+CFG_FEC0_PINMUX,   /* gpio pin muxing */
+CFG_FEC0_MIIBASE,  /* mii base */
+-1,/* phy_addr */
+0, /* duplex and speed */
+0, /* phy name */
+0, /* phyname init */
+0, /* RX BD */
+0, /* TX BD */
+0, /* rx Index */
+0, /* tx Index */
+0, /* tx buffer */
+0, /* initialized flag */
+(struct fec_info_dma *)-1, /* next */
+FEC0_RX_TASK,  /* rxTask */
+FEC0_TX_TASK,  /* txTask */
+FEC0_RX_PRIORITY,  /* rxPri */
+FEC0_TX_PRIORITY,  /* txPri */
+FEC0_RX_INIT,  /* rxInit */
+FEC0_TX_INIT,  /* txInit */
+0, /* usedTbdIndex */
+0, /* cleanTbdNum */
+},
+#endif
+#ifdef CFG_FEC1_IOBASE
+   {
+1, /* index */
+CFG_FEC1_IOBASE,   /* io base */
+CFG_FEC1_PINMUX,   /* gpio pin muxing */
+CFG_FEC1_MIIBASE,  /* mii base */
+-1,/* phy_addr */
+0, /*

Re: [U-Boot-Users] resend#3 [PATCH 6/8] ColdFire: Add MCF547x_8x FEC driver

2008-01-17 Thread Liew Tsi Chung
Ben,

The prototypes have place in include/asm-m68k/fsl_mcdmafec.h.

Regards,
TsiChung 

-Original Message-
From: Ben Warren [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, January 16, 2008 8:33 PM
To: Liew Tsi Chung
Cc: U-Boot-Users; Wolfgang Denx; Rigby John
Subject: Re: [U-Boot-Users] resend#3 [PATCH 6/8] ColdFire: Add
MCF547x_8x FEC driver

Hi Tsi-Chung,

Tsi-Chung Liew wrote:

> +
> +static int fec_send(struct eth_device *dev, volatile void *packet, 
> +int length); static int fec_recv(struct eth_device *dev); static int 
> +fec_init(struct eth_device *dev, bd_t * bd); static void 
> +fec_halt(struct eth_device *dev);
>   
You don't need these prototypes.
> +extern int fecpin_setclear(struct eth_device *dev, int setclear);
> +
> +#ifdef CFG_DISCOVER_PHY
> +extern void mii_init(void);
> +extern uint mii_send(uint mii_cmd);
> +extern int mii_discover_phy(struct eth_device *dev); extern int 
> +mcffec_miiphy_read(char *devname, unsigned char addr,
> +   unsigned char reg, unsigned short *value);
extern int 
> +mcffec_miiphy_write(char *devname, unsigned char addr,
> +unsigned char reg, unsigned short value);
#endif
>   
There's no need to #ifdef prototypes, and the extern'ed ones are in
header files that you've included (or should be).

Since this patch relies on others in the series, it doesn' t make sense
for me to apply it.

John, if the code compiles fine with these removed, please add this to
the patch and apply:

Signed-off-by: Ben Warren <[EMAIL PROTECTED]>

Thanks very much for your contribution, Tsi-Chung.

regards,
Ben

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH] ColdFire: Add MCF5275 cpu and M5275EVB support.

2008-01-17 Thread Liew Tsi Chung
Matthew 

Do you test FEC, Timer and Flash work on this patch?

Regards,
TsiChung
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] M5282EVB compilation errors

2008-01-23 Thread Liew Tsi Chung
Marco,

> I'm trying to build u-boot-1.1.6 for ColdFire 5282 but I face to 
> the following error ( using gcc version 2.95.3 20010315 m68k-elf-
> tools-20031003.sh )

Your compiler is out-of-date, please goto
http://www.codesourcery.com/gnu_toolchains/coldfire/download.html to
download the latest compiler.


> Seems that everybody use dBUG+CoLilo with this cpu, so I wonder 
> if it is u-boot-1.1.6 for ColdFire 5282 a good choice because I'd 
> like to use it.

No. Please use the latest u-boot version. There are many changes since
then.

Thanks.

Regards,
TsiChung

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH] ColdFire: Added M5275EVB support.

2008-01-23 Thread Liew Tsi Chung
David,
 
Matthew's patch is based of commit f18889c2f1... Jan 17 09:35:26 2008 +0100 
Merge branch 'master' of git+ssh://10.10.0.7/home/wd/git/u-boot/master. When 
you cloned the latest as today, there are dozen of patches since then, so the 
patches show errors when you applied.
 
First, you create a new branch based of master if you use the main stream 
branch. git-branch newbranch master. Change your branch to newbranch. 
git-checkout newbranch. Reset to the commit mentioned above. git-reset --hard 
f18889c2f1... Update the two patches from Matthew (Make sure no unwrap text and 
unix file format) git-apply --whitespace=strip patch. Use git-add to apply all 
the new files just added, then temporary create a commit git-commit (Otherwise, 
rebase won't work). To merge with updated u-boot. git-rebase master newbranch. 
There maybe other methods to apply the patch, but this is the method I used so 
far.
 
Hope this help.
 
Regards,
TsiChung
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] M5282EVB compilation errors

2008-01-23 Thread Liew Tsi Chung
Marco, 

> I have again errors.
> Which u-boot and m68k-uclinux version are you using ?

> start.S: Assembler messages:
> start.S:171: Error: operands mismatch -- statement `movec
%d0,%RAMBAR0' 

Can you edit the start.S @ 171 and rename from 0 to 1? That should take
care the error.

Regards,
TsiChung

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH] ColdFire: Added M5275EVB support.

2008-01-24 Thread Liew Tsi Chung
David,
 
Make sure your patch is wrap text when you export or save as from email. 
Aso, make sure your patches do not contain (CR+LF) newlines.
 
unwrap text in your patch:
...
8 files changed, 849 insertions(+), 0 deletions(-)  create mode 100644 
board/freescale/m5275evb/Makefile  create mode 100644 
board/freescale/m5275evb/config.mk
 create mode 100644 board/freescale/m5275evb/m5275evb.c
 create mode 100644 board/freescale/m5275evb/mii.c  create mode 100644 
board/freescale/m5275evb/u-boot.lds
 create mode 100644 include/configs/M5275EVB.h
...

wrap text in your patch:
...
 8 files changed, 849 insertions(+), 0 deletions(-)
 create mode 100644 board/freescale/m5275evb/Makefile
 create mode 100644 board/freescale/m5275evb/config.mk
 create mode 100644 board/freescale/m5275evb/m5275evb.c
 create mode 100644 board/freescale/m5275evb/mii.c
 create mode 100644 board/freescale/m5275evb/u-boot.lds
 create mode 100644 include/configs/M5275EVB.h
...

Regards,
TsiChung

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH] ColdFire: Added M5275EVB support.

2008-01-25 Thread Liew Tsi Chung
David,
 
After you applied the 5275 patches, did you perform a git rebase? One 
ColdFire patch "Fix CFI Flash low level Read/Write macro" is required. The 
original macros have address and value swap, and it will cause exception 
whenever there is a CFI flash low level read/write performs.

Your current branch set to patched. Use "git-rebase master patched" to 
update the patches from master branch (after 
f188896c2f1594fe749fdb99bbc8c54023cfab3a) to patched branch.

Regards,
TsiChung

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH] ColdFire: Added M5275EVB support.

2008-01-28 Thread Liew Tsi Chung
Matthew,

I spotted a few issues:

1. in cpu/mcf52x2/interrupt.c should be
imlr0 &= 0xFFFE;

2. in include/asm-m68k/immap.h CFG_TMRINTR_PRI should set to
0x1E for timer interrupt to work probably.
#define CFG_TMRINTR_PRI (0x1E)

3. in board/freescale/m5275evb/u-boot.lds, this will take care
the environment problem. When the . = DEFINED(env_offset) ? env_offset :
.; is commented, u-boot does not know where to retrieve the env data
from flash; therefore, it always shows bad CRC when booting.

cpu/mcf52x2/start.o (.text)
common/dlmalloc.o   (.text)
lib_generic/string.o(.text)
ilb_generic/zlib.o  (.text)

. = DEFINED(env_offset) ? env_offset : .;
common/environment.o(.text)

Regards,
TsiChung

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH] Use #ifdef CONFIG_FSLDMAFEC

2008-01-30 Thread Liew Tsi Chung
Vlad,

Thanks. I will apply the patch.

Regards,
TsiChung 

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH] ColdFire: Fix missing code flash sizefor M5485EVB

2008-02-04 Thread Liew Tsi Chung
Luigi,

Is the problem you encountered after you implemented the "Move
PPC and M68K ramdiskloading to a common routine" patch or before?

Regards,
TsiChung
 

-Original Message-
From: Luigi 'Comio' Mantellini [mailto:[EMAIL PROTECTED] 
Sent: Monday, February 04, 2008 5:04 PM
To: Liew Tsi Chung
Cc: U-Boot-Users; Wolfgang Denx; Rigby John; Mahan James
Subject: Re: [U-Boot-Users] [PATCH] ColdFire: Fix missing code flash
sizefor M5485EVB

Hi u-boot ml,
Hi Tsi Chung Liew,

I have the following error compiling the M5475xxx targets:

[code]
make[1]: Leaving directory `/mnt/devel/idf/u-boot/common'
make -C libfdt/
make[1]: Entering directory `/mnt/devel/idf/u-boot/libfdt'
m68k-elf-ar crv libfdt.a
make[1]: Leaving directory `/mnt/devel/idf/u-boot/libfdt'
UNDEF_SYM=`m68k-elf-objdump -x lib_generic/libgeneric.a
board/freescale/common/libfreescale.a
board/freescale/m547xevb/libm547xevb.a cpu/mcf547x_8x/libmcf547x_8x.a
lib_m68k/libm68k.a fs/cramfs/libcramfs.a fs/fat/libfat.a
fs/fdos/libfdos.a fs/jffs2/libjffs2.a fs/reiserfs/libreiserfs.a
fs/ext2/libext2fs.a net/libnet.a disk/libdisk.a
drivers/bios_emulator/libatibiosemu.a drivers/block/libblock.a
drivers/dma/libdma.a drivers/hwmon/libhwmon.a drivers/i2c/libi2c.a
drivers/input/libinput.a drivers/misc/libmisc.a drivers/mtd/libmtd.a
drivers/mtd/nand/libnand.a drivers/mtd/nand_legacy/libnand_legacy.a
drivers/mtd/onenand/libonenand.a drivers/net/libnet.a
drivers/net/sk98lin/libsk98lin.a drivers/pci/libpci.a
drivers/pcmcia/libpcmcia.a drivers/spi/libspi.a drivers/rtc/librtc.a
drivers/serial/libserial.a drivers/usb/libusb.a drivers/video/libvideo.a
post/libpost.a post/drivers/libpostdrivers.a common/libcommon.a
libfdt/libfdt.a |sed  -n -e 's/.*\(__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;
\
cd /mnt/devel/idf/u-boot && m68k-elf-ld -Bstatic -T
/mnt/devel/idf/u-boot/board/freescale/m547xevb/u-boot.lds -Ttext
0xFF80  -n $UNDEF_SYM cpu/mcf547x_8x/start.o \ 
--start-group lib_generic/libgeneric.a
board/freescale/common/libfreescale.a
board/freescale/m547xevb/libm547xevb.a cpu/mcf547x_8x/libmcf547x_8x.a
lib_m68k/libm68k.a fs/cramfs/libcramfs.a fs/fat/libfat.a
fs/fdos/libfdos.a fs/jffs2/libjffs2.a fs/reiserfs/libreiserfs.a
fs/ext2/libext2fs.a net/libnet.a disk/libdisk.a
drivers/bios_emulator/libatibiosemu.a drivers/block/libblock.a
drivers/dma/libdma.a drivers/hwmon/libhwmon.a drivers/i2c/libi2c.a
drivers/input/libinput.a drivers/misc/libmisc.a drivers/mtd/libmtd.a
drivers/mtd/nand/libnand.a drivers/mtd/nand_legacy/libnand_legacy.a
drivers/mtd/onenand/libonenand.a drivers/net/libnet.a
drivers/net/sk98lin/libsk98lin.a drivers/pci/libpci.a
drivers/pcmcia/libpcmcia.a drivers/spi/libspi.a drivers/rtc/librtc.a
drivers/serial/libserial.a drivers/usb/libusb.a drivers/video/libvideo.a
post/libpost.a post/drivers/libpostdrivers.a common/libcommon.a
libfdt/libfdt.a --end-group -L /usr/local/lib/gcc/m68k-uclinux/4.1.1
-lgcc \
-Map u-boot.map -o u-boot
common/libcommon.a(cmd_bootm.o): In function `do_bootm_vxworks':
/mnt/devel/idf/u-boot/common/cmd_bootm.c:1622: undefined reference to
`do_bootvx'
common/libcommon.a(cmd_bootm.o): In function `do_bootm_qnxelf':
/mnt/devel/idf/u-boot/common/cmd_bootm.c:1636: undefined reference to
`do_bootelf'
common/libcommon.a(env_flash.o): In function `saveenv':
/mnt/devel/idf/u-boot/common/env_flash.c:312: undefined reference to
`flash_sect_protect'
/mnt/devel/idf/u-boot/common/env_flash.c:316: undefined reference to
`flash_sect_erase'
/mnt/devel/idf/u-boot/common/env_flash.c:329: undefined reference to
`flash_sect_protect'
make: *** [u-boot] Error 1
[/code]

I fixed the error modifying the common/Makefile:
...
-COBJS-$(CONFIG_CMD_ELF) += cmd_elf.o
+COBJS-y += cmd_elf.o
...
-COBJS-$(CONFIG_CMD_FLASH) += cmd_flash.o
+COBJS-y += cmd_flash.o
...

forcing the compiling (and linking) of the cmd_flash.c and cmd_elf.c
files.

I also noticed that the targets that define CFG_DRAMSZ1 cannot compile
because a "temp" variabile is used but not declared in the m547xevb.c
file.

Best regards,

luigi

Il giorno mer, 30/01/2008 alle 15.11 -0600, Tsi-Chung Liew ha scritto:
> From: TsiChungLiew <[EMAIL PROTECTED]>
> 
> Signed-off-by: James Mahan <[EMAIL PROTECTED]>
> Signed-off-by: TsiChung Liew <[EMAIL PROTECTED]>
> ---
>  Makefile |2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 0f6cc59..30fda62 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1912,7 +1912,7 @@ M5485HFE_config :   unconfig
>   M5485EFE_config)
BOOT=2;CODE=0;VID=1;USB=1;RAM=64;RAM1=0;; \
>   M5485FFE_config)
BOOT=2;CODE=32;VID=1;USB=1;RAM=64;RAM1=64;; \
>   M5485GFE_config)
BOOT=4;CODE=0;VID=0;USB=0;RAM=64;RAM1=0;; \
> - M5485HFE_config)BOOT=2;CODE=;VID=1;USB=0;RAM=64;RAM1=0;;
\
&g

Re: [U-Boot-Users] [PATCH] Add support CONFIG_PCIAUTO_SKIP_HOST_BRIDGE in pci_auto.c

2008-03-19 Thread Liew Tsi Chung
I will change it at the later patch with three CF EVBs.

Regards,
TsiChung 

-Original Message-
From: Stefan Roese [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 19, 2008 3:34 AM
To: u-boot-users@lists.sourceforge.net
Cc: Jean-Christophe PLAGNIOL-VILLARD; Liew Tsi Chung; Wolfgang Denx;
Rigby John
Subject: Re: [U-Boot-Users] [PATCH] Add support
CONFIG_PCIAUTO_SKIP_HOST_BRIDGE in pci_auto.c

On Wednesday 19 March 2008, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > diff --git a/drivers/pci/pci_auto.c b/drivers/pci/pci_auto.c index 
> > acfda83..1085a6c 100644
> > --- a/drivers/pci/pci_auto.c
> > +++ b/drivers/pci/pci_auto.c
> > @@ -383,7 +383,7 @@ int pciauto_config_device(struct pci_controller 
> > *hose, pci_dev_t dev) hose->current_busno++;
> > break;
> >
> > -#ifdef CONFIG_MPC5200
> > +#if defined(CONFIG_MPC5200) || 
> > +defined(CONFIG_PCIAUTO_SKIP_HOST_BRIDGE)
>
> I think that you can remove the CONFIG_MPC5200 and define it in the 
> configs of the boards

That would be the optimal version of course.

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]
=

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH] Add brackets to if condition in tools/setlocalversion

2008-03-24 Thread Liew Tsi Chung
Wolfgang,

Please ignore "Add brackets to if condition in
tools/setlocalversion" patch.

The u-boot for ColdFire was able to build prior to version
1.3.2. Until, I merged the local with the latest update. Whenever I
tried to build a u-boot for any ColdFire platforms, the error message
always end up in start.S

*** cpu/mcf5445x/start.s ***
.global version_string
Version_string:
.ascii U_BOOT_VERSION   ln 378
.ascii " (", __DATE__, " - ", __TIME__, ")" ln 379
.ascii CONFIG_IDENT_STRING, "\0"ln 380 (EOF)

*** error message ***
start.S: Assembler messages:
start.S:380 Error: unaligned opcodes detected in executable segment
make[1]: *** [start.o] Error 1
make[1]: Leaving directory '...'

I reversed the patches from HEAD and found out it was the change
in tools/setlocalversion. My first assumption was focused on the
setlocalversion and by adding brackets to it solved the compiling error.
I have not found out the actual cause of the issue yet. For the time
being, please leave it be until I provide the update later.

Thanks.

Regards,
TsiChung



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 20, 2008 7:25 PM
To: Liew Tsi Chung
Cc: U-Boot-Users; Rigby John
Subject: Re: [PATCH] Add brackets to if condition in
tools/setlocalversion

In message
<[EMAIL PROTECTED]> you
wrote:
> The long condition in the script causes all ColdFire platforms unable 
> to compile correctly. By adding square brackets, all compile without 
> error.
> 
> Signed-off-by: TsiChung Liew <[EMAIL PROTECTED]>
> ---
>  tools/setlocalversion |4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/setlocalversion b/tools/setlocalversion index 
> 9bbdafd..2c27291 100755
> --- a/tools/setlocalversion
> +++ b/tools/setlocalversion
> @@ -11,8 +11,8 @@ cd "${1:-.}" || usage  # Check for git and a git 
> repo.
>  if head=`git rev-parse --verify HEAD 2>/dev/null`; then
>   # Do we have an untagged version?
> - if git name-rev --tags HEAD | \
> -grep -E '^HEAD[[:space:]]+(.*~[0-9]*|undefined)$' >
/dev/null; then
> + if [git name-rev --tags HEAD | \
> +grep -E '^HEAD[[:space:]]+(.*~[0-9]*|undefined)$' >
/dev/null]; 
> +then
>   git describe | awk -F- '{printf("-%05d-%s",
$(NF-1),$(NF))}'
>   fi

Ummm... what exactly has this code, which is running natively in the
shell on your development host, to do with a ColdFire cross-compile?

Note that the very same code is used in the Linux kernel.

If this code doesn't work for you, you also cannot compile any recent
Linux kernel code?

Also, I don't understand what you do.

Unless you can provide a really good explanation why that should be
needed I will reject this patch.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [EMAIL PROTECTED]
Computers are not intelligent.  They only think they are.

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH] Add brackets to if condition in tools/setlocalversion

2008-03-24 Thread Liew Tsi Chung
John,

Fedora 3 and Fedora 8, both are using bash.

Regards,
TsiChung

-Original Message-
From: Rigby John 
Sent: Monday, March 24, 2008 2:48 PM
To: Liew Tsi Chung
Cc: [EMAIL PROTECTED]; U-Boot-Users
Subject: Re: [PATCH] Add brackets to if condition in
tools/setlocalversion

What distro are you running?  Some use dash for /bin/sh instead of bash.
That may be your problem.

Liew Tsi Chung wrote:
> Wolfgang,
>
>   Please ignore "Add brackets to if condition in
tools/setlocalversion" 
> patch.
>
>   The u-boot for ColdFire was able to build prior to version
1.3.2. 
> Until, I merged the local with the latest update. Whenever I tried to 
> build a u-boot for any ColdFire platforms, the error message always 
> end up in start.S
>
> *** cpu/mcf5445x/start.s ***
>   .global version_string
> Version_string:
>   .ascii U_BOOT_VERSION   ln 378
>   .ascii " (", __DATE__, " - ", __TIME__, ")" ln 379
>   .ascii CONFIG_IDENT_STRING, "\0"ln 380 (EOF)
>
> *** error message ***
> start.S: Assembler messages:
> start.S:380 Error: unaligned opcodes detected in executable segment
> make[1]: *** [start.o] Error 1
> make[1]: Leaving directory '...'
>
>   I reversed the patches from HEAD and found out it was the change
in 
> tools/setlocalversion. My first assumption was focused on the 
> setlocalversion and by adding brackets to it solved the compiling
error.
> I have not found out the actual cause of the issue yet. For the time 
> being, please leave it be until I provide the update later.
>
>   Thanks.
>
> Regards,
> TsiChung
>
>
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Thursday, March 20, 2008 7:25 PM
> To: Liew Tsi Chung
> Cc: U-Boot-Users; Rigby John
> Subject: Re: [PATCH] Add brackets to if condition in 
> tools/setlocalversion
>
> In message
> <[EMAIL PROTECTED]> you
> wrote:
>   
>> The long condition in the script causes all ColdFire platforms unable

>> to compile correctly. By adding square brackets, all compile without 
>> error.
>>
>> Signed-off-by: TsiChung Liew <[EMAIL PROTECTED]>
>> ---
>>  tools/setlocalversion |4 ++--
>>  1 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/tools/setlocalversion b/tools/setlocalversion index
>> 9bbdafd..2c27291 100755
>> --- a/tools/setlocalversion
>> +++ b/tools/setlocalversion
>> @@ -11,8 +11,8 @@ cd "${1:-.}" || usage  # Check for git and a git 
>> repo.
>>  if head=`git rev-parse --verify HEAD 2>/dev/null`; then
>>  # Do we have an untagged version?
>> -if git name-rev --tags HEAD | \
>> -   grep -E '^HEAD[[:space:]]+(.*~[0-9]*|undefined)$' >
>> 
> /dev/null; then
>   
>> +if [git name-rev --tags HEAD | \
>> +   grep -E '^HEAD[[:space:]]+(.*~[0-9]*|undefined)$' >
>> 
> /dev/null];
>   
>> +then
>>  git describe | awk -F- '{printf("-%05d-%s",
>> 
> $(NF-1),$(NF))}'
>   
>>  fi
>> 
>
> Ummm... what exactly has this code, which is running natively in the 
> shell on your development host, to do with a ColdFire cross-compile?
>
> Note that the very same code is used in the Linux kernel.
>
> If this code doesn't work for you, you also cannot compile any recent 
> Linux kernel code?
>
> Also, I don't understand what you do.
>
> Unless you can provide a really good explanation why that should be 
> needed I will reject this patch.
>
> Best regards,
>
> Wolfgang Denk
>
>   


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH] Add support for setting the I2C bus speed in fsl_i2c.c

2008-03-27 Thread Liew Tsi Chung
547x/548x are not the only ColdFire affected, 5235, 5373, 5275, 5329,
54455, 52277, and 5271 are required to update as well. 

-Original Message-
From: Tabi Timur 
Sent: Thursday, March 27, 2008 9:46 AM
To: Luigi 'Comio' Mantellini
Cc: U-boot-Users; Liew Tsi Chung
Subject: Re: [U-Boot-Users] [PATCH] Add support for setting the I2C bus
speed in fsl_i2c.c

Luigi 'Comio' Mantellini wrote:
> This patch should resolve the compilation issues on 547x/548x cpus.

Sorry, I didn't even think to check for anything outside of PowerPC.  I
had no idea m68k used fsl_i2c.c.

> @@ -47,6 +47,9 @@ typedef struct  global_data {
>   unsigned long   vco_clk;
>   unsigned long   flb_clk;
>  #endif
> +#ifdef CONFIG_MCF547x_8x
> + u32 i2c1_clk;
> +#endif
>   unsigned long   ram_size;   /* RAM size */
>   unsigned long   reloc_off;  /* Relocation Offset */
>   unsigned long   reset_status;   /* reset status register at boot
*/

I suggest that you get rid of the #ifdef and always define i2c1_clk.
The value will be set to 0 on systems that don't have an I2C.  I'm
planning on submitting patches to asm-ppc/global_data.h to get rid of a
bunch of #ifdefs because it's getting too messy.

Either way, I ACK this patch.

--
Timur Tabi
Linux kernel developer at Freescale

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH] Add support for setting the I2C bus speed in fsl_i2c.c

2008-03-27 Thread Liew Tsi Chung
Yes. Thanks.

Regards,
TsiChung 

-Original Message-
From: Tabi Timur 
Sent: Thursday, March 27, 2008 12:51 PM
To: Liew Tsi Chung
Cc: Luigi 'Comio' Mantellini; U-boot-Users
Subject: Re: [U-Boot-Users] [PATCH] Add support for setting the I2C bus
speed in fsl_i2c.c

Liew Tsi Chung wrote:
> 547x/548x are not the only ColdFire affected, 5235, 5373, 5275, 5329, 
> 54455, 52277, and 5271 are required to update as well.

Then how about doing this:

--- a/include/asm-m68k/global_data.h
+++ b/include/asm-m68k/global_data.h
@@ -47,6 +47,9 @@ typedef   struct  global_data {
unsigned long   vco_clk;
unsigned long   flb_clk;
 #endif
+#ifdef CONFIG_FSL_I2C
+   u32 i2c1_clk;
+#endif
unsigned long   ram_size;   /* RAM size */
unsigned long   reloc_off;  /* Relocation Offset */
unsigned long   reset_status;   /* reset status register at boot


--
Timur Tabi
Linux kernel developer at Freescale

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH] ColdFire: Assign version_string as data section in start.S

2008-03-27 Thread Liew Tsi Chung
Wolfgang, 

In message
<[EMAIL PROTECTED]> you
wrote:
>> The compiler does not place the .ascii in start.S to data section, 
>> instead it put in under text section. This is an issue where it

> This is intentional on most architectures. What exactly is your
> problem?

Apparently, it is not the case in ColdFire compilers. The ColdFire
compilers always put the version_string in text section if .data is not
declared and shows build error in start.S - "unaligned opcodes detected
in executable segment". The PowerPC compiler, however, will put the
version_string in data section either with or without .data declared.

Unfortunately, I did not catch the error in the previous release (1.3.0
- 1.3.2), and probably based on luck that the u-boot version, date and
time information was always 4-byte align when I retrieved and worked on
the source. Until now, the version, date and time information was not
4-byte align. I agreed with you on previous email after I submitted the
patch "Add brackets to if condition in tools/setlocalversion", there is
nothing wrong with the Linux script.

>> never gets notice and causes error until an update for 
>> tools/setlocalversion has been applied. A label of .data before
.globl 
>> version_string will force to put under data section.

> Can you please explain which exact bug this is supposed to fix?

I am going to re-state the patch to "Fix build error generates by CF
compilers for all CF CPUs" or "Fix version_string not in data section
generates by CF compilers". Will either one of these works for you?

Regards,
TsiChung

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH] ColdFire: Assign version_string as data section in start.S

2008-03-27 Thread Liew Tsi Chung
Wolfgang,

> Maybe just adding some ".align" directive helps?

The example provided for 8xx or others, there is an offset alignment
after CONFIG_IDENT_STRING - ". = EXC_OFF_SYS_RESET". In fact, it works
after adding ".align 4" after CONFIG_IDENT_STRING.

Thanks.

Regards,
TsiChung

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH] Update CONFIG_PCIAUTO_SKIP_HOST_BRIDGE to related boards

2008-03-28 Thread Liew Tsi Chung
Wolfgang, 

> Um... You would have to add CONFIG_PCIAUTO_SKIP_HOST_BRIDGE to *all*
> board configurations that are based on a MPC5200 CPU, not just the
> small selection above.

Even the MPC52xx base boards do not have CONFIG_PCI and CONFIG_CMD_PCI
included in board configuration file? There are quite a few board
configuration files that do not have them included.

The selection was only targeting the configuration files that have
CONFIG_CMD_PCI and CONFIG_PCI included. The current patch only missed 1
- IceCube.h configuration file, and I will fix that in the next patch.

Let me know what is your decision; however, I still do not see the need
adding CONFIG_PCIAUTO_SKIP_HOST_BRIDGE to MPC5200 base boards that are
not supporting PCI.

Thanks.

Regards,
TsiChung

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] "huge" (6 second) delay when booting linuxkernel (coldfire)

2008-04-08 Thread Liew Tsi Chung
Wolfgang,

I'm glad that you found the problem.

> Booting works fast as it should. (This new CFG_BOOTMAPSZ came from
M5329EVB.h).
It must have been the early work that I did not change to use the new
CFG_BOOTMAPSZ. Now, the current repository has the new CFG_BOOTMAPSZ.

Regards,
TsiChung

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: Friday, April 04, 2008 3:03 AM
To: u-boot-users@lists.sourceforge.net
Subject: Re: [U-Boot-Users] "huge" (6 second) delay when booting
linuxkernel (coldfire)

On 4 Apr 2008 at 8:36, [EMAIL PROTECTED] wrote:

> Hi,
> 
> On 4 Apr 2008 at 8:13, [EMAIL PROTECTED] wrote:
> 
> > Hi,
> > 
> > I have a problem on startup on my Coldfire MCF5373L board.
> > 
> > When the flash is empty, something before booting the linux kernel 
> > takes too long such that the watchdog resets my board before there 
> > is a chance for the kernel to take over control.
> 
> with some more puts() I found there is around 4 second delay in this 
> line of do_bootm_linux() in lib_m68k/m68k_linux.c:
> 
>   cmd_end = cmd_start + strlen(cmdline);

Found the problem.

It was a wrong CFG_BOOTMAPSZ, seems to have been a relic from my very
first try in porting to MCF53xx. With the correct line:

#define CFG_BOOTMAPSZ   (CFG_SDRAM_BASE + (CFG_SDRAM_SIZE <<
20))

Booting works fast as it should. (This new CFG_BOOTMAPSZ came from
M5329EVB.h).

Regards,
Wolfgang

-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Register now and save $200. Hurry, offer ends at 11:59 p.m., 
Monday, April 7! Use priority code J8TLD2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] reg to configure DSPI in mcf54455

2008-04-11 Thread Liew Tsi Chung
Karthik,
 
The current M5445EVB U-boot has the DSPI support be part of the flash
utility in board/freescale/m54455evb/flash.c, since the serial flash in
54455EVB is flash alike. The only feature that it can't perform is read
back from the flash. I have not implemented the DSPI be part of the SPI
and EEPROM utility. The SPI EEPROM might have a conflict if MCF5445x has
I2C EEPROM support at the same time.

To implement the SPI (CONFIG_SPI) feature, provide spi_init_f(),
spi_init_r(), spi_init(), spi_read(), spi_write(), and spi_xfer() in
cpu/mcf5445x/dspi.c. Also, provide spi_eeprom_chipsel() and
spi_chipsel[] in board/5445x/m5445xevb.

Regards,
TsiChung

-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH] ColdFire: Get information from the correct GCC

2008-05-01 Thread Liew Tsi Chung
Shinya 

>>  PLATFORM_RELFLAGS += -ffixed-d7 -msep-data -ifeq ($(findstring 
>> 4.2,$(shell $(CC) --version)),4.2)
>> +ifeq ($(findstring 4.2,$(shell $(CROSS_COMPILE)gcc --version)),4.2)
>>  PLATFORM_CPPFLAGS += -mcpu=5208 -fPIC  else  PLATFORM_CPPFLAGS += 
>> -m5307 -fPIC

> Let me make sure the intention of this change. With or without this
change,
> we can always evaluate $(CROSS_COMPILE)gcc --version, right?
> Or am I missing something?
Yes, we can always evaluate $(CROSS_COMPILE)gcc --version, but not
$(CC)gcc --version. The changed was from $(CC) to $(CROSS_COMPILE). This
issue does not affect if compiler version is 4.1-xx and using Fedora 3
and above, and compiler version is 4.2-xx and using only Fedora 3. But,
it will show compiling error if compiler version is 4.2-xx and using
Fedora 4 and above.

The information will retrieve correctly from GCC when compiling the
source code to object code. Until, when it starts linking the all the
libs and objs, it retrieves the incorrect information from GCC and
select the other PLATFORM_CPPFLAGS and causing linking errors.

>
> There are several $(CC)/$(AR)/$(AS)/$(CPP) users in cpu/*/Makefile &
cpu/*/config.mk.
> I'm wondering whether we need to fix all these usages or not.
No. Only in cpu/*/config.mk with ifeq (condition) PLATFORM_CPPFLAGS +=
... else PLATFORM_CPPFLAGS += ...

Regards,
TsiChung

-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH] ColdFire: Get information from the correct GCC

2008-05-02 Thread Liew Tsi Chung
Wolfgang, 

> Stop! We are not talking about "$(CC)gcc"!
>
> The change was this:
>
> -ifeq ($(findstring 4.2,$(shell $(CC) --version)),4.2)
> +ifeq ($(findstring 4.2,$(shell $(CROSS_COMPILE)gcc --version)),4.2)
>
> And ``$(CC)'' and ``$(CROSS_COMPILE)gcc'' should be really the same
here.
Sorry for the confusion, and yes both $(CC) and $(CROSS_COMPILE)gcc are
the same. It is unsolvable behavior in ifeq (...) where $(shell $(CC)
--version) does not match 4.2 and caused linking error.

Original:
ifeq ($(findstring 4.2,$(shell $(CC) --version)),4.2)
PLATFORM_CPPFLAGS += -mcpu=54455 -fPIC
else
PLATFORM_CPPFLAGS += -m5407 -fPIC
endif

As you can see below captured, -mcpu=54455 was selected in compiling
when gcc version is 4.2. When it comes to linking, the $(shell $(CC)
--version) becomes other value and select the -m5407 option with
different libgcc.

/snip
...
/opt/freescale/usr/local/gcc-4.2.47-uclibc-0.9.47/m68k-uclinux/bin/m68k-
uclinux-gcc -g  -Os   -ffixed-d7 -msep-data -D__KERNEL__
-DTEXT_BASE=0x0400 -I/proj/u-boot/uboot133/u-boot-test/include
-fno-builtin -ffreestanding -nostdinc -isystem
/opt/freescale/usr/local/gcc-4.2.47-uclibc-0.9.47/m68k-uclinux/lib/gcc/m
68k-uclinux/4.2.1/include -pipe  -DCONFIG_M68K -D__M68K__ -Wa,
-mcpu=54455 -fPIC -DTEXT_BASE=0x0400 -Wall -Wstrict-prototypes -c -o
cmd_mac.o cmd_mac.c
/opt/freescale/usr/local/gcc-4.2.47-uclibc-0.9.47/m68k-uclinux/bin/m68k-
uclinux-ar crv libcommon.a main.o ACEX1K.o altera.o bedbug.o circbuf.o
cmd_autoscript.o cmd_bdinfo.o image.o gunzip.o cmd_boot.o cmd_bootm.o
cmd_cache.o cmd_console.o cmd_date.o cmd_eeprom.o cmd_elf.o cmd_ext2.o
cmd_fat.o cmd_fdc.o cmd_flash.o cmd_i2c.o cmd_ide.o cmd_itest.o
cmd_jffs2.o cmd_load.o cmd_mem.o cmd_mii.o cmd_misc.o cmd_nand.o
cmd_net.o cmd_nvedit.o cmd_onenand.o cmd_pcmcia.o cmd_reginfo.o
cmd_ximg.o cmd_vfd.o command.o console.o cyclon2.o stratixII.o devices.o
dlmalloc.o docecc.o environment.o env_common.o env_nand.o
env_dataflash.o env_flash.o env_eeprom.o env_onenand.o env_nvram.o
env_nowhere.o exports.o flash.o fpga.o ft_build.o hush.o kgdb.o lcd.o
lists.o lynxkdi.o memsize.o miiphybb.o miiphyutil.o s_record.o serial.o
soft_i2c.o soft_spi.o spartan2.o spartan3.o usb.o usb_kbd.o
usb_storage.o virtex2.o xilinx.o crc16.o xyzModem.o cmd_mac.o
a - main.o
a - ACEX1K.o
...
a - cmd_mac.o
make[1]: Leaving directory `/proj/u-boot/uboot133/u-boot-test/common'
make -C libfdt/
make[1]: Entering directory `/proj/u-boot/uboot133/u-boot-test/libfdt'
/opt/freescale/usr/local/gcc-4.2.47-uclibc-0.9.47/m68k-uclinux/bin/m68k-
uclinux-ar crv libfdt.a 
make[1]: Leaving directory `/proj/u-boot/uboot133/u-boot-test/libfdt'
make -C api/
make[1]: Entering directory `/proj/u-boot/uboot133/u-boot-test/api'
/opt/freescale/usr/local/gcc-4.2.47-uclibc-0.9.47/m68k-uclinux/bin/m68k-
uclinux-ar crv libapi.a 
make[1]: Leaving directory `/proj/u-boot/uboot133/u-boot-test/api'
make -C post/
make[1]: Entering directory `/proj/u-boot/uboot133/u-boot-test/post'
(echo create libpost.a; for lib in   ; \
 do echo addlib $lib; done; echo save) \
|
/opt/freescale/usr/local/gcc-4.2.47-uclibc-0.9.47/m68k-uclinux/bin/m68k-
uclinux-ar -M
make[1]: Leaving directory `/proj/u-boot/uboot133/u-boot-test/post'
make -C /proj/u-boot/uboot133/u-boot-test/board/freescale/m54455evb/
u-boot.lds
make[1]: Entering directory
`/proj/u-boot/uboot133/u-boot-test/board/freescale/m54455evb'
make[1]: Nothing to be done for `u-boot.lds'.
make[1]: Leaving directory
`/proj/u-boot/uboot133/u-boot-test/board/freescale/m54455evb'
UNDEF_SYM=`/opt/freescale/usr/local/gcc-4.2.47-uclibc-0.9.47/m68k-uclinu
x/bin/m68k-uclinux-objdump -x lib_generic/libgeneric.a
board/freescale/common/libfreescale.a
board/freescale/m54455evb/libm54455evb.a cpu/mcf5445x/libmcf5445x.a
lib_m68k/libm68k.a fs/cramfs/libcramfs.a fs/fat/libfat.a
fs/fdos/libfdos.a fs/jffs2/libjffs2.a fs/reiserfs/libreiserfs.a
fs/ext2/libext2fs.a net/libnet.a disk/libdisk.a
drivers/bios_emulator/libatibiosemu.a drivers/block/libblock.a
drivers/dma/libdma.a drivers/hwmon/libhwmon.a drivers/i2c/libi2c.a
drivers/input/libinput.a drivers/misc/libmisc.a drivers/mtd/libmtd.a
drivers/mtd/nand/libnand.a drivers/mtd/nand_legacy/libnand_legacy.a
drivers/mtd/onenand/libonenand.a drivers/net/libnet.a
drivers/net/sk98lin/libsk98lin.a drivers/pci/libpci.a
drivers/pcmcia/libpcmcia.a drivers/spi/libspi.a drivers/rtc/librtc.a
drivers/serial/libserial.a drivers/usb/libusb.a drivers/video/libvideo.a
common/libcommon.a libfdt/libfdt.a api/libapi.a post/libpost.a |sed  -n
-e 's/.*\(__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
cd /proj/u-boot/uboot133/u-boot-test &&
/opt/freescale/usr/local/gcc-4.2.47-uclibc-0.9.47/m68k-uclinux/bin/m68k-
uclinux-ld -Bstatic -T
/proj/u-boot/uboot133/u-boot-test/board/freescale/m54455evb/u-boot.lds
-n -Ttext 0x0400 $UNDEF_SYM cpu/mcf5445x/start.o \
--start-group lib_generic/libgeneric.a
board/freescale/common/libfreescale.a
board/freescale/m54455evb/libm54455evb.a

Re: [U-Boot-Users] [PATCH] ColdFire: Get information from the correct GCC

2008-05-03 Thread Liew Tsi Chung
Shinya,
 
Which linux distro are you using?
 
Regards,
TsiChung



From: Shinya Kuribayashi [mailto:[EMAIL PROTECTED]
Sent: Fri 5/2/2008 8:25 PM
To: Liew Tsi Chung
Cc: [EMAIL PROTECTED]; U-Boot-Users; Rigby John; Mahan Kurt
Subject: Re: [U-Boot-Users] [PATCH] ColdFire: Get information from the correct 
GCC



Liew Tsi Chung wrote:
> when gcc version is 4.2. When it comes to linking, the $(shell $(CC)
> --version) becomes other value and select the -m5407 option with
> different libgcc.

I reverted this $(CC)-$(CROSS_COMPILE)gcc-conversion patch and built
with M54455EVB_config and CodeSourcery's freescale-coldfire-4.2-125-
m68k-uclinux-i686-pc-linux-gnu.tar.bz2. But couldn't reproduce.

---
[snip]
  :
make[1]: Entering directory 
`/home/skuribay/devel/u-boot.git/board/freescale/m54455evb'
m68k-uclinux-gcc -g  -Os   -ffixed-d7 -msep-data -D__KERNEL__ 
-DTEXT_BASE=0x0400 -I/home/skuribay/devel/u-boot.git/include -fno-builtin 
-ffreestanding -nos
tdinc -isystem 
/opt/codesourcery/freescale-coldfire-4.2/bin/../lib/gcc/m68k-uclinux/4.2.3/include
 -pipe  -DCONFIG_M68K -D__M68K__ -mcpu=54455 -fPIC -DTEXT_BASE
=0x0400 -Wall -Wstrict-prototypes -c -o m54455evb.o m54455evb.c
m68k-uclinux-gcc -g  -Os   -ffixed-d7 -msep-data -D__KERNEL__ 
-DTEXT_BASE=0x0400 -I/home/skuribay/devel/u-boot.git/include -fno-builtin 
-ffreestanding -nos
tdinc -isystem 
/opt/codesourcery/freescale-coldfire-4.2/bin/../lib/gcc/m68k-uclinux/4.2.3/include
 -pipe  -DCONFIG_M68K -D__M68K__ -mcpu=54455 -fPIC -DTEXT_BASE
=0x0400 -Wall -Wstrict-prototypes -c -o flash.o flash.c
m68k-uclinux-gcc -g  -Os   -ffixed-d7 -msep-data -D__KERNEL__ 
-DTEXT_BASE=0x0400 -I/home/skuribay/devel/u-boot.git/include -fno-builtin 
-ffreestanding -nos
tdinc -isystem 
/opt/codesourcery/freescale-coldfire-4.2/bin/../lib/gcc/m68k-uclinux/4.2.3/include
 -pipe  -DCONFIG_M68K -D__M68K__ -mcpu=54455 -fPIC -DTEXT_BASE
=0x0400 -Wall -Wstrict-prototypes -c -o mii.o mii.c
m68k-uclinux-ar crv libm54455evb.a m54455evb.o flash.o mii.o
a - m54455evb.o
a - flash.o
a - mii.o
make[1]: Leaving directory 
`/home/skuribay/devel/u-boot.git/board/freescale/m54455evb'
make -C /home/skuribay/devel/u-boot.git/board/freescale/m54455evb/ u-boot.lds
make[1]: Entering directory 
`/home/skuribay/devel/u-boot.git/board/freescale/m54455evb'
make[1]: Nothing to be done for `u-boot.lds'.
make[1]: Leaving directory 
`/home/skuribay/devel/u-boot.git/board/freescale/m54455evb'
UNDEF_SYM=`m68k-uclinux-objdump -x board/freescale/m54455evb/libm54455evb.a 
lib_generic/libgeneric.a board/freescale/common/libfreescale.a 
cpu/mcf5445x/libmcf5445x.a lib_m68k/libm68k.a fs/cramfs/libcramfs.a 
fs/fat/libfat.a fs/fdos/libfdos.a fs/jffs2/libjffs2.a fs/reiserfs/libreiserfs.a 
fs/ext2/libext2fs.a net/libnet.a disk/libdisk.a 
drivers/bios_emulator/libatibiosemu.a drivers/block/libblock.a 
drivers/dma/libdma.a drivers/hwmon/libhwmon.a drivers/i2c/libi2c.a 
drivers/input/libinput.a drivers/misc/libmisc.a drivers/mtd/libmtd.a 
drivers/mtd/nand/libnand.a drivers/mtd/nand_legacy/libnand_legacy.a 
drivers/mtd/onenand/libonenand.a drivers/net/libnet.a 
drivers/net/sk98lin/libsk98lin.a drivers/pci/libpci.a 
drivers/pcmcia/libpcmcia.a drivers/spi/libspi.a drivers/rtc/librtc.a 
drivers/serial/libserial.a drivers/usb/libusb.a drivers/video/libvideo.a 
common/libcommon.a libfdt/libfdt.a api/libapi.a post/libpost.a | \
sed  -n -e 's/.*\(__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
cd /home/skuribay/devel/u-boot.git && m68k-uclinux-ld -Bstatic 
-T /home/skuribay/devel/u-boot.git/board/freescale/m54455evb/u-boot.lds  -n 
-Ttext 0x0400 $UNDEF_SYM cpu/mcf5445x/start.o \
--start-group lib_generic/libgeneric.a 
board/freescale/common/libfreescale.a cpu/mcf5445x/libmcf5445x.a 
lib_m68k/libm68k.a fs/cramfs/libcramfs.a fs/fat/libfat.a fs/fdos/libfdos.a 
fs/jffs2/libjffs2.a fs/reiserfs/libreiserfs.a fs/ext2/libext2fs.a net/libnet.a 
disk/libdisk.a drivers/bios_emulator/libatibiosemu.a drivers/block/libblock.a 
drivers/dma/libdma.a drivers/hwmon/libhwmon.a drivers/i2c/libi2c.a 
drivers/input/libinput.a drivers/misc/libmisc.a drivers/mtd/libmtd.a 
drivers/mtd/nand/libnand.a drivers/mtd/nand_legacy/libnand_legacy.a 
drivers/mtd/onenand/libonenand.a drivers/net/libnet.a 
drivers/net/sk98lin/libsk98lin.a drivers/pci/libpci.a 
drivers/pcmcia/libpcmcia.a drivers/spi/libspi.a drivers/rtc/librtc.a 
drivers/serial/libserial.a drivers/usb/libusb.a drivers/video/libvideo.a 
common/libcommon.a libfdt/libfdt.a api/libapi.a post/libpost.a 
board/freescale/m54455evb/libm54455evb.a --end-group -L 
/opt/codesourcery/freescale-coldfire-4.2/bin/../lib/gcc/m
68k-uclinux/4.2.3/msep-data -lgcc \
-Map u-boot.map -o u-boot
m68k-uclinux-objcopy --gap-fill=0xff -O srec u-boot u-boot.srec
m68k-uclinux-objcopy --gap-fill=0xff -O binary u-boot u-boot.bin
[EMAIL PROTECTED]:~/devel/

Re: [U-Boot-Users] [PATCH] ColdFire: Get information from the correct GCC

2008-05-04 Thread Liew Tsi Chung
Shinya,
 
I am using Fedora 8. Also, the problem can be generated if using Fedora 4 and 5 
except 3. If you have a Fedora 4 and above, please try it. I bet you will run 
into the same problem as Kurt and I did.
 
Regards,
TsiChung



From: Shinya Kuribayashi [mailto:[EMAIL PROTECTED]
Sent: Sat 5/3/2008 10:49 PM
To: Liew Tsi Chung
Cc: [EMAIL PROTECTED]; U-Boot-Users; Rigby John; Mahan Kurt
Subject: Re: [U-Boot-Users] [PATCH] ColdFire: Get information from the correct 
GCC



Liew Tsi Chung wrote:
> Shinya,
> 
> Which linux distro are you using?
> 
[snip]
> -Map u-boot.map -o u-boot
> m68k-uclinux-objcopy --gap-fill=0xff -O srec u-boot u-boot.srec
> m68k-uclinux-objcopy --gap-fill=0xff -O binary u-boot u-boot.bin
> [EMAIL PROTECTED]:~/devel/u-boot.git$

It's Debian lenny/testing. If any info required, please let me know.

  Shinya



-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH] ColdFire: Get information from the correct GCC

2008-05-05 Thread Liew Tsi Chung
Wolfgang and Shinya,

> Could you confirm it builds with Today's config.mk patch by Wolfgang?
> If it works (I think it will), I'm satisfied with that.

With original $(CC) in cpu/*/config.mk and Wolfgang's config.mk patch:
Still generates the same error (see below)

Regards,
TsiChung

[snip]
/opt/freescale/usr/local/gcc-4.2.47-uclibc-0.9.47/m68k-uclinux/bin/m68k-
uclinux-gcc -g  -Os   -ffixed-d7 -msep-data -D__KERNEL__
-DTEXT_BASE=0x0400 -I/proj/u-boot/uboot133/u-boot-test/include
-fno-builtin -ffreestanding -nostdinc -isystem
/opt/freescale/usr/local/gcc-4.2.47-uclibc-0.9.47/m68k-uclinux/lib/gcc/m
68k-uclinux/4.2.1/include -pipe  -DCONFIG_M68K -D__M68K__ -Wa,
-mcpu=54455 -fPIC -DTEXT_BASE=0x0400 -Wall -Wstrict-prototypes -c -o
cmd_mac.o cmd_mac.c
/opt/freescale/usr/local/gcc-4.2.47-uclibc-0.9.47/m68k-uclinux/bin/m68k-
uclinux-ar crv libcommon.a main.o ACEX1K.o altera.o bedbug.o circbuf.o
cmd_autoscript.o cmd_bdinfo.o image.o gunzip.o cmd_boot.o cmd_bootm.o
cmd_cache.o cmd_console.o cmd_date.o cmd_eeprom.o cmd_elf.o cmd_ext2.o
cmd_fat.o cmd_fdc.o cmd_flash.o cmd_i2c.o cmd_ide.o cmd_itest.o
cmd_jffs2.o cmd_load.o cmd_mem.o cmd_mii.o cmd_misc.o cmd_nand.o
cmd_net.o cmd_nvedit.o cmd_onenand.o cmd_pcmcia.o cmd_reginfo.o
cmd_ximg.o cmd_vfd.o command.o console.o cyclon2.o stratixII.o devices.o
dlmalloc.o docecc.o environment.o env_common.o env_nand.o
env_dataflash.o env_flash.o env_eeprom.o env_onenand.o env_nvram.o
env_nowhere.o exports.o flash.o fpga.o ft_build.o hush.o kgdb.o lcd.o
lists.o lynxkdi.o memsize.o miiphybb.o miiphyutil.o s_record.o serial.o
soft_i2c.o soft_spi.o spartan2.o spartan3.o usb.o usb_kbd.o
usb_storage.o virtex2.o xilinx.o crc16.o xyzModem.o cmd_mac.o
a - main.o
...
a - cmd_mac.o
make[1]: Leaving directory `/proj/u-boot/uboot133/u-boot-test/common'
make -C libfdt/
make[1]: Entering directory `/proj/u-boot/uboot133/u-boot-test/libfdt'
/opt/freescale/usr/local/gcc-4.2.47-uclibc-0.9.47/m68k-uclinux/bin/m68k-
uclinux-ar crv libfdt.a 
make[1]: Leaving directory `/proj/u-boot/uboot133/u-boot-test/libfdt'
make -C api/
make[1]: Entering directory `/proj/u-boot/uboot133/u-boot-test/api'
/opt/freescale/usr/local/gcc-4.2.47-uclibc-0.9.47/m68k-uclinux/bin/m68k-
uclinux-ar crv libapi.a 
make[1]: Leaving directory `/proj/u-boot/uboot133/u-boot-test/api'
make -C post/
make[1]: Entering directory `/proj/u-boot/uboot133/u-boot-test/post'
(echo create libpost.a; for lib in   ; \
 do echo addlib $lib; done; echo save) \
|
/opt/freescale/usr/local/gcc-4.2.47-uclibc-0.9.47/m68k-uclinux/bin/m68k-
uclinux-ar -M
make[1]: Leaving directory `/proj/u-boot/uboot133/u-boot-test/post'
make -C /proj/u-boot/uboot133/u-boot-test/board/freescale/m54455evb/
u-boot.lds
make[1]: Entering directory
`/proj/u-boot/uboot133/u-boot-test/board/freescale/m54455evb'
make[1]: Nothing to be done for `u-boot.lds'.
make[1]: Leaving directory
`/proj/u-boot/uboot133/u-boot-test/board/freescale/m54455evb'
UNDEF_SYM=`/opt/freescale/usr/local/gcc-4.2.47-uclibc-0.9.47/m68k-uclinu
x/bin/m68k-uclinux-objdump -x lib_generic/libgeneric.a
board/freescale/common/libfreescale.a
board/freescale/m54455evb/libm54455evb.a cpu/mcf5445x/libmcf5445x.a
lib_m68k/libm68k.a fs/cramfs/libcramfs.a fs/fat/libfat.a
fs/fdos/libfdos.a fs/jffs2/libjffs2.a fs/reiserfs/libreiserfs.a
fs/ext2/libext2fs.a net/libnet.a disk/libdisk.a
drivers/bios_emulator/libatibiosemu.a drivers/block/libblock.a
drivers/dma/libdma.a drivers/hwmon/libhwmon.a drivers/i2c/libi2c.a
drivers/input/libinput.a drivers/misc/libmisc.a drivers/mtd/libmtd.a
drivers/mtd/nand/libnand.a drivers/mtd/nand_legacy/libnand_legacy.a
drivers/mtd/onenand/libonenand.a drivers/net/libnet.a
drivers/net/sk98lin/libsk98lin.a drivers/pci/libpci.a
drivers/pcmcia/libpcmcia.a drivers/spi/libspi.a drivers/rtc/librtc.a
drivers/serial/libserial.a drivers/usb/libusb.a drivers/video/libvideo.a
common/libcommon.a libfdt/libfdt.a api/libapi.a post/libpost.a |sed  -n
-e 's/.*\(__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
cd /proj/u-boot/uboot133/u-boot-test &&
/opt/freescale/usr/local/gcc-4.2.47-uclibc-0.9.47/m68k-uclinux/bin/m68k-
uclinux-ld -Bstatic -T
/proj/u-boot/uboot133/u-boot-test/board/freescale/m54455evb/u-boot.lds
-n -Ttext 0x0400 $UNDEF_SYM cpu/mcf5445x/start.o \
--start-group lib_generic/libgeneric.a
board/freescale/common/libfreescale.a
board/freescale/m54455evb/libm54455evb.a cpu/mcf5445x/libmcf5445x.a
lib_m68k/libm68k.a fs/cramfs/libcramfs.a fs/fat/libfat.a
fs/fdos/libfdos.a fs/jffs2/libjffs2.a fs/reiserfs/libreiserfs.a
fs/ext2/libext2fs.a net/libnet.a disk/libdisk.a
drivers/bios_emulator/libatibiosemu.a drivers/block/libblock.a
drivers/dma/libdma.a drivers/hwmon/libhwmon.a drivers/i2c/libi2c.a
drivers/input/libinput.a drivers/misc/libmisc.a drivers/mtd/libmtd.a
drivers/mtd/nand/libnand.a drivers/mtd/nand_legacy/libnand_legacy.a
drivers/mtd/onenand/libonenand.a drivers/net/libnet.a
drivers/net/sk98lin/libsk98lin.a drivers/pci/libpci.a
drivers/pcmcia/li

Re: [U-Boot-Users] [PATCH] ColdFire: Get information from the correct GCC

2008-05-05 Thread Liew Tsi Chung
Wolfgang,

Please ignore the previous email stated the new patch did not work.
Apparently, it must have been a mistake that I made after applied your
patch. Now, your patch work, still waiting for Kurt to confirm it.

Does this patch make into u-boot 1.3.3-rc3?

Thanks.

Regards,
TsiChung


-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH] ColdFire: Get information from the correct GCC

2008-05-05 Thread Liew Tsi Chung
Wolfgang,
 
I tested the current version v1.3.3-rc3 (without local changes - $(CC)) with 
codesourcery uclinux version 4.2-125 and 4.2-47. It works!
 
Thanks!
 
Regards,
TsiChung



From: Wolfgang Denk [mailto:[EMAIL PROTECTED]
Sent: Mon 5/5/2008 3:02 PM
To: Liew Tsi Chung
Cc: Shinya Kuribayashi; U-Boot-Users; Rigby John; Mahan Kurt
Subject: Re: [U-Boot-Users] [PATCH] ColdFire: Get information from the correct 
GCC



In message <[EMAIL PROTECTED]> you wrote:
>
> > Could you confirm it builds with Today's config.mk patch by Wolfgang?
> > If it works (I think it will), I'm satisfied with that.
>
> With original $(CC) in cpu/*/config.mk and Wolfgang's config.mk patch:
> Still generates the same error (see below)

Can you please test with the original code from the repository, i. e.
with version v1.3.3-rc3 without local changes?

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]
Brain off-line, please wait.


-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] Reg in SPI problem

2008-05-13 Thread Liew Tsi Chung
Karthikeyan,

DSPI read:

- Check status (sr & 0xF000), continue if >= 4
- Write 0x800n0003 to pop register (0xfc05c038) where n is chipsel (1 << 
chipsel), 3 is perform read (AT25080A does not have fast read feature)
- dummy read
- write 0x800n00xx to popr, address byte 2
- dummy read
- write 0x800n00xx to popr, address byte 1
- dummy read
- write 0x800n00xx to popr, address byte 0
- dummy read
- write 0x800n to popr, ready for read
- read a byte

Hope this help.

[snip - assembly]
move.l  #0xFC05C034, %a2/* dtfr */
move.l  #0xFC05C03B, %a3/* drfr */

move.l  #0x2a000, %d5
move.l  #(TEXT_BASE), %a4

move.l  #0xFC05C02C, %a1/* dspi status */

/* Issue commands and address */
move.l  #0x80020003, %d2/* Fast Read Cmd */
jsr asm_dspi_wr_status
jsr asm_dspi_rd_status

move.l  #0x8002, %d2/* Address byte 2 */
jsr asm_dspi_wr_status
jsr asm_dspi_rd_status

move.l  #0x8002, %d2/* Address byte 1 */
jsr asm_dspi_wr_status
jsr asm_dspi_rd_status

move.l  #0x80020003, %d2/* Address byte 0 */
jsr asm_dspi_wr_status
jsr asm_dspi_rd_status

/* Transfer u-boot from serial flash to memory */
asm_dspi_rd_loop2:
move.l  #0x8002, %d2
jsr asm_dspi_wr_status
jsr asm_dspi_rd_status

move.b  %d1, (%a4)  /* read, copy to dst */

add.l   #1, %a4 /* inc dst by 1 */
sub.l   #1, %d5 /* dec cnt by 1 */
bne asm_dspi_rd_loop2

move.l  #0x0002, %d2/* Terminate */
jsr asm_dspi_wr_status
jsr asm_dspi_rd_status

asm_dspi_wr_status:
move.l  (%a1), %d0  /* status */
and.l   #0xF000, %d0
cmp.l   #0x3000, %d0
bgt asm_dspi_wr_status

move.l  %d2, (%a2)
rts

asm_dspi_rd_status:
move.l  (%a1), %d0  /* status */
and.l   #0x00F0, %d0
lsr.l   #4, %d0
cmp.l   #0, %d0
beq asm_dspi_rd_status

move.b  (%a3), %d1
rts


[snip - c]
do {
dspi_tx(chipsel, 0x80, SER_RDSR);
dspi_rx();
dspi_tx(chipsel, 0x00, 0);
temp = dspi_rx();
} while (temp & 0x01);

dspi_tx(chipsel, 0x80, SER_READ);
dspi_rx();
dspi_tx(chipsel, 0x80, 0);
dspi_rx();
dspi_tx(chipsel, 0x80, 0);
dspi_rx();
dspi_tx(chipsel, 0x80, 0);
dspi_rx();

for (i = 0; i < bytes; i++) {
dspi_tx(chipsel, 0x80, 0);
buf[i] = dspi_rx();
}
dspi_tx(chipsel, 0x00, 0);
dspi_rx();

for (i = 0; i < bytes; i++) {
if ((i % 16) == 0)
printf("\n");
printf("%02x ", buf[i]);
}

Regards,
TsiChung
-
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH] ColdFire: Fix UART baudrate at 115200

2008-05-28 Thread Liew Tsi Chung
Jerry,

The calculation you provided does not work, I tried it before.
The best approach is reverse calculation after finding the closer
counter (or divider), then find the smaller gap to the bus frequency.

Using the calculation without the fix: counter = ((bus_freq / baudrate)
+ 31 )/ 32
Bus freq 140Mhz and baudrate 115200

counter = ((14000 / 115200) + 31) / 32
counter = 38

However, the 38 divider shows partial garbage message when output to the
terminal.

Now, perform reverse calculation to obtain bus frequency.
bus_freq = ((counter * 32) - 31) * 115200

bus_freq = ((38 * 32) - 31) * 115200
bus_freq = 136512000
diff = 14000 - 136512000 = 3488000

counter bus_freqdiff
=== =   ===
36  129139200   way too off!
37  132825600   7174400
38  136512000   3488000
39  140198400   198400  <=== Work at this counter! Small
diff.
40  143884800   3884800

Regards,
TsiChung


-Original Message-
From: Jerry Van Baren [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 28, 2008 1:45 PM
To: Liew Tsi Chung
Cc: U-Boot-Users; Wolfgang Denx; Rigby John
Subject: Re: [U-Boot-Users] [PATCH] ColdFire: Fix UART baudrate at
115200

Tsi-Chung.Liew wrote:
> From: TsiChung Liew <[EMAIL PROTECTED]>
> 
> If bus frequency is larger than 133MHz, the UART cannot output 
> baudrate at 115200 correctly.
> 
> Signed-off-by: TsiChung Liew <[EMAIL PROTECTED]>
> ---
>  drivers/serial/mcfuart.c |5 -
>  1 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/serial/mcfuart.c b/drivers/serial/mcfuart.c index

> 88f3eb1..fca76bd 100644
> --- a/drivers/serial/mcfuart.c
> +++ b/drivers/serial/mcfuart.c
> @@ -64,7 +64,10 @@ int serial_init(void)
>  
>   /* Setting up BaudRate */
>   counter = (u32) (gd->bus_clk / (gd->baudrate));
> - counter >>= 5;
> + counter = (counter + 31) >> 5;
> +
> + if ((gd->bus_clk > 1) && (gd->baudrate >= 115200))
> + counter++;
>  
>   /* write to CTUR: divide counter upper byte */
>   uart->ubg1 = (u8) ((counter & 0xff00) >> 8);

This doesn't look right at all.  It looks like you are patching up
integer math problems by using different bad math and then special
casing the result.  (In the metal working world, this is known as
"measure with a micrometer, mark with chalk, cut with a torch, and grind
to fit.")

Part A:
---
 >  counter = (u32) (gd->bus_clk / (gd->baudrate));

If you want this to be more accurate, you should round it:

 >  counter = (u32) ((gd->bus_clk + (gd->baudrate / 2)) /
(gd->baudrate));

Part B:
---
 > +counter = (counter + 31) >> 5;

This is not rounding properly, it is doing a "ceiling".

 > +counter = (counter + 16) >> 5;

Part C:
---

 > +if ((gd->bus_clk > 1) && (gd->baudrate >= 115200))
 > +counter++;

This looks totally bogus.  I very strongly suspect you need this because
the above parts A: and B: are not rounding the division math properly,
resulting in a wrong divisor *for your configuration*.  While the above
conditional may result in the correct divisor *for your configuration,*
it probably will be wrong for some finite set of *other* configurations.

If I got my algebra correct and my parenthesis balanced, I believe the
above is trying to calculate the following formula:
counter = (u32) (
((gd->bus_clk + (gd->baudrate / 2) +
 (gd->baudrate * 16))
/ (gd->baudrate * 32);

Note, however, that (gd->baudrate / 2) is going to be relatively small
compared to gd->bus_clk and (gd->baudrate * 16), so I suspect that the
above formula could be changed to the following formula with no
significant impact in accuracy:
counter = (u32) (
((gd->bus_clk + (gd->baudrate * 16))
/ (gd->baudrate * 32);

H, checking the math with 133e6 for the bus rate with full precision
math (i.e. a calculator), I get a divisor value of 36.08 (truncated to
an integer => 36).  Your hack-math results in a divisor of 38.  The last
formula I proposed above  result in a divisor of 36.58 (truncated to an
integer => 36).  That checks.

Real math=> 36.08
Hack-math=> 38(109375 baud => 5.1% off)
Last formula => 36(115451 baud => 0.2% off)

For 160e6 bus frequency:
Real math=> 43.40
Hack-math=> 44(113636 baud => 1.4% off)
Last formula => 43(116279 baud => 0.1% off)

I don't see how your formula works (well, actually it works but only
because async serial can handle ~10% error).  In fact, it looks to me
that your "correction" actually results in 

Re: [U-Boot-Users] [PATCH] ColdFire: Fix UART baudrate at 115200

2008-05-28 Thread Liew Tsi Chung
> Where are you getting the +31 from?  Is this in the User's Manual?
No in user's manual. The +31 is rounding up purpose.

> Computations are for mathematicians.  Real engineers measure the
actual frequency.  ;-)
Agree.

> If you change the " - 31" to " - 42", your computations will result in
a different divisor.  
> Why are you subtracting what appears to be an arbitrary number (31)?
Can't use 42 when the user's manual spec the divisor is 32. The "- 31"
comes from counter = ((bus_freq / baudrate) + 31) / 32. Using the same
calculation as mentioned here to find out bus_freq. bus_freq = ((counter
* 32) - 31) * baudrate.

> Are you sure your input frequency is 140MHz and not 144MHZ???  Have
you read the itty-bitty 
> numbers on the crystal?  Have you put a scope on it and actually
measured it?  Never trust 
> those hardware people.  ;-)
Actually, the bus freq is 70Mhz, 140Mhz is cpu freq (scope measurement).
The input freq (crystal/oscillator) not always 1 to 1 ratio. Take
M5253EVBE for example, the input clk is 11Mhz. Then, it multiply up and
divide down for CPU and bus frequency.

> Looking at the MFC5407 (arbitrarily, not knowing what processor you
have), the dividers are 
> as expected and *do not* match your "- 31" 
> calculations.  They have a simple example and simple math that matches
(no "- 31").

> Hmmm, the MFC5407 has a max CLKIN (and thus bus clock) of 54MHz.  You
must have a different 
> flavor.  MFC548x maxes at 50MHz.
> What processor are you using?
52x2, 532x, 547x_8x, 5445x. The 5253EVB is having the issue where the
calculation does not apply if baudrate is 115200.

> Ahh, MFC5249 has a 140MHz bus.  Still is a straight forward divide-by
n*32, no "- 31".
I thought the same too, but the 140Mhz is cpu freq.

Regards,
TsiChung

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH] ColdFire: Fix UART baudrate at 115200

2008-05-29 Thread Liew Tsi Chung
I see your point. I use your formula if you have not other comments.

Regards,
TsiChung 

-Original Message-
From: Jerry Van Baren [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 28, 2008 10:57 PM
To: Liew Tsi Chung
Cc: Jerry Van Baren; U-Boot-Users; Wolfgang Denx; Rigby John
Subject: Re: [U-Boot-Users] [PATCH] ColdFire: Fix UART baudrate at
115200

Liew Tsi Chung wrote:
>> Where are you getting the +31 from?  Is this in the User's Manual?
> No in user's manual. The +31 is rounding up purpose.

The formula (n + 31) / 32 is *NOT ROUNDING* the answer, it is doing a
"ceiling" function.  You need to add 1/2 the divisor to *ROUND*, i.e. (n

+ 16) / 32.

>> Computations are for mathematicians.  Real engineers measure the
> actual frequency.  ;-)
> Agree.
> 
>> If you change the " - 31" to " - 42", your computations will result
in
> a different divisor.  
>> Why are you subtracting what appears to be an arbitrary number (31)?
> Can't use 42 when the user's manual spec the divisor is 32. The "- 31"
> comes from counter = ((bus_freq / baudrate) + 31) / 32. Using the same
> calculation as mentioned here to find out bus_freq. bus_freq =
((counter
> * 32) - 31) * baudrate.

The 42 is an obscure reference to the Hitchhiker's Guide to the Galaxy -

the answer to the question of life, the universe and everything.  In 
other words, it is a totally arbitrary number.  Your use of +31 is not a

*ROUNDING*, it is *CEILING* and thus I claim it is arbitrary, especially

with the +1 to the divisor if your baud rate is suppose to be 115200 
baud.  You don't understand your hardware (if it makes you feel better, 
neither do I, but it is important that *you* understand it).

>> Are you sure your input frequency is 140MHz and not 144MHZ???  Have
> you read the itty-bitty 
>> numbers on the crystal?  Have you put a scope on it and actually
> measured it?  Never trust 
>> those hardware people.  ;-)
> Actually, the bus freq is 70Mhz, 140Mhz is cpu freq (scope
measurement).
> The input freq (crystal/oscillator) not always 1 to 1 ratio. Take
> M5253EVBE for example, the input clk is 11Mhz. Then, it multiply up
and
> divide down for CPU and bus frequency.

This *REALLY* makes your formula wrong.  According to the MCF5253 
Reference Manual Eqn. 15-1, the baud rate is
   fsys / (32 * divisor)
and fsys is 70MHz, *NOT* 140MHz.

baud = SysClk / (32 * divisor)

divisor = (70e6 / 32) / baud

divisor = 2187500 / 115200

divisor = 18.99 => 19

To *round*, add 1/2 the desired baud rate

divisor = ((70e6 / 32) * (baud / 2)) / baud

divisor = (2187500 + 57600) / 115200

divisor = 19.5 => integer truncation => 19



This means gd->bus_clk is *70MHz* (1/2 the CPU frequency), *NOT* 140MHz 
as you assume (note that this matches the Reference Manual).

I return to my contention:

Note, however, that (gd->baudrate / 2) is going to be relatively small
compared to gd->bus_clk and (gd->baudrate * 16), so I suspect that the
above formula could be changed to the following formula with no
significant impact in accuracy:
counter = (u32) (
((gd->bus_clk + (gd->baudrate * 16))
/ (gd->baudrate * 32);

Simplifying the *32 factor to match my formula above:

counter = (u32) (
((gd->bus_clk / 32) + (gd->baudrate / 2))
/ gd->baudrate);

counter = ((70e6 / 32) + (115200 / 2)) / 115200
counter = 19   (after inter truncation)

Note that, without adding (baudrate / 2) - rounding, the above formula 
results in a divisor of 18 rather than the proper 19.  THIS IS YOUR 
PROBLEM and also what your fix should be.

If you rounded properly, the baud rate calculation would work without 
all the magic.

Here is what your change actually does:

/* Setting up BaudRate */
counter = (u32) (gd->bus_clk / (gd->baudrate));
This divide is doing an integer truncation and you are losing 
significant digits.
   70e6 / 115200 = 607.64 => integer truncation = 607

counter = (counter + 31) >> 5;
This is "ceiling", but you've already lost the digits due to the 
previous divide with integer truncation (no rounding).
   (607 + 31) / 32 = 19.9 => integer truncation = 19

You get lucky and get the right answer even though you don't deserve it.
;-)

if ((gd->bus_clk > 1) && (gd->baudrate >= 115200))
counter++;
This is totally bogus.  gd->bus_clk == 70e6 so this is *always false.*

>> Looking at the MFC5407 (arbitrarily, not knowing what processor you
> have), the dividers are 
>> as expected and *do not* match your "- 31" 
>> calculations.  They have a simple example and simple math that
matches
> (no "- 31").
> 
>> Hmmm, the MFC5407 has

Re: [U-Boot-Users] Coldfire 547x, Linux and big memory.

2008-06-17 Thread Liew Tsi Chung
Luigi,

I believe the kernel you retrieve from Freescale side is based on dBug
bootloader and is not u-boot compatible; thus, will cause error when
trying to bring up kernel from u-boot. An engineer is working on the new
update release for 547x_8x soon. Once the kernel is updated, I believe
no update is needed to be done in u-boot side.

Regards,
TsiChung

-Original Message-
From: Luigi 'Comio' Mantellini [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 05, 2008 2:53 AM
To: U-Boot-Users
Cc: Liew Tsi Chung
Subject: Coldfire 547x, Linux and big memory.

Hi List,
Hi Tsi-Ching Liew,

I'm using u-boot 1.3.2 (trunk) on my application in order to boot the
freescale linux kernel for mcf547x cpus. My application has a lot of
memory (256MB) and this causes difficulties to start the linux kernel.

The Head.S code of the mcf547x Linux Kernel allows a one-to-one TLB map
for the first 16MB of memory (mcf547x can use up to 1M for page). From
this observation it is mandatory that U-BOOT should call the kernel
allowing all structures (board descr., intrd, env and command line) onto
the first 16M of physical RAM.

The solutions can be:

- to use the env variables bootm_low = 0 and bootm_size = 0x100
(16M)
- modify the code of do_bootm function in order to limitate mem_size to
16M
- Pray the Freescale to modify the kernel code in order to use a better
and more flexible initialization code.

I'm studying for smart modifications for Kernel and U-Boot (that hasn't
guilt).


Best regards,

luigi

-- 
 __   Luigi Mantellini
   .'__'. R&D - Software
  (.'  '.)Industrie Dial Face S.p.A.
  ( :==: )Via Canzo, 4
  ('.__.')20068 Peschiera Borromeo (MI), Italy
   '.__.' Tel.: +39 02 5167 2813
  Fax:  +39 02 5167 2459
Ind.  Dial Face   Email: [EMAIL PROTECTED]
www.idf-hit.com   GPG fingerprint: 3DD1 7B71 FBDF 6376 1B4A
   B003 175F E979 907E 1650





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


Re: [U-Boot-Users] Coldfire 5272C3 Ethernet Support?

2008-06-17 Thread Liew Tsi Chung
Andrew,
 
Thanks for pointing out the problem. The Ethernet unable to transmit
and causes "TX timeout" is due to timer function (udelay) is not working
properly and used an incorrect timer memory mapped. Please append
defined(CONFIG_M5272) after CONFIG_M5253 in
/include/asm-m68k/timer.h. I will provide the patch sometimes
next week.
 
Regards,
TsiChung
 



From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: Monday, June 16, 2008 4:37 PM
To: u-boot-users@lists.sourceforge.net
Subject: [U-Boot-Users] Coldfire 5272C3 Ethernet Support?


Is ethernet support currently working for the Coldfire 5272C3 eval board
off the git repository?  Whenever I'm trying to transmit (ping, etc) I'm
getting a "TX timeout" and no packets are making it to the wire.  From
what I can tell my receives aren't going much better.
 
Going back through the archives I found a post from March that seemed to
bring up the same issue but with no visible resolution.  If the tip is
broken does anyone know what the last version that was functional on the
5272C3 was?
 
Thanks,
 
Andrew Beard

This email and any attachments are only for use by the intended
recipient(s) and may contain legally privileged, confidential,
proprietary or otherwise private information. Any unauthorized use,
reproduction, dissemination, distribution or other disclosure of the
contents of this e-mail or its attachments is strictly prohibited. If
you have received this email in error, please notify the sender
immediately and delete the original. 
-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH] Fix dm9000 receive status and len little endian issue

2008-06-25 Thread Liew Tsi Chung
Sure.

> Do you provide a patch for those routines too? (if required)
Just the dm9000_rx_status_16bit(). Will re-submit with 8 and 32.

Regards,
TsiChung


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Remy
Bohmer
Sent: Wednesday, June 25, 2008 2:50 PM
To: Liew Tsi Chung
Cc: U-Boot-Users; Rigby John; Ben Warren
Subject: Re: [U-Boot-Users] [PATCH] Fix dm9000 receive status and len
little endian issue

Hello Tsi-Chung,

> The received status and len was in little endian format and caused the

> ethernet unable to proceed further. Add __le16_to_cpu() in 
> dm9000_rx_status_16bit().

I can imagine that similar problems are also valid for the 32bit code
(and maybe the 8 bit code too) It is probably better to change those
other 2 routines too, to keep them all behave the same.
Do you provide a patch for those routines too? (if required)

Kind Regards,

Remy

>
> Signed-off-by: TsiChung Liew <[EMAIL PROTECTED]>
> ---
>  drivers/net/dm9000x.c |4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/dm9000x.c b/drivers/net/dm9000x.c index 
> 844fb76..2895344 100644
> --- a/drivers/net/dm9000x.c
> +++ b/drivers/net/dm9000x.c
> @@ -222,8 +222,8 @@ static void dm9000_rx_status_16bit(u16 *RxStatus, 
> u16 *RxLen)  {
>DM9000_outb(DM9000_MRCMD, DM9000_IO);
>
> -   *RxStatus = DM9000_inw(DM9000_DATA);
> -   *RxLen = DM9000_inw(DM9000_DATA);
> +   *RxStatus = __le16_to_cpu(DM9000_inw(DM9000_DATA));
> +   *RxLen = __le16_to_cpu(DM9000_inw(DM9000_DATA));
>  }
>
>  static void dm9000_rx_status_8bit(u16 *RxStatus, u16 *RxLen)
> --
> 1.5.4.1
>
>
> --
> --- Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for just about anything 
> Open Source.
> http://sourceforge.net/services/buy/index.php
> ___
> U-Boot-Users mailing list
> U-Boot-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/u-boot-users
>

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


Re: [U-Boot-Users] [PATCH] Fix dm9000 receive status and len little endian issue

2008-06-25 Thread Liew Tsi Chung
Ben,

The data (packet data) and the status/len are different in
LE/BE, cannot use just the macro dm9000_x to cover both. In my case,
packet data is already in BE, but the status/len is in LE; therefore,
status/len require byteswap. This has to do with cpu endian mode.

Regards,
TsiChung

-Original Message-
From: Ben Warren [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, June 25, 2008 4:01 PM
To: Liew Tsi Chung
Cc: U-Boot-Users; Rigby John
Subject: Re: [PATCH] Fix dm9000 receive status and len little endian
issue

Tsi-Chung Liew wrote:
> From: TsiChung Liew <[EMAIL PROTECTED]>
>
> The received status and len was in little endian format and caused the

> ethernet unable to proceed further. Add __le16_to_cpu() in 
> dm9000_rx_status_8/16/32bit().
>
> Signed-off-by: TsiChung Liew <[EMAIL PROTECTED]>
> ---
>  drivers/net/dm9000x.c |   16 ++--
>  1 files changed, 10 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/dm9000x.c b/drivers/net/dm9000x.c index 
> 844fb76..e7365fe 100644
> --- a/drivers/net/dm9000x.c
> +++ b/drivers/net/dm9000x.c
> @@ -214,24 +214,28 @@ static void dm9000_rx_status_32bit(u16
*RxStatus, u16 *RxLen)
>   DM9000_outb(DM9000_MRCMD, DM9000_IO);
>  
>   tmpdata = DM9000_inl(DM9000_DATA);
> - *RxStatus = tmpdata;
> - *RxLen = tmpdata >> 16;
> + *RxStatus = __le16_to_cpu(tmpdata);
> + *RxLen = __le16_to_cpu(tmpdata >> 16);
>  }
>  
>  static void dm9000_rx_status_16bit(u16 *RxStatus, u16 *RxLen)  {
>   DM9000_outb(DM9000_MRCMD, DM9000_IO);
>  
> - *RxStatus = DM9000_inw(DM9000_DATA);
> - *RxLen = DM9000_inw(DM9000_DATA);
> + *RxStatus = __le16_to_cpu(DM9000_inw(DM9000_DATA));
> + *RxLen = __le16_to_cpu(DM9000_inw(DM9000_DATA));
>  }
>  
>  static void dm9000_rx_status_8bit(u16 *RxStatus, u16 *RxLen)  {
>   DM9000_outb(DM9000_MRCMD, DM9000_IO);
>  
> - *RxStatus = DM9000_inb(DM9000_DATA) + (DM9000_inb(DM9000_DATA)
<< 8);
> - *RxLen = DM9000_inb(DM9000_DATA) + (DM9000_inb(DM9000_DATA) <<
8);
> + *RxStatus =
> + __le16_to_cpu(DM9000_inb(DM9000_DATA) +
> +   (DM9000_inb(DM9000_DATA) << 8));
> + *RxLen =
> + __le16_to_cpu(DM9000_inb(DM9000_DATA) +
> +   (DM9000_inb(DM9000_DATA) << 8));
>  }
>  
>  /*
>   
Sorry for opening Pandora's box, but wouldn't it be better to redefine
the DM9000_x macros instead of where they're called?

regards,
Ben

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


Re: [U-Boot-Users] [PATCH] Fix dm9000 receive status and len little endian issue

2008-07-01 Thread Liew Tsi Chung
Ben,

May I know the status on this patch?

Regards,
TsiChung 

-
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH 0/2] Coldfire Ethernet initialization changes

2008-07-03 Thread Liew Tsi Chung
Ben,

I am going to test them and let you know next Tuesday. I was
unable to download the net repo using git protocol at work and the http
protocol has index error when I tried to use git-clone.

Thanks for the changes.

Regards,
TsiChung

-Original Message-
From: Ben Warren [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 03, 2008 2:07 AM
To: Liew Tsi Chung; u-boot-users@lists.sourceforge.net
Cc: Ben Warren
Subject: [PATCH 0/2] Coldfire Ethernet initialization changes

These two patches move the default initialization of Coldfire FEC
controllers to cpu_eth_init() in the CPU directories.

I don't have a Coldfire cross compiler set up nor do I have any
hardware, so I'm looking for volunteers to do the following:

1. Run 'MAKEALL coldfire' to check for compile-time errors 2. Try the
code out on real hardware

I'm pushing these patches to a 'testing' branch on the net repo.  Please
clone it as follows:

$ git clone git://git.denx.de/u-boot-net.git $ cd u-boot-net $ git
checkout testing

thanks!
Ben

-
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH 0/2] Coldfire Ethernet initialization changes

2008-07-08 Thread Liew Tsi Chung
Ben,

> I'm pushing these patches to a 'testing' branch on the net repo.
Please clone it as follows:
> $ git clone git://git.denx.de/u-boot-net.git $ cd u-boot-net $ git
checkout testing
There is no testing branch in u-boot-net, so I applied the two patches
you sent on top of current u-boot-net tree (commit
63676841ca2d603b13765f3f7b72ff1a61c23f90 - Jun 18. Remove duplicate code
in cpu/arm926ejs/davinci/lxt972.c).

Only one conflict and error:
The first patch - CONFIG_FSLDMAFEC for 547x_8x and is correct.
Then, the second patch - CONFIG_MCFFEC, appended #if after ||, either
remove CONFIG_MCFFEC for 547x_8x or remove "#if ".

-#if defined(CONFIG_FSLDMAFEC)
+#if defined(CONFIG_FSLDMAFEC) || #if defined(CONFIG_MCFFEC)
+/* Default initializations for MCFFEC controllers.  To override,
+ * create a board-specific function called:
+ * int board_eth_init(bd_t *bis)
+ */
+
 extern int mcdmafec_initialize(bd_t *bis);
+extern int mcffec_initialize(bd_t*);

Thanks!

Regards,
TsiChung
 

-Original Message-
From: Ben Warren [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 03, 2008 2:07 AM
To: Liew Tsi Chung; u-boot-users@lists.sourceforge.net
Cc: Ben Warren
Subject: [PATCH 0/2] Coldfire Ethernet initialization changes

These two patches move the default initialization of Coldfire FEC
controllers to cpu_eth_init() in the CPU directories.

I don't have a Coldfire cross compiler set up nor do I have any
hardware, so I'm looking for volunteers to do the following:

1. Run 'MAKEALL coldfire' to check for compile-time errors 2. Try the
code out on real hardware

I'm pushing these patches to a 'testing' branch on the net repo.  Please
clone it as follows:

$ git clone git://git.denx.de/u-boot-net.git $ cd u-boot-net $ git
checkout testing

thanks!
Ben

-
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH 0/2] Coldfire Ethernet initialization changes

2008-07-08 Thread Liew Tsi Chung
Ben,

>> -#if defined(CONFIG_FSLDMAFEC)
>> +#if defined(CONFIG_FSLDMAFEC) || #if defined(CONFIG_MCFFEC)
>> +/* Default initializations for MCFFEC controllers.  To override,
>> + * create a board-specific function called:
>> + *  int board_eth_init(bd_t *bis)
>> + */
>> +
>>  extern int mcdmafec_initialize(bd_t *bis);
>> +extern int mcffec_initialize(bd_t*);
>>   

>Does it work after you fix this up?
Yes.

Thanks.

Regards,
TsiChung

-
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] Release status - things to be done

2008-07-09 Thread Liew Tsi Chung
Wolfgang,
 
2989 05/29 "Tsi-Chung.Liew" [PATCH] ColdFire: Fix UART baudrate formula
-> for ColdFire custodian

The patch is for /drivers/serial/mcfuart.c. Do I apply this
patch to CF repo?

Thanks.

Regards,
TsiChung


-
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users