Re: [U-Boot] What to do for a working BIOSEMU and ATI_RADEON_FB environment?

2009-03-29 Thread Markus Rathgeb
Thanks a lot Anatolij!

I have done the following changes:


--- include/configs/pcm030.h.org2009-03-28 18:15:31.0 +0100
+++ include/configs/pcm030.h2009-03-29 10:49:52.0 +0200
@@ -156,8 +156,8 @@
 #define CONFIG_PCI_MEM_BUS 0x4000
 #define CONFIG_PCI_MEM_PHYSCONFIG_PCI_MEM_BUS
 #define CONFIG_PCI_MEM_SIZE0x1000
-#define CONFIG_PCI_IO_BUS  0x5000
-#define CONFIG_PCI_IO_PHYS CONFIG_PCI_IO_BUS
+#define CONFIG_PCI_IO_BUS  0x
+#define CONFIG_PCI_IO_PHYS 0x5000
 #define CONFIG_PCI_IO_SIZE 0x0100
 #define CONFIG_SYS_XLB_PIPELINING  1

@@ -247,8 +247,8 @@
 #   define CONFIG_SYS_RAMBOOT  1
 #endif

-#define CONFIG_SYS_MONITOR_LEN (192 << 10) /* Reserve 192 kB for Monitor   */
-#define CONFIG_SYS_MALLOC_LEN (128 << 10) /* Reserve 128 kB for malloc()  */
+#define CONFIG_SYS_MONITOR_LEN (1024 << 10) /* Reserve 1024 kB for Monitor   */
+#define CONFIG_SYS_MALLOC_LEN (1024 << 10) /* Reserve 1024 kB for malloc()  */
 #define CONFIG_SYS_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */

 /*-
@@ -460,4 +460,18 @@
 #define OF_SOC "soc5...@f000"
 #define OF_STDOUT_PATH "/soc5...@f000/ser...@2400"

+#define CONFIG_VIDEO
+#ifdef CONFIG_VIDEO
+   #define CONFIG_BIOSEMU  /* x86 bios emulator
for vga bios */
+   #define CONFIG_ATI_RADEON_FB/* use radeon
framebuffer driver */
+   #define VIDEO_IO_OFFSET CONFIG_PCI_IO_PHYS
+   #define CONFIG_SYS_ISA_IO_BASE_ADDRESS  VIDEO_IO_OFFSET
+   #define CONFIG_VIDEO_SW_CURSOR
+   #define CONFIG_VIDEO_LOGO
+   #define CONFIG_CFB_CONSOLE
+   #define CONFIG_SPLASH_SCREEN
+   #define CONFIG_VGA_AS_SINGLE_DEVICE
+   #define CONFIG_CMD_BMP
+#endif
+
 #endif /* __CONFIG_H */


So, I see now the u-boot on the monitor. More tests will follow.

I changed also CONFIG_SYS_MONITOR_LEN and CONFIG_SYS_MALLOC_LEN.
I do not know, what are the minimum values that are working.
But 128 and 256 for CONFIG_SYS_MALLOC_LEN are to small and with the
above values it is working - so it is okay for me.

Where can I read more about that options (and the options for video)?
Are there documentations or should I read the source code (that is no
problem, but it will be cost a lot of time)?

Thanks again.

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


[U-Boot] help with uboot-1.2 on mpc8548e

2009-03-29 Thread 阎淼
Hi,

   I am trying to boot linux-2.6.26 on mpc8548e borad, but linux can not boot.

   I checked the __log_buf information, and here is the output,  it seems that

   my flat device tree file has something wrong, and kernel went into a trap.

   Could anyone give me some clue ? I am stuck here.  Thanks!

003e6cb4: 3c343e49 6e76616c 69642074 61672030<4>Invalid tag 0
003e6cc4: 20736361 6e6e696e 6720666c 61747465 scanning flatte
003e6cd4: 6e656420 64657669 63652074 72656520ned device tree
003e6ce4: 210a3c34 3e496e76 616c6964 20746167!.<4>Invalid tag
003e6cf4: 20302073 63616e6e 696e6720 666c6174 0 scanning flat
003e6d04: 74656e65 64206465 76696365 20747265tened device tre
003e6d14: 6520210a 3c343e49 6e76616c 69642074e !.<4>Invalid t
003e6d24: 61672030 20736361 6e6e696e 6720666cag 0 scanning fl
003e6d34: 61747465 6e656420 64657669 attened devi
003e6d44:    
003e6d54:    
003e6d64:    
003e6d74:    
003e6d84:    
003e6d94:    74696f6etion
003e6da4: 20696e20 6b65726e 656c206d 6f64652c in kernel mode,
003e6db4: 20736967 3a203520 5b23315d 0a3c343e sig: 5 [#1].<4>
003e6dc4: 0a3c343e 4d6f6475 6c657320 6c696e6b.<4>Modules link
003e6dd4: 65642069 6e3a0a3c 343e4e49 ed in:.<4>NI
003e6de4:    
003e6df4:    
003e6e04:    
003e6e14:    
003e6e24:    
003e6e34:    
003e6e44:    
003e6e54:    
003e6e64:    
003e6e74:    
003e6e84:    
003e6e94:    3c363e47<6>G
003e6ea4: 50523030 3a203030 30303030 30312063PR00: 0001 c
003e6eb4: 30336437 66623020 63303362 3334373803d7fb0 c03b3478
003e6ec4: 20303030 30303030 30203030 34303030  004000
003e6ed4: 30302030 30303030 30303020 00  
003e6ee4:    
003e6ef4:    
003e6f04:    
003e6f14:    
003e6f24:    
003e6f34:    
003e6f44:    
003e6f54:    
003e6f64:    
003e6f74:    
003e6f84:    
003e6f94:    
003e6fa4:    


003e70b4:    
003e70c4:    
003e70d4:    
003e70e4:    
003e70f4:    
003e7104:    
003e7114:    303031300010
003e7124: 20343230 3064 63203465 38303030 4200ffdc 4e8000
003e7134: 32302037 63613033 33373920 20 7ca03379 
003e7144:    
003e7154:    63363531c651
003e7164: 62373820 37633030 30303236 20353430b78 7c26 540
003e7174: 3031 65203c30 66303030 01ffe <0f000
003e7184:    
003e7194:    
003e71a4:    


...


003e72b4:    6e6b6564nked
003e72c4: 20696e3a 0a3c343e 4e49503a 20633030 in:.<4>NIP: c00
003e72d4: 33396663 38204c52 3a206330 39fc8 LR: c0
003e72e4:    
003e72f4:    
003e7304:    
003e7314:    20202020
0

Re: [U-Boot] [PATCH] sf: add driver for SST flashes

2009-03-29 Thread Haavard Skinnemoen
Mike Frysinger wrote:
> Signed-off-by: Mike Frysinger 
> CC: Haavard Skinnemoen 

Looks good to me.

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


Re: [U-Boot] help with uboot-1.2 on mpc8548e

2009-03-29 Thread Wolfgang Denk
Dear =?GB2312?B?0dbttQ==?=,

In message <844375050903290447j315cb86dk3090cfe1fd8d3...@mail.gmail.com> you 
wrote:
> 
>I am trying to boot linux-2.6.26 on mpc8548e borad, but linux can not boot.

Both U-Boot 1.2 and Linux 2.6.26 are very old. Please use recent
versions instead (u-boot-2009.03 and Linux 2.6.29) and report back if
the problem persists.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Our management frequently gets lost in thought.   That's because it's
unfamiliar territory.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] sf: stmicro: drop redundant id read

2009-03-29 Thread Haavard Skinnemoen
Mike Frysinger wrote:
> The common SPI flash code reads the idcode and passes it down to the SPI
> flash driver, so there is no need to read it again ourselves.
> 
> Signed-off-by: Mike Frysinger 
> CC: Haavard Skinnemoen 
> CC: Jason McMullan 
> CC: TsiChung Liew 

Looks reasonable, though it's probably best if someone more familiar
with this particular driver Acks it as well.

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


Re: [U-Boot] [PATCH] SF: always read 5 bytes for the idcode

2009-03-29 Thread Haavard Skinnemoen
Mike Frysinger wrote:
> Some SPI flash drivers like to have extended id information available
> (like the spansion flash), so rather than making it re-issue the ID cmd
> to get at the last 2 bytes, have the common code read 5 bytes rather than
> just 3.  This also matches the Linux behavior where it always reads 5 id
> bytes from all flashes.
> 
> Signed-off-by: Mike Frysinger 
> CC: Mingkai Hu 
> CC: Haavard Skinnemoen 

Yes, that's much better. But perhaps you should pass the last two bytes
to the debug() call a bit further down too?

I guess it's not essential though, so

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


[U-Boot] MPC850: strange problem with icache

2009-03-29 Thread Guowen SHAN
Hi Folks,

I'm porting u-boot-1.3.1 to customer board, which includes MPC850 and 32MB
SDRAM.
When I turned off icache, bus can work correctly under 25MHz/50MHz clock
frequence.
Note that CPU is working under 50MHz. However, the board only can work with
bus
frequence of 25MHz with enabled icache. If I tried to set bus frequence to
50MHz with
enabled icache, it will crash with MCE.

I don't know why. Since it can work at 25MHz with enabled icache, the UPM
words seem
ok. Thanks for your advices!

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


Re: [U-Boot] [PATCH v4] board support patch for phyCORE-MPC5200B-tiny

2009-03-29 Thread Markus Rathgeb
Hi!

Have you read the BIOSEMU stuff in the mailing list?
Can you adjust the PCI section and perhaps you can include the video
example (set undef video).

Greats,
Markus

On Fri, Mar 27, 2009 at 10:48 PM, Jon Smirl  wrote:
> On Fri, Mar 27, 2009 at 4:12 PM, Wolfgang Denk  wrote:
>>> >  create mode 100644 board/phytec/pcm030/Makefile
>>> >  create mode 100644 board/phytec/pcm030/config.mk
>>> >  create mode 100644 board/phytec/pcm030/mt46v32m16-75.h
>>> >  create mode 100644 board/phytec/pcm030/pcm030.c
>>> >  create mode 100644 include/configs/pcm030.h
>>
>> Entries in MAKEALL and in MAINTAINERS missing.
>
> Sascha and Eric, who going to be the Phytec/Pengutronix maintainer for this?
> Send me a couple sets of MX35 development hardware and I'll maintain this.
>
>>
>> Except from that, it looks OK to me.
>>
>> Best regards,
>>
>> Wolfgang Denk
>
>
> --
> Jon Smirl
> jonsm...@gmail.com
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] MPC850: strange problem with icache

2009-03-29 Thread Wolfgang Denk
Dear Guowen SHAN,

In message  you 
wrote:
>
> I'm porting u-boot-1.3.1 to customer board, which includes MPC850 and 32MB 
> SDRAM.
> When I turned off icache, bus can work correctly under 25MHz/50MHz clock 
> frequence.
> Note that CPU is working under 50MHz. However, the board only can work with 
> bus
> frequence of 25MHz with enabled icache. If I tried to set bus frequence to 
> 50MHz with
> enabled icache, it will crash with MCE.

Easy problem - actually FAQ: please see
http://www.denx.de/wiki/view/DULG/UBootCrashAfterRelocation

> I don't know why. Since it can work at 25MHz with enabled icache, the UPM 
> words seem
> ok. Thanks for your advices!

Keep in mind that the UPM setup is only part of the required RAM
initialization sequence. Follow the instructions in the chip
manufacturer's manual to the letter.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
The number you have dialed is imaginary. Please divide by 0  and  try
again.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4] board support patch for phyCORE-MPC5200B-tiny

2009-03-29 Thread Jon Smirl
On Sun, Mar 29, 2009 at 10:08 AM, Markus Rathgeb
 wrote:
> Hi!
>
> Have you read the BIOSEMU stuff in the mailing list?
> Can you adjust the PCI section and perhaps you can include the video
> example (set undef video).

I have v1 of the pcm030 hardware and the baseboard doesn't have a PCI slot.

I looked at some of your older emails. It looks like the framebuffer
is not accessible. You are hanging on a write to the PCI bus.

Forget about running the video BIOS initially, just use the memory
commands from u-boot to make sure you can read and write the
framebuffer.  That will ensure that you have your BARs set, PCI
timings right, etc.

>
> Greats,
> Markus

-- 
Jon Smirl
jonsm...@gmail.com
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4] board support patch for phyCORE-MPC5200B-tiny

2009-03-29 Thread Markus Rathgeb
On Sun, Mar 29, 2009 at 4:29 PM, Jon Smirl  wrote:
> Forget about running the video BIOS initially, just use the memory
> commands from u-boot to make sure you can read and write the
> framebuffer.  That will ensure that you have your BARs set, PCI
> timings right, etc.

Have you read the messages (yesterday and today) with the subject:
"What to do for a working BIOSEMU and ATI_RADEON_FB environment?"

I think I used the memory read command

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


Re: [U-Boot] What to do for a working BIOSEMU and ATI_RADEON_FB environment?

2009-03-29 Thread Jon Smirl
On Sat, Mar 28, 2009 at 11:26 AM, Markus Rathgeb  wrote:
> Hi!
>
> I own a phytec's pcm-030 with the shipped baseboard pcm-973.
> I would like to use a radeon 9200 pci card in the slot on the baseboard.
>
> I have done a git checkout of the u-boot and I am using the 'board
> support patch for phyCORE-MPC5200B-tiny‎' from the mailing list.
>
> To provide the necessary informations here some outputs the u-boot command 
> line:
>
> =
> uboot> pci
> Scanning PCI devices on bus 0
> BusDevFun  VendorId   DeviceId   Device Class       Sub-Class
> _
> 00.18.00   0x1002     0x5c63     Display controller      0x00
> 00.18.01   0x1002     0x5c43     Display controller      0x80
> 00.1a.00   0x1057     0x5809     Bridge device           0x80
>
> uboot> pci header 00.1a.00
>  vendor ID =                   0x1057
>  device ID =                   0x5809
>  command register =            0x0006
>  status register =             0x22a0
>  revision ID =                 0x00
>  class code =                  0x06 (Bridge device)
>  sub class code =              0x80
>  programming interface =       0x00
>  cache line =                  0x08
>  latency time =                0xf8
>  header type =                 0x00
>  BIST =                        0x00
>  base address 0 =              0xf000
>  base address 1 =              0x0008
>  base address 2 =              0x
>  base address 3 =              0x
>  base address 4 =              0x
>  base address 5 =              0x
>  cardBus CIS pointer =         0x
>  sub system vendor ID =        0x
>  sub system ID =               0x
>  expansion ROM base address =  0x
>  interrupt line =              0x00
>  interrupt pin =               0x00
>  min Grant =                   0x00
>  max Latency =                 0x00
>
> uboot> pci display 00.1a.00 0 40
> : 58091057 22a6 0680 f808
> 0010: f000 0008  
> 0020:    
> 0030:    
> 0040:    
> 0050:    
> 0060:    
> 0070:    
> 0080:    
> 0090:    
> 00a0:    
> 00b0:    
> 00c0:    
> 00d0:    
> 00e0:    
> 00f0:    
>
> uboot> pci header 00.18.00
>  vendor ID =                   0x1002
>  device ID =                   0x5c63
>  command register =            0x0007
>  status register =             0x0290
>  revision ID =                 0x01
>  class code =                  0x03 (Display controller)
>  sub class code =              0x00
>  programming interface =       0x00
>  cache line =                  0x08
>  latency time =                0x80
>  header type =                 0x80
>  BIST =                        0x00
>  base address 0 =              0x4008
>  base address 1 =              0x5001
>  base address 2 =              0x4400
>  base address 3 =              0x
>  base address 4 =              0x
>  base address 5 =              0x
>  cardBus CIS pointer =         0x
>  sub system vendor ID =        0x0001
>  sub system ID =               0x0001
>  expansion ROM base address =  0x
>  interrupt line =              0xff
>  interrupt pin =               0x01
>  min Grant =                   0x08
>  max Latency =                 0x00
>
> uboot> pci display 00.18.00 0 40
> : 5c631002 0297 0301 00808008
> 0010: 4008 5001 4400 
> 0020:    00010001
> 0030:  0050  000801ff
> 0040:    00010001
> 0050: 06020001  00205002 4f000210
> 0060: 0200   
> 0070:    
> 0080: 0005   
> 0090:    
> 00a0:    
> 00b0:    
> 00c0:    
> 00d0:    
> 00e0:    
> 00f0:    
>
> uboot> pci header 00.18.01
>  vendor ID =                   0x1002
>  device ID =                   0x5c43
>  command register =            0x0006
>  status register =             0x0290
>  revision ID =                 0x01
>  class code =                  0x03 (Display controller)
>  sub class code =              0x80
>  programming interface =       0x00
>  cache line 

Re: [U-Boot] What to do for a working BIOSEMU and ATI_RADEON_FB environment?

2009-03-29 Thread Jon Smirl
2009/3/29 Jon Smirl :
> On Sat, Mar 28, 2009 at 11:26 AM, Markus Rathgeb  wrote:
>> Hi!
>>
>> I own a phytec's pcm-030 with the shipped baseboard pcm-973.
>> I would like to use a radeon 9200 pci card in the slot on the baseboard.

BTW what you are doing will definitely work if you can get it
debugged. I have used a similar setup on my Efika but it doesn't run
u-boot.

-- 
Jon Smirl
jonsm...@gmail.com
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] SF: always read 5 bytes for the idcode

2009-03-29 Thread Mike Frysinger
On Sunday 29 March 2009 08:40:10 Haavard Skinnemoen wrote:
> Mike Frysinger wrote:
> > Some SPI flash drivers like to have extended id information available
> > (like the spansion flash), so rather than making it re-issue the ID cmd
> > to get at the last 2 bytes, have the common code read 5 bytes rather than
> > just 3.  This also matches the Linux behavior where it always reads 5 id
> > bytes from all flashes.
> >
> > Signed-off-by: Mike Frysinger 
> > CC: Mingkai Hu 
> > CC: Haavard Skinnemoen 
>
> Yes, that's much better. But perhaps you should pass the last two bytes
> to the debug() call a bit further down too?

np, i'll update the patch for that
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] OMAP3: Update Overo pin mux for new expansion board

2009-03-29 Thread Jean-Christophe PLAGNIOL-VILLARD
On 20:00 Mon 16 Mar , Dirk Behme wrote:
> A new Overo expansion board uses GPIO 14, 21, 22 and 23 for LED's and
> switches. This patch changes the pinmux configuration for those pins.
> They were previously set up for unused MMC3_DAT4-7.
> 
> Signed-off-by: Steve Sakoman 
> ---
> 
> Patch is against recent mainline commit
> 'b3dd629e78870ba2dc9f8032978721c0fa02a856'
> "Prepare 2009.03-rc2"
sorry NACK

Please send it correctly because git am will take the information from the
email Hearder and I do not want to fix it manually

BTW we do need a better api to managen pio setting on the omap3 may be
someting as the AT91 api

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


Re: [U-Boot] [PATCH 2/7] mtd: SPI Flash: Support the Spansion Flash

2009-03-29 Thread Mike Frysinger
On Monday 16 March 2009 02:23:50 Hu Mingkai-B21284 wrote:
> From: Mike Frysinger [mailto:vap...@gentoo.org]
> > On Sunday 15 March 2009 22:52:18 Mingkai Hu wrote:
> > > Add MTD SPI Flash support for S25FL008A, S25FL016A, S25FL032A,
> > > S25FL064A, S25FL128P.
> >
> > this doesnt really need to be part of this patch series and
> > can be added all by itself
> >
> > > --- a/drivers/mtd/spi/Makefile
> > > +++ b/drivers/mtd/spi/Makefile
> > > @@ -28,6 +28,7 @@ LIB := $(obj)libspi_flash.a
> > >  COBJS-$(CONFIG_SPI_FLASH)+= spi_flash.o
> > >  COBJS-$(CONFIG_SPI_FLASH_ATMEL)  += atmel.o
> > >  COBJS-$(CONFIG_SPI_FLASH_STMICRO)+= stmicro.o
> > > +COBJS-$(CONFIG_SPI_FLASH_SPANSION) += spansion.o
> >
> > this should be above stmicro -- keep it sorted
> >
> > also, the += is supposed to be indented with a tab, not spaces -mike
>
> Thanks, I'll fix it.

can you post an updated spansion flash driver ?  it can be merged 
independently of the eSPI patch series and it'd be good to get it merged 
sooner so i can push the sf patches without conflicts ...
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2] sf: add driver for SST flashes

2009-03-29 Thread Mike Frysinger
Signed-off-by: Mike Frysinger 
Acked-by: Haavard Skinnemoen 
---
v2
- fix handling of leading/trailing 1 byte edge cases

 drivers/mtd/spi/Makefile |1 +
 drivers/mtd/spi/spi_flash.c  |5 +
 drivers/mtd/spi/spi_flash_internal.h |1 +
 drivers/mtd/spi/sst.c|  358 ++
 4 files changed, 365 insertions(+), 0 deletions(-)
 create mode 100644 drivers/mtd/spi/sst.c

diff --git a/drivers/mtd/spi/Makefile b/drivers/mtd/spi/Makefile
index 6ca6073..a71b16e 100644
--- a/drivers/mtd/spi/Makefile
+++ b/drivers/mtd/spi/Makefile
@@ -28,6 +28,7 @@ LIB   := $(obj)libspi_flash.a
 COBJS-$(CONFIG_SPI_FLASH)  += spi_flash.o
 COBJS-$(CONFIG_SPI_FLASH_ATMEL)+= atmel.o
 COBJS-$(CONFIG_SPI_FLASH_SPANSION) += spansion.o
+COBJS-$(CONFIG_SPI_FLASH_SST)  += sst.o
 COBJS-$(CONFIG_SPI_FLASH_STMICRO)  += stmicro.o
 
 COBJS  := $(COBJS-y)
diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
index d1d81af..1902960 100644
--- a/drivers/mtd/spi/spi_flash.c
+++ b/drivers/mtd/spi/spi_flash.c
@@ -139,6 +139,11 @@ struct spi_flash *spi_flash_probe(unsigned int bus, 
unsigned int cs,
flash = spi_flash_probe_stmicro(spi, idcode);
break;
 #endif
+#ifdef CONFIG_SPI_FLASH_SST
+   case 0xBF:
+   flash = spi_flash_probe_sst(spi, idcode);
+   break;
+#endif
default:
debug("SF: Unsupported manufacturer %02X\n", idcode[0]);
flash = NULL;
diff --git a/drivers/mtd/spi/spi_flash_internal.h 
b/drivers/mtd/spi/spi_flash_internal.h
index 75f5900..2d020c3 100644
--- a/drivers/mtd/spi/spi_flash_internal.h
+++ b/drivers/mtd/spi/spi_flash_internal.h
@@ -43,4 +43,5 @@ int spi_flash_read_common(struct spi_flash *flash, const u8 
*cmd,
 /* Manufacturer-specific probe functions */
 struct spi_flash *spi_flash_probe_spansion(struct spi_slave *spi, u8 *idcode);
 struct spi_flash *spi_flash_probe_atmel(struct spi_slave *spi, u8 *idcode);
+struct spi_flash *spi_flash_probe_sst(struct spi_slave *spi, u8 *idcode);
 struct spi_flash *spi_flash_probe_stmicro(struct spi_slave *spi, u8 *idcode);
diff --git a/drivers/mtd/spi/sst.c b/drivers/mtd/spi/sst.c
new file mode 100644
index 000..f96b731
--- /dev/null
+++ b/drivers/mtd/spi/sst.c
@@ -0,0 +1,358 @@
+/*
+ * Driver for SST serial flashes
+ *
+ * (C) Copyright 2000-2002
+ * Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+ * Copyright 2008, Network Appliance Inc.
+ * Jason McMullan 
+ * Copyright (C) 2004-2007 Freescale Semiconductor, Inc.
+ * TsiChung Liew (tsi-chung.l...@freescale.com)
+ * Copyright (c) 2008-2009 Analog Devices Inc.
+ *
+ * Licensed under the GPL-2 or later.
+ */
+
+#include 
+#include 
+#include 
+
+#include "spi_flash_internal.h"
+
+#define CMD_SST_WREN   0x06/* Write Enable */
+#define CMD_SST_WRDI   0x04/* Write Disable */
+#define CMD_SST_RDSR   0x05/* Read Status Register */
+#define CMD_SST_WRSR   0x01/* Write Status Register */
+#define CMD_SST_READ   0x03/* Read Data Bytes */
+#define CMD_SST_FAST_READ  0x0b/* Read Data Bytes at Higher Speed */
+#define CMD_SST_BP 0x02/* Byte Program */
+#define CMD_SST_AAI_WP 0xAD/* Auto Address Increment Word Program 
*/
+#define CMD_SST_SE 0x20/* Sector Erase */
+
+#define SST_SR_WIP (1 << 0)/* Write-in-Progress */
+#define SST_SR_WEL (1 << 1)/* Write enable */
+#define SST_SR_BP0 (1 << 2)/* Block Protection 0 */
+#define SST_SR_BP1 (1 << 3)/* Block Protection 1 */
+#define SST_SR_BP2 (1 << 4)/* Block Protection 2 */
+#define SST_SR_AAI (1 << 6)/* Addressing mode */
+#define SST_SR_BPL (1 << 7)/* BP bits lock */
+
+struct sst_spi_flash_params {
+   u8 idcode1;
+   u16 nr_sectors;
+   const char *name;
+};
+
+struct sst_spi_flash {
+   struct spi_flash flash;
+   const struct sst_spi_flash_params *params;
+};
+
+static inline struct sst_spi_flash *to_sst_spi_flash(struct spi_flash *flash)
+{
+   return container_of(flash, struct sst_spi_flash, flash);
+}
+
+#define SST_SECTOR_SIZE (4 * 1024)
+static const struct sst_spi_flash_params sst_spi_flash_table[] = {
+   {
+   .idcode1 = 0x01,
+   .nr_sectors = 128,
+   .name = "SST25WF512",
+   },{
+   .idcode1 = 0x02,
+   .nr_sectors = 256,
+   .name = "SST25WF010",
+   },{
+   .idcode1 = 0x03,
+   .nr_sectors = 512,
+   .name = "SST25WF020",
+   },{
+   .idcode1 = 0x04,
+   .nr_sectors = 1024,
+   .name = "SST25WF040",
+   },
+};
+
+static int
+sst_wait_ready(struct spi_flash *flash)
+{
+   struct spi_slave *spi = flash->spi;
+   unsigned long timebase;

[U-Boot] [PATCH v2] sf: always read 5 bytes for the idcode

2009-03-29 Thread Mike Frysinger
Some SPI flash drivers like to have extended id information available
(like the spansion flash), so rather than making it re-issue the ID cmd
to get at the last 2 bytes, have the common code read 5 bytes rather than
just 3.  This also matches the Linux behavior where it always reads 5 id
bytes from all flashes.

Signed-off-by: Mike Frysinger 
Acked-by: Haavard Skinnemoen 
CC: Mingkai Hu 
---
v2
- display all 5 bytes in the debug() output

 drivers/mtd/spi/spansion.c  |   10 ++
 drivers/mtd/spi/spi_flash.c |6 +++---
 2 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/drivers/mtd/spi/spansion.c b/drivers/mtd/spi/spansion.c
index 9de4b7b..b9746fd 100644
--- a/drivers/mtd/spi/spansion.c
+++ b/drivers/mtd/spi/spansion.c
@@ -310,15 +310,9 @@ struct spi_flash *spi_flash_probe_spansion(struct 
spi_slave *spi, u8 *idcode)
struct spansion_spi_flash *spsn;
unsigned int i;
unsigned short jedec, ext_jedec;
-   int ret;
-   u8 id[5] = {0};
-
-   ret = spi_flash_cmd(spi, CMD_READ_ID, id, sizeof(id));
-   if (ret)
-   return NULL;
 
-   jedec = id[1] << 8 | id[2];
-   ext_jedec = id[3] << 8 | id[4];
+   jedec = idcode[1] << 8 | idcode[2];
+   ext_jedec = idcode[3] << 8 | idcode[4];
 
for (i = 0; i < ARRAY_SIZE(spansion_spi_flash_table); i++) {
params = &spansion_spi_flash_table[i];
diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
index 1902960..c8c460b 100644
--- a/drivers/mtd/spi/spi_flash.c
+++ b/drivers/mtd/spi/spi_flash.c
@@ -101,7 +101,7 @@ struct spi_flash *spi_flash_probe(unsigned int bus, 
unsigned int cs,
struct spi_slave *spi;
struct spi_flash *flash;
int ret;
-   u8 idcode[3];
+   u8 idcode[5];
 
spi = spi_setup_slave(bus, cs, max_hz, spi_mode);
if (!spi) {
@@ -120,8 +120,8 @@ struct spi_flash *spi_flash_probe(unsigned int bus, 
unsigned int cs,
if (ret)
goto err_read_id;
 
-   debug("SF: Got idcode %02x %02x %02x\n", idcode[0],
-   idcode[1], idcode[2]);
+   debug("SF: Got idcode %02x %02x %02x %02x %02x\n", idcode[0],
+   idcode[1], idcode[2], idcode[3], idcode[4]);
 
switch (idcode[0]) {
 #ifdef CONFIG_SPI_FLASH_SPANSION
-- 
1.6.2

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


[U-Boot] [PATCH V2] OMAP: rename timer divisor

2009-03-29 Thread Jean-Christophe PLAGNIOL-VILLARD
From: Ladislav Michl 

Divisor field is called PTV not PVT.

Signed-off-by: Ladislav Michl 
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD 
---
V2:
Fix Remaing CONFIG_SYS_PVT
Best Regards,
J.
 cpu/arm1136/omap24xx/interrupts.c   |2 +-
 cpu/arm925t/interrupts.c|2 +-
 cpu/arm926ejs/omap/timer.c  |2 +-
 cpu/arm_cortexa8/omap3/interrupts.c |2 +-
 include/configs/SX1.h   |6 +++---
 include/configs/apollon.h   |6 ++
 include/configs/netstar.h   |4 ++--
 include/configs/omap1510inn.h   |6 +++---
 include/configs/omap1610h2.h|4 ++--
 include/configs/omap1610inn.h   |4 ++--
 include/configs/omap2420h4.h|   10 +-
 include/configs/omap3_beagle.h  |6 ++
 include/configs/omap3_evm.h |6 ++
 include/configs/omap3_overo.h   |6 ++
 include/configs/omap3_pandora.h |6 ++
 include/configs/omap3_zoom1.h   |6 ++
 include/configs/omap5912osk.h   |4 ++--
 include/configs/omap730p2.h |7 +++
 include/configs/voiceblue.h |6 +++---
 19 files changed, 41 insertions(+), 54 deletions(-)

diff --git a/cpu/arm1136/omap24xx/interrupts.c 
b/cpu/arm1136/omap24xx/interrupts.c
index fb02a49..6be1262 100644
--- a/cpu/arm1136/omap24xx/interrupts.c
+++ b/cpu/arm1136/omap24xx/interrupts.c
@@ -49,7 +49,7 @@ int interrupt_init (void)
 
/* Start the counter ticking up */
*((int32_t *) (CONFIG_SYS_TIMERBASE + TLDR)) = TIMER_LOAD_VAL;  /* 
reload value on overflow*/
-   val = (CONFIG_SYS_PVT << 2) | BIT5 | BIT1 | BIT0;   /* mask 
to enable timer*/
+   val = (CONFIG_SYS_PTV << 2) | BIT5 | BIT1 | BIT0;   /* mask 
to enable timer*/
*((int32_t *) (CONFIG_SYS_TIMERBASE + TCLR)) = val; /* start timer 
*/
 
reset_timer_masked(); /* init the timestamp and lastinc value */
diff --git a/cpu/arm925t/interrupts.c b/cpu/arm925t/interrupts.c
index ce3c4ad..361047b 100644
--- a/cpu/arm925t/interrupts.c
+++ b/cpu/arm925t/interrupts.c
@@ -51,7 +51,7 @@ int interrupt_init (void)
 
/* Start the decrementer ticking down from 0x */
*((int32_t *) (CONFIG_SYS_TIMERBASE + LOAD_TIM)) = TIMER_LOAD_VAL;
-   val = MPUTIM_ST | MPUTIM_AR | MPUTIM_CLOCK_ENABLE | (CONFIG_SYS_PVT << 
MPUTIM_PTV_BIT);
+   val = MPUTIM_ST | MPUTIM_AR | MPUTIM_CLOCK_ENABLE | (CONFIG_SYS_PTV << 
MPUTIM_PTV_BIT);
*((int32_t *) (CONFIG_SYS_TIMERBASE + CNTL_TIMER)) = val;
 
/* init the timestamp and lastdec value */
diff --git a/cpu/arm926ejs/omap/timer.c b/cpu/arm926ejs/omap/timer.c
index 49e74ab..bedc2e7 100644
--- a/cpu/arm926ejs/omap/timer.c
+++ b/cpu/arm926ejs/omap/timer.c
@@ -52,7 +52,7 @@ int timer_init (void)
 
/* Start the decrementer ticking down from 0x */
*((int32_t *) (CONFIG_SYS_TIMERBASE + LOAD_TIM)) = TIMER_LOAD_VAL;
-   val = MPUTIM_ST | MPUTIM_AR | MPUTIM_CLOCK_ENABLE | (CONFIG_SYS_PVT << 
MPUTIM_PTV_BIT);
+   val = MPUTIM_ST | MPUTIM_AR | MPUTIM_CLOCK_ENABLE | (CONFIG_SYS_PTV << 
MPUTIM_PTV_BIT);
*((int32_t *) (CONFIG_SYS_TIMERBASE + CNTL_TIMER)) = val;
 
/* init the timestamp and lastdec value */
diff --git a/cpu/arm_cortexa8/omap3/interrupts.c 
b/cpu/arm_cortexa8/omap3/interrupts.c
index 384ffdc..e0b3fbc 100644
--- a/cpu/arm_cortexa8/omap3/interrupts.c
+++ b/cpu/arm_cortexa8/omap3/interrupts.c
@@ -47,7 +47,7 @@ int interrupt_init(void)
/* start the counter ticking up, reload value on overflow */
writel(TIMER_LOAD_VAL, &timer_base->tldr);
/* enable timer */
-   writel((CONFIG_SYS_PVT << 2) | TCLR_PRE | TCLR_AR | TCLR_ST,
+   writel((CONFIG_SYS_PTV << 2) | TCLR_PRE | TCLR_AR | TCLR_ST,
&timer_base->tclr);
 
reset_timer_masked();   /* init the timestamp and lastinc value */
diff --git a/include/configs/SX1.h b/include/configs/SX1.h
index ebc8236..caa6592 100644
--- a/include/configs/SX1.h
+++ b/include/configs/SX1.h
@@ -138,9 +138,9 @@
 /* The 1510 has 3 timers, they can be driven by the RefClk (12Mhz) or by DPLL1.
  * This time is further subdivided by a local divisor.
  */
-#define CONFIG_SYS_TIMERBASE   0xFFFEC500  /* use timer 1 */
-#define CONFIG_SYS_PVT 7   /* 2^(pvt+1), divide by 256 
*/
-#define CONFIG_SYS_HZ  ((CONFIG_SYS_CLK_FREQ)/(2 << 
CONFIG_SYS_PVT))
+#define CONFIG_SYS_TIMERBASE   OMAP1510_TIMER1_BASE/* use timer 1 */
+#define CONFIG_SYS_PTV 7   /* 2^(PTV+1), divide by 256 */
+#define CONFIG_SYS_HZ  ((CONFIG_SYS_CLK_FREQ)/(2 << CONFIG_SYS_PTV))
 
 /*---
  * Stack sizes
diff --git a/include/configs/apollon.h b/include/configs/apollon.h
index 97c8806..04da083 100644
--- a/include/configs/apollon.h
+++ b/include/configs/apollon.h
@@ -203,11 +203,9 @@
  * or by 32KHz clk, or from external sig. This rate is

[U-Boot] [PATCH 01/19] s3c4510b: move specific code to soc directory

2009-03-29 Thread Jean-Christophe PLAGNIOL-VILLARD
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD 
---
 Makefile   |2 +-
 cpu/arm720t/cpu.c  |   62 --
 cpu/arm720t/s3c4510b/Makefile  |   46 +++
 cpu/arm720t/s3c4510b/cache.c   |   86 
 include/asm-arm/arch-arm720t/hardware.h|4 +-
 .../s3c4510b.h => arch-s3c4510b/hardware.h}|0
 6 files changed, 134 insertions(+), 66 deletions(-)
 create mode 100644 cpu/arm720t/s3c4510b/Makefile
 create mode 100644 cpu/arm720t/s3c4510b/cache.c
 rename include/asm-arm/{arch-arm720t/s3c4510b.h => arch-s3c4510b/hardware.h} 
(100%)

diff --git a/Makefile b/Makefile
index 1cce381..a6dadf6 100644
--- a/Makefile
+++ b/Makefile
@@ -2943,7 +2943,7 @@ modnet50_config : unconfig
@$(MKCONFIG) $(@:_config=) arm arm720t modnet50
 
 evb4510_config :   unconfig
-   @$(MKCONFIG) $(@:_config=) arm arm720t evb4510
+   @$(MKCONFIG) $(@:_config=) arm arm720t evb4510 NULL s3c4510b
 
 lpc2292sodimm_config:  unconfig
@$(MKCONFIG) $(@:_config=) arm arm720t lpc2292sodimm NULL lpc2292
diff --git a/cpu/arm720t/cpu.c b/cpu/arm720t/cpu.c
index 5ac8f59..8166982 100644
--- a/cpu/arm720t/cpu.c
+++ b/cpu/arm720t/cpu.c
@@ -188,71 +188,9 @@ int dcache_status (void)
 {
return (read_p15_c1 () & C1_IDC) != 0;
 }
-
-#elif defined(CONFIG_S3C4510B)
-
-void icache_enable (void)
-{
-   s32 i;
-
-   /* disable all cache bits */
-   CLR_REG( REG_SYSCFG, 0x3F);
-
-   /* 8KB cache, write enable */
-   SET_REG( REG_SYSCFG, CACHE_WRITE_BUFF | CACHE_MODE_01);
-
-   /* clear TAG RAM bits */
-   for ( i = 0; i < 256; i++)
- PUT_REG( CACHE_TAG_RAM + 4*i, 0x);
-
-   /* clear SET0 RAM */
-   for(i=0; i < 1024; i++)
- PUT_REG( CACHE_SET0_RAM + 4*i, 0x);
-
-   /* clear SET1 RAM */
-   for(i=0; i < 1024; i++)
- PUT_REG( CACHE_SET1_RAM + 4*i, 0x);
-
-   /* enable cache */
-   SET_REG( REG_SYSCFG, CACHE_ENABLE);
-
-}
-
-void icache_disable (void)
-{
-   /* disable all cache bits */
-   CLR_REG( REG_SYSCFG, 0x3F);
-}
-
-int icache_status (void)
-{
-   return GET_REG( REG_SYSCFG) & CACHE_ENABLE;
-}
-
-void dcache_enable (void)
-{
-   /* we don't have seperate instruction/data caches */
-   icache_enable();
-}
-
-void dcache_disable (void)
-{
-   /* we don't have seperate instruction/data caches */
-   icache_disable();
-}
-
-int dcache_status (void)
-{
-   /* we don't have seperate instruction/data caches */
-   return icache_status();
-}
-
 #elif defined(CONFIG_INTEGRATOR) && defined(CONFIG_ARCH_INTEGRATOR)
/* No specific cache setup for IntegratorAP/CM720T as yet */
void icache_enable (void)
{
}
-#elif defined(CONFIG_LPC2292) /* just to satisfy the compiler */
-#else
-#error No icache/dcache enable/disable functions defined for this CPU type
 #endif
diff --git a/cpu/arm720t/s3c4510b/Makefile b/cpu/arm720t/s3c4510b/Makefile
new file mode 100644
index 000..c9520b6
--- /dev/null
+++ b/cpu/arm720t/s3c4510b/Makefile
@@ -0,0 +1,46 @@
+#
+# (C) Copyright 2000-2008
+# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(SOC).a
+
+COBJS-y+= cache.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS-y))
+
+all:   $(obj).depend $(LIB)
+
+$(LIB):$(OBJS)
+   $(AR) $(ARFLAGS) $@ $(OBJS)
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
+
diff --git a/cpu/arm720t/s3c4510b/cache.c b/cpu/arm720t/s3c4510b/cache.c
new file mode 100644
index 000..104d287
--- /dev/null
+++ b/cpu/arm720t/s3c4510b/cache.c
@@ -0,0 +1,86 @@
+/*
+ * (C) Copyright 2002
+ * Sysgo Real-Time Solutions, GmbH 
+ * Marius Groeger 
+ *
+ * (C) Copyright 2002
+ * Sysgo Real-Time Solutions, GmbH 
+ * Alex Zuepke 
+ *
+ * See file CREDITS for list of people who c

[U-Boot] [PATCH 06/19] sa1100: move serial driver to drivers/serial

2009-03-29 Thread Jean-Christophe PLAGNIOL-VILLARD
add CONFIG_SA1100_SERIAL to activate the driver

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD 
---
 cpu/sa1100/Makefile|2 +-
 drivers/serial/Makefile|1 +
 .../serial.c => drivers/serial/serial_sa1100.c |0
 include/configs/assabet.h  |1 +
 include/configs/dnp1110.h  |1 +
 include/configs/gcplus.h   |1 +
 include/configs/lart.h |1 +
 include/configs/shannon.h  |1 +
 8 files changed, 7 insertions(+), 1 deletions(-)
 rename cpu/sa1100/serial.c => drivers/serial/serial_sa1100.c (100%)

diff --git a/cpu/sa1100/Makefile b/cpu/sa1100/Makefile
index 790faeb..fd696f7 100644
--- a/cpu/sa1100/Makefile
+++ b/cpu/sa1100/Makefile
@@ -26,7 +26,7 @@ include $(TOPDIR)/config.mk
 LIB= $(obj)lib$(CPU).a
 
 START  = start.o
-COBJS  = serial.o interrupts.o cpu.o
+COBJS  = interrupts.o cpu.o
 
 SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
index 37cc5a0..8cac794 100644
--- a/drivers/serial/Makefile
+++ b/drivers/serial/Makefile
@@ -37,6 +37,7 @@ COBJS-$(CONFIG_IXP_SERIAL) += serial_ixp.o
 COBJS-$(CONFIG_MAX3100_SERIAL) += serial_max3100.o
 COBJS-$(CONFIG_PL010_SERIAL) += serial_pl01x.o
 COBJS-$(CONFIG_PL011_SERIAL) += serial_pl01x.o
+COBJS-$(CONFIG_SA1100_SERIAL) += serial_sa1100.o
 COBJS-$(CONFIG_S3C44B0_SERIAL) += serial_s3c44b0.o
 COBJS-$(CONFIG_XILINX_UARTLITE) += serial_xuartlite.o
 COBJS-$(CONFIG_SCIF_CONSOLE) += serial_sh.o
diff --git a/cpu/sa1100/serial.c b/drivers/serial/serial_sa1100.c
similarity index 100%
rename from cpu/sa1100/serial.c
rename to drivers/serial/serial_sa1100.c
diff --git a/include/configs/assabet.h b/include/configs/assabet.h
index 4da68b3..a6c442b 100644
--- a/include/configs/assabet.h
+++ b/include/configs/assabet.h
@@ -57,6 +57,7 @@
 /*
  * select serial console configuration
  */
+#define CONFIG_SA1100_SERIAL
 #define CONFIG_SERIAL1  1  /* we use SERIAL 1 on Intel Assabet */
 
 /* allow to overwrite serial and ethaddr */
diff --git a/include/configs/dnp1110.h b/include/configs/dnp1110.h
index 3f658a7..8f615bd 100644
--- a/include/configs/dnp1110.h
+++ b/include/configs/dnp1110.h
@@ -59,6 +59,7 @@
 /*
  * select serial console configuration
  */
+#define CONFIG_SA1100_SERIAL
 #define CONFIG_SERIAL1  1  /* we use SERIAL 1 */
 
 /* allow to overwrite serial and ethaddr */
diff --git a/include/configs/gcplus.h b/include/configs/gcplus.h
index 81ee05f..77d4578 100644
--- a/include/configs/gcplus.h
+++ b/include/configs/gcplus.h
@@ -70,6 +70,7 @@
 /*
  * select serial console configuration
  */
+#define CONFIG_SA1100_SERIAL
 #define CONFIG_SERIAL3  1  /* we use SERIAL 3 on ADS GCPlus */
 
 /* allow to overwrite serial and ethaddr */
diff --git a/include/configs/lart.h b/include/configs/lart.h
index 877d5c7..e34ec22 100644
--- a/include/configs/lart.h
+++ b/include/configs/lart.h
@@ -52,6 +52,7 @@
 /*
  * select serial console configuration
  */
+#define CONFIG_SA1100_SERIAL
 #define CONFIG_SERIAL3  1  /* we use SERIAL 3 on LART */
 
 /* allow to overwrite serial and ethaddr */
diff --git a/include/configs/shannon.h b/include/configs/shannon.h
index 717036c..c8b0b16 100644
--- a/include/configs/shannon.h
+++ b/include/configs/shannon.h
@@ -59,6 +59,7 @@
 /*
  * select serial console configuration
  */
+#define CONFIG_SA1100_SERIAL
 #define CONFIG_SERIAL3  1  /* we use SERIAL 3  */
 
 /* allow to overwrite serial and ethaddr */
-- 
1.6.2.1

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


[U-Boot] [PATCH 05/19] s3c44b0: extract cache from cpu.c

2009-03-29 Thread Jean-Christophe PLAGNIOL-VILLARD
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD 
---
 cpu/s3c44b0/Makefile   |2 +-
 cpu/s3c44b0/{cpu.c => cache.c} |   56 +---
 cpu/s3c44b0/cpu.c  |   62 
 3 files changed, 2 insertions(+), 118 deletions(-)
 copy cpu/s3c44b0/{cpu.c => cache.c} (71%)

diff --git a/cpu/s3c44b0/Makefile b/cpu/s3c44b0/Makefile
index fd696f7..ae909a6 100644
--- a/cpu/s3c44b0/Makefile
+++ b/cpu/s3c44b0/Makefile
@@ -26,7 +26,7 @@ include $(TOPDIR)/config.mk
 LIB= $(obj)lib$(CPU).a
 
 START  = start.o
-COBJS  = interrupts.o cpu.o
+COBJS  = cache.o cpu.o interrupts.o
 
 SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
diff --git a/cpu/s3c44b0/cpu.c b/cpu/s3c44b0/cache.c
similarity index 71%
copy from cpu/s3c44b0/cpu.c
copy to cpu/s3c44b0/cache.c
index 752191d..bc10171 100644
--- a/cpu/s3c44b0/cpu.c
+++ b/cpu/s3c44b0/cache.c
@@ -24,10 +24,6 @@
  * MA 02111-1307 USA
  */
 
-/*
- * S3C44B0 CPU specific code
- */
-
 #include 
 #include 
 #include 
@@ -42,57 +38,6 @@ static void s3c44b0_flush_cache(void)
}
 }
 
-
-int cpu_init (void)
-{
-   icache_enable();
-
-   return 0;
-}
-
-int cleanup_before_linux (void)
-{
-   /*
-   cache memory should be enabled before calling
-   Linux to make the kernel uncompression faster
-   */
-   icache_enable();
-
-   disable_interrupts ();
-
-   return 0;
-}
-
-void reset_cpu (ulong addr)
-{
-   /*
-   reset the cpu using watchdog
-   */
-
-   /* Disable the watchdog.*/
-   WTCON&=~(1<<5);
-
-   /* set the timeout value to a short time... */
-   WTCNT = 0x1;
-
-   /* Enable the watchdog. */
-   WTCON|=1;
-   WTCON|=(1<<5);
-
-   while(1) {
-   /*NOP*/
-   }
-}
-
-int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
-{
-   disable_interrupts ();
-   reset_cpu (0);
-
-   /*NOTREACHED*/
-   return (0);
-}
-
 void icache_enable (void)
 {
ulong reg;
@@ -143,3 +88,4 @@ int dcache_status (void)
 {
return dcache_status();
 }
+
diff --git a/cpu/s3c44b0/cpu.c b/cpu/s3c44b0/cpu.c
index 752191d..e4cdb82 100644
--- a/cpu/s3c44b0/cpu.c
+++ b/cpu/s3c44b0/cpu.c
@@ -32,17 +32,6 @@
 #include 
 #include 
 
-static void s3c44b0_flush_cache(void)
-{
-   volatile int i;
-   /* flush cycle */
-   for(i=0x10002000;i<0x10004800;i+=16)
-   {
-   *((int *)i)=0x0;
-   }
-}
-
-
 int cpu_init (void)
 {
icache_enable();
@@ -92,54 +81,3 @@ int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char 
*argv[])
/*NOTREACHED*/
return (0);
 }
-
-void icache_enable (void)
-{
-   ulong reg;
-
-   s3c44b0_flush_cache();
-
-   /*
-   Init cache
-   Non-cacheable area (everything outside RAM)
-   0x: - 0x0C00:
-*/
-   NCACHBE0 = 0xC000;
-   NCACHBE1 = 0x;
-
-   /*
-   Enable chache
-   */
-   reg = SYSCFG;
-   reg |= 0x0006; /* 8kB */
-   SYSCFG = reg;
-}
-
-void icache_disable (void)
-{
-   ulong reg;
-
-   reg = SYSCFG;
-   reg &= ~0x0006; /* 8kB */
-   SYSCFG = reg;
-}
-
-int icache_status (void)
-{
-   return 0;
-}
-
-void dcache_enable (void)
-{
-   icache_enable();
-}
-
-void dcache_disable (void)
-{
-   icache_disable();
-}
-
-int dcache_status (void)
-{
-   return dcache_status();
-}
-- 
1.6.2.1

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


[U-Boot] [PATCH 04/19] s3c44b0: move serial driver to drivers/serial

2009-03-29 Thread Jean-Christophe PLAGNIOL-VILLARD
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD 
---
 cpu/s3c44b0/Makefile   |2 +-
 drivers/serial/Makefile|1 +
 .../serial.c => drivers/serial/serial_s3c44b0.c|0
 include/configs/B2.h   |1 +
 4 files changed, 3 insertions(+), 1 deletions(-)
 rename cpu/s3c44b0/serial.c => drivers/serial/serial_s3c44b0.c (100%)

diff --git a/cpu/s3c44b0/Makefile b/cpu/s3c44b0/Makefile
index 790faeb..fd696f7 100644
--- a/cpu/s3c44b0/Makefile
+++ b/cpu/s3c44b0/Makefile
@@ -26,7 +26,7 @@ include $(TOPDIR)/config.mk
 LIB= $(obj)lib$(CPU).a
 
 START  = start.o
-COBJS  = serial.o interrupts.o cpu.o
+COBJS  = interrupts.o cpu.o
 
 SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
index d0efd73..37cc5a0 100644
--- a/drivers/serial/Makefile
+++ b/drivers/serial/Makefile
@@ -37,6 +37,7 @@ COBJS-$(CONFIG_IXP_SERIAL) += serial_ixp.o
 COBJS-$(CONFIG_MAX3100_SERIAL) += serial_max3100.o
 COBJS-$(CONFIG_PL010_SERIAL) += serial_pl01x.o
 COBJS-$(CONFIG_PL011_SERIAL) += serial_pl01x.o
+COBJS-$(CONFIG_S3C44B0_SERIAL) += serial_s3c44b0.o
 COBJS-$(CONFIG_XILINX_UARTLITE) += serial_xuartlite.o
 COBJS-$(CONFIG_SCIF_CONSOLE) += serial_sh.o
 COBJS-$(CONFIG_USB_TTY) += usbtty.o
diff --git a/cpu/s3c44b0/serial.c b/drivers/serial/serial_s3c44b0.c
similarity index 100%
rename from cpu/s3c44b0/serial.c
rename to drivers/serial/serial_s3c44b0.c
diff --git a/include/configs/B2.h b/include/configs/B2.h
index 9340db6..01b65c5 100644
--- a/include/configs/B2.h
+++ b/include/configs/B2.h
@@ -65,6 +65,7 @@
 /*
  * select serial console configuration
  */
+#define CONFIG_S3C44B0_SERIAL
 #define CONFIG_SERIAL1 1   /* we use Serial line 1 */
 
 #define CONFIG_S3C44B0_I2C
-- 
1.6.2.1

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


[U-Boot] [PATCH 03/19] s3c44b0: move rtc driver to drivers/rtc

2009-03-29 Thread Jean-Christophe PLAGNIOL-VILLARD
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD 
---
 cpu/s3c44b0/cpu.c |   77 --
 drivers/rtc/Makefile  |1 +
 drivers/rtc/s3c44b0_rtc.c |  102 +
 include/configs/B2.h  |1 +
 4 files changed, 104 insertions(+), 77 deletions(-)
 create mode 100644 drivers/rtc/s3c44b0_rtc.c

diff --git a/cpu/s3c44b0/cpu.c b/cpu/s3c44b0/cpu.c
index 0c44691..752191d 100644
--- a/cpu/s3c44b0/cpu.c
+++ b/cpu/s3c44b0/cpu.c
@@ -143,80 +143,3 @@ int dcache_status (void)
 {
return dcache_status();
 }
-
-/*
-   RTC stuff
-*/
-#include 
-#ifndef BCD2HEX
-   #define BCD2HEX(n)  ((n>>4)*10+(n&0x0f))
-#endif
-#ifndef HEX2BCD
-   #define HEX2BCD(x) x) / 10) << 4) + (x) % 10)
-#endif
-
-int rtc_get (struct rtc_time* tm)
-{
-   RTCCON |= 1;
-   tm->tm_year  = BCD2HEX(BCDYEAR);
-   tm->tm_mon   = BCD2HEX(BCDMON);
-   tm->tm_wday   = BCD2HEX(BCDDATE);
-   tm->tm_mday   = BCD2HEX(BCDDAY);
-   tm->tm_hour  = BCD2HEX(BCDHOUR);
-   tm->tm_min  = BCD2HEX(BCDMIN);
-   tm->tm_sec  = BCD2HEX(BCDSEC);
-
-   if (tm->tm_sec==0) {
-   /* we have to re-read the rtc data because of the "one second 
deviation" problem */
-   /* see RTC datasheet for more info about it */
-   tm->tm_year  = BCD2HEX(BCDYEAR);
-   tm->tm_mon   = BCD2HEX(BCDMON);
-   tm->tm_mday   = BCD2HEX(BCDDAY);
-   tm->tm_wday   = BCD2HEX(BCDDATE);
-   tm->tm_hour  = BCD2HEX(BCDHOUR);
-   tm->tm_min  = BCD2HEX(BCDMIN);
-   tm->tm_sec  = BCD2HEX(BCDSEC);
-   }
-
-   RTCCON &= ~1;
-
-   if(tm->tm_year >= 70)
-   tm->tm_year += 1900;
-   else
-   tm->tm_year += 2000;
-
-   return 0;
-}
-
-int rtc_set (struct rtc_time* tm)
-{
-   if(tm->tm_year < 2000)
-   tm->tm_year -= 1900;
-   else
-   tm->tm_year -= 2000;
-
-   RTCCON |= 1;
-   BCDYEAR = HEX2BCD(tm->tm_year);
-   BCDMON = HEX2BCD(tm->tm_mon);
-   BCDDAY = HEX2BCD(tm->tm_mday);
-   BCDDATE = HEX2BCD(tm->tm_wday);
-   BCDHOUR = HEX2BCD(tm->tm_hour);
-   BCDMIN = HEX2BCD(tm->tm_min);
-   BCDSEC = HEX2BCD(tm->tm_sec);
-   RTCCON &= 1;
-
-   return 0;
-}
-
-void rtc_reset (void)
-{
-   RTCCON |= 1;
-   BCDYEAR = 0;
-   BCDMON = 0;
-   BCDDAY = 0;
-   BCDDATE = 0;
-   BCDHOUR = 0;
-   BCDMIN = 0;
-   BCDSEC = 0;
-   RTCCON &= 1;
-}
diff --git a/drivers/rtc/Makefile b/drivers/rtc/Makefile
index 94bc518..3831dd9 100644
--- a/drivers/rtc/Makefile
+++ b/drivers/rtc/Makefile
@@ -57,6 +57,7 @@ COBJS-$(CONFIG_RTC_PL031) += pl031.o
 COBJS-$(CONFIG_RTC_RS5C372A) += rs5c372.o
 COBJS-$(CONFIG_RTC_RX8025) += rx8025.o
 COBJS-$(CONFIG_RTC_S3C24X0) += s3c24x0_rtc.o
+COBJS-$(CONFIG_RTC_S3C44B0) += s3c44b0_rtc.o
 COBJS-$(CONFIG_RTC_X1205) += x1205.o
 
 COBJS  := $(sort $(COBJS-y))
diff --git a/drivers/rtc/s3c44b0_rtc.c b/drivers/rtc/s3c44b0_rtc.c
new file mode 100644
index 000..489536f
--- /dev/null
+++ b/drivers/rtc/s3c44b0_rtc.c
@@ -0,0 +1,102 @@
+/*
+ * (C) Copyright 2004
+ * DAVE Srl
+ * http://www.dave-tech.it
+ * http://www.wawnet.biz
+ * mailto:i...@wawnet.biz
+ *
+ * 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
+ */
+
+/*
+ * S3C44B0 CPU specific code
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+int rtc_get (struct rtc_time* tm)
+{
+   RTCCON |= 1;
+   tm->tm_year  = BCD2BIN(BCDYEAR);
+   tm->tm_mon   = BCD2BIN(BCDMON);
+   tm->tm_wday   = BCD2BIN(BCDDATE);
+   tm->tm_mday   = BCD2BIN(BCDDAY);
+   tm->tm_hour  = BCD2BIN(BCDHOUR);
+   tm->tm_min  = BCD2BIN(BCDMIN);
+   tm->tm_sec  = BCD2BIN(BCDSEC);
+
+   if (tm->tm_sec==0) {
+   /* we have to re-read the rtc data because of the "one second 
deviation" problem */
+   /* see RTC datasheet for more info about it */
+   tm->tm_year  = BCD2BIN(BCDYEAR);
+   tm->tm_mon   = BCD2BIN(BCDMON);
+   tm->tm_mday   = BCD2BIN(BCDDAY);
+   tm->tm_wday   = BCD2BIN(BCDDATE);
+   tm->tm_hour  = BCD2BIN(BCDHOUR);
+  

[U-Boot] [PATCH 07/19] netarm: move serial driver to drivers/serial

2009-03-29 Thread Jean-Christophe PLAGNIOL-VILLARD
add CONFIG_NETARM_SERIAL to activate the driver

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD 
---
 cpu/arm720t/Makefile|2 +-
 drivers/serial/Makefile |1 +
 {cpu/arm720t => drivers/serial}/serial_netarm.c |5 -
 include/configs/modnet50.h  |1 +
 4 files changed, 3 insertions(+), 6 deletions(-)
 rename {cpu/arm720t => drivers/serial}/serial_netarm.c (99%)

diff --git a/cpu/arm720t/Makefile b/cpu/arm720t/Makefile
index c97f329..a038042 100644
--- a/cpu/arm720t/Makefile
+++ b/cpu/arm720t/Makefile
@@ -26,7 +26,7 @@ include $(TOPDIR)/config.mk
 LIB= $(obj)lib$(CPU).a
 
 START  = start.o
-COBJS  = serial.o serial_netarm.o interrupts.o cpu.o
+COBJS  = serial.o interrupts.o cpu.o
 
 SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS) $(SOBJS))
diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
index 8cac794..e76a2ad 100644
--- a/drivers/serial/Makefile
+++ b/drivers/serial/Makefile
@@ -35,6 +35,7 @@ COBJS-$(CONFIG_S3C64XX) += s3c64xx.o
 COBJS-$(CONFIG_SYS_NS16550_SERIAL) += serial.o
 COBJS-$(CONFIG_IXP_SERIAL) += serial_ixp.o
 COBJS-$(CONFIG_MAX3100_SERIAL) += serial_max3100.o
+COBJS-$(CONFIG_NETARM_SERIAL) += serial_netarm.o
 COBJS-$(CONFIG_PL010_SERIAL) += serial_pl01x.o
 COBJS-$(CONFIG_PL011_SERIAL) += serial_pl01x.o
 COBJS-$(CONFIG_SA1100_SERIAL) += serial_sa1100.o
diff --git a/cpu/arm720t/serial_netarm.c b/drivers/serial/serial_netarm.c
similarity index 99%
rename from cpu/arm720t/serial_netarm.c
rename to drivers/serial/serial_netarm.c
index 1a1b2db..2eb5393 100644
--- a/cpu/arm720t/serial_netarm.c
+++ b/drivers/serial/serial_netarm.c
@@ -29,9 +29,6 @@
  */
 
 #include 
-
-#ifdef CONFIG_NETARM
-
 #include 
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -196,5 +193,3 @@ void serial_puts (const char *s)
serial_putc (*s++);
}
 }
-
-#endif /* CONFIG_NETARM */
diff --git a/include/configs/modnet50.h b/include/configs/modnet50.h
index b8ae018..74bab5f 100644
--- a/include/configs/modnet50.h
+++ b/include/configs/modnet50.h
@@ -56,6 +56,7 @@
 /*
  * select serial console configuration
  */
+#define CONFIG_NETARM_SERIAL
 #define CONFIG_SERIAL1 1   /* we use Serial line 1 */
 
 /* allow to overwrite serial and ethaddr */
-- 
1.6.2.1

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


[U-Boot] [PATCH 02/19] s3c44b0: move i2c driver to drivers/i2c

2009-03-29 Thread Jean-Christophe PLAGNIOL-VILLARD
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD 
---
 cpu/s3c44b0/cpu.c  |  735 +++-
 drivers/i2c/Makefile   |1 +
 cpu/s3c44b0/cpu.c => drivers/i2c/s3c44b0_i2c.c |  198 ---
 include/configs/B2.h   |2 +
 4 files changed, 225 insertions(+), 711 deletions(-)
 rewrite cpu/s3c44b0/cpu.c (60%)
 rename cpu/s3c44b0/cpu.c => drivers/i2c/s3c44b0_i2c.c (70%)

diff --git a/cpu/s3c44b0/cpu.c b/cpu/s3c44b0/cpu.c
dissimilarity index 60%
index 2960f2f..0c44691 100644
--- a/cpu/s3c44b0/cpu.c
+++ b/cpu/s3c44b0/cpu.c
@@ -1,513 +1,222 @@
-/*
- * (C) Copyright 2004
- * DAVE Srl
- * http://www.dave-tech.it
- * http://www.wawnet.biz
- * mailto:i...@wawnet.biz
- *
- * 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
- */
-
-/*
- * S3C44B0 CPU specific code
- */
-
-#include 
-#include 
-#include 
-
-static void s3c44b0_flush_cache(void)
-{
-   volatile int i;
-   /* flush cycle */
-   for(i=0x10002000;i<0x10004800;i+=16)
-   {
-   *((int *)i)=0x0;
-   }
-}
-
-
-int cpu_init (void)
-{
-   icache_enable();
-
-   return 0;
-}
-
-int cleanup_before_linux (void)
-{
-   /*
-   cache memory should be enabled before calling
-   Linux to make the kernel uncompression faster
-   */
-   icache_enable();
-
-   disable_interrupts ();
-
-   return 0;
-}
-
-void reset_cpu (ulong addr)
-{
-   /*
-   reset the cpu using watchdog
-   */
-
-   /* Disable the watchdog.*/
-   WTCON&=~(1<<5);
-
-   /* set the timeout value to a short time... */
-   WTCNT = 0x1;
-
-   /* Enable the watchdog. */
-   WTCON|=1;
-   WTCON|=(1<<5);
-
-   while(1) {
-   /*NOP*/
-   }
-}
-
-int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
-{
-   disable_interrupts ();
-   reset_cpu (0);
-
-   /*NOTREACHED*/
-   return (0);
-}
-
-void icache_enable (void)
-{
-   ulong reg;
-
-   s3c44b0_flush_cache();
-
-   /*
-   Init cache
-   Non-cacheable area (everything outside RAM)
-   0x: - 0x0C00:
-*/
-   NCACHBE0 = 0xC000;
-   NCACHBE1 = 0x;
-
-   /*
-   Enable chache
-   */
-   reg = SYSCFG;
-   reg |= 0x0006; /* 8kB */
-   SYSCFG = reg;
-}
-
-void icache_disable (void)
-{
-   ulong reg;
-
-   reg = SYSCFG;
-   reg &= ~0x0006; /* 8kB */
-   SYSCFG = reg;
-}
-
-int icache_status (void)
-{
-   return 0;
-}
-
-void dcache_enable (void)
-{
-   icache_enable();
-}
-
-void dcache_disable (void)
-{
-   icache_disable();
-}
-
-int dcache_status (void)
-{
-   return dcache_status();
-}
-
-/*
-   RTC stuff
-*/
-#include 
-#ifndef BCD2HEX
-   #define BCD2HEX(n)  ((n>>4)*10+(n&0x0f))
-#endif
-#ifndef HEX2BCD
-   #define HEX2BCD(x) x) / 10) << 4) + (x) % 10)
-#endif
-
-int rtc_get (struct rtc_time* tm)
-{
-   RTCCON |= 1;
-   tm->tm_year  = BCD2HEX(BCDYEAR);
-   tm->tm_mon   = BCD2HEX(BCDMON);
-   tm->tm_wday   = BCD2HEX(BCDDATE);
-   tm->tm_mday   = BCD2HEX(BCDDAY);
-   tm->tm_hour  = BCD2HEX(BCDHOUR);
-   tm->tm_min  = BCD2HEX(BCDMIN);
-   tm->tm_sec  = BCD2HEX(BCDSEC);
-
-   if (tm->tm_sec==0) {
-   /* we have to re-read the rtc data because of the "one second 
deviation" problem */
-   /* see RTC datasheet for more info about it */
-   tm->tm_year  = BCD2HEX(BCDYEAR);
-   tm->tm_mon   = BCD2HEX(BCDMON);
-   tm->tm_mday   = BCD2HEX(BCDDAY);
-   tm->tm_wday   = BCD2HEX(BCDDATE);
-   tm->tm_hour  = BCD2HEX(BCDHOUR);
-   tm->tm_min  = BCD2HEX(BCDMIN);
-   tm->tm_sec  = BCD2HEX(BCDSEC);
-   }
-
-   RTCCON &= ~1;
-
-   if(tm->tm_year >= 70)
-   tm->tm_year += 1900;
-   else
-   tm->tm_year += 2000;
-
-   return 0;
-}
-
-int rtc_set (struct rtc_time* tm)
-{
-   if(tm->tm_year < 2000)
-   tm->tm_year -= 1900;
-   else
-   tm->tm_year -= 2000;
-
-   RTCCON |= 1;
-   BCDYEAR = 

[U-Boot] [PATCH 08/19] imx31: move serial driver to drivers/serial

2009-03-29 Thread Jean-Christophe PLAGNIOL-VILLARD
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD 
---
 cpu/arm1136/mx31/Makefile  |2 +-
 drivers/serial/Makefile|1 +
 .../mx31/serial.c => drivers/serial/serial_mx31.c  |6 --
 3 files changed, 2 insertions(+), 7 deletions(-)
 rename cpu/arm1136/mx31/serial.c => drivers/serial/serial_mx31.c (99%)

diff --git a/cpu/arm1136/mx31/Makefile b/cpu/arm1136/mx31/Makefile
index b648ffd..0e06f0a 100644
--- a/cpu/arm1136/mx31/Makefile
+++ b/cpu/arm1136/mx31/Makefile
@@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk
 
 LIB= $(obj)lib$(SOC).a
 
-COBJS  = interrupts.o serial.o generic.o
+COBJS  = interrupts.o generic.o
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
index e76a2ad..619d9da 100644
--- a/drivers/serial/Makefile
+++ b/drivers/serial/Makefile
@@ -35,6 +35,7 @@ COBJS-$(CONFIG_S3C64XX) += s3c64xx.o
 COBJS-$(CONFIG_SYS_NS16550_SERIAL) += serial.o
 COBJS-$(CONFIG_IXP_SERIAL) += serial_ixp.o
 COBJS-$(CONFIG_MAX3100_SERIAL) += serial_max3100.o
+COBJS-$(CONFIG_MX31_UART) += serial_mx31.o
 COBJS-$(CONFIG_NETARM_SERIAL) += serial_netarm.o
 COBJS-$(CONFIG_PL010_SERIAL) += serial_pl01x.o
 COBJS-$(CONFIG_PL011_SERIAL) += serial_pl01x.o
diff --git a/cpu/arm1136/mx31/serial.c b/drivers/serial/serial_mx31.c
similarity index 99%
rename from cpu/arm1136/mx31/serial.c
rename to drivers/serial/serial_mx31.c
index e025e94..7c0682a 100644
--- a/cpu/arm1136/mx31/serial.c
+++ b/drivers/serial/serial_mx31.c
@@ -18,9 +18,6 @@
  */
 
 #include 
-
-#if defined CONFIG_MX31_UART
-
 #include 
 
 #define __REG(x) (*((volatile u32 *)(x)))
@@ -227,6 +224,3 @@ int serial_init (void)
 
return 0;
 }
-
-
-#endif /* CONFIG_MX31 */
-- 
1.6.2.1

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


[U-Boot] [PATCH 09/19] s3c64xx: move usb driver to drivers/usb

2009-03-29 Thread Jean-Christophe PLAGNIOL-VILLARD
add CONFIG_USB_S3C64XX to activate the driver

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD 
---
 cpu/arm1176/s3c64xx/Makefile   |1 -
 drivers/usb/Makefile   |1 +
 .../s3c64xx/usb.c => drivers/usb/s3c64xx_usb.c |0
 include/configs/smdk6400.h |1 +
 4 files changed, 2 insertions(+), 1 deletions(-)
 rename cpu/arm1176/s3c64xx/usb.c => drivers/usb/s3c64xx_usb.c (100%)

diff --git a/cpu/arm1176/s3c64xx/Makefile b/cpu/arm1176/s3c64xx/Makefile
index 4ab1811..fa4ee3f 100644
--- a/cpu/arm1176/s3c64xx/Makefile
+++ b/cpu/arm1176/s3c64xx/Makefile
@@ -30,7 +30,6 @@ LIB   = $(obj)lib$(SOC).a
 
 COBJS-y= interrupts.o
 COBJS-$(CONFIG_S3C6400)+= cpu_init.o speed.o
-COBJS-$(CONFIG_USB_OHCI_NEW) += usb.o
 
 OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS-y))
 
diff --git a/drivers/usb/Makefile b/drivers/usb/Makefile
index b306a65..7ddb72a 100644
--- a/drivers/usb/Makefile
+++ b/drivers/usb/Makefile
@@ -33,6 +33,7 @@ COBJS-$(CONFIG_USB_EHCI) += usb_ehci_core.o
 # host
 COBJS-$(CONFIG_USB_ISP116X_HCD) += isp116x-hcd.o
 COBJS-$(CONFIG_USB_R8A66597_HCD) += r8a66597-hcd.o
+COBJS-$(CONFIG_USB_S3C64XX) += s3c64xx_usb.o
 COBJS-$(CONFIG_USB_SL811HS) += sl811_usb.o
 COBJS-$(CONFIG_USB_EHCI_FSL) += usb_ehci_fsl.o
 COBJS-$(CONFIG_USB_EHCI_PCI) += usb_ehci_pci.o
diff --git a/cpu/arm1176/s3c64xx/usb.c b/drivers/usb/s3c64xx_usb.c
similarity index 100%
rename from cpu/arm1176/s3c64xx/usb.c
rename to drivers/usb/s3c64xx_usb.c
diff --git a/include/configs/smdk6400.h b/include/configs/smdk6400.h
index 06d6a88..d3cf6e5 100644
--- a/include/configs/smdk6400.h
+++ b/include/configs/smdk6400.h
@@ -288,6 +288,7 @@
 
 #if !defined(CONFIG_ENABLE_MMU)
 #define CONFIG_CMD_USB 1
+#define CONFIG_USB_S3C64XX
 #define CONFIG_USB_OHCI_NEW1
 #define CONFIG_SYS_USB_OHCI_REGS_BASE  0x7430
 #define CONFIG_SYS_USB_OHCI_SLOT_NAME  "s3c6400"
-- 
1.6.2.1

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


[U-Boot] [PATCH 10/19] ks8695: move serial driver to drivers/serial

2009-03-29 Thread Jean-Christophe PLAGNIOL-VILLARD
add CONFIG_KS8695_SERIAL to activate the driver

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD 
---
 cpu/arm920t/ks8695/Makefile|2 +-
 drivers/serial/Makefile|1 +
 .../serial.c => drivers/serial/serial_ks8695.c |0
 include/configs/cm4008.h   |1 +
 include/configs/cm41xx.h   |1 +
 5 files changed, 4 insertions(+), 1 deletions(-)
 rename cpu/arm920t/ks8695/serial.c => drivers/serial/serial_ks8695.c (100%)

diff --git a/cpu/arm920t/ks8695/Makefile b/cpu/arm920t/ks8695/Makefile
index 7db9473..f6b0063 100644
--- a/cpu/arm920t/ks8695/Makefile
+++ b/cpu/arm920t/ks8695/Makefile
@@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk
 
 LIB= $(obj)lib$(SOC).a
 
-COBJS  = interrupts.o serial.o
+COBJS  = interrupts.o
 SOBJS  = lowlevel_init.o
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
index 619d9da..95255df 100644
--- a/drivers/serial/Makefile
+++ b/drivers/serial/Makefile
@@ -34,6 +34,7 @@ COBJS-$(CONFIG_DRIVER_S3C4510_UART) += s3c4510b_uart.o
 COBJS-$(CONFIG_S3C64XX) += s3c64xx.o
 COBJS-$(CONFIG_SYS_NS16550_SERIAL) += serial.o
 COBJS-$(CONFIG_IXP_SERIAL) += serial_ixp.o
+COBJS-$(CONFIG_KS8695_SERIAL) += serial_ks8695.o
 COBJS-$(CONFIG_MAX3100_SERIAL) += serial_max3100.o
 COBJS-$(CONFIG_MX31_UART) += serial_mx31.o
 COBJS-$(CONFIG_NETARM_SERIAL) += serial_netarm.o
diff --git a/cpu/arm920t/ks8695/serial.c b/drivers/serial/serial_ks8695.c
similarity index 100%
rename from cpu/arm920t/ks8695/serial.c
rename to drivers/serial/serial_ks8695.c
diff --git a/include/configs/cm4008.h b/include/configs/cm4008.h
index 124fad7..7ea1a46 100644
--- a/include/configs/cm4008.h
+++ b/include/configs/cm4008.h
@@ -53,6 +53,7 @@
  * select serial console configuration
  */
 #define CONFIG_ENV_IS_NOWHERE
+#define CONFIG_KS8695_SERIAL
 #defineCONFIG_SERIAL1
 #define CONFIG_CONS_INDEX  1
 #define CONFIG_BAUDRATE115200
diff --git a/include/configs/cm41xx.h b/include/configs/cm41xx.h
index 5c255ce..ea374da 100644
--- a/include/configs/cm41xx.h
+++ b/include/configs/cm41xx.h
@@ -53,6 +53,7 @@
  * select serial console configuration
  */
 #define CONFIG_ENV_IS_NOWHERE
+#define CONFIG_KS8695_SERIAL
 #defineCONFIG_SERIAL1
 #define CONFIG_CONS_INDEX  1
 #define CONFIG_BAUDRATE115200
-- 
1.6.2.1

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


[U-Boot] [PATCH 11/19] lpc2292: move serial driver to drivers/serial

2009-03-29 Thread Jean-Christophe PLAGNIOL-VILLARD
add CONFIG_LPC2292_SERIAL to activate the driver

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD 
---
 cpu/arm720t/serial.c|   77 
 drivers/serial/Makefile |1 +
 drivers/serial/serial_lpc2292.c |  105 +++
 include/configs/SMN42.h |1 +
 include/configs/lpc2292sodimm.h |1 +
 5 files changed, 108 insertions(+), 77 deletions(-)
 create mode 100644 drivers/serial/serial_lpc2292.c

diff --git a/cpu/arm720t/serial.c b/cpu/arm720t/serial.c
index 54a9b31..b54d1cf 100644
--- a/cpu/arm720t/serial.c
+++ b/cpu/arm720t/serial.c
@@ -122,81 +122,4 @@ serial_puts (const char *s)
serial_putc (*s++);
}
 }
-
-#elif defined(CONFIG_LPC2292)
-
-DECLARE_GLOBAL_DATA_PTR;
-
-#include 
-
-void serial_setbrg (void)
-{
-   unsigned short divisor = 0;
-
-   switch (gd->baudrate) {
-   case   1200:divisor = 3072; break;
-   case   9600:divisor =  384; break;
-   case  19200:divisor =  192; break;
-   case  38400:divisor =   96; break;
-   case  57600:divisor =   64; break;
-   case 115200:divisor =   32; break;
-   default:hang ();break;
-   }
-
-   /* init serial UART0 */
-   PUT8(U0LCR, 0);
-   PUT8(U0IER, 0);
-   PUT8(U0LCR, 0x80);  /* DLAB=1 */
-   PUT8(U0DLL, (unsigned char)(divisor & 0x00FF));
-   PUT8(U0DLM, (unsigned char)(divisor >> 8));
-   PUT8(U0LCR, 0x03);  /* 8N1, DLAB=0  */
-   PUT8(U0FCR, 1); /* Enable RX and TX FIFOs */
-}
-
-int serial_init (void)
-{
-   unsigned long pinsel0;
-
-   serial_setbrg ();
-
-   pinsel0 = GET32(PINSEL0);
-   pinsel0 &= ~(0x0003);
-   pinsel0 |= 5;
-   PUT32(PINSEL0, pinsel0);
-
-   return (0);
-}
-
-void serial_putc (const char c)
-{
-   if (c == '\n')
-   {
-   while((GET8(U0LSR) & (1<<5)) == 0); /* Wait for empty U0THR */
-   PUT8(U0THR, '\r');
-   }
-
-   while((GET8(U0LSR) & (1<<5)) == 0); /* Wait for empty U0THR */
-   PUT8(U0THR, c);
-}
-
-int serial_getc (void)
-{
-   while((GET8(U0LSR) & 1) == 0);
-   return GET8(U0RBR);
-}
-
-void
-serial_puts (const char *s)
-{
-   while (*s) {
-   serial_putc (*s++);
-   }
-}
-
-/* Test if there is a byte to read */
-int serial_tstc (void)
-{
-   return (GET8(U0LSR) & 1);
-}
-
 #endif
diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
index 95255df..eaf4f8e 100644
--- a/drivers/serial/Makefile
+++ b/drivers/serial/Makefile
@@ -35,6 +35,7 @@ COBJS-$(CONFIG_S3C64XX) += s3c64xx.o
 COBJS-$(CONFIG_SYS_NS16550_SERIAL) += serial.o
 COBJS-$(CONFIG_IXP_SERIAL) += serial_ixp.o
 COBJS-$(CONFIG_KS8695_SERIAL) += serial_ks8695.o
+COBJS-$(CONFIG_LPC2292_SERIAL) += serial_lpc2292.o
 COBJS-$(CONFIG_MAX3100_SERIAL) += serial_max3100.o
 COBJS-$(CONFIG_MX31_UART) += serial_mx31.o
 COBJS-$(CONFIG_NETARM_SERIAL) += serial_netarm.o
diff --git a/drivers/serial/serial_lpc2292.c b/drivers/serial/serial_lpc2292.c
new file mode 100644
index 000..87b7d5f
--- /dev/null
+++ b/drivers/serial/serial_lpc2292.c
@@ -0,0 +1,105 @@
+/*
+ * (C) Copyright 2002-2004
+ * Wolfgang Denk, DENX Software Engineering, 
+ *
+ * (C) Copyright 2002
+ * Sysgo Real-Time Solutions, GmbH 
+ * Marius Groeger 
+ *
+ * (C) Copyright 2002
+ * Sysgo Real-Time Solutions, GmbH 
+ * Alex Zuepke 
+ *
+ * Copyright (C) 1999 2000 2001 Erik Mouw (j.a.k.m...@its.tudelft.nl)
+ *
+ * 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 
+
+DECLARE_GLOBAL_DATA_PTR;
+
+void serial_setbrg (void)
+{
+   unsigned short divisor = 0;
+
+   switch (gd->baudrate) {
+   case   1200:divisor = 3072; break;
+   case   9600:divisor =  384; break;
+   case  19200:divisor =  192; break;
+   case  38400:divisor =   96; break;
+   case  57600:divisor =   64; break;
+   case 115200:divisor =   32; break;
+   default:hang ();break;
+   }
+
+   /* init serial UART0 */
+   PUT8(U0LCR, 0);
+   PUT8(U0IER, 0);
+   PUT8(U0LCR, 0x80);  /* DLAB=1 */
+   PUT8(U0DLL, (unsigned char)(divisor & 0x00FF));
+   PUT8(U0DLM, (unsigned char)(divisor >> 8));
+   PUT8(U0LCR, 0x03); 

[U-Boot] [PATCH 12/19] arm720t/clps7111: move serial driver to drivers/serial

2009-03-29 Thread Jean-Christophe PLAGNIOL-VILLARD
add CONFIG_CLPS7111_SERIAL to activate the driver

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD 
---
 cpu/arm720t/Makefile   |2 +-
 drivers/serial/Makefile|1 +
 .../serial.c => drivers/serial/serial_clps7111.c   |4 
 include/configs/armadillo.h|1 +
 include/configs/ep7312.h   |1 +
 include/configs/impa7.h|1 +
 6 files changed, 5 insertions(+), 5 deletions(-)
 rename cpu/arm720t/serial.c => drivers/serial/serial_clps7111.c (96%)

diff --git a/cpu/arm720t/Makefile b/cpu/arm720t/Makefile
index a038042..d5ac7d3 100644
--- a/cpu/arm720t/Makefile
+++ b/cpu/arm720t/Makefile
@@ -26,7 +26,7 @@ include $(TOPDIR)/config.mk
 LIB= $(obj)lib$(CPU).a
 
 START  = start.o
-COBJS  = serial.o interrupts.o cpu.o
+COBJS  = interrupts.o cpu.o
 
 SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS) $(SOBJS))
diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
index eaf4f8e..6ab847f 100644
--- a/drivers/serial/Makefile
+++ b/drivers/serial/Makefile
@@ -33,6 +33,7 @@ COBJS-$(CONFIG_SYS_NS16550) += ns16550.o
 COBJS-$(CONFIG_DRIVER_S3C4510_UART) += s3c4510b_uart.o
 COBJS-$(CONFIG_S3C64XX) += s3c64xx.o
 COBJS-$(CONFIG_SYS_NS16550_SERIAL) += serial.o
+COBJS-$(CONFIG_CLPS7111_SERIAL) += serial_clps7111.o
 COBJS-$(CONFIG_IXP_SERIAL) += serial_ixp.o
 COBJS-$(CONFIG_KS8695_SERIAL) += serial_ks8695.o
 COBJS-$(CONFIG_LPC2292_SERIAL) += serial_lpc2292.o
diff --git a/cpu/arm720t/serial.c b/drivers/serial/serial_clps7111.c
similarity index 96%
rename from cpu/arm720t/serial.c
rename to drivers/serial/serial_clps7111.c
index b54d1cf..a6aecad 100644
--- a/cpu/arm720t/serial.c
+++ b/drivers/serial/serial_clps7111.c
@@ -29,9 +29,6 @@
  */
 
 #include 
-
-#if defined(CONFIG_IMPA7) || defined(CONFIG_EP7312) || 
defined(CONFIG_ARMADILLO)
-
 #include 
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -122,4 +119,3 @@ serial_puts (const char *s)
serial_putc (*s++);
}
 }
-#endif
diff --git a/include/configs/armadillo.h b/include/configs/armadillo.h
index ef6ce22..7ba5e17 100644
--- a/include/configs/armadillo.h
+++ b/include/configs/armadillo.h
@@ -64,6 +64,7 @@
 /*
  * select serial console configuration
  */
+#define CONFIG_CLPS7111_SERIAL
 #define CONFIG_SERIAL1 1   /* we use Serial line 1 */
 
 /* allow to overwrite serial and ethaddr */
diff --git a/include/configs/ep7312.h b/include/configs/ep7312.h
index d12b13f..630fff3 100644
--- a/include/configs/ep7312.h
+++ b/include/configs/ep7312.h
@@ -55,6 +55,7 @@
 /*
  * select serial console configuration
  */
+#define CONFIG_CLPS7111_SERIAL
 #define CONFIG_SERIAL1 1   /* we use Serial line 1 */
 
 /* allow to overwrite serial and ethaddr */
diff --git a/include/configs/impa7.h b/include/configs/impa7.h
index efd4214..c7001cc 100644
--- a/include/configs/impa7.h
+++ b/include/configs/impa7.h
@@ -54,6 +54,7 @@
 /*
  * select serial console configuration
  */
+#define CONFIG_CLPS7111_SERIAL
 #define CONFIG_SERIAL1 1   /* we use Serial line 1 */
 
 /* allow to overwrite serial and ethaddr */
-- 
1.6.2.1

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


[U-Boot] [PATCH 13/19] omap3: remove duplicate interrupts code

2009-03-29 Thread Jean-Christophe PLAGNIOL-VILLARD
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD 
---
 cpu/arm_cortexa8/omap3/interrupts.c |  128 ---
 1 files changed, 0 insertions(+), 128 deletions(-)

diff --git a/cpu/arm_cortexa8/omap3/interrupts.c 
b/cpu/arm_cortexa8/omap3/interrupts.c
index 9e9817d..384ffdc 100644
--- a/cpu/arm_cortexa8/omap3/interrupts.c
+++ b/cpu/arm_cortexa8/omap3/interrupts.c
@@ -34,137 +34,9 @@
 
 #include 
 #include 
-#include 
 
 #define TIMER_LOAD_VAL 0
 
-#ifdef CONFIG_USE_IRQ
-/* enable IRQ interrupts */
-void enable_interrupts(void)
-{
-   unsigned long temp;
-   __asm__ __volatile__("mrs %0, cpsr\n"
-"bic %0, %0, #0x80\n" "msr cpsr_c, %0":"=r"(temp)
-::"memory");
-}
-
-/*
- * disable IRQ/FIQ interrupts
- * returns true if interrupts had been enabled before we disabled them
- */
-int disable_interrupts(void)
-{
-   unsigned long old, temp;
-   __asm__ __volatile__("mrs %0, cpsr\n"
-"orr %1, %0, #0xc0\n"
-"msr cpsr_c, %1":"=r"(old), "=r"(temp)
-::"memory");
-   return (old & 0x80) == 0;
-}
-#else
-void enable_interrupts(void)
-{
-   return;
-}
-int disable_interrupts(void)
-{
-   return 0;
-}
-#endif
-
-void bad_mode(void)
-{
-   panic("Resetting CPU ...\n");
-   reset_cpu(0);
-}
-
-void show_regs(struct pt_regs *regs)
-{
-   unsigned long flags;
-   const char *processor_modes[] = {
-   "USER_26", "FIQ_26", "IRQ_26", "SVC_26",
-   "UK4_26", "UK5_26", "UK6_26", "UK7_26",
-   "UK8_26", "UK9_26", "UK10_26", "UK11_26",
-   "UK12_26", "UK13_26", "UK14_26", "UK15_26",
-   "USER_32", "FIQ_32", "IRQ_32", "SVC_32",
-   "UK4_32", "UK5_32", "UK6_32", "ABT_32",
-   "UK8_32", "UK9_32", "UK10_32", "UND_32",
-   "UK12_32", "UK13_32", "UK14_32", "SYS_32",
-   };
-
-   flags = condition_codes(regs);
-
-   printf("pc : [<%08lx>]lr : [<%08lx>]\n"
-   "sp : %08lx  ip : %08lx  fp : %08lx\n",
-   instruction_pointer(regs),
-   regs->ARM_lr, regs->ARM_sp, regs->ARM_ip, regs->ARM_fp);
-   printf("r10: %08lx  r9 : %08lx  r8 : %08lx\n",
-   regs->ARM_r10, regs->ARM_r9, regs->ARM_r8);
-   printf("r7 : %08lx  r6 : %08lx  r5 : %08lx  r4 : %08lx\n",
-   regs->ARM_r7, regs->ARM_r6, regs->ARM_r5, regs->ARM_r4);
-   printf("r3 : %08lx  r2 : %08lx  r1 : %08lx  r0 : %08lx\n",
-   regs->ARM_r3, regs->ARM_r2, regs->ARM_r1, regs->ARM_r0);
-   printf("Flags: %c%c%c%c",
-   flags & CC_N_BIT ? 'N' : 'n',
-   flags & CC_Z_BIT ? 'Z' : 'z',
-   flags & CC_C_BIT ? 'C' : 'c', flags & CC_V_BIT ? 'V' : 'v');
-   printf("  IRQs %s  FIQs %s  Mode %s%s\n",
-   interrupts_enabled(regs) ? "on" : "off",
-   fast_interrupts_enabled(regs) ? "on" : "off",
-   processor_modes[processor_mode(regs)],
-   thumb_mode(regs) ? " (T)" : "");
-}
-
-void do_undefined_instruction(struct pt_regs *pt_regs)
-{
-   printf("undefined instruction\n");
-   show_regs(pt_regs);
-   bad_mode();
-}
-
-void do_software_interrupt(struct pt_regs *pt_regs)
-{
-   printf("software interrupt\n");
-   show_regs(pt_regs);
-   bad_mode();
-}
-
-void do_prefetch_abort(struct pt_regs *pt_regs)
-{
-   printf("prefetch abort\n");
-   show_regs(pt_regs);
-   bad_mode();
-}
-
-void do_data_abort(struct pt_regs *pt_regs)
-{
-   printf("data abort\n");
-   show_regs(pt_regs);
-   bad_mode();
-}
-
-void do_not_used(struct pt_regs *pt_regs)
-{
-   printf("not used\n");
-   show_regs(pt_regs);
-   bad_mode();
-}
-
-void do_fiq(struct pt_regs *pt_regs)
-{
-   printf("fast interrupt request\n");
-   show_regs(pt_regs);
-   bad_mode();
-}
-
-void do_irq(struct pt_regs *pt_regs)
-{
-   printf("interrupt request\n");
-   show_regs(pt_regs);
-   bad_mode();
-}
-
-
 static ulong timestamp;
 static ulong lastinc;
 static gptimer_t *timer_base = (gptimer_t *)CONFIG_SYS_TIMERBASE;
-- 
1.6.2.1

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


[U-Boot] [PATCH 19/19] s3c2410: move nand driver to drivers/mtd/nand

2009-03-29 Thread Jean-Christophe PLAGNIOL-VILLARD
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD 
---
 cpu/arm920t/s3c24x0/Makefile   |2 +-
 drivers/mtd/nand/Makefile  |1 +
 .../nand.c => drivers/mtd/nand/s3c2410_nand.c  |8 
 include/configs/sbc2410x.h |1 +
 4 files changed, 3 insertions(+), 9 deletions(-)
 rename cpu/arm920t/s3c24x0/nand.c => drivers/mtd/nand/s3c2410_nand.c (96%)

diff --git a/cpu/arm920t/s3c24x0/Makefile b/cpu/arm920t/s3c24x0/Makefile
index fd13e53..3afe19c 100644
--- a/cpu/arm920t/s3c24x0/Makefile
+++ b/cpu/arm920t/s3c24x0/Makefile
@@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk
 
 LIB= $(obj)lib$(SOC).a
 
-COBJS  = interrupts.o speed.o usb.o usb_ohci.o nand.o
+COBJS  = interrupts.o speed.o usb.o usb_ohci.o
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
diff --git a/drivers/mtd/nand/Makefile b/drivers/mtd/nand/Makefile
index 258ee25..471cd6b 100644
--- a/drivers/mtd/nand/Makefile
+++ b/drivers/mtd/nand/Makefile
@@ -41,6 +41,7 @@ COBJS-$(CONFIG_NAND_DAVINCI) += davinci_nand.o
 COBJS-$(CONFIG_NAND_FSL_ELBC) += fsl_elbc_nand.o
 COBJS-$(CONFIG_NAND_FSL_UPM) += fsl_upm.o
 COBJS-$(CONFIG_NAND_NOMADIK) += nomadik.o
+COBJS-$(CONFIG_NAND_S3C2410) += s3c2410_nand.c
 COBJS-$(CONFIG_NAND_S3C64XX) += s3c64xx.o
 COBJS-$(CONFIG_NAND_OMAP_GPMC) += omap_gpmc.o
 endif
diff --git a/cpu/arm920t/s3c24x0/nand.c b/drivers/mtd/nand/s3c2410_nand.c
similarity index 96%
rename from cpu/arm920t/s3c24x0/nand.c
rename to drivers/mtd/nand/s3c2410_nand.c
index 60174fb..d27a625 100644
--- a/cpu/arm920t/s3c24x0/nand.c
+++ b/drivers/mtd/nand/s3c2410_nand.c
@@ -26,9 +26,6 @@
 #define DEBUGN(x, args ...) {}
 #endif
 
-#if defined(CONFIG_CMD_NAND)
-#if !defined(CONFIG_NAND_LEGACY)
-
 #include 
 #include 
 #include 
@@ -172,8 +169,3 @@ int board_nand_init(struct nand_chip *nand)
 
return 0;
 }
-
-#else
- #error "U-Boot legacy NAND support not available for S3C2410"
-#endif
-#endif
diff --git a/include/configs/sbc2410x.h b/include/configs/sbc2410x.h
index 2b659e3..af00187 100644
--- a/include/configs/sbc2410x.h
+++ b/include/configs/sbc2410x.h
@@ -199,6 +199,7 @@
  * NAND flash settings
  */
 #if defined(CONFIG_CMD_NAND)
+#define CONFIG_NAND_S3C2410
 #define CONFIG_SYS_MAX_NAND_DEVICE 1   /* Max number of NAND devices   
*/
 #define SECTORSIZE 512
 
-- 
1.6.2.1

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


[U-Boot] [PATCH 14/19] imx: move serial driver to drivers/serial

2009-03-29 Thread Jean-Christophe PLAGNIOL-VILLARD
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD 
---
 cpu/arm920t/imx/Makefile   |2 +-
 drivers/serial/Makefile|1 +
 .../imx/serial.c => drivers/serial/serial_imx.c|6 --
 include/configs/mx1ads.h   |1 +
 include/configs/mx1fs2.h   |3 ++-
 include/configs/scb9328.h  |1 +
 6 files changed, 6 insertions(+), 8 deletions(-)
 rename cpu/arm920t/imx/serial.c => drivers/serial/serial_imx.c (97%)

diff --git a/cpu/arm920t/imx/Makefile b/cpu/arm920t/imx/Makefile
index 9207ec1..d3352de 100644
--- a/cpu/arm920t/imx/Makefile
+++ b/cpu/arm920t/imx/Makefile
@@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk
 
 LIB= $(obj)lib$(SOC).a
 
-COBJS  = generic.o interrupts.o serial.o speed.o
+COBJS  = generic.o interrupts.o speed.o
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
index 6ab847f..705ae47 100644
--- a/drivers/serial/Makefile
+++ b/drivers/serial/Makefile
@@ -34,6 +34,7 @@ COBJS-$(CONFIG_DRIVER_S3C4510_UART) += s3c4510b_uart.o
 COBJS-$(CONFIG_S3C64XX) += s3c64xx.o
 COBJS-$(CONFIG_SYS_NS16550_SERIAL) += serial.o
 COBJS-$(CONFIG_CLPS7111_SERIAL) += serial_clps7111.o
+COBJS-$(CONFIG_IMX_SERIAL) += serial_imx.o
 COBJS-$(CONFIG_IXP_SERIAL) += serial_ixp.o
 COBJS-$(CONFIG_KS8695_SERIAL) += serial_ks8695.o
 COBJS-$(CONFIG_LPC2292_SERIAL) += serial_lpc2292.o
diff --git a/cpu/arm920t/imx/serial.c b/drivers/serial/serial_imx.c
similarity index 97%
rename from cpu/arm920t/imx/serial.c
rename to drivers/serial/serial_imx.c
index 85f1167..b9ca748 100644
--- a/cpu/arm920t/imx/serial.c
+++ b/drivers/serial/serial_imx.c
@@ -18,12 +18,8 @@
  */
 
 #include 
-#if defined (CONFIG_IMX)
-
 #include 
 
-#ifndef CONFIG_IMX_SERIAL_NONE
-
 #if defined CONFIG_IMX_SERIAL1
 #define UART_BASE IMX_UART1_BASE
 #elif defined CONFIG_IMX_SERIAL2
@@ -223,5 +219,3 @@ serial_puts (const char *s)
serial_putc (*s++);
}
 }
-#endif /* CONFIG_IMX_SERIAL_NONE */
-#endif /* defined CONFIG_IMX */
diff --git a/include/configs/mx1ads.h b/include/configs/mx1ads.h
index c3812e6..12e567b 100644
--- a/include/configs/mx1ads.h
+++ b/include/configs/mx1ads.h
@@ -40,6 +40,7 @@
 /*
  * Select serial console configuration
   */
+#define CONFIG_IMX_SERIAL
 #define CONFIG_IMX_SERIAL1 /* internal uart 1 */
 /* #define _CONFIG_UART2 *//* internal uart 2 */
 /* #define CONFIG_SILENT_CONSOLE *//* use this to disable output */
diff --git a/include/configs/mx1fs2.h b/include/configs/mx1fs2.h
index b174b5f..431e669 100644
--- a/include/configs/mx1fs2.h
+++ b/include/configs/mx1fs2.h
@@ -289,11 +289,12 @@
0x000b00b ->3<- -> 64MHz/4=16MHz */
 
 #ifdef _CONFIG_UART1
+#define CONFIG_IMX_SERIAL
 #define CONFIG_IMX_SERIAL1
 #elif defined _CONFIG_UART2
+#define CONFIG_IMX_SERIAL
 #define CONFIG_IMX_SERIAL2
 #elif defined _CONFIG_UART3 | defined _CONFIG_UART4
-#define CONFIG_IMX_SERIAL_NONE
 #define CONFIG_SYS_NS16550
 #define CONFIG_SYS_NS16550_SERIAL
 #define CONFIG_SYS_NS16550_CLK 3686400
diff --git a/include/configs/scb9328.h b/include/configs/scb9328.h
index 10db535..2f166c9 100644
--- a/include/configs/scb9328.h
+++ b/include/configs/scb9328.h
@@ -29,6 +29,7 @@
 #define CONFIG_SCB9328 1 /* on a scb9328tronix board */
 #undef CONFIG_USE_IRQ/* don't need use IRQ/FIQ*/
 
+#define CONFIG_IMX_SERIAL
 #define CONFIG_IMX_SERIAL1
 /*
  * Select serial console configuration
-- 
1.6.2.1

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


[U-Boot] [PATCH 15/19] davinci: move nand driver to drivers/mtd/nand

2009-03-29 Thread Jean-Christophe PLAGNIOL-VILLARD
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD 
---
 cpu/arm926ejs/davinci/Makefile |2 +-
 drivers/mtd/nand/Makefile  |1 +
 .../nand.c => drivers/mtd/nand/davinci_nand.c  |9 -
 include/configs/davinci_dvevm.h|1 +
 include/configs/davinci_schmoogie.h|1 +
 include/configs/davinci_sffsdr.h   |1 +
 include/configs/davinci_sonata.h   |1 +
 7 files changed, 6 insertions(+), 10 deletions(-)
 rename cpu/arm926ejs/davinci/nand.c => drivers/mtd/nand/davinci_nand.c (98%)

diff --git a/cpu/arm926ejs/davinci/Makefile b/cpu/arm926ejs/davinci/Makefile
index 0f77f40..53f7742 100644
--- a/cpu/arm926ejs/davinci/Makefile
+++ b/cpu/arm926ejs/davinci/Makefile
@@ -27,7 +27,7 @@ include $(TOPDIR)/config.mk
 
 LIB= $(obj)lib$(SOC).a
 
-COBJS  = timer.o ether.o lxt972.o dp83848.o i2c.o nand.o
+COBJS  = timer.o ether.o lxt972.o dp83848.o i2c.o
 SOBJS  = lowlevel_init.o reset.o
 
 SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
diff --git a/drivers/mtd/nand/Makefile b/drivers/mtd/nand/Makefile
index 03b0028..258ee25 100644
--- a/drivers/mtd/nand/Makefile
+++ b/drivers/mtd/nand/Makefile
@@ -37,6 +37,7 @@ endif
 
 COBJS-$(CONFIG_NAND_ATMEL) += atmel_nand.o
 COBJS-$(CONFIG_DRIVER_NAND_BFIN) += bfin_nand.o
+COBJS-$(CONFIG_NAND_DAVINCI) += davinci_nand.o
 COBJS-$(CONFIG_NAND_FSL_ELBC) += fsl_elbc_nand.o
 COBJS-$(CONFIG_NAND_FSL_UPM) += fsl_upm.o
 COBJS-$(CONFIG_NAND_NOMADIK) += nomadik.o
diff --git a/cpu/arm926ejs/davinci/nand.c b/drivers/mtd/nand/davinci_nand.c
similarity index 98%
rename from cpu/arm926ejs/davinci/nand.c
rename to drivers/mtd/nand/davinci_nand.c
index 014e2b0..a974667 100644
--- a/cpu/arm926ejs/davinci/nand.c
+++ b/drivers/mtd/nand/davinci_nand.c
@@ -43,10 +43,6 @@
 
 #include 
 #include 
-
-#ifdef CONFIG_SYS_USE_NAND
-#if !defined(CONFIG_NAND_LEGACY)
-
 #include 
 #include 
 #include 
@@ -468,8 +464,3 @@ int board_nand_init(struct nand_chip *nand)
 
return(0);
 }
-
-#else
-#error "U-Boot legacy NAND support not available for DaVinci chips"
-#endif
-#endif /* CONFIG_SYS_USE_NAND */
diff --git a/include/configs/davinci_dvevm.h b/include/configs/davinci_dvevm.h
index 667c0d8..b43beaa 100644
--- a/include/configs/davinci_dvevm.h
+++ b/include/configs/davinci_dvevm.h
@@ -112,6 +112,7 @@
 /* Flash & Environment */
 /*=*/
 #ifdef CONFIG_SYS_USE_NAND
+#define CONFIG_NAND_DAVINCI
 #undef CONFIG_ENV_IS_IN_FLASH
 #define CONFIG_SYS_NO_FLASH
 #define CONFIG_ENV_IS_IN_NAND  /* U-Boot env in NAND Flash  */
diff --git a/include/configs/davinci_schmoogie.h 
b/include/configs/davinci_schmoogie.h
index 22d3808..2c97a00 100644
--- a/include/configs/davinci_schmoogie.h
+++ b/include/configs/davinci_schmoogie.h
@@ -81,6 +81,7 @@
 /*=*/
 #undef CONFIG_ENV_IS_IN_FLASH
 #define CONFIG_SYS_NO_FLASH
+#define CONFIG_NAND_DAVINCI
 #define CONFIG_ENV_IS_IN_NAND  /* U-Boot env in NAND Flash  */
 #define CONFIG_ENV_SECT_SIZE   2048/* Env sector Size */
 #define CONFIG_ENV_SIZESZ_128K
diff --git a/include/configs/davinci_sffsdr.h b/include/configs/davinci_sffsdr.h
index 875bab6..9354c2f 100644
--- a/include/configs/davinci_sffsdr.h
+++ b/include/configs/davinci_sffsdr.h
@@ -77,6 +77,7 @@
 /* Flash & Environment */
 #undef CONFIG_ENV_IS_IN_FLASH
 #define CONFIG_SYS_NO_FLASH
+#define CONFIG_NAND_DAVINCI
 #define CONFIG_ENV_IS_IN_NAND  /* U-Boot env in NAND Flash  */
 #define CONFIG_ENV_SECT_SIZE   2048/* Env sector Size */
 #define CONFIG_ENV_SIZESZ_128K
diff --git a/include/configs/davinci_sonata.h b/include/configs/davinci_sonata.h
index 47ab27a..0865d0d 100644
--- a/include/configs/davinci_sonata.h
+++ b/include/configs/davinci_sonata.h
@@ -112,6 +112,7 @@
 /* Flash & Environment */
 /*=*/
 #ifdef CONFIG_SYS_USE_NAND
+#define CONFIG_NAND_DAVINCI
 #undef CONFIG_ENV_IS_IN_FLASH
 #define CONFIG_SYS_NO_FLASH
 #define CONFIG_ENV_IS_IN_NAND  /* U-Boot env in NAND Flash  */
-- 
1.6.2.1

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


[U-Boot] [PATCH 18/19] s3c24x0: move i2c driver to drivers/i2c

2009-03-29 Thread Jean-Christophe PLAGNIOL-VILLARD
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD 
---
 cpu/arm920t/s3c24x0/Makefile   |2 +-
 drivers/i2c/Makefile   |1 +
 .../s3c24x0/i2c.c => drivers/i2c/s3c24x0_i2c.c |5 -
 3 files changed, 2 insertions(+), 6 deletions(-)
 rename cpu/arm920t/s3c24x0/i2c.c => drivers/i2c/s3c24x0_i2c.c (99%)

diff --git a/cpu/arm920t/s3c24x0/Makefile b/cpu/arm920t/s3c24x0/Makefile
index 8fd525e..fd13e53 100644
--- a/cpu/arm920t/s3c24x0/Makefile
+++ b/cpu/arm920t/s3c24x0/Makefile
@@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk
 
 LIB= $(obj)lib$(SOC).a
 
-COBJS  = i2c.o interrupts.o speed.o usb.o usb_ohci.o nand.o
+COBJS  = interrupts.o speed.o usb.o usb_ohci.o nand.o
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
diff --git a/drivers/i2c/Makefile b/drivers/i2c/Makefile
index 4b4d9db..ef32f13 100644
--- a/drivers/i2c/Makefile
+++ b/drivers/i2c/Makefile
@@ -32,6 +32,7 @@ COBJS-$(CONFIG_I2C_MXC) += mxc_i2c.o
 COBJS-$(CONFIG_DRIVER_OMAP1510_I2C) += omap1510_i2c.o
 COBJS-$(CONFIG_DRIVER_OMAP24XX_I2C) += omap24xx_i2c.o
 COBJS-$(CONFIG_DRIVER_OMAP34XX_I2C) += omap24xx_i2c.o
+COBJS-$(CONFIG_DRIVER_S3C24X0_I2C) += s3c24x0_i2c.o
 COBJS-$(CONFIG_S3C44B0_I2C) += s3c44b0_i2c.o
 COBJS-$(CONFIG_SOFT_I2C) += soft_i2c.o
 COBJS-$(CONFIG_TSI108_I2C) += tsi108_i2c.o
diff --git a/cpu/arm920t/s3c24x0/i2c.c b/drivers/i2c/s3c24x0_i2c.c
similarity index 99%
rename from cpu/arm920t/s3c24x0/i2c.c
rename to drivers/i2c/s3c24x0_i2c.c
index fba5cd1..f0c1aa3 100644
--- a/cpu/arm920t/s3c24x0/i2c.c
+++ b/drivers/i2c/s3c24x0_i2c.c
@@ -27,9 +27,6 @@
  */
 
 #include 
-
-#ifdef CONFIG_DRIVER_S3C24X0_I2C
-
 #if defined(CONFIG_S3C2400)
 #include 
 #elif defined(CONFIG_S3C2410)
@@ -443,5 +440,3 @@ int i2c_write (uchar chip, uint addr, int alen, uchar * 
buffer, int len)
 len) != 0);
 }
 #endif /* CONFIG_HARD_I2C */
-
-#endif /* CONFIG_DRIVER_S3C24X0_I2C */
-- 
1.6.2.1

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


[U-Boot] [PATCH 16/19] davinci: move i2c driver to drivers/i2c

2009-03-29 Thread Jean-Christophe PLAGNIOL-VILLARD
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD 
---
 cpu/arm926ejs/davinci/Makefile |2 +-
 drivers/i2c/Makefile   |1 +
 .../davinci/i2c.c => drivers/i2c/davinci_i2c.c |5 -
 3 files changed, 2 insertions(+), 6 deletions(-)
 rename cpu/arm926ejs/davinci/i2c.c => drivers/i2c/davinci_i2c.c (98%)

diff --git a/cpu/arm926ejs/davinci/Makefile b/cpu/arm926ejs/davinci/Makefile
index 53f7742..ed24e65 100644
--- a/cpu/arm926ejs/davinci/Makefile
+++ b/cpu/arm926ejs/davinci/Makefile
@@ -27,7 +27,7 @@ include $(TOPDIR)/config.mk
 
 LIB= $(obj)lib$(SOC).a
 
-COBJS  = timer.o ether.o lxt972.o dp83848.o i2c.o
+COBJS  = timer.o ether.o lxt972.o dp83848.o
 SOBJS  = lowlevel_init.o reset.o
 
 SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
diff --git a/drivers/i2c/Makefile b/drivers/i2c/Makefile
index 69cf9a6..4b4d9db 100644
--- a/drivers/i2c/Makefile
+++ b/drivers/i2c/Makefile
@@ -26,6 +26,7 @@ include $(TOPDIR)/config.mk
 LIB:= $(obj)libi2c.a
 
 COBJS-$(CONFIG_BFIN_TWI_I2C) += bfin-twi_i2c.o
+COBJS-$(CONFIG_DRIVER_DAVINCI_I2C) += davinci_i2c.o
 COBJS-$(CONFIG_FSL_I2C) += fsl_i2c.o
 COBJS-$(CONFIG_I2C_MXC) += mxc_i2c.o
 COBJS-$(CONFIG_DRIVER_OMAP1510_I2C) += omap1510_i2c.o
diff --git a/cpu/arm926ejs/davinci/i2c.c b/drivers/i2c/davinci_i2c.c
similarity index 98%
rename from cpu/arm926ejs/davinci/i2c.c
rename to drivers/i2c/davinci_i2c.c
index 3ba20ef..eee1cbd 100644
--- a/cpu/arm926ejs/davinci/i2c.c
+++ b/drivers/i2c/davinci_i2c.c
@@ -25,9 +25,6 @@
  */
 
 #include 
-
-#ifdef CONFIG_DRIVER_DAVINCI_I2C
-
 #include 
 #include 
 #include 
@@ -330,5 +327,3 @@ int i2c_write(u_int8_t chip, u_int32_t addr, int alen, 
u_int8_t *buf, int len)
 
return(0);
 }
-
-#endif /* CONFIG_DRIVER_DAVINCI_I2C */
-- 
1.6.2.1

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


[U-Boot] [PATCH 17/19] s3c24x0: move serial driver to drivers/serial

2009-03-29 Thread Jean-Christophe PLAGNIOL-VILLARD
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD 
---
 cpu/arm920t/s3c24x0/Makefile   |3 +--
 drivers/serial/Makefile|1 +
 .../serial.c => drivers/serial/serial_s3c24x0.c|4 
 include/configs/VCMA9.h|1 +
 include/configs/sbc2410x.h |1 +
 include/configs/smdk2400.h |1 +
 include/configs/smdk2410.h |1 +
 include/configs/trab.h |1 +
 8 files changed, 7 insertions(+), 6 deletions(-)
 rename cpu/arm920t/s3c24x0/serial.c => drivers/serial/serial_s3c24x0.c (97%)

diff --git a/cpu/arm920t/s3c24x0/Makefile b/cpu/arm920t/s3c24x0/Makefile
index 6764920..8fd525e 100644
--- a/cpu/arm920t/s3c24x0/Makefile
+++ b/cpu/arm920t/s3c24x0/Makefile
@@ -25,8 +25,7 @@ include $(TOPDIR)/config.mk
 
 LIB= $(obj)lib$(SOC).a
 
-COBJS  = i2c.o interrupts.o serial.o speed.o \
- usb.o usb_ohci.o nand.o
+COBJS  = i2c.o interrupts.o speed.o usb.o usb_ohci.o nand.o
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
index 705ae47..696d5fb 100644
--- a/drivers/serial/Makefile
+++ b/drivers/serial/Makefile
@@ -44,6 +44,7 @@ COBJS-$(CONFIG_NETARM_SERIAL) += serial_netarm.o
 COBJS-$(CONFIG_PL010_SERIAL) += serial_pl01x.o
 COBJS-$(CONFIG_PL011_SERIAL) += serial_pl01x.o
 COBJS-$(CONFIG_SA1100_SERIAL) += serial_sa1100.o
+COBJS-$(CONFIG_S3C24X0_SERIAL) += serial_s3c24x0.o
 COBJS-$(CONFIG_S3C44B0_SERIAL) += serial_s3c44b0.o
 COBJS-$(CONFIG_XILINX_UARTLITE) += serial_xuartlite.o
 COBJS-$(CONFIG_SCIF_CONSOLE) += serial_sh.o
diff --git a/cpu/arm920t/s3c24x0/serial.c b/drivers/serial/serial_s3c24x0.c
similarity index 97%
rename from cpu/arm920t/s3c24x0/serial.c
rename to drivers/serial/serial_s3c24x0.c
index 064b998..1b1b7a6 100644
--- a/cpu/arm920t/s3c24x0/serial.c
+++ b/drivers/serial/serial_s3c24x0.c
@@ -19,8 +19,6 @@
  */
 
 #include 
-#if defined(CONFIG_S3C2400) || defined (CONFIG_S3C2410) || defined 
(CONFIG_TRAB)
-
 #if defined(CONFIG_S3C2400) || defined(CONFIG_TRAB)
 #include 
 #elif defined(CONFIG_S3C2410)
@@ -300,5 +298,3 @@ struct serial_device s3c24xx_serial2_device =
INIT_S3C_SERIAL_STRUCTURE(2, "s3ser2", "S3UART3");
 
 #endif /* CONFIG_SERIAL_MULTI */
-
-#endif /* defined(CONFIG_S3C2400) || defined (CONFIG_S3C2410) || defined 
(CONFIG_TRAB) */
diff --git a/include/configs/VCMA9.h b/include/configs/VCMA9.h
index 8550223..5e614fd 100644
--- a/include/configs/VCMA9.h
+++ b/include/configs/VCMA9.h
@@ -117,6 +117,7 @@
 /*
  * select serial console configuration
  */
+#define CONFIG_S3C24X0_SERIAL
 #define CONFIG_SERIAL1  1  /* we use SERIAL 1 on VCMA9 */
 
 /
diff --git a/include/configs/sbc2410x.h b/include/configs/sbc2410x.h
index 102c45a..2b659e3 100644
--- a/include/configs/sbc2410x.h
+++ b/include/configs/sbc2410x.h
@@ -70,6 +70,7 @@
 /*
  * select serial console configuration
  */
+#define CONFIG_S3C24X0_SERIAL
 #define CONFIG_SERIAL1  1  /* we use SERIAL 1 on SBC2410X */
 
 /
diff --git a/include/configs/smdk2400.h b/include/configs/smdk2400.h
index 856d1fb..ffdf217 100644
--- a/include/configs/smdk2400.h
+++ b/include/configs/smdk2400.h
@@ -63,6 +63,7 @@
 /*
  * select serial console configuration
  */
+#define CONFIG_S3C24X0_SERIAL
 #define CONFIG_SERIAL1  1  /* we use SERIAL 1 on SAMSUNG */
 
 #undef CONFIG_HWFLOW   /* include RTS/CTS flow control support 
*/
diff --git a/include/configs/smdk2410.h b/include/configs/smdk2410.h
index 797a596..fb43706 100644
--- a/include/configs/smdk2410.h
+++ b/include/configs/smdk2410.h
@@ -60,6 +60,7 @@
 /*
  * select serial console configuration
  */
+#define CONFIG_S3C24X0_SERIAL
 #define CONFIG_SERIAL1  1  /* we use SERIAL 1 on SMDK2410 */
 
 /
diff --git a/include/configs/trab.h b/include/configs/trab.h
index 625d8ee..520fe36 100644
--- a/include/configs/trab.h
+++ b/include/configs/trab.h
@@ -111,6 +111,7 @@
 /*
  * select serial console configuration
  */
+#define CONFIG_S3C24X0_SERIAL
 #define CONFIG_SERIAL1 1   /* we use SERIAL 1 on TRAB */
 
 #define CONFIG_HWFLOW  /* include RTS/CTS flow control support 
*/
-- 
1.6.2.1

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


[U-Boot] ARM Pull Request

2009-03-29 Thread Jean-Christophe PLAGNIOL-VILLARD
Hi Wolfgang,

Please pull
The following changes since commit 88685b5f62274167ad2ba8a58e108d89ff71955b:
  Wolfgang Denk (1):
VCMA9: fix compile errors

are available in the git repository at:

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

Jean-Christophe PLAGNIOL-VILLARD (19):
  s3c4510b: move specific code to soc directory
  s3c44b0: move i2c driver to drivers/i2c
  s3c44b0: move rtc driver to drivers/rtc
  s3c44b0: move serial driver to drivers/serial
  s3c44b0: extract cache from cpu.c
  sa1100: move serial driver to drivers/serial
  netarm: move serial driver to drivers/serial
  imx31: move serial driver to drivers/serial
  s3c64xx: move usb driver to drivers/usb
  ks8695: move serial driver to drivers/serial
  lpc2292: move serial driver to drivers/serial
  arm720t/clps7111: move serial driver to drivers/serial
  omap3: remove duplicate interrupts code
  imx: move serial driver to drivers/serial
  davinci: move nand driver to drivers/mtd/nand
  davinci: move i2c driver to drivers/i2c
  s3c24x0: move serial driver to drivers/serial
  s3c24x0: move i2c driver to drivers/i2c
  s3c2410: move nand driver to drivers/mtd/nand

Ladislav Michl (7):
  Remove nowhere used symbol CONFIG_SYS_CLKS_IN_HZ
  NetStar: update crcit utility
  NetStar: use generic flash driver
  NetStar: add RTC support
  OMAP: reindent timer code
  OMAP: rename timer divisor
  OMAP: use {read,write}l to access timer registers

 Makefile   |2 +-
 board/netstar/Makefile |2 +-
 board/netstar/crcit.c  |   14 +-
 board/netstar/flash.c  |  343 
 board/netstar/netstar.c|   20 +
 cpu/arm1136/mx31/Makefile  |2 +-
 cpu/arm1136/omap24xx/interrupts.c  |2 +-
 cpu/arm1176/s3c64xx/Makefile   |1 -
 cpu/arm720t/Makefile   |2 +-
 cpu/arm720t/cpu.c  |   62 ---
 cpu/arm720t/s3c4510b/Makefile  |   46 ++
 cpu/arm720t/s3c4510b/cache.c   |   86 
 cpu/arm720t/serial.c   |  202 -
 cpu/arm920t/imx/Makefile   |2 +-
 cpu/arm920t/ks8695/Makefile|2 +-
 cpu/arm920t/s3c24x0/Makefile   |3 +-
 cpu/arm925t/interrupts.c   |   40 +-
 cpu/arm926ejs/davinci/Makefile |2 +-
 cpu/arm926ejs/omap/timer.c |2 +-
 cpu/arm_cortexa8/omap3/interrupts.c|  130 +--
 cpu/s3c44b0/Makefile   |2 +-
 cpu/s3c44b0/cache.c|   91 
 cpu/s3c44b0/cpu.c  |  430 
 cpu/sa1100/Makefile|2 +-
 drivers/i2c/Makefile   |3 +
 .../davinci/i2c.c => drivers/i2c/davinci_i2c.c |5 -
 .../s3c24x0/i2c.c => drivers/i2c/s3c24x0_i2c.c |5 -
 drivers/i2c/s3c44b0_i2c.c  |  315 ++
 drivers/mtd/nand/Makefile  |2 +
 .../nand.c => drivers/mtd/nand/davinci_nand.c  |9 -
 .../nand.c => drivers/mtd/nand/s3c2410_nand.c  |8 -
 drivers/rtc/Makefile   |1 +
 drivers/rtc/s3c44b0_rtc.c  |  102 +
 drivers/serial/Makefile|9 +
 .../serial.c => drivers/serial/serial_clps7111.c   |   97 ++---
 .../imx/serial.c => drivers/serial/serial_imx.c|6 -
 .../serial.c => drivers/serial/serial_ks8695.c |0
 drivers/serial/serial_lpc2292.c|  105 +
 .../mx31/serial.c => drivers/serial/serial_mx31.c  |6 -
 {cpu/arm720t => drivers/serial}/serial_netarm.c|5 -
 .../serial.c => drivers/serial/serial_s3c24x0.c|4 -
 .../serial.c => drivers/serial/serial_s3c44b0.c|0
 .../serial.c => drivers/serial/serial_sa1100.c |0
 drivers/usb/Makefile   |1 +
 .../s3c64xx/usb.c => drivers/usb/s3c64xx_usb.c |0
 include/asm-arm/arch-arm720t/hardware.h|4 +-
 .../s3c4510b.h => arch-s3c4510b/hardware.h}|0
 include/configs/ADNPESC1.h |1 -
 include/configs/B2.h   |6 +-
 include/configs/DK1C20.h   |1 -
 include/configs/DK1S10.h   |1 -
 include/configs/EXBITGEN.h |2 -
 include/configs/SMN42.h|3 +-
 include/configs/SX1.h  |8 +-
 include/configs/VCMA9.h|4 +-
 include/configs/W7OLMC.h 

Re: [U-Boot] ARM Pull Request

2009-03-29 Thread Wolfgang Denk
Dear Jean-Christophe PLAGNIOL-VILLARD,

In message <20090329210943.gf19...@game.jcrosoft.org> you wrote:
> Hi Wolfgang,
> 
> Please pull
> The following changes since commit 88685b5f62274167ad2ba8a58e108d89ff71955b:
>   Wolfgang Denk (1):
> VCMA9: fix compile errors
> 
> are available in the git repository at:
> 
>   git://git.denx.de/u-boot-arm.git master
> 
> Jean-Christophe PLAGNIOL-VILLARD (19):
>   s3c4510b: move specific code to soc directory
>   s3c44b0: move i2c driver to drivers/i2c
>   s3c44b0: move rtc driver to drivers/rtc
>   s3c44b0: move serial driver to drivers/serial
>   s3c44b0: extract cache from cpu.c
>   sa1100: move serial driver to drivers/serial
>   netarm: move serial driver to drivers/serial
>   imx31: move serial driver to drivers/serial
>   s3c64xx: move usb driver to drivers/usb
>   ks8695: move serial driver to drivers/serial
>   lpc2292: move serial driver to drivers/serial
>   arm720t/clps7111: move serial driver to drivers/serial
>   omap3: remove duplicate interrupts code
>   imx: move serial driver to drivers/serial
>   davinci: move nand driver to drivers/mtd/nand
>   davinci: move i2c driver to drivers/i2c
>   s3c24x0: move serial driver to drivers/serial
>   s3c24x0: move i2c driver to drivers/i2c
>   s3c2410: move nand driver to drivers/mtd/nand

Ummm... don't you think it would be appropriate to allow at least for
2...3 days of review?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
In a business, marketroids, salespukes, and  lawyers  have  different
goals from those who actually do work and produce something. Usually,
is  is the former who triumph over the latter, due to the simple rule
that those who print the money make the rules.
 -- Tom Christiansen in <5jdcls$b0...@csnews.cs.colorado.edu>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] ARM Pull Request

2009-03-29 Thread Jean-Christophe PLAGNIOL-VILLARD
On 23:31 Sun 29 Mar , Wolfgang Denk wrote:
> Dear Jean-Christophe PLAGNIOL-VILLARD,
> 
> In message <20090329210943.gf19...@game.jcrosoft.org> you wrote:
> > Hi Wolfgang,
> > 
> > Please pull
> > The following changes since commit 88685b5f62274167ad2ba8a58e108d89ff71955b:
> >   Wolfgang Denk (1):
> > VCMA9: fix compile errors
> > 
> > are available in the git repository at:
> > 
> >   git://git.denx.de/u-boot-arm.git master
> > 
> > Jean-Christophe PLAGNIOL-VILLARD (19):
> >   s3c4510b: move specific code to soc directory
> >   s3c44b0: move i2c driver to drivers/i2c
> >   s3c44b0: move rtc driver to drivers/rtc
> >   s3c44b0: move serial driver to drivers/serial
> >   s3c44b0: extract cache from cpu.c
> >   sa1100: move serial driver to drivers/serial
> >   netarm: move serial driver to drivers/serial
> >   imx31: move serial driver to drivers/serial
> >   s3c64xx: move usb driver to drivers/usb
> >   ks8695: move serial driver to drivers/serial
> >   lpc2292: move serial driver to drivers/serial
> >   arm720t/clps7111: move serial driver to drivers/serial
> >   omap3: remove duplicate interrupts code
> >   imx: move serial driver to drivers/serial
> >   davinci: move nand driver to drivers/mtd/nand
> >   davinci: move i2c driver to drivers/i2c
> >   s3c24x0: move serial driver to drivers/serial
> >   s3c24x0: move i2c driver to drivers/i2c
> >   s3c2410: move nand driver to drivers/mtd/nand
> 
> Ummm... don't you think it would be appropriate to allow at least for
> 2...3 days of review?
The 14 first patches are already send 4 days agao
the 6 last are just code move

but if you prefer to wait 2 or 3 days ok

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


[U-Boot] AT91 Pull Request

2009-03-29 Thread Jean-Christophe PLAGNIOL-VILLARD
Hi Wolfgang,

Please pull
The following changes since commit 88685b5f62274167ad2ba8a58e108d89ff71955b:
  Wolfgang Denk (1):
VCMA9: fix compile errors

are available in the git repository at:

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

Jean-Christophe PLAGNIOL-VILLARD (12):
  at91sam9/at91cap: spi init add hardware chip select support
  at91sam9: add watchdog support
  at91: rename DATAFLASH_MMC_SELECT to CONFIG_DATAFLASH_MMC_SELECT
  at91rm9200dk: Move conditional compilation to Makefile
  add dataflash mmc mux missing support
  at91rm9200: move serial driver to drivers/serial
  at91rm9200: move serial shutdown code to serial drivers
  at91rm9200: Reset update
  at91: move usb driver to drivers/usb
  at91: move dataflash spi driver to drivers/spi
  at91: add hardware i2c drivers
  at91sam9263ek: active hush and auto compelete support

Ulf Samuelsson (1):
  Add support for the AT91RM9200EK Board.

 MAKEALL|1 +
 Makefile   |4 +
 board/atmel/at91rm9200dk/Makefile  |   14 +-
 board/atmel/at91rm9200dk/at91rm9200dk.c|   10 +
 board/atmel/at91rm9200dk/mux.c |   28 +-
 board/atmel/at91rm9200ek/Makefile  |   56 
 board/atmel/at91rm9200ek/at91rm9200ek.c|   86 +
 board/atmel/at91rm9200ek/config.mk |1 +
 board/atmel/at91rm9200ek/led.c |   89 ++
 board/atmel/at91rm9200ek/misc.c|   51 +++
 board/atmel/at91rm9200ek/mux.c |   38 +++
 board/atmel/at91rm9200ek/partition.c   |   38 +++
 board/atmel/at91rm9200ek/u-boot.lds|   56 
 common/Makefile|1 +
 common/cmd_dataflash_mmc_mux.c |   65 
 cpu/arm920t/at91rm9200/Makefile|2 +-
 cpu/arm920t/at91rm9200/interrupts.c|   27 +--
 cpu/arm920t/start.S|4 +-
 cpu/arm926ejs/at91/.gitignore  |5 +
 cpu/arm926ejs/at91/Makefile|8 +-
 cpu/arm926ejs/at91/at91cap9_i2c.c  |   39 +++
 cpu/arm926ejs/at91/at91cap9_spi.c  |   37 ++-
 cpu/arm926ejs/at91/at91sam9260_i2c.c   |   39 +++
 cpu/arm926ejs/at91/at91sam9260_spi.c   |   36 ++-
 cpu/arm926ejs/at91/at91sam9261_i2c.c   |   39 +++
 cpu/arm926ejs/at91/at91sam9261_spi.c   |   36 ++-
 cpu/arm926ejs/at91/at91sam9263_i2c.c   |   39 +++
 cpu/arm926ejs/at91/at91sam9263_spi.c   |   36 ++-
 cpu/arm926ejs/at91/at91sam9rl_i2c.c|   50 +++
 cpu/arm926ejs/at91/at91sam9rl_spi.c|   18 +-
 doc/README.at91|   11 +
 drivers/i2c/Makefile   |1 +
 drivers/i2c/atmel_i2c.c|  234 ++
 drivers/mtd/cfi_flash.c|5 +-
 drivers/serial/Makefile|1 +
 .../serial.c => drivers/serial/at91rm9200_usart.c  |5 +
 drivers/serial/atmel_usart.c   |4 +-
 drivers/spi/Makefile   |1 +
 .../spi.c => drivers/spi/atmel_dataflash_spi.c |0
 drivers/usb/Makefile   |1 +
 .../at91/usb.c => drivers/usb/atmel_usb.c  |0
 drivers/watchdog/Makefile  |   46 +++
 drivers/watchdog/at91sam9_wdt.c|   79 +
 include/asm-arm/arch-at91/at91_common.h|2 +
 include/asm-arm/arch-at91/at91_twi.h   |   68 
 include/asm-arm/arch-at91/at91_wdt.h   |   38 +++
 include/asm-arm/arch-at91/clk.h|4 +
 include/asm-arm/arch-at91/hardware.h   |5 +
 include/at45.h |2 +-
 include/common.h   |1 +
 include/configs/afeb9260.h |2 +
 include/configs/at91cap9adk.h  |2 +
 include/configs/at91rm9200dk.h |1 +
 include/configs/at91rm9200ek.h |  327 
 include/configs/at91sam9260ek.h|2 +
 include/configs/at91sam9261ek.h|2 +
 include/configs/at91sam9263ek.h|5 +
 include/configs/at91sam9rlek.h |1 +
 include/configs/cmc_pu2.h  |1 +
 include/configs/csb637.h   |1 +
 include/configs/kb9202.h   |1 +
 include/configs/m501sk.h   |1 +
 include/configs/mp2usb.h   |1 +
 63 files changed, 1727 insertions(+), 81 deletions(-)
 create mode 100644 board/atmel/at91rm

Re: [U-Boot] [PATCH 2/2] at91: Add support for esd MEESC board

2009-03-29 Thread Jean-Christophe PLAGNIOL-VILLARD
> +# along with this program; if not, write to the Free Software
> +# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
> +# MA 02111-1307 USA
> +#
> +
> +include $(TOPDIR)/config.mk
> +
> +LIB  = $(obj)lib$(BOARD).a
> +
> +COBJS-y += meesc.o
please use $(BOARD)
> +
> +SRCS := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
> +OBJS := $(addprefix $(obj),$(COBJS-y))
> +SOBJS:= $(addprefix $(obj),$(SOBJS))
> +
> +$(LIB):  $(obj).depend $(OBJS) $(SOBJS)
> + $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
> +
> +clean:
> + rm -f $(SOBJS) $(OBJS)
> +
> +distclean:   clean
> + rm -f $(LIB) core *.bak $(obj).depend
> +
> +#
> +
> +# defines $(obj).depend target
> +include $(SRCTREE)/rules.mk
> +
> +sinclude $(obj).depend
> +
> +#
> diff --git a/board/esd/meesc/config.mk b/board/esd/meesc/config.mk
> new file mode 100644
> index 000..9ce161e
> --- /dev/null
> +++ b/board/esd/meesc/config.mk
> @@ -0,0 +1 @@
> +TEXT_BASE = 0x21f0
> diff --git a/board/esd/meesc/meesc.c b/board/esd/meesc/meesc.c
> new file mode 100644
> index 000..122707a
> --- /dev/null
> +++ b/board/esd/meesc/meesc.c
> @@ -0,0 +1,400 @@
> +/*
> + * (C) Copyright 2007-2008
> + * Stelian Pop 
> + * Lead Tech Design 
> + *
> + * (C) Copyright 2008
> + * Ulf Samuelsson 
> + *
> + * (C) Copyright 2009
> + * Daniel Gorsulowski 
> + * esd electronic system design gmbh 
> + *
> + * See file CREDITS for list of people who contributed to this
> + * project.
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License as
> + * published by the Free Software Foundation; either version 2 of
> + * the License, or (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
> + * MA 02111-1307 USA
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +DECLARE_GLOBAL_DATA_PTR;
> +
> +/*
> + * Miscelaneous platform dependent initialisations
> + */
> +
> +static void meesc_serial_hw_init(void)
> +{
> + /* initialize DBGU pins*/
> + at91_set_A_periph(AT91_PIN_PC30, 0);/* DRXD */
> + at91_set_A_periph(AT91_PIN_PC31, 1);/* DTXD */
> + at91_sys_write(AT91_PMC_PCER, 1 << AT91_ID_SYS);
> +}
please use new hw_init framwork
> +
> +#define LED1AAT91_PIN_PB8
> +#define LED1BAT91_PIN_PB7
> +static void meesc_gpio_hw_init(void)
> +{
> + /* Peripheral Clock Enable Register */
> + at91_sys_write(AT91_PMC_PCER,   1 << AT91SAM9263_ID_PIOA |
> + 1 << AT91SAM9263_ID_PIOB |
> + 1 << AT91SAM9263_ID_PIOCDE);
> +
> + /* defines ports as output */
> + at91_set_gpio_output(LED1A, 0);
> + at91_set_gpio_output(LED1B, 0);
> +}
> +
> +#ifdef CONFIG_CMD_NAND
> +static void meesc_nand_hw_init(void)
> +{
> + unsigned long csa;
> +
> + /* Enable CS3 */
> + csa = at91_sys_read(AT91_MATRIX_EBI0CSA);
> + at91_sys_write(AT91_MATRIX_EBI0CSA,
> + csa | AT91_MATRIX_EBI0_CS3A_SMC_SMARTMEDIA);
> +
> + /* Configure SMC CS3 for NAND/SmartMedia */
> + at91_sys_write(AT91_SMC_SETUP(3),
> + AT91_SMC_NWESETUP_(1) | AT91_SMC_NCS_WRSETUP_(0) |
> + AT91_SMC_NRDSETUP_(1) | AT91_SMC_NCS_RDSETUP_(0));
> + at91_sys_write(AT91_SMC_PULSE(3),
> + AT91_SMC_NWEPULSE_(3) | AT91_SMC_NCS_WRPULSE_(3) |
> + AT91_SMC_NRDPULSE_(3) | AT91_SMC_NCS_RDPULSE_(3));
> + at91_sys_write(AT91_SMC_CYCLE(3),
> + AT91_SMC_NWECYCLE_(5) | AT91_SMC_NRDCYCLE_(5));
> + at91_sys_write(AT91_SMC_MODE(3),
> + AT91_SMC_READMODE | AT91_SMC_WRITEMODE |
> + AT91_SMC_EXNWMODE_DISABLE |
> +#ifdef CONFIG_SYS_NAND_DBW_16
> + AT91_SMC_DBW_16 |
> +#else /* CONFIG_SYS_NAND_DBW_8 */
> + AT91_SMC_DBW_8 |
> +#endif
> + AT91_SMC_TDF_(2));
> +
> + /* Configure RDY/BSY */
> + at91_set_gpio_input(CONFIG_SYS_NAND_READY_PIN, 1);
> +
> + /* Enable NandFlash */
> + at91_set_gpio_output(CONFIG_SYS_NAND_ENABLE_PIN, 1);
> +}
> +#endif /* CONFIG_CMD_NAND */
> +
> +static void meesc_ethercat_hw_init(void)
> +{
do you have intention to use it in U-Boot?
> + /* Configure SMC EBI1_CS0 for EtherCAT */
> + at91_sys_write(AT91_SMC1_SETUP(0),
> + AT91_SMC_NWESETUP_(0) | AT

[U-Boot] [PATCH v3 0/5] Update for inka4x0 plus some new features

2009-03-29 Thread Detlev Zundel
This patchset contains updates for the ink4x0 platform.  Namely it
adds hardware diagnostic funtions and an RTC driver.

For a nice integration by using private command tables, do_help is
extended to support this scenario also.

To successfully convert all the pointer access to accessor macros, a
bunch of new defines is also needed for the 5200 cpu.


Changes from v2:

Addresses comments from ML.  Specifically:
- Fixing the odd empty line here and there
- Removed some cruft uncovered in the review process
- Rebased against master becaus some patches were
  already applied by Wolfgang.

Detlev Zundel (5):
  drivers/twserial: Add protocol driver for "three wire serial"
interface.
  rtc: add support for 4543 RTC (manufactured by e.g. EPSON)
  inka4x0: Add hardware diagnosis functions for inka4x0
  inka4x0: Add hardware diagnosis and RTC in configuration.
  inka4x0: Use proper accessor macros for memory mapped registers.

 Makefile|3 +-
 board/inka4x0/Makefile  |4 +-
 board/inka4x0/inka4x0.c |  171 +-
 board/inka4x0/inkadiag.c|  514 +++
 drivers/rtc/Makefile|1 +
 drivers/rtc/rtc4543.c   |  118 ++
 drivers/twserial/Makefile   |   46 
 drivers/twserial/soft_tws.c |  111 ++
 include/configs/inka4x0.h   |   91 +++-
 include/ns16550.h   |   11 +
 include/rtc.h   |4 +
 include/tws.h   |   38 
 12 files changed, 1042 insertions(+), 70 deletions(-)
 create mode 100644 board/inka4x0/inkadiag.c
 create mode 100644 drivers/rtc/rtc4543.c
 create mode 100644 drivers/twserial/Makefile
 create mode 100644 drivers/twserial/soft_tws.c
 create mode 100644 include/tws.h

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


[U-Boot] [PATCH v3 2/5] rtc: add support for 4543 RTC (manufactured by e.g. EPSON)

2009-03-29 Thread Detlev Zundel
Signed-off-by: Detlev Zundel 
Signed-off-by: Andreas Pfefferle 
---
 drivers/rtc/Makefile  |1 +
 drivers/rtc/rtc4543.c |  118 +
 include/rtc.h |4 ++
 3 files changed, 123 insertions(+), 0 deletions(-)
 create mode 100644 drivers/rtc/rtc4543.c

diff --git a/drivers/rtc/Makefile b/drivers/rtc/Makefile
index 94bc518..6adece2 100644
--- a/drivers/rtc/Makefile
+++ b/drivers/rtc/Makefile
@@ -55,6 +55,7 @@ COBJS-$(CONFIG_RTC_MPC8xx) += mpc8xx.o
 COBJS-$(CONFIG_RTC_PCF8563) += pcf8563.o
 COBJS-$(CONFIG_RTC_PL031) += pl031.o
 COBJS-$(CONFIG_RTC_RS5C372A) += rs5c372.o
+COBJS-$(CONFIG_RTC_RTC4543) += rtc4543.o
 COBJS-$(CONFIG_RTC_RX8025) += rx8025.o
 COBJS-$(CONFIG_RTC_S3C24X0) += s3c24x0_rtc.o
 COBJS-$(CONFIG_RTC_X1205) += x1205.o
diff --git a/drivers/rtc/rtc4543.c b/drivers/rtc/rtc4543.c
new file mode 100644
index 000..242d9bc
--- /dev/null
+++ b/drivers/rtc/rtc4543.c
@@ -0,0 +1,118 @@
+/*
+ * (C) Copyright 2008, 2009
+ * Andreas Pfefferle, DENX Software Engineering, a...@denx.de.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#if defined(CONFIG_CMD_DATE)
+
+/*
+ * Note: The acrobatics below is due to the hideously ingenius idea of
+ * the chip designers.  As the chip does not allow register
+ * addressing, all values need to be read and written in one go.  Sure
+ * enough, the 'wday' field (0-6) is transferred using the economic
+ * number of 4 bits right in the middle of the packet.
+ */
+
+int rtc_get(struct rtc_time *tm)
+{
+   int rel = 0;
+   uchar buffer[7];
+
+   memset(buffer, 0, 7);
+
+   /* Read 52 bits into our buffer */
+   tws_read(buffer, 52);
+
+   tm->tm_sec  = BCD2BIN( buffer[0] & 0x7F);
+   tm->tm_min  = BCD2BIN( buffer[1] & 0x7F);
+   tm->tm_hour = BCD2BIN( buffer[2] & 0x3F);
+   tm->tm_wday = BCD2BIN( buffer[3] & 0x07);
+   tm->tm_mday = BCD2BIN((buffer[3] & 0xF0) >> 4 | (buffer[4] & 0x0F) << 
4);
+   tm->tm_mon  = BCD2BIN((buffer[4] & 0x30) >> 4 | (buffer[5] & 0x0F) << 
4);
+   tm->tm_year = BCD2BIN((buffer[5] & 0xF0) >> 4 | (buffer[6] & 0x0F) << 
4) + 2000;
+   tm->tm_yday = 0;
+   tm->tm_isdst = 0;
+
+   if (tm->tm_sec & 0x80) {
+   puts("### Warning: RTC Low Voltage - date/time not reliable\n");
+   rel = -1;
+   }
+
+   debug("Get DATE: %4d-%02d-%02d (wday=%d)  TIME: %2d:%02d:%02d\n",
+   tm->tm_year, tm->tm_mon, tm->tm_mday, tm->tm_wday,
+   tm->tm_hour, tm->tm_min, tm->tm_sec);
+
+   return rel;
+}
+
+int rtc_set(struct rtc_time *tm)
+{
+   uchar buffer[7];
+   uchar tmp;
+
+   debug("Set DATE: %4d-%02d-%02d (wday=%d)  TIME: %2d:%02d:%02d\n",
+   tm->tm_year, tm->tm_mon, tm->tm_mday, tm->tm_wday,
+   tm->tm_hour, tm->tm_min, tm->tm_sec);
+
+   memset(buffer, 0, 7);
+   buffer[0] = BIN2BCD(tm->tm_sec);
+   buffer[1] = BIN2BCD(tm->tm_min);
+   buffer[2] = BIN2BCD(tm->tm_hour);
+   buffer[3] = BIN2BCD(tm->tm_wday);
+   tmp = BIN2BCD(tm->tm_mday);
+   buffer[3] |= (tmp & 0x0F) << 4;
+   buffer[4] =  (tmp & 0xF0) >> 4;
+   tmp = BIN2BCD(tm->tm_mon);
+   buffer[4] |= (tmp & 0x0F) << 4;
+   buffer[5] =  (tmp & 0xF0) >> 4;
+   tmp = BIN2BCD(tm->tm_year  % 100);
+   buffer[5] |= (tmp & 0x0F) << 4;
+   buffer[6] =  (tmp & 0xF0) >> 4;
+
+   /* Write the resulting 52 bits to device */
+   tws_write(buffer, 52);
+
+   return 0;
+}
+
+void rtc_reset(void)
+{
+   struct rtc_time tmp;
+
+   tmp.tm_sec = 0;
+   tmp.tm_min = 0;
+   tmp.tm_hour = 0;
+   tmp.tm_wday = 4;
+   tmp.tm_mday = 1;
+   tmp.tm_mon = 1;
+   tmp.tm_year = 2000;
+   rtc_set(&tmp);
+}
+
+#endif
diff --git a/include/rtc.h b/include/rtc.h
index 785fbe3..019c2eb 100644
--- a/include/rtc.h
+++ b/include/rtc.h
@@ -61,4 +61,8 @@ void to_tm (int, struct rtc_time *);
 unsigned long mktime (unsigned int, unsigned int, unsigned int,
  unsigned int, unsigned int, unsigned int);
 
+uchar rtc_read(uchar reg) __attribute__((weak));
+void  rtc_write(uchar reg, uchar va

[U-Boot] [PATCH v3 4/5] inka4x0: Add hardware diagnosis and RTC in configuration.

2009-03-29 Thread Detlev Zundel
This patch adds the board specific communication routines needed by
the external 4543 RTC.

Signed-off-by: Detlev Zundel 
Signed-off-by: Andreas Pfefferle 
---
 board/inka4x0/inka4x0.c   |   20 ++
 include/configs/inka4x0.h |   90 ++--
 2 files changed, 105 insertions(+), 5 deletions(-)

diff --git a/board/inka4x0/inka4x0.c b/board/inka4x0/inka4x0.c
index bb5c25d..a8bc3b3 100644
--- a/board/inka4x0/inka4x0.c
+++ b/board/inka4x0/inka4x0.c
@@ -33,6 +33,7 @@
  * MA 02111-1307 USA
  */
 
+#include 
 #include 
 #include 
 #include 
@@ -189,6 +190,8 @@ int misc_init_r (void) {
 
 int misc_init_f (void)
 {
+   struct mpc5xxx_gpio *gpio = (struct mpc5xxx_gpio *)MPC5XXX_GPIO;
+   struct mpc5xxx_wu_gpio *wu_gpio = (struct mpc5xxx_wu_gpio 
*)MPC5XXX_WU_GPIO;
char tmp[10];
int i, br;
 
@@ -236,6 +239,23 @@ int misc_init_f (void)
*(vu_long *) MPC5XXX_WU_GPIO_ENABLE |= GPIO_PSC3_9;
*(vu_long *) MPC5XXX_WU_GPIO_DIR|= GPIO_PSC3_9;
*(vu_long *) MPC5XXX_WU_GPIO_DATA_O   |= GPIO_PSC3_9;
+
+   /*
+* Configure three wire serial interface to RTC (PSC1_4,
+* PSC2_4, PSC3_4, PSC3_5)
+*/
+   setbits_8(&wu_gpio->enable,  MPC5XXX_GPIO_WKUP_PSC1_4 |
+MPC5XXX_GPIO_WKUP_PSC2_4);
+   setbits_8(&wu_gpio->ddr, MPC5XXX_GPIO_WKUP_PSC1_4 |
+MPC5XXX_GPIO_WKUP_PSC2_4);
+   clrbits_8(&wu_gpio->dvo, MPC5XXX_GPIO_WKUP_PSC1_4);
+   clrbits_8(&gpio->sint_inten, MPC5XXX_GPIO_SINT_PSC3_4 |
+MPC5XXX_GPIO_SINT_PSC3_5);
+   setbits_8(&gpio->sint_gpioe, MPC5XXX_GPIO_SINT_PSC3_4 |
+MPC5XXX_GPIO_SINT_PSC3_5);
+   setbits_8(&gpio->sint_ddr,   MPC5XXX_GPIO_SINT_PSC3_5);
+   clrbits_8(&gpio->sint_dvo,   MPC5XXX_GPIO_SINT_PSC3_5);
+
return 0;
 }
 
diff --git a/include/configs/inka4x0.h b/include/configs/inka4x0.h
index b80796d..5f06b09 100644
--- a/include/configs/inka4x0.h
+++ b/include/configs/inka4x0.h
@@ -1,4 +1,7 @@
 /*
+ * (C) Copyright 2009
+ * Detlev Zundel, DENX Software Engineering, d...@denx.de.
+ *
  * (C) Copyright 2003-2005
  * Wolfgang Denk, DENX Software Engineering, w...@denx.de.
  *
@@ -90,16 +93,17 @@
  */
 #include 
 
+#define CONFIG_CMD_DATE
 #define CONFIG_CMD_DHCP
 #define CONFIG_CMD_EXT2
 #define CONFIG_CMD_FAT
 #define CONFIG_CMD_IDE
 #define CONFIG_CMD_NFS
 #define CONFIG_CMD_PCI
+#define CONFIG_CMD_PING
 #define CONFIG_CMD_SNTP
 #define CONFIG_CMD_USB
 
-
 #defineCONFIG_TIMESTAMP1   /* Print image info with 
timestamp */
 
 #if (TEXT_BASE == 0xFFE0)  /* Boot low */
@@ -240,15 +244,91 @@
  * 01 -> CAN1 on I2C1, CAN2 on Tmr0/1 do not use on TQM5200 with onboard
  *   EEPROM
  * use PSC1 as UART: Bits 28-31 (mask: 0x0007): 0100
- * use PSC6_1 and PSC6_3 as GPIO: Bits 9:11 (mask: 0x0700):
- * 011 -> PSC6 could not be used as UART or CODEC. IrDA still possible.
+ * use PSC2 as UART: Bits 24-27 (mask: 0x0070): 0100
+ * use PSC3 as UART: Bits 20-23 (mask: 0x0700): 0100
+ * use PSC6 as UART: Bits  9-11 (mask: 0x0070): 0101
  */
-#define CONFIG_SYS_GPS_PORT_CONFIG 0x01001004
+#define CONFIG_SYS_GPS_PORT_CONFIG 0x01501444
 
 /*
  * RTC configuration
  */
-#define CONFIG_RTC_MPC5200 1   /* use internal MPC5200 RTC */
+#define CONFIG_RTC_RTC4543 1   /* use external RTC */
+
+/*
+ * Software (bit-bang) three wire serial configuration
+ *
+ * Note that we need the ifdefs because otherwise compilation of
+ * mkimage.c fails.
+ */
+#define CONFIG_SOFT_TWS1
+
+#ifdef TWS_IMPLEMENTATION
+#include 
+#include 
+
+#define TWS_CE MPC5XXX_GPIO_WKUP_PSC1_4 /* GPIO_WKUP_0 */
+#define TWS_WR MPC5XXX_GPIO_WKUP_PSC2_4 /* GPIO_WKUP_1 */
+#define TWS_DATA   MPC5XXX_GPIO_SINT_PSC3_4 /* GPIO_SINT_0 */
+#define TWS_CLKMPC5XXX_GPIO_SINT_PSC3_5 /* GPIO_SINT_1 */
+
+static inline void tws_ce(unsigned bit)
+{
+   struct mpc5xxx_wu_gpio *wu_gpio =
+   (struct mpc5xxx_wu_gpio *)MPC5XXX_WU_GPIO;
+   if (bit)
+   setbits_8(&wu_gpio->dvo, TWS_CE);
+   else
+   clrbits_8(&wu_gpio->dvo, TWS_CE);
+}
+
+static inline void tws_wr(unsigned bit)
+{
+   struct mpc5xxx_wu_gpio *wu_gpio =
+   (struct mpc5xxx_wu_gpio *)MPC5XXX_WU_GPIO;
+   if (bit)
+   setbits_8(&wu_gpio->dvo, TWS_WR);
+   else
+   clrbits_8(&wu_gpio->dvo, TWS_WR);
+}
+
+static inline void tws_clk(unsigned bit)
+{
+   struct mpc5xxx_gpio *gpio =
+   (struct mpc5xxx_gpio *)MPC5XXX_GPIO;
+   if (bit)
+   setbits_8(&gpio->sint_dvo, TWS_CLK);
+   else
+   clrbits_8(&gpio->sint_dvo, TWS_CLK);
+}
+
+static inline void tws_data(unsigned bit)
+{
+   struct mpc5xxx_gpio *gpio =
+   (struct mpc5xxx_gpio *)MPC5XXX_GPIO;
+

[U-Boot] [PATCH v3 1/5] drivers/twserial: Add protocol driver for "three wire serial" interface.

2009-03-29 Thread Detlev Zundel
This pretty unintelligent interface is used on some RTC chips.

Signed-off-by: Detlev Zundel 
---
 Makefile|3 +-
 drivers/twserial/Makefile   |   46 ++
 drivers/twserial/soft_tws.c |  111 +++
 include/tws.h   |   38 +++
 4 files changed, 197 insertions(+), 1 deletions(-)
 create mode 100644 drivers/twserial/Makefile
 create mode 100644 drivers/twserial/soft_tws.c
 create mode 100644 include/tws.h

diff --git a/Makefile b/Makefile
index 1cce381..b6fb939 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000-2008
+# (C) Copyright 2000-2009
 # Wolfgang Denk, DENX Software Engineering, w...@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
@@ -262,6 +262,7 @@ TAG_SUBDIRS += cpu/mpc8xxx
 endif
 LIBS += drivers/rtc/librtc.a
 LIBS += drivers/serial/libserial.a
+LIBS += drivers/twserial/libtws.a
 LIBS += drivers/usb/libusb.a
 LIBS += drivers/video/libvideo.a
 LIBS += common/libcommon.a
diff --git a/drivers/twserial/Makefile b/drivers/twserial/Makefile
new file mode 100644
index 000..0b059f3
--- /dev/null
+++ b/drivers/twserial/Makefile
@@ -0,0 +1,46 @@
+#
+# (C) Copyright 2009
+# Detlev Zundel, DENX Software Engineering, d...@denx.de.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB:= $(obj)libtws.a
+
+COBJS-$(CONFIG_SOFT_TWS) += soft_tws.o
+
+COBJS  := $(COBJS-y)
+SRCS   := $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+
+all:   $(LIB)
+
+$(LIB):$(obj).depend $(OBJS)
+   $(AR) $(ARFLAGS) $@ $(OBJS)
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/drivers/twserial/soft_tws.c b/drivers/twserial/soft_tws.c
new file mode 100644
index 000..0b50e1d
--- /dev/null
+++ b/drivers/twserial/soft_tws.c
@@ -0,0 +1,111 @@
+/*
+ * (C) Copyright 2009
+ * Detlev Zundel, DENX Software Engineering, d...@denx.de.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ */
+
+#define TWS_IMPLEMENTATION
+#include 
+
+/*=*/
+/* Public Functions*/
+/*=*/
+
+/*---
+ * Read bits
+ */
+int tws_read(uchar *buffer, int len)
+{
+   int rem = len;
+   uchar accu, shift;
+
+   debug("tws_read: buffer %p len %d\n", buffer, len);
+
+   /* Configure the data pin for input */
+   tws_data_config_output(0);
+
+   /* Disable WR, i.e. setup a read */
+   tws_wr(0);
+   udelay(1);
+
+   /* Rise CE */
+   tws_ce(1);
+   udelay(1);
+
+   for (; rem > 0; ) {
+   for (shift = 0, accu = 0;
+(rem > 0) && (shift < 8);
+rem--, shift++) {
+   tws_clk(1);
+   udelay(10);
+   accu |= (tws_data_read() << shift); /* LSB first */
+   tws_clk(0);
+   udelay(10);
+   }
+   *buffer++ = accu;
+   }
+
+   /* Lower CE */
+   tws_ce(0);
+
+   return len - rem;
+}
+
+
+/*---

[U-Boot] [PATCH v3 3/5] inka4x0: Add hardware diagnosis functions for inka4x0

2009-03-29 Thread Detlev Zundel
This patch adds advanced diagnosis functions for the inka4x0 board.

Signed-off-by: Andreas Pfefferle 
Signed-off-by: Detlev Zundel 
---
 board/inka4x0/Makefile|4 +-
 board/inka4x0/inka4x0.c   |   20 ++-
 board/inka4x0/inkadiag.c  |  514 +
 include/configs/inka4x0.h |1 +
 include/ns16550.h |   11 +
 5 files changed, 546 insertions(+), 4 deletions(-)
 create mode 100644 board/inka4x0/inkadiag.c

diff --git a/board/inka4x0/Makefile b/board/inka4x0/Makefile
index 442e2d0..82aa950 100644
--- a/board/inka4x0/Makefile
+++ b/board/inka4x0/Makefile
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2003-2006
+# (C) Copyright 2003-2009
 # Wolfgang Denk, DENX Software Engineering, w...@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
@@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk
 
 LIB= $(obj)lib$(BOARD).a
 
-COBJS  := $(BOARD).o
+COBJS  := $(BOARD).o inkadiag.o
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS))
diff --git a/board/inka4x0/inka4x0.c b/board/inka4x0/inka4x0.c
index 507196b..bb5c25d 100644
--- a/board/inka4x0/inka4x0.c
+++ b/board/inka4x0/inka4x0.c
@@ -1,6 +1,9 @@
 /*
- * (C) Copyright 2003-2004
- * Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+ * (C) Copyright 2008-2009
+ * Andreas Pfefferle, DENX Software Engineering, a...@denx.de.
+ *
+ * (C) Copyright 2009
+ * Detlev Zundel, DENX Software Engineering, d...@denx.de.
  *
  * (C) Copyright 2004
  * Mark Jonas, Freescale Semiconductor, mark.jo...@motorola.com.
@@ -8,6 +11,9 @@
  * (C) Copyright 2004
  * Martin Krause, TQ-Systems GmbH, martin.kra...@tqs.de
  *
+ * (C) Copyright 2003-2004
+ * Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+ *
  * See file CREDITS for list of people who contributed to this
  * project.
  *
@@ -171,6 +177,16 @@ void flash_preinit(void)
*(vu_long *)MPC5XXX_BOOTCS_CFG &= ~0x1; /* clear RO */
 }
 
+int misc_init_r (void) {
+   extern int inkadiag_init_r (void);
+
+   /*
+* The command table used for the subcommands of inkadiag
+* needs to be relocated manually.
+*/
+   return inkadiag_init_r();
+}
+
 int misc_init_f (void)
 {
char tmp[10];
diff --git a/board/inka4x0/inkadiag.c b/board/inka4x0/inkadiag.c
new file mode 100644
index 000..06c9807
--- /dev/null
+++ b/board/inka4x0/inkadiag.c
@@ -0,0 +1,514 @@
+/*
+ * (C) Copyright 2008, 2009 Andreas Pfefferle,
+ * DENX Software Engineering, a...@denx.de.
+ * (C) Copyright 2009 Detlev Zundel,
+ * DENX Software Engineering, d...@denx.de.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+/* This is needed for the includes in ns16550.h */
+#define CONFIG_SYS_NS16550_REG_SIZE 1
+#include 
+
+#define GPIO_BASE  ((u_char *)CONFIG_SYS_CS3_START)
+
+#define DIGIN_TOUCHSCR_MASK0x3000  /* Inputs 12-13 */
+#define DIGIN_KEYB_MASK0x0001  /* Input 16 */
+
+#define DIGIN_DRAWER_SW1   0x0040  /* Input 22 */
+#define DIGIN_DRAWER_SW2   0x0080  /* Input 23 */
+
+#define DIGIO_LED0 0x0001  /* Output 0 */
+#define DIGIO_LED1 0x0002  /* Output 1 */
+#define DIGIO_LED2 0x0004  /* Output 2 */
+#define DIGIO_LED3 0x0008  /* Output 3 */
+#define DIGIO_LED4 0x0010  /* Output 4 */
+#define DIGIO_LED5 0x0020  /* Output 5 */
+
+#define DIGIO_DRAWER1  0x0100  /* Output 8 */
+#define DIGIO_DRAWER2  0x0200  /* Output 9 */
+
+#define SERIAL_PORT_BASE   ((u_char *)CONFIG_SYS_CS2_START)
+
+#define PSC_OP1_RTS0x01
+#define PSC_OP0_RTS0x01
+
+/*
+ * Table with supported baudrates (defined in inka4x0.h)
+ */
+static const unsigned long baudrate_table[] = CONFIG_SYS_BAUDRATE_TABLE;
+#defineN_BAUDRATES (sizeof(baudrate_table) / sizeof(baudrate_table[0]))
+
+static unsigned int inka_digin_get_input(void)
+{
+   return in_8(GPIO_BASE + 0) << 0 | in_8(GPIO_BASE + 1) << 8 |
+   in_8(GPIO_BASE + 2) << 16 | in_8(GPIO_BASE + 3) << 24;
+}
+
+#define LED_HIG

[U-Boot] [PATCH v3 5/5] inka4x0: Use proper accessor macros for memory mapped registers.

2009-03-29 Thread Detlev Zundel
Signed-off-by: Detlev Zundel 
---
 board/inka4x0/inka4x0.c |  139 +--
 1 files changed, 75 insertions(+), 64 deletions(-)

diff --git a/board/inka4x0/inka4x0.c b/board/inka4x0/inka4x0.c
index a8bc3b3..7428b92 100644
--- a/board/inka4x0/inka4x0.c
+++ b/board/inka4x0/inka4x0.c
@@ -55,41 +55,35 @@
 #ifndef CONFIG_SYS_RAMBOOT
 static void sdram_start (int hi_addr)
 {
+   volatile struct mpc5xxx_sdram *sdram =
+   (struct mpc5xxx_sdram *)MPC5XXX_SDRAM;
long hi_addr_bit = hi_addr ? 0x0100 : 0;
 
/* unlock mode register */
-   *(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | 0x8000 | 
hi_addr_bit;
-   __asm__ volatile ("sync");
+   out_be32(&sdram->ctrl, SDRAM_CONTROL | 0x8000 | hi_addr_bit);
 
/* precharge all banks */
-   *(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | 0x8002 | 
hi_addr_bit;
-   __asm__ volatile ("sync");
+   out_be32(&sdram->ctrl, SDRAM_CONTROL | 0x8002 | hi_addr_bit);
 
 #if SDRAM_DDR
/* set mode register: extended mode */
-   *(vu_long *)MPC5XXX_SDRAM_MODE = SDRAM_EMODE;
-   __asm__ volatile ("sync");
+   out_be32(&sdram->mode, SDRAM_EMODE);
 
/* set mode register: reset DLL */
-   *(vu_long *)MPC5XXX_SDRAM_MODE = SDRAM_MODE | 0x0400;
-   __asm__ volatile ("sync");
+   out_be32(&sdram->mode, SDRAM_MODE | 0x0400);
 #endif
 
/* precharge all banks */
-   *(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | 0x8002 | 
hi_addr_bit;
-   __asm__ volatile ("sync");
+   out_be32(&sdram->ctrl, SDRAM_CONTROL | 0x8002 | hi_addr_bit);
 
/* auto refresh */
-   *(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | 0x8004 | 
hi_addr_bit;
-   __asm__ volatile ("sync");
+   out_be32(&sdram->ctrl, SDRAM_CONTROL | 0x8004 | hi_addr_bit);
 
/* set mode register */
-   *(vu_long *)MPC5XXX_SDRAM_MODE = SDRAM_MODE;
-   __asm__ volatile ("sync");
+   out_be32(&sdram->mode, SDRAM_MODE);
 
/* normal operation */
-   *(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | hi_addr_bit;
-   __asm__ volatile ("sync");
+   out_be32(&sdram->ctrl, SDRAM_CONTROL | hi_addr_bit);
 }
 #endif
 
@@ -101,24 +95,27 @@ static void sdram_start (int hi_addr)
 
 phys_size_t initdram (int board_type)
 {
+   volatile struct mpc5xxx_mmap_ctl *mm =
+   (struct mpc5xxx_mmap_ctl *) CONFIG_SYS_MBAR;
+   volatile struct mpc5xxx_cdm *cdm =
+   (struct mpc5xxx_cdm *)  MPC5XXX_CDM;
+   volatile struct mpc5xxx_sdram *sdram =
+   (struct mpc5xxx_sdram *)MPC5XXX_SDRAM;
ulong dramsize = 0;
 #ifndef CONFIG_SYS_RAMBOOT
long test1, test2;
 
/* setup SDRAM chip selects */
-   *(vu_long *)MPC5XXX_SDRAM_CS0CFG = 0x001c; /* 512MB at 0x0 */
-   *(vu_long *)MPC5XXX_SDRAM_CS1CFG = 0x4000; /* disabled */
-   __asm__ volatile ("sync");
+   out_be32(&mm->sdram0, 0x001c);  /* 512MB at 0x0 */
+   out_be32(&mm->sdram1, 0x4000);  /* disabled */
 
/* setup config registers */
-   *(vu_long *)MPC5XXX_SDRAM_CONFIG1 = SDRAM_CONFIG1;
-   *(vu_long *)MPC5XXX_SDRAM_CONFIG2 = SDRAM_CONFIG2;
-   __asm__ volatile ("sync");
+   out_be32(&sdram->config1, SDRAM_CONFIG1);
+   out_be32(&sdram->config2, SDRAM_CONFIG2);
 
 #if SDRAM_DDR
/* set tap delay */
-   *(vu_long *)MPC5XXX_CDM_PORCFG = SDRAM_TAPDELAY;
-   __asm__ volatile ("sync");
+   out_be32(&cdm->porcfg, SDRAM_TAPDELAY);
 #endif
 
/* find RAM size using SDRAM CS0 only */
@@ -140,17 +137,17 @@ phys_size_t initdram (int board_type)
 
/* set SDRAM CS0 size according to the amount of RAM found */
if (dramsize > 0) {
-   *(vu_long *)MPC5XXX_SDRAM_CS0CFG = 0x13 +
-   __builtin_ffs(dramsize >> 20) - 1;
+   out_be32(&mm->sdram0, 0x13 +
+__builtin_ffs(dramsize >> 20) - 1);
} else {
-   *(vu_long *)MPC5XXX_SDRAM_CS0CFG = 0; /* disabled */
+   out_be32(&mm->sdram0, 0); /* disabled */
}
 
-   *(vu_long *)MPC5XXX_SDRAM_CS1CFG = dramsize; /* disabled */
+   out_be32(&mm->sdram1, dramsize); /* disabled */
 #else /* CONFIG_SYS_RAMBOOT */
 
/* retrieve size of memory connected to SDRAM CS0 */
-   dramsize = *(vu_long *)MPC5XXX_SDRAM_CS0CFG & 0xFF;
+   dramsize = in_be32(&mm->sdram0) & 0xFF;
if (dramsize >= 0x13) {
dramsize = (1 << (dramsize - 0x13)) << 20;
} else {
@@ -169,13 +166,15 @@ int checkboard (void)
 
 void flash_preinit(void)
 {
+   volatile struct mpc5xxx_lpb *lpb = (struct mpc5xxx_lpb *)MPC5XXX_LPB;
+
/*
 * Now, when we are in RAM, enable flash write
 * access for detection process.
-* Note that CS_BOOT cannot be cleared when
+* Note that CS_BOOT (CS0) cannot be cleared when
  

Re: [U-Boot] MPC850: strange problem with icache

2009-03-29 Thread Guowen SHAN
Dear Guowen SHAN,
>
> In message 
> you wrote:
> >
> > I'm porting u-boot-1.3.1 to customer board, which includes MPC850 and
> 32MB SDRAM.
> > When I turned off icache, bus can work correctly under 25MHz/50MHz clock
> frequence.
> > Note that CPU is working under 50MHz. However, the board only can work
> with bus
> > frequence of 25MHz with enabled icache. If I tried to set bus frequence
> to 50MHz with
> > enabled icache, it will crash with MCE.
>
> Easy problem - actually FAQ: please see
> http://www.denx.de/wiki/view/DULG/UBootCrashAfterRelocation


I don't understand it completely. 25MHz with enabled icache  could use burst
to fecth instructions
from RAM, which should have proved the UPM words and initialization sequence
was ok, right?


> 
>
> > I don't know why. Since it can work at 25MHz with enabled icache, the UPM
> words seem
> > ok. Thanks for your advices!
>
> Keep in mind that the UPM setup is only part of the required RAM
> initialization sequence. Follow the instructions in the chip
> manufacturer's manual to the letter.
>
>
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] u-boot-2009.03 Hangs

2009-03-29 Thread renjith kumar
On Fri, Mar 27, 2009 at 7:15 PM, Wolfgang Denk  wrote:

>
>  commit 3edf68c47fdd52f19c1e840771c19ba90cf5ced1


> Author: Stefan Roese 
> Date:   Thu Mar 26 16:14:13 2009 +0100


This Patch Removes the  problem , Thanks.


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


[U-Boot] [PATCH] cmd_mmc: add support device command for selecting mmc device (resend)

2009-03-29 Thread Minkyu Kang
This patch improves device command for selecting mmc device

Signed-off-by: Minkyu Kang 
---
 common/cmd_mmc.c |   61 +
 1 files changed, 56 insertions(+), 5 deletions(-)

diff --git a/common/cmd_mmc.c b/common/cmd_mmc.c
index 16c919b..fb99899 100644
--- a/common/cmd_mmc.c
+++ b/common/cmd_mmc.c
@@ -26,19 +26,70 @@
 #include 
 
 #ifndef CONFIG_GENERIC_MMC
+int curr_device = -1;
+
 int do_mmc (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
-   if (mmc_legacy_init (1) != 0) {
-   printf ("No MMC card found\n");
+   int dev;
+
+   if (argc < 2) {
+   cmd_usage(cmdtp);
return 1;
}
+
+   if (strcmp(argv[1], "init") == 0) {
+   if (argc == 2) {
+   if (curr_device < 0)
+   dev = 1;
+   else
+   dev = curr_device;
+   } else if (argc == 3) {
+   dev = (int)simple_strtoul(argv[2], NULL, 10);
+   } else {
+   cmd_usage(cmdtp);
+   return 1;
+   }
+
+   if (mmc_legacy_init(dev) != 0) {
+   puts("No MMC card found\n");
+   return 1;
+   }
+
+   curr_device = dev;
+   printf("mmc%d is available\n", curr_device);
+   } else if (strcmp(argv[1], "device") == 0) {
+   if (argc == 2) {
+   if (curr_device < 0) {
+   puts("No MMC device available\n");
+   return 1;
+   }
+   } else if (argc == 3) {
+   dev = (int)simple_strtoul(argv[2], NULL, 10);
+
+#ifdef CONFIG_SYS_MMC_SET_DEV
+   if (mmc_set_dev(dev) != 0)
+   return 1;
+#endif
+   curr_device = dev;
+   } else {
+   cmd_usage(cmdtp);
+   return 1;
+   }
+
+   printf("mmc%d is current device\n", curr_device);
+   } else {
+   cmd_usage(cmdtp);
+   return 1;
+   }
+
return 0;
 }
 
 U_BOOT_CMD(
-   mmcinit,1,  0,  do_mmc,
-   "init mmc card",
-   NULL
+   mmc, 3, 1, do_mmc,
+   "MMC sub-system",
+   "init [dev] - init MMC sub system\n"
+   "mmc device [dev] - show or set current device\n"
 );
 #else /* !CONFIG_GENERIC_MMC */
 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] NetLoop initialization bug

2009-03-29 Thread Heiko Schocher
Hello Michael,

Michael Zaidman wrote:
> Hi Heiko,
>
> The patch "netloop: speed up NetLoop" you delivered
> into the u-boot-2009.03 introduced bug I have described
> below a few days ago. Could you please take a look at
> the proposed fix?
>   

Sorry, seems I missed it.

> Thanks,
> Michael
>
> -- Forwarded message --
> From: Michael Zaidman 
> Date: Sun, Mar 22, 2009 at 8:35 PM
> Subject: [U-Boot] [PATCH] NetLoop initialization bug
> To: u-boot@lists.denx.de
>
>
> [U-Boot] [PATCH] NetLoop initialization bug
>   

Thanks for catching this.
Your patch doesn;t apply, I get "malformed patch". Before
sending a new one, please have a look at my comments:

>
>
> Upon u-boot's start up the first ping command causes a failure of the
> consequent TFTP command. It happens in the recently added mechanism of
> the NetLoop initialization where initialization of global network parameters 
> is
> separated in the NetInitLoop routine which is called per env_id change.
> Thus, ping request will initialize the network parameters necessary for ping
> operation only, afterwards the env_changed_id will be set to the env_id
> that will prevent all following initialization requests from other protocols.
> The problem is that the initialized by ping subset of network parameters is 
> not
> sufficient for other protocols and particularly for TFTP
> which requires the NetServerIp also.
>
> Signed-off-by: michael.zaid...@gmail.com
>
> diff --git a/net/net.c b/net/net.c
> index a89f6a0..dc98d0f 100644
> --- a/net/net.c
> +++ b/net/net.c
> @@ -288,64 +288,13 @@ NetInitLoop(proto_t protocol)
>if (env_changed_id == env_id)
>return 0;
>
> -   switch (protocol) {
> -#if defined(CONFIG_CMD_NFS)
> -   case NFS:
> -#endif
> -#if defined(CONFIG_CMD_PING)
> -   case PING:
> -#endif
> -#if defined(CONFIG_CMD_SNTP)
> -   case SNTP:
> -#endif
> -   case NETCONS:
> -   case TFTP:
> -   NetCopyIP(&NetOurIP, &bd->bi_ip_addr);
> -   NetOurGatewayIP = getenv_IPaddr ("gatewayip");
> -   NetOurSubnetMask= getenv_IPaddr ("netmask");
> -   NetOurVLAN = getenv_VLAN("vlan");
> -   NetOurNativeVLAN = getenv_VLAN("nvlan");
> +   NetCopyIP(&NetOurIP, &bd->bi_ip_addr);
> +   NetOurGatewayIP = getenv_IPaddr ("gatewayip");
> +   NetOurSubnetMask= getenv_IPaddr ("netmask");
> +   NetServerIP = getenv_IPaddr ("serverip");
>   

The following 2 vars are just used, if CONFIG_CMD_CDP
is used, can we do a "#if defined" around it?
> +   NetOurNativeVLAN = getenv_VLAN("nvlan");
> +   NetOurVLAN = getenv_VLAN("vlan");
>   
[...]
> @@ -443,18 +392,19 @@ restart:
>/* Start with a clean slate... */
>BootpTry = 0;
>NetOurIP = 0;
> -   NetServerIP = getenv_IPaddr ("serverip");
>DhcpRequest();  /* Basically same as BOOTP */
>break;
>  #endif
>
>case BOOTP:
>BootpTry = 0;
> +   NetOurIP = 0;
>   

why we need this here?

>BootpRequest ();
>break;
>
>case RARP:
>RarpTry = 0;
> +   NetOurIP = 0;
>   
also here?
Has this to do something with the bugfix?

bye
Heiko

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany 

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


Re: [U-Boot] [Patch] soft_i2c.c compiler/linker error

2009-03-29 Thread Heiko Schocher
Hello Jens,

Jens Scharsig wrote:
> This patch fix the compiler/linker errors
>
> common/cmd_i2c.c:1252: undefined reference to `i2c_get_bus_speed'
> common/cmd_i2c.c:1256: undefined reference to `i2c_set_bus_speed'
>
> if board use CONFIG_I2C_CMD_TREE and CONFIG_I2C_MULTI_BUS is not uesd/undef
>
> Signed-off-by: Jens Scharsig 
> ---
>
> diff --git a/drivers/i2c/soft_i2c.c b/drivers/i2c/soft_i2c.c
> index ed5f5b2..68b267f 100644
> --- a/drivers/i2c/soft_i2c.c
> +++ b/drivers/i2c/soft_i2c.c
> @@ -246,6 +246,7 @@ int i2c_set_bus_num(unsigned int bus)
>  #endif
>   return 0;
>  }
> +#endif
>  
>  /* TODO: add 100/400k switching */
>  unsigned int i2c_get_bus_speed(void)
> @@ -260,7 +261,7 @@ int i2c_set_bus_speed(unsigned int speed)
>  
>   return 0;
>  }
> -#endif
> +
>   

no need to add an empty line.

[...]

thanks for catching
Heiko

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany 

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


Re: [U-Boot] [Patch] soft_i2c.c compiler/linker error

2009-03-29 Thread Heiko Schocher
Hello Jean-Christophe

Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 11:31 Fri 27 Mar , Jens Scharsig wrote:
>   
>> This patch fix the compiler/linker errors
>>
>> common/cmd_i2c.c:1252: undefined reference to `i2c_get_bus_speed'
>> common/cmd_i2c.c:1256: undefined reference to `i2c_set_bus_speed'
>>
>> if board use CONFIG_I2C_CMD_TREE and CONFIG_I2C_MULTI_BUS is not uesd/undef
>>
>> Signed-off-by: Jens Scharsig 
>> 
> NACK
>
> you must implement it
>   

It is implemented in the driver, but not activated, because
wrong define order ... I think this patch is OK.

bye
Heiko

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany 

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


Re: [U-Boot] [PATCH 02/13] s3c44b0: move i2c driver to drivers/i2c

2009-03-29 Thread Heiko Schocher
Hello Jean,

Jean-Christophe PLAGNIOL-VILLARD wrote:
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD 
> ---
>  cpu/s3c44b0/cpu.c  |  735 
> +++-
>  drivers/i2c/Makefile   |1 +
>  cpu/s3c44b0/cpu.c => drivers/i2c/s3c44b0_i2c.c |  198 ---
>  include/configs/B2.h   |2 +
>  4 files changed, 225 insertions(+), 711 deletions(-)
>  rewrite cpu/s3c44b0/cpu.c (60%)
>  rename cpu/s3c44b0/cpu.c => drivers/i2c/s3c44b0_i2c.c (70%)
>   

Because I think this go through your arm git tree, you get for this
patch my:

Acked-by: Heiko Schocher 

bye
Heiko

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany 

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


Re: [U-Boot] [PATCH 12/13] at91: add hardware i2c drivers

2009-03-29 Thread Heiko Schocher
Hello Jean,

Jean-Christophe PLAGNIOL-VILLARD wrote:
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD 
> ---
>  cpu/arm926ejs/at91/Makefile|6 +
>  .../arm926ejs/at91/at91cap9_i2c.c  |   31 ++--
>  .../arm926ejs/at91/at91sam9260_i2c.c   |   31 ++--
>  .../arm926ejs/at91/at91sam9261_i2c.c   |   31 ++--
>  .../arm926ejs/at91/at91sam9263_i2c.c   |   31 ++--
>  .../clk.h => cpu/arm926ejs/at91/at91sam9rl_i2c.c   |   37 ++--
>  drivers/i2c/Makefile   |1 +
>  drivers/i2c/atmel_i2c.c|  234 
> 
>  include/asm-arm/arch-at91/at91_common.h|2 +
>  include/asm-arm/arch-at91/at91_twi.h   |   68 ++
>  include/asm-arm/arch-at91/clk.h|4 +
>  include/asm-arm/arch-at91/hardware.h   |5 +
>  12 files changed, 405 insertions(+), 76 deletions(-)
>  copy include/asm-arm/arch-at91/at91_common.h => 
> cpu/arm926ejs/at91/at91cap9_i2c.c (61%)
>  copy include/asm-arm/arch-at91/at91_common.h => 
> cpu/arm926ejs/at91/at91sam9260_i2c.c (61%)
>  copy include/asm-arm/arch-at91/at91_common.h => 
> cpu/arm926ejs/at91/at91sam9261_i2c.c (61%)
>  copy include/asm-arm/arch-at91/at91_common.h => 
> cpu/arm926ejs/at91/at91sam9263_i2c.c (61%)
>  copy include/asm-arm/arch-at91/clk.h => cpu/arm926ejs/at91/at91sam9rl_i2c.c 
> (52%)
>  create mode 100644 drivers/i2c/atmel_i2c.c
>  create mode 100644 include/asm-arm/arch-at91/at91_twi.h
>
>   
[...]
> diff --git a/drivers/i2c/Makefile b/drivers/i2c/Makefile
> index 9c74657..27a5251 100644
> --- a/drivers/i2c/Makefile
> +++ b/drivers/i2c/Makefile
> @@ -25,6 +25,7 @@ include $(TOPDIR)/config.mk
>  
>  LIB  := $(obj)libi2c.a
>  
> +COBJS-$(CONFIG_I2C_ATMEL) += atmel_i2c.o
>  COBJS-$(CONFIG_BFIN_TWI_I2C) += bfin-twi_i2c.o
>  COBJS-$(CONFIG_FSL_I2C) += fsl_i2c.o
>  COBJS-$(CONFIG_I2C_MXC) += mxc_i2c.o
>   

Independent from your patch, I think we need here a common
rule. Either we name in future this define "CONFIG_I2C_XXX"
or "CONFIG_XXX_I2C. I vote for using "CONFIG_I2C_XXX"

> diff --git a/drivers/i2c/atmel_i2c.c b/drivers/i2c/atmel_i2c.c
> new file mode 100644
> index 000..b4c5530
> --- /dev/null
> +++ b/drivers/i2c/atmel_i2c.c
> @@ -0,0 +1,234 @@
> +/*
> + *  i2c Support for Atmel's AT91RM9200 Two-Wire Interface
> + *
> + *  (c) Rick Bronson
> + *
> + *  Borrowed heavily from original work by:
> + *  Copyright (c) 2000 Philip Edelbrock 
> + *
> + *  Modified to work with u-boot by (C) 2004 Gary Jennejohn ga...@denx.de
> + *
> + *  This program is free software; you can redistribute it and/or modify
> + *  it under the terms of the GNU General Public License as published by
> + *  the Free Software Foundation; either version 2 of the License, or
> + *  (at your option) any later version.
> + *
> + *  This program is distributed in the hope that it will be useful,
> + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
> + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + *  GNU General Public License for more details.
> + *
> + *  You should have received a copy of the GNU General Public License
> + *  along with this program; if not, write to the Free Software
> + *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
> + *
> +*/
> +#include 
> +
> +#ifdef CONFIG_HARD_I2C
>   

Why not "#if defined(CONFIG_I2C_ATMEL)" as in the Makefile?

> +
> +#include 
> +#include 
>   
[...]
> + if (alen > 1)
> + return 1;
> + /* XXX assume an ATMEL AT24C16 */
> + if (alen == 1) {
> +#if 0 /* EEPROM code already sets this correctly */
> + chip |= (addr >> 8) & 0xff;
> +#endif
>   

please remove dead code.

> + addr = addr & 0xff;
> + }
> +#endif
> + return at91_xfer(chip, addr, alen, buffer, len, 1);
> +}
> +
> +int
> +i2c_write(unsigned char chip, unsigned int addr, int alen,
> +   unsigned char *buffer, int len)
> +{
> +#ifdef CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW
> + int i;
> + unsigned char *buf;
> +
> + /* we only allow one address byte */
> + if (alen > 1)
> + return 1;
> + /* XXX assume an ATMEL AT24C16 */
> + if (alen == 1) {
> + buf = buffer;
> + /* do single byte writes */
> + for (i = 0; i < len; i++) {
> +#if 0 /* EEPROM code already sets this correctly */
> + chip |= (addr >> 8) & 0xff;
> +#endif
>   

here too, please remove dead code.

> + addr = addr & 0xff;
> + if (at91_xfer(chip, addr, alen, buf++, 1, 0))
> + return 1;
> + addr++;
> + }
> + return 0;
>   
[...]
> diff --git a/include/asm-arm/arch-at91/at91_twi.h 
> b/include/asm-arm/arch-at91/at91_twi.h
> new file mode 100644
> index 000..bb2880f
> --- /dev/null
> +++ b/include/asm-arm/arch-at91/at91_twi.h
> @@ -0,0 +1