Re: [U-Boot] [RESEND] ca9x4_ct_vxp build error

2012-03-21 Thread Matt Waddel
Hi Marek,

Your message wasn't ignored, you must have missed my response.

There have been 2 patches submitted to fix this problem. They are
virtually identical:

http://lists.denx.de/pipermail/u-boot/2012-March/119558.html
http://lists.denx.de/pipermail/u-boot/2012-February/118511.html

Either one will work, I Acked the 2nd one since it was submitted
first:

http://lists.denx.de/pipermail/u-boot/2012-March/119997.html

Best regards,
Matt

On 03/20/2012 03:11 PM, Marek Vasut wrote:
> As my previous remark about this board not building was ignored, I'm 
> resending 
> it one more time. I'll do one more resend of this note and if noone fixes 
> this 
> I'll submit a removal patch.
> 
> $ CROSS_COMPILE=arm-linux-gnueabi- ARCH=arm ./MAKEALL ca9x4_ct_vxp
> Configuring for ca9x4_ct_vxp board...
> common/libcommon.o: In function `cread_line':
> /home/marex/U-Boot/u-boot-marex/common/main.c:695: undefined reference to 
> `get_ticks'
> /home/marex/U-Boot/u-boot-marex/common/main.c:695: undefined reference to 
> `get_tbclk'
> /home/marex/U-Boot/u-boot-marex/common/main.c:698: undefined reference to 
> `get_ticks'
> arm-linux-gnueabi-ld: BFD (GNU Binutils for Debian) 2.22 assertion fail 
> ../../bfd/elf32-arm.c:7498
> arm-linux-gnueabi-ld: BFD (GNU Binutils for Debian) 2.22 assertion fail 
> ../../bfd/elf32-arm.c:7498
> arm-linux-gnueabi-ld: BFD (GNU Binutils for Debian) 2.22 assertion fail 
> ../../bfd/elf32-arm.c:13830
> /bin/sh: line 1: 11250 Segmentation fault  arm-linux-gnueabi-ld -pie -T u-
> boot.lds -Bstatic -Ttext 0x6080 $UNDEF_SYM arch/arm/cpu/armv7/start.o --
> start-group api/libapi.o arch/arm/cpu/armv7/libarmv7.o arch/arm/lib/libarm.o 
> common/libcommon.o disk/libdisk.o drivers/bios_emulator/libatibiosemu.o 
> drivers/block/libblock.o drivers/dma/libdma.o drivers/fpga/libfpga.o 
> drivers/gpio/libgpio.o drivers/hwmon/libhwmon.o drivers/i2c/libi2c.o 
> drivers/input/libinput.o drivers/misc/libmisc.o drivers/mmc/libmmc.o 
> drivers/mtd/libmtd.o drivers/mtd/nand/libnand.o 
> drivers/mtd/onenand/libonenand.o 
> drivers/mtd/spi/libspi_flash.o drivers/mtd/ubi/libubi.o drivers/net/libnet.o 
> drivers/net/phy/libphy.o drivers/pci/libpci.o drivers/pcmcia/libpcmcia.o 
> drivers/power/libpower.o drivers/rtc/librtc.o drivers/serial/libserial.o 
> drivers/spi/libspi.o drivers/twserial/libtws.o drivers/usb/eth/libusb_eth.o 
> drivers/usb/gadget/libusb_gadget.o drivers/usb/host/libusb_host.o 
> drivers/usb/musb/libusb_musb.o drivers/usb/phy/libusb_phy.o 
> drivers/usb/ulpi/libusb_ulpi.o drivers/video/libvideo.o 
> drivers/watchdog/libwatchdog.o fs/cramfs/libcramfs.o fs/ext2/libext2fs.o 
> fs/fat/libfat.o fs/fdos/libfdos.o fs/jffs2/libjffs2.o 
> fs/reiserfs/libreiserfs.o 
> fs/ubifs/libubifs.o fs/yaffs2/libyaffs2.o lib/libfdt/libfdt.o 
> lib/libgeneric.o 
> lib/lzma/liblzma.o lib/lzo/liblzo.o lib/zlib/libz.o net/libnet.o 
> post/libpost.o 
> board/armltd/vexpress/libvexpress.o --end-group /home/marex/U-Boot/u-boot-
> marex/arch/arm/lib/eabi_compat.o -L /usr/lib/gcc/arm-linux-gnueabi/4.4.6 
> -lgcc -
> Map u-boot.map -o u-boot
> make: *** [u-boot] Error 139
> arm-linux-gnueabi-size: ./u-boot: File format not recognized
> 
> - SUMMARY 
> Boards compiled: 1
> Boards with warnings or errors: 1 ( ca9x4_ct_vxp )
> --


-- 
Linaro.org │ Open source software for ARM SoCs
Follow Linaro:
http://www.facebook.com/pages/Linaro/155974581091106
http://twitter.com/#!/linaroorg
http://www.linaro.org/linaro-blog/
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH resend] ARMV7/Vexpress: add missing get_ticks() and get_tbclk()

2012-03-09 Thread Matt Waddel
On 02/22/2012 07:56 AM, walimis wrote:
> From: Liming Wang 
> 
> commit f31a911fe (arm, post: add missing post_time_ms for arm)
> enables get_ticks and get_tbclk for all arm based boards,
> arm/vexpress also needs these functions to work.
> 
> Signed-off-by: Liming Wang 

Acked-by: matt.wad...@linaro.org

> ---
>  board/armltd/vexpress/ca9x4_ct_vxp.c |   10 ++
>  1 files changed, 10 insertions(+), 0 deletions(-)
> 
> diff --git a/board/armltd/vexpress/ca9x4_ct_vxp.c 
> b/board/armltd/vexpress/ca9x4_ct_vxp.c
> index da6f14d..0b36d12 100644
> --- a/board/armltd/vexpress/ca9x4_ct_vxp.c
> +++ b/board/armltd/vexpress/ca9x4_ct_vxp.c
> @@ -226,3 +226,13 @@ void lowlevel_init(void)
>  ulong get_board_rev(void){
>   return readl((u32 *)SYS_ID);
>  }
> +
> +unsigned long long get_ticks(void)
> +{
> + return get_timer(0);
> +}
> +
> +ulong get_tbclk (void)
> +{
> + return (ulong)CONFIG_SYS_HZ;
> +}
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/1] arm: vexpress: Fixed get_ticks/get_tbclk build failures

2012-03-05 Thread matt . waddel
From: Matt Waddel 

Added get_ticks() and get_tbclk() routines

Signed-off-by: Matt Waddel 
---
 board/armltd/vexpress/ca9x4_ct_vxp.c |   10 ++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/board/armltd/vexpress/ca9x4_ct_vxp.c 
b/board/armltd/vexpress/ca9x4_ct_vxp.c
index da6f14d..22e5af1 100644
--- a/board/armltd/vexpress/ca9x4_ct_vxp.c
+++ b/board/armltd/vexpress/ca9x4_ct_vxp.c
@@ -226,3 +226,13 @@ void lowlevel_init(void)
 ulong get_board_rev(void){
return readl((u32 *)SYS_ID);
 }
+
+unsigned long long get_ticks(void)
+{
+   return get_timer(0);
+}
+
+ulong get_tbclk(void)
+{
+   return (ulong)CONFIG_SYS_HZ;
+}
-- 
1.7.5.4

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


Re: [U-Boot] [PATCH 1/1] ARM: vexpress: Change maintainer for ARM Versatile Express platforms

2011-10-18 Thread Matt Waddel
On 10/18/2011 08:22 AM, Ryan Harkin wrote:
> Change maintainer for ARM Versatile Express platforms.
> 
> Signed-off-by: Ryan Harkin 

Acked-by: Matt Waddel 

> ---
>  MAINTAINERS |3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 578f38e..dbc9269 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -856,7 +856,8 @@ Hugo Villeneuve 
>  
>   SFFSDR  ARM926EJS
>  
> -Matt Waddel 
> +Ryan Harkin 
> +Jon Medhurst (Tixy) 
>  
>   vexpress_ca9x4  ARM ARMV7 (Quad Core)
>   vexpress_ca5x2  ARM ARMV7 (Dual Core)
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] MMC: PL180: Fix infinite loop with VExpress extended fifo implementation

2011-10-06 Thread Matt Waddel
On 10/04/2011 11:32 AM, Jon Medhurst (Tixy) wrote:
> From: Jon Medhurst 
> 
> The new IO FPGA implementation for Versatile Express contains an MMCI
> (PL180) cell with the FIFO extended to 128 words. This causes the
> read_bytes() function to go into an infinite loop; as it will wait for
> for the half-full signal (SDI_STA_RXFIFOBR) if there are more than 8
> words remaining (SDI_FIFO_BURST_SIZE), but it won't receive this signal
> once there are fewer than 64 words left to transfer.
> 
> One possible fix is to add some build time configuration to change
> SDI_FIFO_BURST_SIZE for the new implementation. However, the problematic
> code only seems to exist as a small performance optimisation, so the
> solution implemented by this patch is to simply remove it. The error
> checking following the loop is also removed as this will be handled by
> code further down the function.
> 
> Cc: Andy Fleming 
> Signed-off-by: Jon Medhurst 

Acked-by: Matt Waddel 

> ---
> 
> If it is desirable to keep the burst read optimisation, then an
> alternative solution would be to keep the loop and add an if clause to
> do a single read if the fifo doesn't have enough for a burst.
> 
> ---
>  drivers/mmc/arm_pl180_mmci.c |   26 --
>  1 files changed, 0 insertions(+), 26 deletions(-)
> 
> diff --git a/drivers/mmc/arm_pl180_mmci.c b/drivers/mmc/arm_pl180_mmci.c
> index ed296ee..e6467a2 100644
> --- a/drivers/mmc/arm_pl180_mmci.c
> +++ b/drivers/mmc/arm_pl180_mmci.c
> @@ -111,7 +111,6 @@ static int do_command(struct mmc *dev, struct mmc_cmd 
> *cmd)
>  static int read_bytes(struct mmc *dev, u32 *dest, u32 blkcount, u32 blksize)
>  {
> u32 *tempbuff = dest;
> -   int i;
> u64 xfercount = blkcount * blksize;
> struct mmc_host *host = dev->priv;
> u32 status, status_err;
> @@ -121,31 +120,6 @@ static int read_bytes(struct mmc *dev, u32 *dest, u32 
> blkcount, u32 blksize)
> status = readl(&host->base->status);
> status_err = status & (SDI_STA_DCRCFAIL | SDI_STA_DTIMEOUT |
>SDI_STA_RXOVERR);
> -   while (!status_err &&
> -  (xfercount >= SDI_FIFO_BURST_SIZE * sizeof(u32))) {
> -   if (status & SDI_STA_RXFIFOBR) {
> -   for (i = 0; i < SDI_FIFO_BURST_SIZE; i++)
> -   *(tempbuff + i) = readl(&host->base->fifo);
> -   tempbuff += SDI_FIFO_BURST_SIZE;
> -   xfercount -= SDI_FIFO_BURST_SIZE * sizeof(u32);
> -   }
> -   status = readl(&host->base->status);
> -   status_err = status &
> -   (SDI_STA_DCRCFAIL | SDI_STA_DTIMEOUT | 
> SDI_STA_RXOVERR);
> -   }
> -
> -   if (status & SDI_STA_DTIMEOUT) {
> -   printf("Read data timed out, xfercount: %llu, status: 
> 0x%08X\n",
> -   xfercount, status);
> -   return -ETIMEDOUT;
> -   } else if (status & SDI_STA_DCRCFAIL) {
> -   printf("Read data blk CRC error: 0x%x\n", status);
> -   return -EILSEQ;
> -   } else if (status & SDI_STA_RXOVERR) {
> -   printf("Read data RX overflow error\n");
> -   return -EIO;
> -   }
> -
> while ((!status_err) && (xfercount >= sizeof(u32))) {
> if (status & SDI_STA_RXDAVL) {
> *(tempbuff) = readl(&host->base->fifo);


-- 
Linaro.org │ Open source software for ARM SoCs
Follow Linaro:
http://www.facebook.com/pages/Linaro/155974581091106
http://twitter.com/#!/linaroorg
http://www.linaro.org/linaro-blog/
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v5 13/13] arm: ca9x4_ct_vxp: enable PXE BOOTP options support

2011-09-09 Thread Matt Waddel
On 08/31/2011 09:37 AM, Jason Hobbs wrote:
> Signed-off-by: Jason Hobbs 
> Cc: Matt Waddel 

Acked-by: Matt Waddel 

> ---
> changes for v2:
> - add armv7 architecture to VCI string
> 
> changes for v4:
> - combine the PXE bootp options with the other bootp options
> 
> changes for v5:
> - none
> 
>  include/configs/ca9x4_ct_vxp.h |3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/include/configs/ca9x4_ct_vxp.h b/include/configs/ca9x4_ct_vxp.h
> index 5f49f49..5adfe64 100644
> --- a/include/configs/ca9x4_ct_vxp.h
> +++ b/include/configs/ca9x4_ct_vxp.h
> @@ -98,6 +98,9 @@
>  #define CONFIG_BOOTP_BOOTPATH
>  #define CONFIG_BOOTP_GATEWAY
>  #define CONFIG_BOOTP_HOSTNAME
> +#define CONFIG_BOOTP_PXE
> +#define CONFIG_BOOTP_PXE_CLIENTARCH  0x100
> +#define CONFIG_BOOTP_VCI_STRING  "U-boot.armv7.ca9x4_ct_vxp"
>  
>  /* Miscellaneous configurable options */
>  #undef   CONFIG_SYS_CLKS_IN_HZ
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v5 12/13] arm: ca9x4_ct_vxp: enable pxe command support

2011-09-09 Thread Matt Waddel
On 08/31/2011 09:37 AM, Jason Hobbs wrote:
> Signed-off-by: Jason Hobbs 
> Cc: Matt Waddel 

Acked-by: Matt Waddel 

> ---
> changes in v2:
> - use CONFIG_MENU to enable building the menu for pxecfg use
> 
> changes in v4:
> - use CONFIG_CMD_PXE instead of CONFIG_CMD_PXECFG
> - update to standard environment variables
> 
> changes for v5:
> - none
> 
>  include/configs/ca9x4_ct_vxp.h |4 
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/include/configs/ca9x4_ct_vxp.h b/include/configs/ca9x4_ct_vxp.h
> index 7e5dc66..5f49f49 100644
> --- a/include/configs/ca9x4_ct_vxp.h
> +++ b/include/configs/ca9x4_ct_vxp.h
> @@ -70,6 +70,8 @@
>  /* Command line configuration */
>  #define CONFIG_CMD_BDI
>  #define CONFIG_CMD_DHCP
> +#define CONFIG_CMD_PXE
> +#define CONFIG_MENU
>  #define CONFIG_CMD_ELF
>  #define CONFIG_CMD_ENV
>  #define CONFIG_CMD_FLASH
> @@ -133,6 +135,8 @@
>   "kernel_addr=0x4410\0" \
>   "ramdisk_addr=0x4480\0" \
>   "maxramdisk=0x180\0" \
> + "pxefile_addr_r=0x8800\0" \
> + "kernel_addr_r=0x80008000\0" \
>   "console=ttyAMA0,38400n8\0" \
>   "dram=1024M\0" \
>   "root=/dev/sda1 rw\0" \
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v5 11/13] Convert ca9x4_ct_vxp to standard env variables

2011-09-09 Thread Matt Waddel
On 08/31/2011 09:37 AM, Jason Hobbs wrote:
> Signed-off-by: Jason Hobbs 
> Cc: Matt Waddel 

Tested-by: Matt Waddel 

> ---
> new in v4
> 
> changes for v5:
> - none
> 
>  include/configs/ca9x4_ct_vxp.h |   12 ++--
>  1 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/include/configs/ca9x4_ct_vxp.h b/include/configs/ca9x4_ct_vxp.h
> index 8c57eab..7e5dc66 100644
> --- a/include/configs/ca9x4_ct_vxp.h
> +++ b/include/configs/ca9x4_ct_vxp.h
> @@ -129,10 +129,10 @@
>  #define CONFIG_BOOTCOMMAND   "run bootflash;"
>  #define CONFIG_EXTRA_ENV_SETTINGS \
>   "loadaddr=0x80008000\0" \
> - "initrd=0x6100\0" \
> - "kerneladdr=0x4410\0" \
> - "initrdaddr=0x4480\0" \
> - "maxinitrd=0x180\0" \
> + "ramdisk_addr_r=0x6100\0" \
> + "kernel_addr=0x4410\0" \
> + "ramdisk_addr=0x4480\0" \
> + "maxramdisk=0x180\0" \
>   "console=ttyAMA0,38400n8\0" \
>   "dram=1024M\0" \
>   "root=/dev/sda1 rw\0" \
> @@ -142,8 +142,8 @@
>   "mem=${dram} mtdparts=${mtd} mmci.fmax=19 " \
>   "devtmpfs.mount=0  vmalloc=256M\0" \
>   "bootflash=run flashargs; " \
> - "cp ${initrdaddr} ${initrd} ${maxinitrd}; " \
> - "bootm ${kerneladdr} ${initrd}\0"
> + "cp ${ramdisk_addr} ${ramdisk_addr_r} ${maxramdisk}; " \
> + "bootm ${kernel_addr} ${ramdisk_addr_r}\0"
>  
>  /* FLASH and environment organization */
>  #define PHYS_FLASH_SIZE  0x0400  /* 64MB */
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Urgent : Regd. Cortex A9 quad core versatile express ca9x4_ct_vxp support in U-Boot..

2011-08-22 Thread Matt Waddel
On 08/22/2011 07:47 AM, Christopher Harvey wrote:
> On 08/22/11 02:22, Sandeep Kumar wrote:
>> Hi Matt,
>>
>> We are in a process of developing a SoC around cortex a9 quad core
>> versatile express. For that we made changes in the U-Boot. Is there any
>> way (like any simulator/emulator which supports this board) to validate
>> the changes before getting the arm board itself.
>>
> QEMU supports supports a few ARM versatile boards.

Peter Maydell has been developing QEMU support for the
Versatile Express. Here is a link to some of the work
he has done:

https://wiki.linaro.org/PeterMaydell/QemuVersatileExpress

It looks like the instructions are for kernel testing.
So you may have to spend some time figuring out bootloader
support, but I suppose it would be similar.

--Matt

> ___
> 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] Urgent : Regd. Cortex A9 quad core versatile express ca9x4_ct_vxp support in U-Boot..

2011-08-21 Thread Matt Waddel
Hi Sandeep,

On 08/21/2011 12:37 AM, Sandeep Kumar wrote:
> Hi all,
> 
> I am trying to use U-Boot for cortex A9 quad core versatile express board. I 
> saw that the support is already added
> for that board but i am not able to find out the DDR initialization code
> anywhere before using the stack. In fact i didn't find the DDR
> initialization code anywhere for this board. This board also comes along
> with a CLCD (color LCD) controller which is also not initialized
> anywhere for this board. Is the support for this board is tested as
> without initializing the DDR how the code relocation and execution from
> DDR is possible.

Sorry for not responding sooner.

Currently the DDR setup is handled by the ARM boot monitor code
and u-boot runs as the 2nd stage bootloader. So DDR setup is
not done in u-boot.

Also, the CLCD is not setup in u-boot.

--Matt

> 
> Any kind of pointers will be very helpful.
> 
> 
> 
> 
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 3/3] ARMV7: Vexpress: Add MMC support

2011-04-16 Thread Matt Waddel
On 04/13/2011 05:09 AM, Andy Fleming wrote:
> On Wed, Mar 2, 2011 at 11:22 PM,   wrote:
>> From: Matt Waddel 
>>
>> Added the board specific definitions to use the MMCI device.
>>
>> Signed-off-by: Matt Waddel 
> 
> Looks fine to me.  I can apply this to my tree if that's fine with the
> maintainer.  If not, I'm also OK if the maintainer wants to pull in
> the driver patch (with the previously-mentioned small change).

Hi Andy,

I made the ffs() change you suggested and have posted a 4th
version of the 3 patches (even though the 2nd one was the only
one that changed, I wanted to make sure they were all still in
sync with the repository).

If you could apply these to your tree that would be great.

> 
> Either way:
> Acked-by: Andy Fleming 

Thanks,
Matt

> 
> Andy
> ___
> 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


[U-Boot] [PATCH V4 0/3] Add support for the MMC device to the vexpress

2011-04-16 Thread matt . waddel
From: Matt Waddel 

These patches add support for the ARM PrimeCell PL180 MultiMedia Interface.
The Versatile Express was the test platform for these changes.

---
Change log:

v2 - Rename patch items to a more descriptive name (ie. mmci -> arm_mmci)
 Fixed conflicting fuction call and added prototype to arm_mmci.h

v3 - Rename patch items (arm_mmci -> arm_pl180_mmci)
 (Note: Patch 1/3 still did not change with these corrections)

v4 - Removed convert_from_bytes_to_power_of_two() routine and used generic ffs
 call instead. (Feedback from Andy Fleming.)

Matt Waddel (3):
  MMC: Max blocks value adjustable
  MMC: Add support for PL180 ARM mmc device
  ARMV7: Vexpress: Add MMC support

 board/armltd/vexpress/ca9x4_ct_vxp.c |9 +
 drivers/mmc/Makefile |1 +
 drivers/mmc/arm_pl180_mmci.c |  441 ++
 drivers/mmc/arm_pl180_mmci.h |  183 ++
 drivers/mmc/mmc.c|   19 +-
 include/configs/ca9x4_ct_vxp.h   |4 +
 6 files changed, 647 insertions(+), 10 deletions(-)
 create mode 100644 drivers/mmc/arm_pl180_mmci.c
 create mode 100644 drivers/mmc/arm_pl180_mmci.h

-- 
1.7.4.1

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


[U-Boot] [PATCH V4 3/3] ARMV7: Vexpress: Add MMC support

2011-04-16 Thread matt . waddel
From: Matt Waddel 

Added the board specific definitions to use the MMCI device.

Signed-off-by: Matt Waddel 
---
 board/armltd/vexpress/ca9x4_ct_vxp.c |9 +
 include/configs/ca9x4_ct_vxp.h   |4 
 2 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/board/armltd/vexpress/ca9x4_ct_vxp.c 
b/board/armltd/vexpress/ca9x4_ct_vxp.c
index ce1be1e..3566b95 100644
--- a/board/armltd/vexpress/ca9x4_ct_vxp.c
+++ b/board/armltd/vexpress/ca9x4_ct_vxp.c
@@ -86,6 +86,15 @@ int board_eth_init(bd_t *bis)
return rc;
 }
 
+int cpu_mmc_init(bd_t *bis)
+{
+   int rc = 0;
+#ifdef CONFIG_ARM_PL180_MMCI
+   rc = arm_pl180_mmci_init();
+#endif
+   return rc;
+}
+
 static void flash__init(void)
 {
/* Setup the sytem control register to allow writing to flash */
diff --git a/include/configs/ca9x4_ct_vxp.h b/include/configs/ca9x4_ct_vxp.h
index 63f003d..4ab58c0 100644
--- a/include/configs/ca9x4_ct_vxp.h
+++ b/include/configs/ca9x4_ct_vxp.h
@@ -86,6 +86,10 @@
 #define CONFIG_MMC 1
 #define CONFIG_CMD_MMC
 #define CONFIG_GENERIC_MMC
+#define CONFIG_ARM_PL180_MMCI
+#define CONFIG_ARM_PL180_MMCI_BASE 0x10005000
+#define CONFIG_SYS_MMC_MAX_BLK_COUNT   127
+#define CONFIG_ARM_PL180_MMCI_CLOCK_FREQ 625
 
 /* BOOTP options */
 #define CONFIG_BOOTP_BOOTFILESIZE
-- 
1.7.4.1

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


[U-Boot] [PATCH V4 2/3] MMC: Add support for PL180 ARM mmc device

2011-04-16 Thread matt . waddel
From: Matt Waddel 

Add support for the ARM PrimeCell MultiMedia Interface - PL180.
Ported from original device driver written by ST-Ericsson.

Signed-off-by: Matt Waddel 
---
 drivers/mmc/Makefile |1 +
 drivers/mmc/arm_pl180_mmci.c |  441 ++
 drivers/mmc/arm_pl180_mmci.h |  183 +
 3 files changed, 625 insertions(+), 0 deletions(-)
 create mode 100644 drivers/mmc/arm_pl180_mmci.c
 create mode 100644 drivers/mmc/arm_pl180_mmci.h

diff --git a/drivers/mmc/Makefile b/drivers/mmc/Makefile
index 3496f0a..7b3c319 100644
--- a/drivers/mmc/Makefile
+++ b/drivers/mmc/Makefile
@@ -31,6 +31,7 @@ COBJS-$(CONFIG_DAVINCI_MMC) += davinci_mmc.o
 COBJS-$(CONFIG_FSL_ESDHC) += fsl_esdhc.o
 COBJS-$(CONFIG_GENERIC_MMC) += mmc.o
 COBJS-$(CONFIG_GENERIC_ATMEL_MCI) += gen_atmel_mci.o
+COBJS-$(CONFIG_ARM_PL180_MMCI) += arm_pl180_mmci.o
 COBJS-$(CONFIG_MXC_MMC) += mxcmmc.o
 COBJS-$(CONFIG_OMAP3_MMC) += omap3_mmc.o
 COBJS-$(CONFIG_OMAP_HSMMC) += omap_hsmmc.o
diff --git a/drivers/mmc/arm_pl180_mmci.c b/drivers/mmc/arm_pl180_mmci.c
new file mode 100644
index 000..245f482
--- /dev/null
+++ b/drivers/mmc/arm_pl180_mmci.c
@@ -0,0 +1,441 @@
+/*
+ * ARM PrimeCell MultiMedia Card Interface - PL180
+ *
+ * Copyright (C) ST-Ericsson SA 2010
+ *
+ * Author: Ulf Hansson 
+ * Author: Martin Lundholm 
+ * Ported to drivers/mmc/ by: Matt Waddel 
+ *
+ * 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 DEBUG */
+
+#include 
+#include "common.h"
+#include 
+#include 
+#include "arm_pl180_mmci.h"
+#include 
+
+struct mmc_host {
+   struct sdi_registers *base;
+};
+
+static int wait_for_command_end(struct mmc *dev, struct mmc_cmd *cmd)
+{
+   u32 hoststatus, statusmask;
+   struct mmc_host *host = dev->priv;
+
+   statusmask = SDI_STA_CTIMEOUT | SDI_STA_CCRCFAIL;
+   if ((cmd->resp_type & MMC_RSP_PRESENT))
+   statusmask |= SDI_STA_CMDREND;
+   else
+   statusmask |= SDI_STA_CMDSENT;
+
+   do
+   hoststatus = readl(&host->base->status) & statusmask;
+   while (!hoststatus);
+
+   writel(statusmask, &host->base->status_clear);
+   if (hoststatus & SDI_STA_CTIMEOUT) {
+   printf("CMD%d time out\n", cmd->cmdidx);
+   return -ETIMEDOUT;
+   } else if ((hoststatus & SDI_STA_CCRCFAIL) &&
+  (cmd->flags & MMC_RSP_CRC)) {
+   printf("CMD%d CRC error\n", cmd->cmdidx);
+   return -EILSEQ;
+   }
+
+   if (cmd->resp_type & MMC_RSP_PRESENT) {
+   cmd->response[0] = readl(&host->base->response0);
+   cmd->response[1] = readl(&host->base->response1);
+   cmd->response[2] = readl(&host->base->response2);
+   cmd->response[3] = readl(&host->base->response3);
+   debug("CMD%d response[0]:0x%08X, response[1]:0x%08X, "
+   "response[2]:0x%08X, response[3]:0x%08X\n",
+   cmd->cmdidx, cmd->response[0], cmd->response[1],
+   cmd->response[2], cmd->response[3]);
+   }
+
+   return 0;
+}
+
+/* send command to the mmc card and wait for results */
+static int do_command(struct mmc *dev, struct mmc_cmd *cmd)
+{
+   int result;
+   u32 sdi_cmd = 0;
+   struct mmc_host *host = dev->priv;
+
+   sdi_cmd = ((cmd->cmdidx & SDI_CMD_CMDINDEX_MASK) | SDI_CMD_CPSMEN);
+
+   if (cmd->resp_type) {
+   sdi_cmd |= SDI_CMD_WAITRESP;
+   if (cmd->resp_type & MMC_RSP_136)
+   sdi_cmd |= SDI_CMD_LONGRESP;
+   }
+
+   writel((u32)cmd->cmdarg, &host->base->argument);
+   udelay(COMMAND_REG_DELAY);
+   writel(sdi_cmd, &host->base->command);
+   result = wait_for_command_end(dev, cmd);
+
+   /* After CMD2 set RCA to a none zero value. */
+   if ((result == 0) && (cmd->cmdidx == MMC_CMD_ALL_SEND_CID))
+   dev->rca = 10;
+
+   /* After CMD3 open drain is switched off and push pull is used. */
+   if ((result == 0

[U-Boot] [PATCH V4 1/3] MMC: Max blocks value adjustable

2011-04-16 Thread matt . waddel
From: Matt Waddel 

The maximum blocks value was hardcoded to 65535 due to a 16 bit
register length.  The value can change for different platforms.
This patch makes the default the current value of 65535, but it
is configurable for other platforms.

Signed-off-by: Matt Waddel 
---
 drivers/mmc/mmc.c |   19 +--
 1 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 6805b33..d69eaa1 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -33,6 +33,11 @@
 #include 
 #include 
 
+/* Set block count limit because of 16 bit register limit on some hardware*/
+#ifndef CONFIG_SYS_MMC_MAX_BLK_COUNT
+#define CONFIG_SYS_MMC_MAX_BLK_COUNT 65535
+#endif
+
 static struct list_head mmc_devices;
 static int cur_dev_num = -1;
 
@@ -139,11 +144,8 @@ mmc_bwrite(int dev_num, ulong start, lbaint_t blkcnt, 
const void*src)
return 0;
 
do {
-   /*
-* The 65535 constraint comes from some hardware has
-* only 16 bit width block number counter
-*/
-   cur = (blocks_todo > 65535) ? 65535 : blocks_todo;
+   cur = (blocks_todo > CONFIG_SYS_MMC_MAX_BLK_COUNT) ?
+  CONFIG_SYS_MMC_MAX_BLK_COUNT : blocks_todo;
if(mmc_write_blocks(mmc, start, cur, src) != cur)
return 0;
blocks_todo -= cur;
@@ -215,11 +217,8 @@ static ulong mmc_bread(int dev_num, ulong start, lbaint_t 
blkcnt, void *dst)
return 0;
 
do {
-   /*
-* The 65535 constraint comes from some hardware has
-* only 16 bit width block number counter
-*/
-   cur = (blocks_todo > 65535) ? 65535 : blocks_todo;
+   cur = (blocks_todo > CONFIG_SYS_MMC_MAX_BLK_COUNT) ?
+  CONFIG_SYS_MMC_MAX_BLK_COUNT : blocks_todo;
if(mmc_read_blocks(mmc, dst, start, cur) != cur)
return 0;
blocks_todo -= cur;
-- 
1.7.4.1

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


[U-Boot] [PATCH 1/1] ARMV7: Vexpress: Remove config.mk

2011-03-03 Thread matt . waddel
From: Matt Waddel 

Remove obsolete board config.mk.

Signed-off-by: Matt Waddel 
---
 board/armltd/vexpress/config.mk |   22 --
 include/configs/ca9x4_ct_vxp.h  |1 +
 2 files changed, 1 insertions(+), 22 deletions(-)
 delete mode 100644 board/armltd/vexpress/config.mk

diff --git a/board/armltd/vexpress/config.mk b/board/armltd/vexpress/config.mk
deleted file mode 100644
index 36395f2..000
--- a/board/armltd/vexpress/config.mk
+++ /dev/null
@@ -1,22 +0,0 @@
-#
-# 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
-#
-# Linux-Kernel is expected to be at 0x60008000
-#
-CONFIG_SYS_TEXT_BASE = 0x6080
diff --git a/include/configs/ca9x4_ct_vxp.h b/include/configs/ca9x4_ct_vxp.h
index 4ab58c0..c6fac32 100644
--- a/include/configs/ca9x4_ct_vxp.h
+++ b/include/configs/ca9x4_ct_vxp.h
@@ -30,6 +30,7 @@
 /* Board info register */
 #define SYS_ID 0x1000
 #define CONFIG_REVISION_TAG1
+#define CONFIG_SYS_TEXT_BASE   0x6080
 
 /* High Level Configuration Options */
 #define CONFIG_ARMV7   1
-- 
1.7.1

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


[U-Boot] [PATCH V3 0/3] Add support for the MMC device to the vexpress

2011-03-02 Thread matt . waddel
From: Matt Waddel 

These patches add support for the ARM PrimeCell PL180 MultiMedia Interface.
The Versatile Express was the test platform for these changes.

---
Change log:

v2 - Rename patch items to a more descriptive name (ie. mmci -> arm_mmci)
 Fixed conflicting fuction call and added prototype to arm_mmci.h

v3 - Rename patch items (arm_mmci -> arm_pl180_mmci)
 (Note: Patch 1/3 still did not change with these corrections)

Matt Waddel (3):
  MMC: Max blocks value adjustable
  MMC: Add support for PL180 ARM mmc device
  ARMV7: Vexpress: Add MMC support

 board/armltd/vexpress/ca9x4_ct_vxp.c |9 +
 drivers/mmc/Makefile |1 +
 drivers/mmc/arm_pl180_mmci.c |  452 ++
 drivers/mmc/arm_pl180_mmci.h |  183 ++
 drivers/mmc/mmc.c|   19 +-
 include/configs/ca9x4_ct_vxp.h   |4 +
 6 files changed, 658 insertions(+), 10 deletions(-)
 create mode 100644 drivers/mmc/arm_pl180_mmci.c
 create mode 100644 drivers/mmc/arm_pl180_mmci.h

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


[U-Boot] [PATCH v3 3/3] ARMV7: Vexpress: Add MMC support

2011-03-02 Thread matt . waddel
From: Matt Waddel 

Added the board specific definitions to use the MMCI device.

Signed-off-by: Matt Waddel 
---
 board/armltd/vexpress/ca9x4_ct_vxp.c |9 +
 include/configs/ca9x4_ct_vxp.h   |4 
 2 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/board/armltd/vexpress/ca9x4_ct_vxp.c 
b/board/armltd/vexpress/ca9x4_ct_vxp.c
index ce1be1e..3566b95 100644
--- a/board/armltd/vexpress/ca9x4_ct_vxp.c
+++ b/board/armltd/vexpress/ca9x4_ct_vxp.c
@@ -86,6 +86,15 @@ int board_eth_init(bd_t *bis)
return rc;
 }
 
+int cpu_mmc_init(bd_t *bis)
+{
+   int rc = 0;
+#ifdef CONFIG_ARM_PL180_MMCI
+   rc = arm_pl180_mmci_init();
+#endif
+   return rc;
+}
+
 static void flash__init(void)
 {
/* Setup the sytem control register to allow writing to flash */
diff --git a/include/configs/ca9x4_ct_vxp.h b/include/configs/ca9x4_ct_vxp.h
index 63f003d..4ab58c0 100644
--- a/include/configs/ca9x4_ct_vxp.h
+++ b/include/configs/ca9x4_ct_vxp.h
@@ -86,6 +86,10 @@
 #define CONFIG_MMC 1
 #define CONFIG_CMD_MMC
 #define CONFIG_GENERIC_MMC
+#define CONFIG_ARM_PL180_MMCI
+#define CONFIG_ARM_PL180_MMCI_BASE 0x10005000
+#define CONFIG_SYS_MMC_MAX_BLK_COUNT   127
+#define CONFIG_ARM_PL180_MMCI_CLOCK_FREQ 625
 
 /* BOOTP options */
 #define CONFIG_BOOTP_BOOTFILESIZE
-- 
1.7.1

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


[U-Boot] [PATCH v3 2/3] MMC: Add support for PL180 ARM mmc device

2011-03-02 Thread matt . waddel
From: Matt Waddel 

Add support for the ARM PrimeCell MultiMedia Interface - PL180.
Ported from original device driver written by ST-Ericsson.

Signed-off-by: Matt Waddel 
---
 drivers/mmc/Makefile |1 +
 drivers/mmc/arm_pl180_mmci.c |  452 ++
 drivers/mmc/arm_pl180_mmci.h |  183 +
 3 files changed, 636 insertions(+), 0 deletions(-)
 create mode 100644 drivers/mmc/arm_pl180_mmci.c
 create mode 100644 drivers/mmc/arm_pl180_mmci.h

diff --git a/drivers/mmc/Makefile b/drivers/mmc/Makefile
index 3496f0a..7b3c319 100644
--- a/drivers/mmc/Makefile
+++ b/drivers/mmc/Makefile
@@ -31,6 +31,7 @@ COBJS-$(CONFIG_DAVINCI_MMC) += davinci_mmc.o
 COBJS-$(CONFIG_FSL_ESDHC) += fsl_esdhc.o
 COBJS-$(CONFIG_GENERIC_MMC) += mmc.o
 COBJS-$(CONFIG_GENERIC_ATMEL_MCI) += gen_atmel_mci.o
+COBJS-$(CONFIG_ARM_PL180_MMCI) += arm_pl180_mmci.o
 COBJS-$(CONFIG_MXC_MMC) += mxcmmc.o
 COBJS-$(CONFIG_OMAP3_MMC) += omap3_mmc.o
 COBJS-$(CONFIG_OMAP_HSMMC) += omap_hsmmc.o
diff --git a/drivers/mmc/arm_pl180_mmci.c b/drivers/mmc/arm_pl180_mmci.c
new file mode 100644
index 000..9b60e4f
--- /dev/null
+++ b/drivers/mmc/arm_pl180_mmci.c
@@ -0,0 +1,452 @@
+/*
+ * ARM PrimeCell MultiMedia Card Interface - PL180
+ *
+ * Copyright (C) ST-Ericsson SA 2010
+ *
+ * Author: Ulf Hansson 
+ * Author: Martin Lundholm 
+ * Ported to drivers/mmc/ by: Matt Waddel 
+ *
+ * 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 DEBUG */
+
+#include 
+#include "common.h"
+#include 
+#include 
+#include "arm_pl180_mmci.h"
+#include 
+
+struct mmc_host {
+   struct sdi_registers *base;
+};
+
+static int wait_for_command_end(struct mmc *dev, struct mmc_cmd *cmd)
+{
+   u32 hoststatus, statusmask;
+   struct mmc_host *host = dev->priv;
+
+   statusmask = SDI_STA_CTIMEOUT | SDI_STA_CCRCFAIL;
+   if ((cmd->resp_type & MMC_RSP_PRESENT))
+   statusmask |= SDI_STA_CMDREND;
+   else
+   statusmask |= SDI_STA_CMDSENT;
+
+   do
+   hoststatus = readl(&host->base->status) & statusmask;
+   while (!hoststatus);
+
+   writel(statusmask, &host->base->status_clear);
+   if (hoststatus & SDI_STA_CTIMEOUT) {
+   printf("CMD%d time out\n", cmd->cmdidx);
+   return -ETIMEDOUT;
+   } else if ((hoststatus & SDI_STA_CCRCFAIL) &&
+  (cmd->flags & MMC_RSP_CRC)) {
+   printf("CMD%d CRC error\n", cmd->cmdidx);
+   return -EILSEQ;
+   }
+
+   if (cmd->resp_type & MMC_RSP_PRESENT) {
+   cmd->response[0] = readl(&host->base->response0);
+   cmd->response[1] = readl(&host->base->response1);
+   cmd->response[2] = readl(&host->base->response2);
+   cmd->response[3] = readl(&host->base->response3);
+   debug("CMD%d response[0]:0x%08X, response[1]:0x%08X, "
+   "response[2]:0x%08X, response[3]:0x%08X\n",
+   cmd->cmdidx, cmd->response[0], cmd->response[1],
+   cmd->response[2], cmd->response[3]);
+   }
+
+   return 0;
+}
+
+/* send command to the mmc card and wait for results */
+static int do_command(struct mmc *dev, struct mmc_cmd *cmd)
+{
+   int result;
+   u32 sdi_cmd = 0;
+   struct mmc_host *host = dev->priv;
+
+   sdi_cmd = ((cmd->cmdidx & SDI_CMD_CMDINDEX_MASK) | SDI_CMD_CPSMEN);
+
+   if (cmd->resp_type) {
+   sdi_cmd |= SDI_CMD_WAITRESP;
+   if (cmd->resp_type & MMC_RSP_136)
+   sdi_cmd |= SDI_CMD_LONGRESP;
+   }
+
+   writel((u32)cmd->cmdarg, &host->base->argument);
+   udelay(COMMAND_REG_DELAY);
+   writel(sdi_cmd, &host->base->command);
+   result = wait_for_command_end(dev, cmd);
+
+   /* After CMD2 set RCA to a none zero value. */
+   if ((result == 0) && (cmd->cmdidx == MMC_CMD_ALL_SEND_CID))
+   dev->rca = 10;
+
+   /* After CMD3 open drain is switched off and push pull is used. 

Re: [U-Boot] [PATCH V2 0/3] Add support for the MMC device to the vexpress

2011-03-01 Thread Matt Waddel
Hi Reinhard,

On 02/28/2011 10:58 PM, Reinhard Meyer wrote:
> Dear matt.waddel,
>> From: Matt Waddel
>>

> Sorry, my original comment still holds true for the naming,
> now the name suggests that this driver is generic to ARM devices,
> which clearly is not true.

Correct. However, this hardware device was developed by ARM (the
company). As far as I know the other ARM mmc drivers, like the
omap3_mmc, are not. So that would be the difference between the
naming of these drivers.

I don't feel like this driver should be named after a particular
platform like vexpress, since this driver could be used in any
ARM hardware.

> 
> Can you list which devices have a MMCI that is covered by this
> driver? PL180 only? Or a series of PLxxx? It should be
> possible to find a naming that is more descriptive than "arm".

The PL180 is the name assigned to the hardware in the SOC.
Here is the description of device from the 1st paragraph in
the manual:

1.1 About the ARM PrimeCell Multimedia Card Interface (PL180)
   The PrimeCell Multimedia Card Interface (MCI) is an Advanced
Microcontroller Bus Architecture(AMBA) compliant, System-on-a-Chip
(SoC) peripheral that is developed, tested, and licensed by ARM.


As far as other platforms that use this hardware, it is in some
of the other ARM EVMs and some STEricsson platforms like the u300
and u8500.

> 
> (That such a generic name slipped into the kernel must not
> imply we have to make the same mistake in u-boot)

I agree. However, it would be nice to have a bit of a link between
the device in the kernel and the one in u-boot and I didn't think
having "_mmci" in the name would be too objectionable.

Would pl180_mmci.c work? or how about arm_pl180_mmc.c? I'm open to
other suggestions.

Best regards,
Matt

> 
> Best Regards,
> Reinhard

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


[U-Boot] [PATCH V2 3/3] ARMV7: Vexpress: Add MMC support

2011-02-28 Thread matt . waddel
From: Matt Waddel 

Added the board specific definitions to use the MMCI device.

Signed-off-by: Matt Waddel 
---
 board/armltd/vexpress/ca9x4_ct_vxp.c |9 +
 include/configs/ca9x4_ct_vxp.h   |4 
 2 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/board/armltd/vexpress/ca9x4_ct_vxp.c 
b/board/armltd/vexpress/ca9x4_ct_vxp.c
index ce1be1e..92cb6be 100644
--- a/board/armltd/vexpress/ca9x4_ct_vxp.c
+++ b/board/armltd/vexpress/ca9x4_ct_vxp.c
@@ -86,6 +86,15 @@ int board_eth_init(bd_t *bis)
return rc;
 }
 
+int cpu_mmc_init(bd_t *bis)
+{
+   int rc = 0;
+#ifdef CONFIG_ARM_MMCI
+   rc = arm_mmci_init();
+#endif
+   return rc;
+}
+
 static void flash__init(void)
 {
/* Setup the sytem control register to allow writing to flash */
diff --git a/include/configs/ca9x4_ct_vxp.h b/include/configs/ca9x4_ct_vxp.h
index 63f003d..52fb5df 100644
--- a/include/configs/ca9x4_ct_vxp.h
+++ b/include/configs/ca9x4_ct_vxp.h
@@ -86,6 +86,10 @@
 #define CONFIG_MMC 1
 #define CONFIG_CMD_MMC
 #define CONFIG_GENERIC_MMC
+#define CONFIG_ARM_MMCI
+#define CONFIG_ARM_MMCI_BASE   0x10005000
+#define CONFIG_SYS_MMC_MAX_BLK_COUNT   127
+#define CONFIG_ARM_MMCI_CLOCK_FREQ 625
 
 /* BOOTP options */
 #define CONFIG_BOOTP_BOOTFILESIZE
-- 
1.7.1

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


[U-Boot] [PATCH V2 2/3] MMC: Add support for PL180 ARM mmc device

2011-02-28 Thread matt . waddel
From: Matt Waddel 

Add support for the ARM PrimeCell MultiMedia Interface - PL180.
Ported from original device driver written by ST-Ericsson.

Signed-off-by: Matt Waddel 
---
 drivers/mmc/Makefile   |1 +
 drivers/mmc/arm_mmci.c |  452 
 drivers/mmc/arm_mmci.h |  183 +++
 3 files changed, 636 insertions(+), 0 deletions(-)
 create mode 100644 drivers/mmc/arm_mmci.c
 create mode 100644 drivers/mmc/arm_mmci.h

diff --git a/drivers/mmc/Makefile b/drivers/mmc/Makefile
index 3496f0a..7f365b4 100644
--- a/drivers/mmc/Makefile
+++ b/drivers/mmc/Makefile
@@ -31,6 +31,7 @@ COBJS-$(CONFIG_DAVINCI_MMC) += davinci_mmc.o
 COBJS-$(CONFIG_FSL_ESDHC) += fsl_esdhc.o
 COBJS-$(CONFIG_GENERIC_MMC) += mmc.o
 COBJS-$(CONFIG_GENERIC_ATMEL_MCI) += gen_atmel_mci.o
+COBJS-$(CONFIG_ARM_MMCI) += arm_mmci.o
 COBJS-$(CONFIG_MXC_MMC) += mxcmmc.o
 COBJS-$(CONFIG_OMAP3_MMC) += omap3_mmc.o
 COBJS-$(CONFIG_OMAP_HSMMC) += omap_hsmmc.o
diff --git a/drivers/mmc/arm_mmci.c b/drivers/mmc/arm_mmci.c
new file mode 100644
index 000..8380138
--- /dev/null
+++ b/drivers/mmc/arm_mmci.c
@@ -0,0 +1,452 @@
+/*
+ * ARM PrimeCell MultiMedia Card Interface - PL180
+ *
+ * Copyright (C) ST-Ericsson SA 2010
+ *
+ * Author: Ulf Hansson 
+ * Author: Martin Lundholm 
+ * Ported to drivers/mmc/ by: Matt Waddel 
+ *
+ * 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 DEBUG */
+
+#include 
+#include "common.h"
+#include 
+#include 
+#include "arm_mmci.h"
+#include 
+
+struct mmc_host {
+   struct sdi_registers *base;
+};
+
+static int wait_for_command_end(struct mmc *dev, struct mmc_cmd *cmd)
+{
+   u32 hoststatus, statusmask;
+   struct mmc_host *host = dev->priv;
+
+   statusmask = SDI_STA_CTIMEOUT | SDI_STA_CCRCFAIL;
+   if ((cmd->resp_type & MMC_RSP_PRESENT))
+   statusmask |= SDI_STA_CMDREND;
+   else
+   statusmask |= SDI_STA_CMDSENT;
+
+   do
+   hoststatus = readl(&host->base->status) & statusmask;
+   while (!hoststatus);
+
+   writel(statusmask, &host->base->status_clear);
+   if (hoststatus & SDI_STA_CTIMEOUT) {
+   printf("CMD%d time out\n", cmd->cmdidx);
+   return -ETIMEDOUT;
+   } else if ((hoststatus & SDI_STA_CCRCFAIL) &&
+  (cmd->flags & MMC_RSP_CRC)) {
+   printf("CMD%d CRC error\n", cmd->cmdidx);
+   return -EILSEQ;
+   }
+
+   if (cmd->resp_type & MMC_RSP_PRESENT) {
+   cmd->response[0] = readl(&host->base->response0);
+   cmd->response[1] = readl(&host->base->response1);
+   cmd->response[2] = readl(&host->base->response2);
+   cmd->response[3] = readl(&host->base->response3);
+   debug("CMD%d response[0]:0x%08X, response[1]:0x%08X, "
+   "response[2]:0x%08X, response[3]:0x%08X\n",
+   cmd->cmdidx, cmd->response[0], cmd->response[1],
+   cmd->response[2], cmd->response[3]);
+   }
+
+   return 0;
+}
+
+/* send command to the mmc card and wait for results */
+static int do_command(struct mmc *dev, struct mmc_cmd *cmd)
+{
+   int result;
+   u32 sdi_cmd = 0;
+   struct mmc_host *host = dev->priv;
+
+   sdi_cmd = ((cmd->cmdidx & SDI_CMD_CMDINDEX_MASK) | SDI_CMD_CPSMEN);
+
+   if (cmd->resp_type) {
+   sdi_cmd |= SDI_CMD_WAITRESP;
+   if (cmd->resp_type & MMC_RSP_136)
+   sdi_cmd |= SDI_CMD_LONGRESP;
+   }
+
+   writel((u32)cmd->cmdarg, &host->base->argument);
+   udelay(COMMAND_REG_DELAY);
+   writel(sdi_cmd, &host->base->command);
+   result = wait_for_command_end(dev, cmd);
+
+   /* After CMD2 set RCA to a none zero value. */
+   if ((result == 0) && (cmd->cmdidx == MMC_CMD_ALL_SEND_CID))
+   dev->rca = 10;
+
+   /* After CMD3 open drain is switched off and push pull is used. */
+   if ((result == 0) && (cmd->cmdidx == MMC_CMD_SET_RELATIVE_ADDR)) {

[U-Boot] [PATCH V2 0/3] Add support for the MMC device to the vexpress

2011-02-28 Thread matt . waddel
From: Matt Waddel 

These patches add support for the ARM PrimeCell PL180 MultiMedia Interface.
The Versatile Express was the test platform for these changes.

---
Change log:

v2 - Rename patch items to a more descriptive name (ie. mmci -> arm_mmci)
 Fixed conflicting fuction call and added prototype to arm_mmci.h
 (Note: Patch 1/3 did not change with these corrections)

Matt Waddel (3):
  MMC: Max blocks value adjustable
  MMC: Add support for PL180 ARM mmc device
  ARMV7: Vexpress: Add MMC support

 board/armltd/vexpress/ca9x4_ct_vxp.c |9 +
 drivers/mmc/Makefile |1 +
 drivers/mmc/arm_mmci.c   |  452 ++
 drivers/mmc/arm_mmci.h   |  183 ++
 drivers/mmc/mmc.c|   19 +-
 include/configs/ca9x4_ct_vxp.h   |4 +
 6 files changed, 658 insertions(+), 10 deletions(-)
 create mode 100644 drivers/mmc/arm_mmci.c
 create mode 100644 drivers/mmc/arm_mmci.h

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


[U-Boot] [PATCH 3/3] ARMV7: Vexpress: Add MMC support

2011-02-24 Thread matt . waddel
From: Matt Waddel 

Added the board specific definitions to use the MMCI device.

Signed-off-by: Matt Waddel 
---
 board/armltd/vexpress/ca9x4_ct_vxp.c |9 +
 include/configs/ca9x4_ct_vxp.h   |4 
 2 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/board/armltd/vexpress/ca9x4_ct_vxp.c 
b/board/armltd/vexpress/ca9x4_ct_vxp.c
index ce1be1e..73cea1c 100644
--- a/board/armltd/vexpress/ca9x4_ct_vxp.c
+++ b/board/armltd/vexpress/ca9x4_ct_vxp.c
@@ -86,6 +86,15 @@ int board_eth_init(bd_t *bis)
return rc;
 }
 
+int cpu_mmc_init(bd_t *bis)
+{
+   int rc = 0;
+#ifdef CONFIG_MMCI
+   rc = mmci_init(bis);
+#endif
+   return rc;
+}
+
 static void flash__init(void)
 {
/* Setup the sytem control register to allow writing to flash */
diff --git a/include/configs/ca9x4_ct_vxp.h b/include/configs/ca9x4_ct_vxp.h
index 63f003d..47a3bfc 100644
--- a/include/configs/ca9x4_ct_vxp.h
+++ b/include/configs/ca9x4_ct_vxp.h
@@ -86,6 +86,10 @@
 #define CONFIG_MMC 1
 #define CONFIG_CMD_MMC
 #define CONFIG_GENERIC_MMC
+#define CONFIG_MMCI
+#define CONFIG_MMC_BASE0x10005000
+#define CONFIG_SYS_MMC_MAX_BLK_COUNT   127
+#define CONFIG_MMCI_CLOCK_FREQ 625
 
 /* BOOTP options */
 #define CONFIG_BOOTP_BOOTFILESIZE
-- 
1.7.1

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


[U-Boot] [PATCH 2/3] MMC: Add support for PL180 ARM mmc device

2011-02-24 Thread matt . waddel
From: Matt Waddel 

Add support for the ARM PrimeCell MultiMedia Interface - PL180.
Ported from original device driver written by ST-Ericsson.

Signed-off-by: Matt Waddel 
---
 drivers/mmc/Makefile |1 +
 drivers/mmc/mmci.c   |  452 ++
 drivers/mmc/mmci.h   |  181 
 3 files changed, 634 insertions(+), 0 deletions(-)
 create mode 100644 drivers/mmc/mmci.c
 create mode 100644 drivers/mmc/mmci.h

diff --git a/drivers/mmc/Makefile b/drivers/mmc/Makefile
index 3496f0a..70b 100644
--- a/drivers/mmc/Makefile
+++ b/drivers/mmc/Makefile
@@ -31,6 +31,7 @@ COBJS-$(CONFIG_DAVINCI_MMC) += davinci_mmc.o
 COBJS-$(CONFIG_FSL_ESDHC) += fsl_esdhc.o
 COBJS-$(CONFIG_GENERIC_MMC) += mmc.o
 COBJS-$(CONFIG_GENERIC_ATMEL_MCI) += gen_atmel_mci.o
+COBJS-$(CONFIG_MMCI) += mmci.o
 COBJS-$(CONFIG_MXC_MMC) += mxcmmc.o
 COBJS-$(CONFIG_OMAP3_MMC) += omap3_mmc.o
 COBJS-$(CONFIG_OMAP_HSMMC) += omap_hsmmc.o
diff --git a/drivers/mmc/mmci.c b/drivers/mmc/mmci.c
new file mode 100644
index 000..ba2f335
--- /dev/null
+++ b/drivers/mmc/mmci.c
@@ -0,0 +1,452 @@
+/*
+ * ARM PrimeCell MultiMedia Card Interface - PL180
+ *
+ * Copyright (C) ST-Ericsson SA 2010
+ *
+ * Author: Ulf Hansson 
+ * Author: Martin Lundholm 
+ * Ported to drivers/mmc/ by: Matt Waddel 
+ *
+ * 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 DEBUG */
+
+#include 
+#include "common.h"
+#include 
+#include 
+#include "mmci.h"
+#include 
+
+struct mmc_host {
+   struct sdi_registers *base;
+};
+
+static int wait_for_command_end(struct mmc *dev, struct mmc_cmd *cmd)
+{
+   u32 hoststatus, statusmask;
+   struct mmc_host *host = dev->priv;
+
+   statusmask = SDI_STA_CTIMEOUT | SDI_STA_CCRCFAIL;
+   if ((cmd->resp_type & MMC_RSP_PRESENT))
+   statusmask |= SDI_STA_CMDREND;
+   else
+   statusmask |= SDI_STA_CMDSENT;
+
+   do
+   hoststatus = readl(&host->base->status) & statusmask;
+   while (!hoststatus);
+
+   writel(statusmask, &host->base->status_clear);
+   if (hoststatus & SDI_STA_CTIMEOUT) {
+   printf("CMD%d time out\n", cmd->cmdidx);
+   return -ETIMEDOUT;
+   } else if ((hoststatus & SDI_STA_CCRCFAIL) &&
+  (cmd->flags & MMC_RSP_CRC)) {
+   printf("CMD%d CRC error\n", cmd->cmdidx);
+   return -EILSEQ;
+   }
+
+   if (cmd->resp_type & MMC_RSP_PRESENT) {
+   cmd->response[0] = readl(&host->base->response0);
+   cmd->response[1] = readl(&host->base->response1);
+   cmd->response[2] = readl(&host->base->response2);
+   cmd->response[3] = readl(&host->base->response3);
+   debug("CMD%d response[0]:0x%08X, response[1]:0x%08X, "
+   "response[2]:0x%08X, response[3]:0x%08X\n",
+   cmd->cmdidx, cmd->response[0], cmd->response[1],
+   cmd->response[2], cmd->response[3]);
+   }
+
+   return 0;
+}
+
+/* send command to the mmc card and wait for results */
+static int do_command(struct mmc *dev, struct mmc_cmd *cmd)
+{
+   int result;
+   u32 sdi_cmd = 0;
+   struct mmc_host *host = dev->priv;
+
+   sdi_cmd = ((cmd->cmdidx & SDI_CMD_CMDINDEX_MASK) | SDI_CMD_CPSMEN);
+
+   if (cmd->resp_type) {
+   sdi_cmd |= SDI_CMD_WAITRESP;
+   if (cmd->resp_type & MMC_RSP_136)
+   sdi_cmd |= SDI_CMD_LONGRESP;
+   }
+
+   writel((u32)cmd->cmdarg, &host->base->argument);
+   udelay(COMMAND_REG_DELAY);
+   writel(sdi_cmd, &host->base->command);
+   result = wait_for_command_end(dev, cmd);
+
+   /* After CMD2 set RCA to a none zero value. */
+   if ((result == 0) && (cmd->cmdidx == MMC_CMD_ALL_SEND_CID))
+   dev->rca = 10;
+
+   /* After CMD3 open drain is switched off and push pull is used. */
+   if ((result == 0) && (cmd->cmdidx == MMC_CMD_SET_RELATIVE_ADDR)) {
+   u32 sdi_pwr = readl

[U-Boot] [PATCH 1/3] MMC: Max blocks value adjustable

2011-02-24 Thread matt . waddel
From: Matt Waddel 

The maximum blocks value was hardcoded to 65535 due to a 16 bit
register length.  The value can change for different platforms.
This patch makes the default the current value of 65535, but it
is configurable for other platforms.

Signed-off-by: Matt Waddel 
---
 drivers/mmc/mmc.c |   19 +--
 1 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 6805b33..d69eaa1 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -33,6 +33,11 @@
 #include 
 #include 
 
+/* Set block count limit because of 16 bit register limit on some hardware*/
+#ifndef CONFIG_SYS_MMC_MAX_BLK_COUNT
+#define CONFIG_SYS_MMC_MAX_BLK_COUNT 65535
+#endif
+
 static struct list_head mmc_devices;
 static int cur_dev_num = -1;
 
@@ -139,11 +144,8 @@ mmc_bwrite(int dev_num, ulong start, lbaint_t blkcnt, 
const void*src)
return 0;
 
do {
-   /*
-* The 65535 constraint comes from some hardware has
-* only 16 bit width block number counter
-*/
-   cur = (blocks_todo > 65535) ? 65535 : blocks_todo;
+   cur = (blocks_todo > CONFIG_SYS_MMC_MAX_BLK_COUNT) ?
+  CONFIG_SYS_MMC_MAX_BLK_COUNT : blocks_todo;
if(mmc_write_blocks(mmc, start, cur, src) != cur)
return 0;
blocks_todo -= cur;
@@ -215,11 +217,8 @@ static ulong mmc_bread(int dev_num, ulong start, lbaint_t 
blkcnt, void *dst)
return 0;
 
do {
-   /*
-* The 65535 constraint comes from some hardware has
-* only 16 bit width block number counter
-*/
-   cur = (blocks_todo > 65535) ? 65535 : blocks_todo;
+   cur = (blocks_todo > CONFIG_SYS_MMC_MAX_BLK_COUNT) ?
+  CONFIG_SYS_MMC_MAX_BLK_COUNT : blocks_todo;
if(mmc_read_blocks(mmc, dst, start, cur) != cur)
return 0;
blocks_todo -= cur;
-- 
1.7.1

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


[U-Boot] [PATCH 0/3] Add support for the MMC device to the vexpress

2011-02-24 Thread matt . waddel
From: Matt Waddel 

These patches add support for the ARM PrimeCell PL180 MultiMedia Interface.
The Versatile Express was the test platform for these changes.

Matt Waddel (3):
  MMC: Max blocks value adjustable
  MMC: Add support for PL180 ARM mmc device
  ARMV7: Vexpress: Add MMC support

 board/armltd/vexpress/ca9x4_ct_vxp.c |9 +
 drivers/mmc/Makefile |1 +
 drivers/mmc/mmc.c|   19 +-
 drivers/mmc/mmci.c   |  452 ++
 drivers/mmc/mmci.h   |  181 ++
 include/configs/ca9x4_ct_vxp.h   |4 +
 6 files changed, 656 insertions(+), 10 deletions(-)
 create mode 100644 drivers/mmc/mmci.c
 create mode 100644 drivers/mmc/mmci.h

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


[U-Boot] Vexpress build fixes

2010-12-06 Thread Matt Waddel
Hi Wolfgang,

Can these 3 patches be included before the next release?
They fix build errors in the versatile express code.

http://lists.denx.de/pipermail/u-boot/2010-December/082984.html
http://lists.denx.de/pipermail/u-boot/2010-November/081034.html
http://lists.denx.de/pipermail/u-boot/2010-November/082654.html

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


Re: [U-Boot] [STATUS] v2010.12-rc2 released

2010-12-02 Thread Matt Waddel
Hi Wolfgang,

On 12/02/2010 11:13 AM, John Rigby wrote:
> On Tue, Nov 30, 2010 at 8:00 AM, Wolfgang Denk  wrote:
>> Hello everybody.
>>
>> I apologise for being a bit late with this announcement:
>>
>> * U-Boot v2010.12-rc2 was released on Sunday, November 28.
>>
>> * Release "v2010.12" is (still) scheduled in 13 days:
>>  on December 13, 2010.
>>
>> Please help testing, and check if all your relevant patches have been
>> included.
>>
> 
> I have verified ca9x4_ct_vxp builds cleanly if the following patches are
> applied:
> 
> ARMV7: Vexpress build errors
> http://lists.denx.de/pipermail/u-boot/2010-November/081033.html

I found that you had NAKed a patch similar to this one a few weeks
ago.  So I redid this patch and submitted a new one this morning:

http://lists.denx.de/pipermail/u-boot/2010-December/082984.html

This one removes the #include sys_proto.h.  The other 2 patches John
listed below should still be valid for this platform.

Thanks,
Matt

> ARMV7: Vexpress compile warnings
> http://lists.denx.de/pipermail/u-boot/2010-November/081034.html
> ARMV7:ca9x4_ct_vxp: udelay reference fix
> http://patchwork.ozlabs.org/patch/73478/
> 
> John
> ___
> 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


[U-Boot] [PATCH v2 1/2] Vexpress build errors

2010-12-02 Thread matt . waddel
From: Matt Waddel 

This patch fixes build errors in the vexpress system:
  - Removed sys_proto.h requirement from syslib.c.
  - Switched vexpress to the default armv7 linker script.
  - Renamed TEXT_BASE to CONFIG_SYS_TEXT_BASE.


Signed-off-by: Matt Waddel 
---
Change log v2:
Removed the new arch/arm/include/asm/arch-armv7/sys_proto.h file.

 arch/arm/cpu/armv7/syslib.c  |1 -
 board/armltd/vexpress/config.mk  |3 +-
 board/armltd/vexpress/u-boot.lds |   65 --
 3 files changed, 1 insertions(+), 68 deletions(-)
 delete mode 100644 board/armltd/vexpress/u-boot.lds

diff --git a/arch/arm/cpu/armv7/syslib.c b/arch/arm/cpu/armv7/syslib.c
index f9ed9a3..84d17f0 100644
--- a/arch/arm/cpu/armv7/syslib.c
+++ b/arch/arm/cpu/armv7/syslib.c
@@ -23,7 +23,6 @@
 
 #include 
 #include 
-#include 
 
 /
  * sdelay() - simple spin loop.  Will be constant time as
diff --git a/board/armltd/vexpress/config.mk b/board/armltd/vexpress/config.mk
index 2d797d7..36395f2 100644
--- a/board/armltd/vexpress/config.mk
+++ b/board/armltd/vexpress/config.mk
@@ -19,5 +19,4 @@
 #
 # Linux-Kernel is expected to be at 0x60008000
 #
-TEXT_BASE = 0x6080
-LDSCRIPT := $(SRCTREE)/board/armltd/vexpress/u-boot.lds
+CONFIG_SYS_TEXT_BASE = 0x6080
diff --git a/board/armltd/vexpress/u-boot.lds b/board/armltd/vexpress/u-boot.lds
deleted file mode 100644
index 5ac62f2..000
--- a/board/armltd/vexpress/u-boot.lds
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * (C) Copyright 2002
- * Gary Jennejohn, DENX Software Engineering, 
- *
- * 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
- */
-OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
-OUTPUT_ARCH(arm)
-ENTRY(_start)
-SECTIONS
-{
-   . = 0x;
-   . = ALIGN(4);
-   .text   :
-   {
-   arch/arm/cpu/armv7/start.o  (.text)
-   *(.text)
-   }
-
-   . = ALIGN(4);
-   .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata))) }
-
-   . = ALIGN(4);
-   .data : { *(.data)
-   __datarel_start = .;
-   *(.data.rel)
-   __datarelrolocal_start = .;
-   *(.data.rel.ro.local)
-   __datarellocal_start = .;
-   *(.data.rel.local)
-   __datarelro_start = .;
-   *(.data.rel.ro)
-   }
-
-   __got_start = .;
-   . = ALIGN(4);
-   .got : { *(.got) }
-   __got_end = .;
-
-   . = .;
-   __u_boot_cmd_start = .;
-   .u_boot_cmd : { *(.u_boot_cmd) }
-   __u_boot_cmd_end = .;
-
-   . = ALIGN(4);
-   __bss_start = .;
-   .bss : { *(.bss) }
-   _end = .;
-}
-- 
1.7.1

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


[U-Boot] [PATCH] ARMV7:ca9x4_ct_vxp: udelay reference fix

2010-11-29 Thread Matt Waddel
Fixes undefined reference to `__udelay' build failure.

Signed-off-by: Matt Waddel 
---
 board/armltd/vexpress/ca9x4_ct_vxp.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/board/armltd/vexpress/ca9x4_ct_vxp.c
b/board/armltd/vexpress/ca9x4_ct_vxp.c
index c1c4ea1..ce1be1e 100644
--- a/board/armltd/vexpress/ca9x4_ct_vxp.c
+++ b/board/armltd/vexpress/ca9x4_ct_vxp.c
@@ -157,7 +157,7 @@ void reset_cpu(ulong addr)
  * Delay x useconds AND perserve advance timstamp value
  * assumes timer is ticking at 1 msec
  */
-void udelay(ulong usec)
+void __udelay(ulong usec)
 {
ulong tmo, tmp;

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


[U-Boot] [PATCH 2/2] ARMV7: Vexpress compile warnings

2010-11-02 Thread matt . waddel
From: Matt Waddel 

Fixed "pointer from integer without a cast" warnings in Vexpress.

Signed-off-by: Matt Waddel 
---
 board/armltd/vexpress/ca9x4_ct_vxp.c |9 ++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/board/armltd/vexpress/ca9x4_ct_vxp.c 
b/board/armltd/vexpress/ca9x4_ct_vxp.c
index 48dfc8c..c1c4ea1 100644
--- a/board/armltd/vexpress/ca9x4_ct_vxp.c
+++ b/board/armltd/vexpress/ca9x4_ct_vxp.c
@@ -95,16 +95,19 @@ static void flash__init(void)
 
 int dram_init(void)
 {
-   gd->ram_size = get_ram_size(CONFIG_SYS_SDRAM_BASE, PHYS_SDRAM_1_SIZE);
+   gd->ram_size =
+   get_ram_size((long *)CONFIG_SYS_SDRAM_BASE, PHYS_SDRAM_1_SIZE);
return 0;
 }
 
 void dram_init_banksize(void)
 {
gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
-   gd->bd->bi_dram[0].size = get_ram_size(PHYS_SDRAM_1, PHYS_SDRAM_1_SIZE);
+   gd->bd->bi_dram[0].size =
+   get_ram_size((long *)PHYS_SDRAM_1, PHYS_SDRAM_1_SIZE);
gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
-   gd->bd->bi_dram[1].size = get_ram_size(PHYS_SDRAM_2, PHYS_SDRAM_2_SIZE);
+   gd->bd->bi_dram[1].size =
+   get_ram_size((long *)PHYS_SDRAM_2, PHYS_SDRAM_2_SIZE);
 }
 
 int timer_init(void)
-- 
1.7.1

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


[U-Boot] [PATCH 1/2] ARMV7: Vexpress build errors

2010-11-02 Thread matt . waddel
From: Matt Waddel 

This patch fixes build errors in the vexpress system:
 - syslib.c requires sys_proto.h file, used the example from /arch-mx5/.
 - The linker script was missing required sections. Found the default
   armv7 linker script can be used by vexpress.  Switched to that one.
 - Renamed TEXT_BASE to CONFIG_SYS_TEXT_BASE.

Signed-off-by: Matt Waddel 
---
 arch/arm/include/asm/arch-armv7/sys_proto.h |   29 
 board/armltd/vexpress/config.mk |3 +-
 board/armltd/vexpress/u-boot.lds|   65 ---
 3 files changed, 30 insertions(+), 67 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-armv7/sys_proto.h
 delete mode 100644 board/armltd/vexpress/u-boot.lds

diff --git a/arch/arm/include/asm/arch-armv7/sys_proto.h 
b/arch/arm/include/asm/arch-armv7/sys_proto.h
new file mode 100644
index 000..f77446a
--- /dev/null
+++ b/arch/arm/include/asm/arch-armv7/sys_proto.h
@@ -0,0 +1,29 @@
+/*
+ * (C) Copyright 2009
+ * Stefano Babic, DENX Software Engineering, sba...@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
+ */
+
+#ifndef _SYS_PROTO_H_
+#define _SYS_PROTO_H_
+
+void sdelay(unsigned long);
+
+#endif
diff --git a/board/armltd/vexpress/config.mk b/board/armltd/vexpress/config.mk
index 2d797d7..36395f2 100644
--- a/board/armltd/vexpress/config.mk
+++ b/board/armltd/vexpress/config.mk
@@ -19,5 +19,4 @@
 #
 # Linux-Kernel is expected to be at 0x60008000
 #
-TEXT_BASE = 0x6080
-LDSCRIPT := $(SRCTREE)/board/armltd/vexpress/u-boot.lds
+CONFIG_SYS_TEXT_BASE = 0x6080
diff --git a/board/armltd/vexpress/u-boot.lds b/board/armltd/vexpress/u-boot.lds
deleted file mode 100644
index 5ac62f2..000
--- a/board/armltd/vexpress/u-boot.lds
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * (C) Copyright 2002
- * Gary Jennejohn, DENX Software Engineering, 
- *
- * 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
- */
-OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
-OUTPUT_ARCH(arm)
-ENTRY(_start)
-SECTIONS
-{
-   . = 0x;
-   . = ALIGN(4);
-   .text   :
-   {
-   arch/arm/cpu/armv7/start.o  (.text)
-   *(.text)
-   }
-
-   . = ALIGN(4);
-   .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata))) }
-
-   . = ALIGN(4);
-   .data : { *(.data)
-   __datarel_start = .;
-   *(.data.rel)
-   __datarelrolocal_start = .;
-   *(.data.rel.ro.local)
-   __datarellocal_start = .;
-   *(.data.rel.local)
-   __datarelro_start = .;
-   *(.data.rel.ro)
-   }
-
-   __got_start = .;
-   . = ALIGN(4);
-   .got : { *(.got) }
-   __got_end = .;
-
-   . = .;
-   __u_boot_cmd_start = .;
-   .u_boot_cmd : { *(.u_boot_cmd) }
-   __u_boot_cmd_end = .;
-
-   . = ALIGN(4);
-   __bss_start = .;
-   .bss : { *(.bss) }
-   _end = .;
-}
-- 
1.7.1

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


[U-Boot] [PATCH 0/2] ARMV7: Fixing Vexpress build errors and warnings

2010-11-02 Thread matt . waddel
From: Matt Waddel 

These patches fix several build errors and warnings. A successful build for 
this platform depends on Steve Sakoman's "ARMV7: Fix build for non-OMAP3 
boards" patch.

Matt Waddel (2):
  ARMV7: Vexpress build errors
  ARMV7: Vexpress compile warnings

 arch/arm/include/asm/arch-armv7/sys_proto.h |   29 
 board/armltd/vexpress/ca9x4_ct_vxp.c|9 +++-
 board/armltd/vexpress/config.mk |3 +-
 board/armltd/vexpress/u-boot.lds|   65 ---
 4 files changed, 36 insertions(+), 70 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-armv7/sys_proto.h
 delete mode 100644 board/armltd/vexpress/u-boot.lds

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


Re: [U-Boot] [PATCH V5 0/2] ARMV7: Add support for the Versatile Express Quad Cortex A9 platform

2010-10-11 Thread Matt Waddel
Hi Wolfgang,

On 10/07/2010 03:48 PM, matt.wad...@linaro.org wrote:
>   ARMV7: Versatile Express Coretile CortexA9x4 support
>   ARMV7: Fixed baudrate setting in pl01x driver

These 2 patches have been hanging around for a while and
I've been pulling them along with the trunk changes.
They've already been reviewed a couple of times, and there
was one Tested-by a while back.  I was wondering if there
is anything else I need to do get them merged. I'm concerned
they won't make it in before the merge window closes again.

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


[U-Boot] [PATCH V5 2/2] ARMV7: Fixed baudrate setting in pl01x driver

2010-10-07 Thread matt . waddel
From: Matt Waddel 

The pl01x serial driver was lacking the code to switch baudrates from the
command line.  Fixed by simply saving the new baudrate and calling
serial_init() again.  Also fixed CamelCase variables, I/O accessors and
comment style.

Signed-off-by: Matt Waddel 
---
 drivers/serial/serial_pl01x.c |   93 +
 1 files changed, 38 insertions(+), 55 deletions(-)

diff --git a/drivers/serial/serial_pl01x.c b/drivers/serial/serial_pl01x.c
index c645cef..c0ae947 100644
--- a/drivers/serial/serial_pl01x.c
+++ b/drivers/serial/serial_pl01x.c
@@ -29,25 +29,23 @@
 
 #include 
 #include 
-
+#include 
 #include "serial_pl01x.h"
 
-#define IO_WRITE(addr, val) (*(volatile unsigned int *)(addr) = (val))
-#define IO_READ(addr) (*(volatile unsigned int *)(addr))
-
 /*
  * Integrator AP has two UARTs, we use the first one, at 38400-8-N-1
  * Integrator CP has two UARTs, use the first one, at 38400-8-N-1
  * Versatile PB has four UARTs.
  */
 #define CONSOLE_PORT CONFIG_CONS_INDEX
-#define baudRate CONFIG_BAUDRATE
 static volatile unsigned char *const port[] = CONFIG_PL01x_PORTS;
 #define NUM_PORTS (sizeof(port)/sizeof(port[0]))
 
 static void pl01x_putc (int portnum, char c);
 static int pl01x_getc (int portnum);
 static int pl01x_tstc (int portnum);
+unsigned int baudrate = CONFIG_BAUDRATE;
+DECLARE_GLOBAL_DATA_PTR;
 
 #ifdef CONFIG_PL010_SERIAL
 
@@ -55,16 +53,11 @@ int serial_init (void)
 {
unsigned int divisor;
 
-   /*
-** First, disable everything.
-*/
-   IO_WRITE (port[CONSOLE_PORT] + UART_PL010_CR, 0x0);
+   /* First, disable everything */
+   writel(0x0, port[CONSOLE_PORT] + UART_PL010_CR);
 
-   /*
-** Set baud rate
-**
-*/
-   switch (baudRate) {
+   /* Set baud rate */
+   switch (baudrate) {
case 9600:
divisor = UART_PL010_BAUD_9600;
break;
@@ -89,20 +82,15 @@ int serial_init (void)
divisor = UART_PL010_BAUD_38400;
}
 
-   IO_WRITE (port[CONSOLE_PORT] + UART_PL010_LCRM,
- ((divisor & 0xf00) >> 8));
-   IO_WRITE (port[CONSOLE_PORT] + UART_PL010_LCRL, (divisor & 0xff));
+   writel(((divisor & 0xf00) >> 8), port[CONSOLE_PORT] + UART_PL010_LCRM);
+   writel((divisor & 0xff), port[CONSOLE_PORT] + UART_PL010_LCRL);
 
-   /*
-** Set the UART to be 8 bits, 1 stop bit, no parity, fifo enabled.
-*/
-   IO_WRITE (port[CONSOLE_PORT] + UART_PL010_LCRH,
- (UART_PL010_LCRH_WLEN_8 | UART_PL010_LCRH_FEN));
+   /* Set the UART to be 8 bits, 1 stop bit, no parity, fifo enabled */
+   writel((UART_PL010_LCRH_WLEN_8 | UART_PL010_LCRH_FEN),
+   port[CONSOLE_PORT] + UART_PL010_LCRH);
 
-   /*
-** Finally, enable the UART
-*/
-   IO_WRITE (port[CONSOLE_PORT] + UART_PL010_CR, (UART_PL010_CR_UARTEN));
+   /* Finally, enable the UART */
+   writel((UART_PL010_CR_UARTEN), port[CONSOLE_PORT] + UART_PL010_CR);
 
return 0;
 }
@@ -118,38 +106,31 @@ int serial_init (void)
unsigned int remainder;
unsigned int fraction;
 
-   /*
-** First, disable everything.
-*/
-   IO_WRITE (port[CONSOLE_PORT] + UART_PL011_CR, 0x0);
+   /* First, disable everything */
+   writel(0x0, port[CONSOLE_PORT] + UART_PL011_CR);
 
/*
-** Set baud rate
-**
-** IBRD = UART_CLK / (16 * BAUD_RATE)
-** FBRD = ROUND((64 * MOD(UART_CLK,(16 * BAUD_RATE))) / (16 * 
BAUD_RATE))
+* Set baud rate
+*
+* IBRD = UART_CLK / (16 * BAUD_RATE)
+* FBRD = RND((64 * MOD(UART_CLK,(16 * BAUD_RATE))) / (16 * BAUD_RATE))
 */
-   temp = 16 * baudRate;
+   temp = 16 * baudrate;
divider = CONFIG_PL011_CLOCK / temp;
remainder = CONFIG_PL011_CLOCK % temp;
-   temp = (8 * remainder) / baudRate;
+   temp = (8 * remainder) / baudrate;
fraction = (temp >> 1) + (temp & 1);
 
-   IO_WRITE (port[CONSOLE_PORT] + UART_PL011_IBRD, divider);
-   IO_WRITE (port[CONSOLE_PORT] + UART_PL011_FBRD, fraction);
+   writel(divider, port[CONSOLE_PORT] + UART_PL011_IBRD);
+   writel(fraction, port[CONSOLE_PORT] + UART_PL011_FBRD);
 
-   /*
-** Set the UART to be 8 bits, 1 stop bit, no parity, fifo enabled.
-*/
-   IO_WRITE (port[CONSOLE_PORT] + UART_PL011_LCRH,
- (UART_PL011_LCRH_WLEN_8 | UART_PL011_LCRH_FEN));
+   /* Set the UART to be 8 bits, 1 stop bit, no parity, fifo enabled */
+   writel((UART_PL011_LCRH_WLEN_8 | UART_PL011_LCRH_FEN),
+   port[CONSOLE_PORT] + UART_PL011_LCRH);
 
-   /*
-** Finally, enable the UART
-*/
-   IO_WRITE (port[CONSOLE_PORT] + UART_PL011_CR,
- (UART_PL011_CR_UARTEN | UART_PL011_CR_TXE |
-  UART_PL011_CR_RXE));
+

[U-Boot] [PATCH V5 1/2] ARMV7: Versatile Express Coretile CortexA9x4 support

2010-10-07 Thread matt . waddel
From: Matt Waddel 

Adds support for the ARM quad-core Cortex-A9 processor

This system includes a motherboard(Versatile Express), daughterboard
(Coretile), and SOC(Cortex-A9 quad core).  The serial port, ethernet,
and flash systems work with these additions.  The naming convention
is:
   SOC -> CortexA9 quad core = ca9x4
   daughterboard -> Coretile = ct
   motherboard -> Versatile Express = vxp
This gives ca9x4_ct_vxp.c as the board support file.

Signed-off-by: Matt Waddel 
---
 MAINTAINERS|4 +
 MAKEALL|1 +
 arch/arm/include/asm/arch-armv7/sysctrl.h  |   70 +
 arch/arm/include/asm/arch-armv7/systimer.h |   50 +++
 arch/arm/include/asm/arch-armv7/wdt.h  |   55 +++
 board/armltd/vexpress/Makefile |   49 ++
 board/armltd/vexpress/ca9x4_ct_vxp.c   |  220 
 board/armltd/vexpress/config.mk|   23 +++
 board/armltd/vexpress/u-boot.lds   |   65 
 boards.cfg |1 +
 include/configs/ca9x4_ct_vxp.h |  196 +
 11 files changed, 734 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-armv7/sysctrl.h
 create mode 100644 arch/arm/include/asm/arch-armv7/systimer.h
 create mode 100644 arch/arm/include/asm/arch-armv7/wdt.h
 create mode 100644 board/armltd/vexpress/Makefile
 create mode 100644 board/armltd/vexpress/ca9x4_ct_vxp.c
 create mode 100644 board/armltd/vexpress/config.mk
 create mode 100644 board/armltd/vexpress/u-boot.lds
 create mode 100644 include/configs/ca9x4_ct_vxp.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 5e3a3fa..71dcd5b 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -802,6 +802,10 @@ Hugo Villeneuve 
 
SFFSDR  ARM926EJS
 
+Matt Waddel 
+
+   ca9x4_ct_vxpARM ARMV7 (Quad Core)
+
 Prafulla Wadaskar 
 
mv88f6281gtw_ge ARM926EJS (Kirkwood SoC)
diff --git a/MAKEALL b/MAKEALL
index 1b506d6..abceccd 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -489,6 +489,7 @@ LIST_ARM11="\
 #
 LIST_ARMV7="   \
am3517_evm  \
+   ca9x4_ct_vxp\
devkit8000  \
mx51evk \
omap3_beagle\
diff --git a/arch/arm/include/asm/arch-armv7/sysctrl.h 
b/arch/arm/include/asm/arch-armv7/sysctrl.h
new file mode 100644
index 000..4e45167
--- /dev/null
+++ b/arch/arm/include/asm/arch-armv7/sysctrl.h
@@ -0,0 +1,70 @@
+/*
+ * (C) Copyright 2010 Linaro
+ * Matt Waddel, 
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+#ifndef _SYSCTRL_H_
+#define _SYSCTRL_H_
+
+/* System controller (SP810) register definitions */
+#define SP810_TIMER0_ENSEL (1 << 15)
+#define SP810_TIMER1_ENSEL (1 << 17)
+#define SP810_TIMER2_ENSEL (1 << 19)
+#define SP810_TIMER3_ENSEL (1 << 21)
+
+struct sysctrl {
+   u32 scctrl; /* 0x000 */
+   u32 scsysstat;
+   u32 scimctrl;
+   u32 scimstat;
+   u32 scxtalctrl;
+   u32 scpllctrl;
+   u32 scpllfctrl;
+   u32 scperctrl0;
+   u32 scperctrl1;
+   u32 scperen;
+   u32 scperdis;
+   u32 scperclken;
+   u32 scperstat;
+   u32 res1[0x006];
+   u32 scflashctrl;/* 0x04c */
+   u32 res2[0x3a4];
+   u32 scsysid0;   /* 0xee0 */
+   u32 scsysid1;
+   u32 scsysid2;
+   u32 scsysid3;
+   u32 scitcr;
+   u32 scitir0;
+   u32 scitir1;
+   u32 scitor;
+   u32 sccntctrl;
+   u32 sccntdata;
+   u32 sccntstep;
+   u32 res3[0x32];
+   u32 scperiphid0;/* 0xfe0 */
+   u32 scperiphid1;
+   u32 scperiphid2;
+   u32 scperiphid3;
+   u32 scpcellid0;
+   u32 scpcellid1;
+   u32 scpcellid2;
+   u32 scpcellid3;
+};
+#endif /* _SYSCTRL_H_ */
diff --git a/arch/arm/include/asm/arch-armv7/systimer.h 
b/arch/arm/include/asm/arch-armv7/systimer.h
new file mode 100644
index 000..e745e37
--- /dev/null
+++ b/arch/arm/include/asm/arch-armv7/systimer.h
@@ -0,0 +1,50 @@
+/*
+ 

[U-Boot] [PATCH V5 0/2] ARMV7: Add support for the Versatile Express Quad Cortex A9 platform

2010-10-07 Thread matt . waddel
From: Matt Waddel 

Adds support for the ARM quad-core Cortex-A9 processor.
  This system includes a motherboard(Versatile Express), daughterboard
  (Coretile), and SOC(Cortex-A9 quad core).  The serial port, ethernet,
  and flash systems work with these additions.  The naming convention
  is:
 SOC -> CortexA9 quad core = ca9x4  
 daughterboard -> Coretile = ct
 motherboard -> Versatile Express = vxp
  This gives ca9x4_ct_vxp.c as the board support file.

The 2nd patch fixes a bug in the "set baudrate xxx" functionality and
fixes some of the code problems like CamelCase and IO accessors.

---

Version 2 -
  Removed unneeded multi-core low_level setup code.

Version 3 - 
 Patch 1)
  1) Fixups from Wolfgang's code review:
- Remove CamelCase variable definitions, keep lists sorted, tab indents 
  only, remove trailing empty lines, remove unneeded configuration options,
  use I/O accessors, added while(1) loop in reset command
  2) Simplified board_init declarations
  3) Added CONFIG_INITRD_TAG declaration
  4) Removed unneeded assembly directives from Makefile
 Patch 2)
  1) Replaced IO_WRITE and IO_READ calls in serial_pl01x.c with calls to 
 readl() and writel(). Fixed commenting and CamelCase problems.

Version 4 -
  1) Refactored to work with the "next" branch
  2) Fixed a bug in the 2nd flash bank definition

Version 5 -
  1) Refactored to apply to the tip of git tree.
  2) Improved the environment settings and added the run command option

Matt Waddel (2):
  ARMV7: Versatile Express Coretile CortexA9x4 support
  ARMV7: Fixed baudrate setting in pl01x driver

 MAINTAINERS|4 +
 MAKEALL|1 +
 arch/arm/include/asm/arch-armv7/sysctrl.h  |   70 +
 arch/arm/include/asm/arch-armv7/systimer.h |   50 +++
 arch/arm/include/asm/arch-armv7/wdt.h  |   55 +++
 board/armltd/vexpress/Makefile |   49 ++
 board/armltd/vexpress/ca9x4_ct_vxp.c   |  220 
 board/armltd/vexpress/config.mk|   23 +++
 board/armltd/vexpress/u-boot.lds   |   65 
 boards.cfg |1 +
 drivers/serial/serial_pl01x.c  |   93 +---
 include/configs/ca9x4_ct_vxp.h |  196 +
 12 files changed, 772 insertions(+), 55 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-armv7/sysctrl.h
 create mode 100644 arch/arm/include/asm/arch-armv7/systimer.h
 create mode 100644 arch/arm/include/asm/arch-armv7/wdt.h
 create mode 100644 board/armltd/vexpress/Makefile
 create mode 100644 board/armltd/vexpress/ca9x4_ct_vxp.c
 create mode 100644 board/armltd/vexpress/config.mk
 create mode 100644 board/armltd/vexpress/u-boot.lds
 create mode 100644 include/configs/ca9x4_ct_vxp.h

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


[U-Boot] [PATCH V5 0/2] ARMV7: Add support for the Versatile Express Quad Cortex A9 platform

2010-10-07 Thread matt . waddel
From: Matt Waddel 

Matt Waddel (2):
  Adds support for the ARM quad-core Cortex-A9 processor.
This system includes a motherboard(Versatile Express), daughterboard
(Coretile), and SOC(Cortex-A9 quad core).  The serial port, ethernet,
and flash systems work with these additions.  The naming convention
is:
   SOC -> CortexA9 quad core = ca9x4  
   daughterboard -> Coretile = ct
   motherboard -> Versatile Express = vxp
This gives ca9x4_ct_vxp.c as the board support file.

  The 2nd patch fixes a bug in the "set baudrate xxx" functionality and
  fixes some of the code problems like CamelCase and IO accessors.

---

Version 2 -
  Removed unneeded multi-core low_level setup code.

Version 3 - 
 Patch 1)
  1) Fixups from Wolfgang's code review:
- Remove CamelCase variable definitions, keep lists sorted, tab indents 
  only, remove trailing empty lines, remove unneeded configuration options,
  use I/O accessors, added while(1) loop in reset command
  2) Simplified board_init declarations
  3) Added CONFIG_INITRD_TAG declaration
  4) Removed unneeded assembly directives from Makefile
 Patch 2)
  1) Replaced IO_WRITE and IO_READ calls in serial_pl01x.c with calls to 
 readl() and writel(). Fixed commenting and CamelCase problems.

Version 4 -
  1) Refactored to work with the "next" branch
  2) Fixed a bug in the 2nd flash bank definition

Version 5 -
  1) Refactored to apply to the tip of git tree.
  2) Improved the environment settings and added the run command option

 MAINTAINERS|4 +
 MAKEALL|1 +
 arch/arm/include/asm/arch-armv7/sysctrl.h  |   70 +
 arch/arm/include/asm/arch-armv7/systimer.h |   50 +++
 arch/arm/include/asm/arch-armv7/wdt.h  |   55 +++
 board/armltd/vexpress/Makefile |   49 ++
 board/armltd/vexpress/ca9x4_ct_vxp.c   |  220 
 board/armltd/vexpress/config.mk|   23 +++
 board/armltd/vexpress/u-boot.lds   |   65 
 boards.cfg |1 +
 drivers/serial/serial_pl01x.c  |   93 +---
 include/configs/ca9x4_ct_vxp.h |  196 +
 12 files changed, 772 insertions(+), 55 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-armv7/sysctrl.h
 create mode 100644 arch/arm/include/asm/arch-armv7/systimer.h
 create mode 100644 arch/arm/include/asm/arch-armv7/wdt.h
 create mode 100644 board/armltd/vexpress/Makefile
 create mode 100644 board/armltd/vexpress/ca9x4_ct_vxp.c
 create mode 100644 board/armltd/vexpress/config.mk
 create mode 100644 board/armltd/vexpress/u-boot.lds
 create mode 100644 include/configs/ca9x4_ct_vxp.h

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


[U-Boot] [PATCH NEXT V4 2/2] ARMV7: Fixed baudrate setting in pl01x driver

2010-09-13 Thread matt . waddel
From: Matt Waddel 

The pl01x serial driver was lacking the code to switch baudrates from the
command line.  Fixed by simply saving the new baudrate and calling
serial_init() again.  Also fixed CamelCase variables, I/O accessors and
comment style.

Signed-off-by: Matt Waddel 
---
 drivers/serial/serial_pl01x.c |   93 +
 1 files changed, 38 insertions(+), 55 deletions(-)

diff --git a/drivers/serial/serial_pl01x.c b/drivers/serial/serial_pl01x.c
index c645cef..c0ae947 100644
--- a/drivers/serial/serial_pl01x.c
+++ b/drivers/serial/serial_pl01x.c
@@ -29,25 +29,23 @@
 
 #include 
 #include 
-
+#include 
 #include "serial_pl01x.h"
 
-#define IO_WRITE(addr, val) (*(volatile unsigned int *)(addr) = (val))
-#define IO_READ(addr) (*(volatile unsigned int *)(addr))
-
 /*
  * Integrator AP has two UARTs, we use the first one, at 38400-8-N-1
  * Integrator CP has two UARTs, use the first one, at 38400-8-N-1
  * Versatile PB has four UARTs.
  */
 #define CONSOLE_PORT CONFIG_CONS_INDEX
-#define baudRate CONFIG_BAUDRATE
 static volatile unsigned char *const port[] = CONFIG_PL01x_PORTS;
 #define NUM_PORTS (sizeof(port)/sizeof(port[0]))
 
 static void pl01x_putc (int portnum, char c);
 static int pl01x_getc (int portnum);
 static int pl01x_tstc (int portnum);
+unsigned int baudrate = CONFIG_BAUDRATE;
+DECLARE_GLOBAL_DATA_PTR;
 
 #ifdef CONFIG_PL010_SERIAL
 
@@ -55,16 +53,11 @@ int serial_init (void)
 {
unsigned int divisor;
 
-   /*
-** First, disable everything.
-*/
-   IO_WRITE (port[CONSOLE_PORT] + UART_PL010_CR, 0x0);
+   /* First, disable everything */
+   writel(0x0, port[CONSOLE_PORT] + UART_PL010_CR);
 
-   /*
-** Set baud rate
-**
-*/
-   switch (baudRate) {
+   /* Set baud rate */
+   switch (baudrate) {
case 9600:
divisor = UART_PL010_BAUD_9600;
break;
@@ -89,20 +82,15 @@ int serial_init (void)
divisor = UART_PL010_BAUD_38400;
}
 
-   IO_WRITE (port[CONSOLE_PORT] + UART_PL010_LCRM,
- ((divisor & 0xf00) >> 8));
-   IO_WRITE (port[CONSOLE_PORT] + UART_PL010_LCRL, (divisor & 0xff));
+   writel(((divisor & 0xf00) >> 8), port[CONSOLE_PORT] + UART_PL010_LCRM);
+   writel((divisor & 0xff), port[CONSOLE_PORT] + UART_PL010_LCRL);
 
-   /*
-** Set the UART to be 8 bits, 1 stop bit, no parity, fifo enabled.
-*/
-   IO_WRITE (port[CONSOLE_PORT] + UART_PL010_LCRH,
- (UART_PL010_LCRH_WLEN_8 | UART_PL010_LCRH_FEN));
+   /* Set the UART to be 8 bits, 1 stop bit, no parity, fifo enabled */
+   writel((UART_PL010_LCRH_WLEN_8 | UART_PL010_LCRH_FEN),
+   port[CONSOLE_PORT] + UART_PL010_LCRH);
 
-   /*
-** Finally, enable the UART
-*/
-   IO_WRITE (port[CONSOLE_PORT] + UART_PL010_CR, (UART_PL010_CR_UARTEN));
+   /* Finally, enable the UART */
+   writel((UART_PL010_CR_UARTEN), port[CONSOLE_PORT] + UART_PL010_CR);
 
return 0;
 }
@@ -118,38 +106,31 @@ int serial_init (void)
unsigned int remainder;
unsigned int fraction;
 
-   /*
-** First, disable everything.
-*/
-   IO_WRITE (port[CONSOLE_PORT] + UART_PL011_CR, 0x0);
+   /* First, disable everything */
+   writel(0x0, port[CONSOLE_PORT] + UART_PL011_CR);
 
/*
-** Set baud rate
-**
-** IBRD = UART_CLK / (16 * BAUD_RATE)
-** FBRD = ROUND((64 * MOD(UART_CLK,(16 * BAUD_RATE))) / (16 * 
BAUD_RATE))
+* Set baud rate
+*
+* IBRD = UART_CLK / (16 * BAUD_RATE)
+* FBRD = RND((64 * MOD(UART_CLK,(16 * BAUD_RATE))) / (16 * BAUD_RATE))
 */
-   temp = 16 * baudRate;
+   temp = 16 * baudrate;
divider = CONFIG_PL011_CLOCK / temp;
remainder = CONFIG_PL011_CLOCK % temp;
-   temp = (8 * remainder) / baudRate;
+   temp = (8 * remainder) / baudrate;
fraction = (temp >> 1) + (temp & 1);
 
-   IO_WRITE (port[CONSOLE_PORT] + UART_PL011_IBRD, divider);
-   IO_WRITE (port[CONSOLE_PORT] + UART_PL011_FBRD, fraction);
+   writel(divider, port[CONSOLE_PORT] + UART_PL011_IBRD);
+   writel(fraction, port[CONSOLE_PORT] + UART_PL011_FBRD);
 
-   /*
-** Set the UART to be 8 bits, 1 stop bit, no parity, fifo enabled.
-*/
-   IO_WRITE (port[CONSOLE_PORT] + UART_PL011_LCRH,
- (UART_PL011_LCRH_WLEN_8 | UART_PL011_LCRH_FEN));
+   /* Set the UART to be 8 bits, 1 stop bit, no parity, fifo enabled */
+   writel((UART_PL011_LCRH_WLEN_8 | UART_PL011_LCRH_FEN),
+   port[CONSOLE_PORT] + UART_PL011_LCRH);
 
-   /*
-** Finally, enable the UART
-*/
-   IO_WRITE (port[CONSOLE_PORT] + UART_PL011_CR,
- (UART_PL011_CR_UARTEN | UART_PL011_CR_TXE |
-  UART_PL011_CR_RXE));
+

[U-Boot] [PATCH NEXT V4 1/2] ARMV7: Versatile Express Coretile CortexA9x4 support

2010-09-13 Thread matt . waddel
From: Matt Waddel 

Adds support for the ARM quad-core Cortex-A9 processor.  This system
includes a motherboard(Versatile Express), daughterboard(Coretile),
and SOC(Cortex-A9 quad core).  The serial port, ethernet, and flash
systems work with these additions.  The naming convention is:
  SOC -> CortexA9 quad core = ca9x4
  daughterboard -> Coretile = ct
  motherboard -> Versatile Express = vxp
This gives ca9x4_ct_vxp.c as the board support file.

Signed-off-by: Matt Waddel 
---
 MAINTAINERS|4 +
 MAKEALL|1 +
 arch/arm/include/asm/arch-armv7/sysctrl.h  |   70 +
 arch/arm/include/asm/arch-armv7/systimer.h |   50 ++
 arch/arm/include/asm/arch-armv7/wdt.h  |   55 +++
 board/armltd/vexpress/Makefile |   49 ++
 board/armltd/vexpress/ca9x4_ct_vxp.c   |  224 
 board/armltd/vexpress/config.mk|   23 +++
 board/armltd/vexpress/u-boot.lds   |   65 
 boards.cfg |1 +
 include/configs/ca9x4_ct_vxp.h |  178 ++
 11 files changed, 720 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-armv7/sysctrl.h
 create mode 100644 arch/arm/include/asm/arch-armv7/systimer.h
 create mode 100644 arch/arm/include/asm/arch-armv7/wdt.h
 create mode 100644 board/armltd/vexpress/Makefile
 create mode 100644 board/armltd/vexpress/ca9x4_ct_vxp.c
 create mode 100644 board/armltd/vexpress/config.mk
 create mode 100644 board/armltd/vexpress/u-boot.lds
 create mode 100644 include/configs/ca9x4_ct_vxp.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 0c6ce2b..e325dde 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -797,6 +797,10 @@ Hugo Villeneuve 
 
SFFSDR  ARM926EJS
 
+Matt Waddel 
+
+   ca9x4_ct_vxpARM ARMV7 (Quad Core)
+
 Prafulla Wadaskar 
 
mv88f6281gtw_ge ARM926EJS (Kirkwood SoC)
diff --git a/MAKEALL b/MAKEALL
index 761038e..91c67c1 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -489,6 +489,7 @@ LIST_ARM11="\
 #
 LIST_ARMV7="   \
am3517_evm  \
+   ca9x4_ct_vxp\
devkit8000  \
mx51evk \
omap3_beagle\
diff --git a/arch/arm/include/asm/arch-armv7/sysctrl.h 
b/arch/arm/include/asm/arch-armv7/sysctrl.h
new file mode 100644
index 000..4e45167
--- /dev/null
+++ b/arch/arm/include/asm/arch-armv7/sysctrl.h
@@ -0,0 +1,70 @@
+/*
+ * (C) Copyright 2010 Linaro
+ * Matt Waddel, 
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+#ifndef _SYSCTRL_H_
+#define _SYSCTRL_H_
+
+/* System controller (SP810) register definitions */
+#define SP810_TIMER0_ENSEL (1 << 15)
+#define SP810_TIMER1_ENSEL (1 << 17)
+#define SP810_TIMER2_ENSEL (1 << 19)
+#define SP810_TIMER3_ENSEL (1 << 21)
+
+struct sysctrl {
+   u32 scctrl; /* 0x000 */
+   u32 scsysstat;
+   u32 scimctrl;
+   u32 scimstat;
+   u32 scxtalctrl;
+   u32 scpllctrl;
+   u32 scpllfctrl;
+   u32 scperctrl0;
+   u32 scperctrl1;
+   u32 scperen;
+   u32 scperdis;
+   u32 scperclken;
+   u32 scperstat;
+   u32 res1[0x006];
+   u32 scflashctrl;/* 0x04c */
+   u32 res2[0x3a4];
+   u32 scsysid0;   /* 0xee0 */
+   u32 scsysid1;
+   u32 scsysid2;
+   u32 scsysid3;
+   u32 scitcr;
+   u32 scitir0;
+   u32 scitir1;
+   u32 scitor;
+   u32 sccntctrl;
+   u32 sccntdata;
+   u32 sccntstep;
+   u32 res3[0x32];
+   u32 scperiphid0;/* 0xfe0 */
+   u32 scperiphid1;
+   u32 scperiphid2;
+   u32 scperiphid3;
+   u32 scpcellid0;
+   u32 scpcellid1;
+   u32 scpcellid2;
+   u32 scpcellid3;
+};
+#endif /* _SYSCTRL_H_ */
diff --git a/arch/arm/include/asm/arch-armv7/systimer.h 
b/arch/arm/include/asm/arch-armv7/systimer.h
new file mode 100644
index 000..e745e37
--- /dev/null
+++ b/arch/arm/include/asm/arch-armv7/systimer.h
@@ -0,0 +1,50 @@
+/*
+ * (C) Copyrigh

[U-Boot] [PATCH NEXT V4 0/2] ARMV7: Add support for the Versatile Express Quad Cortex A9 platform

2010-09-13 Thread matt . waddel
From: Matt Waddel 

Adds support for the ARM quad-core Cortex-A9 processor.
This system includes a motherboard(Versatile Express),
daughterboard(Coretile), and an SOC(Cortex-A9 quad core).
The serial port, ethernet, and flash systems work with
these additions.

The 2nd patch fixes a bug in the "set baudrate xxx" functionality.

---

Version 2 - Removed unneeded multi-core low_level setup code.

Version 3 - 
 Patch 1)
  1) Fixups from Wolfgang's code review:
- Remove CamelCase variable definitions, keep lists sorted, tab indents 
  only, remove trailing empty lines, remove unneeded configuration options,
  use I/O accessors, added while(1) loop in reset command
  2) Simplified board_init declarations
  3) Added CONFIG_INITRD_TAG declaration
  4) Removed unneeded assembly directives from Makefile
 Patch 2)
  1) Replaced IO_WRITE and IO_READ calls in serial_pl01x.c with calls to 
 readl() and writel(). Fixed commenting and CamelCase problems.

Version 4 -
  1) Refactored to work with the "next" branch
  2) Fixed a bug in the 2nd flash bank definition

Matt Waddel (2):
  ARMV7: Versatile Express Coretile CortexA9x4 support
  ARMV7: Fixed baudrate setting in pl01x driver

 MAINTAINERS|4 +
 MAKEALL|1 +
 arch/arm/include/asm/arch-armv7/sysctrl.h  |   70 +
 arch/arm/include/asm/arch-armv7/systimer.h |   50 ++
 arch/arm/include/asm/arch-armv7/wdt.h  |   55 +++
 board/armltd/vexpress/Makefile |   49 ++
 board/armltd/vexpress/ca9x4_ct_vxp.c   |  224 
 board/armltd/vexpress/config.mk|   23 +++
 board/armltd/vexpress/u-boot.lds   |   65 
 boards.cfg |1 +
 drivers/serial/serial_pl01x.c  |   93 +---
 include/configs/ca9x4_ct_vxp.h |  178 ++
 12 files changed, 758 insertions(+), 55 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-armv7/sysctrl.h
 create mode 100644 arch/arm/include/asm/arch-armv7/systimer.h
 create mode 100644 arch/arm/include/asm/arch-armv7/wdt.h
 create mode 100644 board/armltd/vexpress/Makefile
 create mode 100644 board/armltd/vexpress/ca9x4_ct_vxp.c
 create mode 100644 board/armltd/vexpress/config.mk
 create mode 100644 board/armltd/vexpress/u-boot.lds
 create mode 100644 include/configs/ca9x4_ct_vxp.h

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


[U-Boot] [PATCH V3 2/2] ARMV7: Fixed baudrate setting in pl01x driver

2010-09-06 Thread matt . waddel
From: Matt Waddel 

The pl01x serial driver was lacking the code to switch baudrates from the
command line.  Fixed by simply saving the new baudrate and calling
serial_init() again.  Also fixed CamelCase variables, I/O accessors and
comment style.

Signed-off-by: Matt Waddel 
---
 drivers/serial/serial_pl01x.c |   93 +
 1 files changed, 38 insertions(+), 55 deletions(-)

diff --git a/drivers/serial/serial_pl01x.c b/drivers/serial/serial_pl01x.c
index c645cef..c0ae947 100644
--- a/drivers/serial/serial_pl01x.c
+++ b/drivers/serial/serial_pl01x.c
@@ -29,25 +29,23 @@
 
 #include 
 #include 
-
+#include 
 #include "serial_pl01x.h"
 
-#define IO_WRITE(addr, val) (*(volatile unsigned int *)(addr) = (val))
-#define IO_READ(addr) (*(volatile unsigned int *)(addr))
-
 /*
  * Integrator AP has two UARTs, we use the first one, at 38400-8-N-1
  * Integrator CP has two UARTs, use the first one, at 38400-8-N-1
  * Versatile PB has four UARTs.
  */
 #define CONSOLE_PORT CONFIG_CONS_INDEX
-#define baudRate CONFIG_BAUDRATE
 static volatile unsigned char *const port[] = CONFIG_PL01x_PORTS;
 #define NUM_PORTS (sizeof(port)/sizeof(port[0]))
 
 static void pl01x_putc (int portnum, char c);
 static int pl01x_getc (int portnum);
 static int pl01x_tstc (int portnum);
+unsigned int baudrate = CONFIG_BAUDRATE;
+DECLARE_GLOBAL_DATA_PTR;
 
 #ifdef CONFIG_PL010_SERIAL
 
@@ -55,16 +53,11 @@ int serial_init (void)
 {
unsigned int divisor;
 
-   /*
-** First, disable everything.
-*/
-   IO_WRITE (port[CONSOLE_PORT] + UART_PL010_CR, 0x0);
+   /* First, disable everything */
+   writel(0x0, port[CONSOLE_PORT] + UART_PL010_CR);
 
-   /*
-** Set baud rate
-**
-*/
-   switch (baudRate) {
+   /* Set baud rate */
+   switch (baudrate) {
case 9600:
divisor = UART_PL010_BAUD_9600;
break;
@@ -89,20 +82,15 @@ int serial_init (void)
divisor = UART_PL010_BAUD_38400;
}
 
-   IO_WRITE (port[CONSOLE_PORT] + UART_PL010_LCRM,
- ((divisor & 0xf00) >> 8));
-   IO_WRITE (port[CONSOLE_PORT] + UART_PL010_LCRL, (divisor & 0xff));
+   writel(((divisor & 0xf00) >> 8), port[CONSOLE_PORT] + UART_PL010_LCRM);
+   writel((divisor & 0xff), port[CONSOLE_PORT] + UART_PL010_LCRL);
 
-   /*
-** Set the UART to be 8 bits, 1 stop bit, no parity, fifo enabled.
-*/
-   IO_WRITE (port[CONSOLE_PORT] + UART_PL010_LCRH,
- (UART_PL010_LCRH_WLEN_8 | UART_PL010_LCRH_FEN));
+   /* Set the UART to be 8 bits, 1 stop bit, no parity, fifo enabled */
+   writel((UART_PL010_LCRH_WLEN_8 | UART_PL010_LCRH_FEN),
+   port[CONSOLE_PORT] + UART_PL010_LCRH);
 
-   /*
-** Finally, enable the UART
-*/
-   IO_WRITE (port[CONSOLE_PORT] + UART_PL010_CR, (UART_PL010_CR_UARTEN));
+   /* Finally, enable the UART */
+   writel((UART_PL010_CR_UARTEN), port[CONSOLE_PORT] + UART_PL010_CR);
 
return 0;
 }
@@ -118,38 +106,31 @@ int serial_init (void)
unsigned int remainder;
unsigned int fraction;
 
-   /*
-** First, disable everything.
-*/
-   IO_WRITE (port[CONSOLE_PORT] + UART_PL011_CR, 0x0);
+   /* First, disable everything */
+   writel(0x0, port[CONSOLE_PORT] + UART_PL011_CR);
 
/*
-** Set baud rate
-**
-** IBRD = UART_CLK / (16 * BAUD_RATE)
-** FBRD = ROUND((64 * MOD(UART_CLK,(16 * BAUD_RATE))) / (16 * 
BAUD_RATE))
+* Set baud rate
+*
+* IBRD = UART_CLK / (16 * BAUD_RATE)
+* FBRD = RND((64 * MOD(UART_CLK,(16 * BAUD_RATE))) / (16 * BAUD_RATE))
 */
-   temp = 16 * baudRate;
+   temp = 16 * baudrate;
divider = CONFIG_PL011_CLOCK / temp;
remainder = CONFIG_PL011_CLOCK % temp;
-   temp = (8 * remainder) / baudRate;
+   temp = (8 * remainder) / baudrate;
fraction = (temp >> 1) + (temp & 1);
 
-   IO_WRITE (port[CONSOLE_PORT] + UART_PL011_IBRD, divider);
-   IO_WRITE (port[CONSOLE_PORT] + UART_PL011_FBRD, fraction);
+   writel(divider, port[CONSOLE_PORT] + UART_PL011_IBRD);
+   writel(fraction, port[CONSOLE_PORT] + UART_PL011_FBRD);
 
-   /*
-** Set the UART to be 8 bits, 1 stop bit, no parity, fifo enabled.
-*/
-   IO_WRITE (port[CONSOLE_PORT] + UART_PL011_LCRH,
- (UART_PL011_LCRH_WLEN_8 | UART_PL011_LCRH_FEN));
+   /* Set the UART to be 8 bits, 1 stop bit, no parity, fifo enabled */
+   writel((UART_PL011_LCRH_WLEN_8 | UART_PL011_LCRH_FEN),
+   port[CONSOLE_PORT] + UART_PL011_LCRH);
 
-   /*
-** Finally, enable the UART
-*/
-   IO_WRITE (port[CONSOLE_PORT] + UART_PL011_CR,
- (UART_PL011_CR_UARTEN | UART_PL011_CR_TXE |
-  UART_PL011_CR_RXE));
+

[U-Boot] [PATCH V3 1/2] ARMV7: Versatile Express Coretile CortexA9x4 support

2010-09-06 Thread matt . waddel
From: Matt Waddel 

Adds support for the ARM quad-core Cortex-A9 processor.  This system
includes a motherboard(Versatile Express), daughterboard(Coretile),
and SOC(Cortex-A9 quad core).  The serial port, ethernet, and flash
systems work with these additions.  The naming convention is:
  SOC -> CortexA9 quad core = ca9x4
  daughterboard -> Coretile = ct
  motherboard -> Versatile Express = vxp
This gives ca9x4_ct_vxp.c as the board support file.

Signed-off-by: Matt Waddel 
---
 MAINTAINERS|4 +
 MAKEALL|1 +
 arch/arm/include/asm/arch-armv7/sysctrl.h  |   70 +
 arch/arm/include/asm/arch-armv7/systimer.h |   50 +++
 arch/arm/include/asm/arch-armv7/wdt.h  |   55 +++
 board/armltd/vexpress/Makefile |   49 ++
 board/armltd/vexpress/ca9x4_ct_vxp.c   |  221 
 board/armltd/vexpress/config.mk|   24 +++
 board/armltd/vexpress/u-boot.lds   |   50 +++
 boards.cfg |1 +
 include/configs/ca9x4_ct_vxp.h |  172 +
 11 files changed, 697 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-armv7/sysctrl.h
 create mode 100644 arch/arm/include/asm/arch-armv7/systimer.h
 create mode 100644 arch/arm/include/asm/arch-armv7/wdt.h
 create mode 100644 board/armltd/vexpress/Makefile
 create mode 100644 board/armltd/vexpress/ca9x4_ct_vxp.c
 create mode 100644 board/armltd/vexpress/config.mk
 create mode 100644 board/armltd/vexpress/u-boot.lds
 create mode 100644 include/configs/ca9x4_ct_vxp.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 4b91b0f..465cf83 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -800,6 +800,10 @@ Hugo Villeneuve 
 
SFFSDR  ARM926EJS
 
+Matt Waddel 
+
+   ca9x4_ct_vxpARM ARMV7 (Quad Core)
+
 Prafulla Wadaskar 
 
mv88f6281gtw_ge ARM926EJS (Kirkwood SoC)
diff --git a/MAKEALL b/MAKEALL
index b34ae33..72d2050 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -651,6 +651,7 @@ LIST_ARM11="\
 #
 LIST_ARMV7="   \
am3517_evm  \
+   ca9x4_ct_vxp\
devkit8000  \
mx51evk \
omap3_beagle\
diff --git a/arch/arm/include/asm/arch-armv7/sysctrl.h 
b/arch/arm/include/asm/arch-armv7/sysctrl.h
new file mode 100644
index 000..a8c725c
--- /dev/null
+++ b/arch/arm/include/asm/arch-armv7/sysctrl.h
@@ -0,0 +1,70 @@
+/*
+ * (C) Copyright 2010 Linaro
+ * Matt Waddel, 
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+#ifndef _SYSCTRL_H_
+#define _SYSCTRL_H_
+
+/* System controller (SP810) register definitions */
+#define SP810_TIMER0_ENSEL (1 << 15)
+#define SP810_TIMER1_ENSEL (1 << 17)
+#define SP810_TIMER2_ENSEL (1 << 19)
+#define SP810_TIMER3_ENSEL (1 << 21)
+
+struct sysctrl {
+   u32 scctrl; /* 0x000 */
+   u32 scsysstat;
+   u32 scimctrl;
+   u32 scimstat;
+   u32 scxtalctrl;
+   u32 scpllctrl;
+   u32 scpllfctrl;
+   u32 scperctrl0;
+   u32 scperctrl1;
+   u32 scperen;
+   u32 scperdis;
+   u32 scperclken;
+   u32 scperstat;
+   u32 res1[0x006];
+   u32 scflashctrl;/* 0x04c */
+   u32 res2[0x3a4];
+   u32 scsysid0;   /* 0xee0 */
+   u32 scsysid1;
+   u32 scsysid2;
+   u32 scsysid3;
+   u32 scitcr;
+   u32 scitir0;
+   u32 scitir1;
+   u32 scitor;
+   u32 sccntctrl;
+   u32 sccntdata;
+   u32 sccntstep;
+   u32 res3[0x32];
+   u32 scperiphid0;/* 0xfe0 */
+   u32 scperiphid1;
+   u32 scperiphid2;
+   u32 scperiphid3;
+   u32 scpcellid0;
+   u32 scpcellid1;
+   u32 scpcellid2;
+   u32 scpcellid3;
+};
+#endif /* _SYSCTRL_H_ */
diff --git a/arch/arm/include/asm/arch-armv7/systimer.h 
b/arch/arm/include/asm/arch-armv7/systimer.h
new file mode 100644
index 000..55802ec
--- /dev/null
+++ b/arch/arm/include/asm/arch-armv7/systimer.h
@@ -0,0 +1,50 @@
+/*
+ * (C) Copyright 201

[U-Boot] [PATCH V3 0/2] ARMV7: Add support for the Versatile Express Quad Cortex A9 platform

2010-09-06 Thread matt . waddel
From: Matt Waddel 

Adds support for the ARM quad-core Cortex-A9 processor.
This system includes a motherboard(Versatile Express),
daughterboard(Coretile), and an SOC(Cortex-A9 quad core).
The serial port, ethernet, and flash systems work with
these additions.

The 2nd patch fixes a bug in the "set baudrate xxx" functionality.

---

Version 2 - Removed unneeded multi-core low_level setup code.

Version 3 - 
 Patch 1)
  1) Fixups from Wolfgang's code review:
- Remove CamelCase variable definitions, keep lists sorted, tab indents 
  only, remove trailing empty lines, remove unneeded configuration options,
  use I/O accessors, added while(1) loop in reset command
  2) Simplified board_init declarations
  3) Added CONFIG_INITRD_TAG declaration
  4) Removed unneeded assembly directives from Makefile
 Patch 2)
  1) Replaced IO_WRITE and IO_READ calls in serial_pl01x.c with calls to 
 readl() and writel(). Fixed commenting and CamelCase problems.

Matt Waddel (2):
  ARMV7: Versatile Express Coretile CortexA9x4 support
  ARMV7: Fixed baudrate setting in pl01x driver

 MAINTAINERS|4 +
 MAKEALL|1 +
 arch/arm/include/asm/arch-armv7/sysctrl.h  |   70 +
 arch/arm/include/asm/arch-armv7/systimer.h |   50 +++
 arch/arm/include/asm/arch-armv7/wdt.h  |   55 +++
 board/armltd/vexpress/Makefile |   49 ++
 board/armltd/vexpress/ca9x4_ct_vxp.c   |  221 
 board/armltd/vexpress/config.mk|   24 +++
 board/armltd/vexpress/u-boot.lds   |   50 +++
 boards.cfg |1 +
 drivers/serial/serial_pl01x.c  |   93 +---
 include/configs/ca9x4_ct_vxp.h |  172 +
 12 files changed, 735 insertions(+), 55 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-armv7/sysctrl.h
 create mode 100644 arch/arm/include/asm/arch-armv7/systimer.h
 create mode 100644 arch/arm/include/asm/arch-armv7/wdt.h
 create mode 100644 board/armltd/vexpress/Makefile
 create mode 100644 board/armltd/vexpress/ca9x4_ct_vxp.c
 create mode 100644 board/armltd/vexpress/config.mk
 create mode 100644 board/armltd/vexpress/u-boot.lds
 create mode 100644 include/configs/ca9x4_ct_vxp.h

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


[U-Boot] [PATCH V2 0/2] ARMV7: Add support for Versatile Express CortexA9x4

2010-07-28 Thread matt . waddel
From: Matt Waddel 

Adds support for the ARM quad-core Cortex-A9 processor.
This system includes a motherboard(Versatile Express),
daughterboard(Coretile), and an SOC(Cortex-A9 quad core).
The serial port, ethernet, and flash systems work with
these additions.

The 2nd patch fixes a bug in the "set baudrate xxx" functionality.

Version 2 - Removed unneeded multi-core low_level setup code.

Matt Waddel (2):
  ARMV7: Versatile Express Coretile CortexA9x4 support
  ARMV7: Fixed baudrate setting in pl01x driver

 MAINTAINERS|4 +
 MAKEALL|1 +
 arch/arm/include/asm/arch-armv7/sysctrl.h  |   68 
 arch/arm/include/asm/arch-armv7/systimer.h |   50 ++
 arch/arm/include/asm/arch-armv7/wdt.h  |   55 +++
 board/armltd/vexpress/Makefile |   50 ++
 board/armltd/vexpress/ca9x4_ct_vxp.c   |  231 
 board/armltd/vexpress/config.mk|   26 +++
 board/armltd/vexpress/u-boot.lds   |   50 ++
 boards.cfg |1 +
 drivers/serial/serial_pl01x.c  |5 +-
 include/configs/ca9x4_ct_vxp.h |  181 ++
 12 files changed, 721 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-armv7/sysctrl.h
 create mode 100644 arch/arm/include/asm/arch-armv7/systimer.h
 create mode 100644 arch/arm/include/asm/arch-armv7/wdt.h
 create mode 100644 board/armltd/vexpress/Makefile
 create mode 100644 board/armltd/vexpress/ca9x4_ct_vxp.c
 create mode 100644 board/armltd/vexpress/config.mk
 create mode 100644 board/armltd/vexpress/u-boot.lds
 create mode 100644 include/configs/ca9x4_ct_vxp.h

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


[U-Boot] [PATCH V2 2/2] ARMV7: Fixed baudrate setting in pl01x driver

2010-07-28 Thread matt . waddel
From: Matt Waddel 

The pl01x serial driver was lacking the code to switch baudrates from the
command line.  Fixed by simply saving the new baudrate and calling
serial_init() again.

Signed-off-by: Matt Waddel 
---
 drivers/serial/serial_pl01x.c |5 -
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/serial/serial_pl01x.c b/drivers/serial/serial_pl01x.c
index c645cef..5cd5b9c 100644
--- a/drivers/serial/serial_pl01x.c
+++ b/drivers/serial/serial_pl01x.c
@@ -41,13 +41,14 @@
  * Versatile PB has four UARTs.
  */
 #define CONSOLE_PORT CONFIG_CONS_INDEX
-#define baudRate CONFIG_BAUDRATE
 static volatile unsigned char *const port[] = CONFIG_PL01x_PORTS;
 #define NUM_PORTS (sizeof(port)/sizeof(port[0]))
 
 static void pl01x_putc (int portnum, char c);
 static int pl01x_getc (int portnum);
 static int pl01x_tstc (int portnum);
+unsigned int baudRate = CONFIG_BAUDRATE;
+DECLARE_GLOBAL_DATA_PTR;
 
 #ifdef CONFIG_PL010_SERIAL
 
@@ -183,6 +184,8 @@ int serial_tstc (void)
 
 void serial_setbrg (void)
 {
+   baudRate = gd->baudrate;
+   serial_init();
 }
 
 static void pl01x_putc (int portnum, char c)
-- 
1.7.0.4

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


[U-Boot] [PATCH V2 1/2] ARMV7: Versatile Express Coretile CortexA9x4 support

2010-07-28 Thread matt . waddel
From: Matt Waddel 

Adds support for the ARM quad-core Cortex-A9 processor.  This system
includes a motherboard(Versatile Express), daughterboard(Coretile),
and SOC(Cortex-A9 quad core).  The serial port, ethernet, and flash
systems work with these additions.  The naming convention is:
  SOC -> CortexA9 quad core = ca9x4
  daughterboard -> Coretile = ct
  motherboard -> Versatile Express = vxp
This gives ca9x4_ct_vxp.c as the board support file.

Signed-off-by: Matt Waddel 
---
 MAINTAINERS|4 +
 MAKEALL|1 +
 arch/arm/include/asm/arch-armv7/sysctrl.h  |   68 
 arch/arm/include/asm/arch-armv7/systimer.h |   50 ++
 arch/arm/include/asm/arch-armv7/wdt.h  |   55 +++
 board/armltd/vexpress/Makefile |   50 ++
 board/armltd/vexpress/ca9x4_ct_vxp.c   |  231 
 board/armltd/vexpress/config.mk|   26 +++
 board/armltd/vexpress/u-boot.lds   |   50 ++
 boards.cfg |1 +
 include/configs/ca9x4_ct_vxp.h |  181 ++
 11 files changed, 717 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-armv7/sysctrl.h
 create mode 100644 arch/arm/include/asm/arch-armv7/systimer.h
 create mode 100644 arch/arm/include/asm/arch-armv7/wdt.h
 create mode 100644 board/armltd/vexpress/Makefile
 create mode 100644 board/armltd/vexpress/ca9x4_ct_vxp.c
 create mode 100644 board/armltd/vexpress/config.mk
 create mode 100644 board/armltd/vexpress/u-boot.lds
 create mode 100644 include/configs/ca9x4_ct_vxp.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 4b91b0f..31ff42f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -800,6 +800,10 @@ Hugo Villeneuve 
 
SFFSDR  ARM926EJS
 
+Matt Waddel 
+
+   vexpressARM ARMV7 (quad core)
+
 Prafulla Wadaskar 
 
mv88f6281gtw_ge ARM926EJS (Kirkwood SoC)
diff --git a/MAKEALL b/MAKEALL
index 2133559..88b1843 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -663,6 +663,7 @@ LIST_ARMV7="\
omap4_sdp4430   \
s5p_goni\
smdkc100\
+   ca9x4_ct_vxp\
 "
 
 #
diff --git a/arch/arm/include/asm/arch-armv7/sysctrl.h 
b/arch/arm/include/asm/arch-armv7/sysctrl.h
new file mode 100644
index 000..50cf661
--- /dev/null
+++ b/arch/arm/include/asm/arch-armv7/sysctrl.h
@@ -0,0 +1,68 @@
+/*
+ * (C) Copyright 2010 Linaro
+ * Matt Waddel, 
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+#ifndef _SYSCTRL_H_
+#define _SYSCTRL_H_
+
+/* System controller (SP810) register definitions */
+#define SP810_TIMER0_EnSel (1 << 15)
+#define SP810_TIMER1_EnSel (1 << 17)
+#define SP810_TIMER2_EnSel (1 << 19)
+#define SP810_TIMER3_EnSel (1 << 21)
+
+struct sysctrl {
+   u32 scctrl; /* 0x000 */
+   u32 scsysstat;
+   u32 scimctrl;
+   u32 scimstat;
+   u32 scxtalctrl;
+   u32 scpllctrl;
+   u32 scpllfctrl;
+   u32 scperctrl0;
+   u32 scperctrl1;
+   u32 scperen;
+   u32 scperdis;
+   u32 scperclken;
+   u32 scperstat;
+   u32 res1[0x3ac];
+   u32 scsysid0;   /* 0xee0 */
+   u32 scsysid1;
+   u32 scsysid2;
+   u32 scsysid3;
+   u32 scitcr;
+   u32 scitir0;
+   u32 scitir1;
+   u32 scitor;
+   u32 sccntctrl;
+   u32 sccntdata;
+   u32 sccntstep;
+   u32 res2[0x32];
+   u32 scperiphid0;/* 0xfe0 */
+   u32 scperiphid1;
+   u32 scperiphid2;
+   u32 scperiphid3;
+   u32 scpcellid0;
+   u32 scpcellid1;
+   u32 scpcellid2;
+   u32 scpcellid3;
+};
+#endif /* _SYSCTRL_H_ */
diff --git a/arch/arm/include/asm/arch-armv7/systimer.h 
b/arch/arm/include/asm/arch-armv7/systimer.h
new file mode 100644
index 000..085e2d8
--- /dev/null
+++ b/arch/arm/include/asm/arch-armv7/systimer.h
@@ -0,0 +1,50 @@
+/*
+ * (C) Copyright 2010 Linaro
+ * Matt Waddel, 
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is fr

[U-Boot] [PATCH 2/2] ARMV7: Fix baudrate change capabilities

2010-07-27 Thread Matt Waddel
The pl01x serial driver was lacking the code to switch baudrates
from the command line.  Fixed by simply saving the new baudrate
and calling serial_init() again.

Signed-off-by: Matt Waddel 

diff --git a/drivers/serial/serial_pl01x.c b/drivers/serial/serial_pl01x.c
index c645cef..5cd5b9c 100644
--- a/drivers/serial/serial_pl01x.c
+++ b/drivers/serial/serial_pl01x.c
@@ -41,13 +41,14 @@
  * Versatile PB has four UARTs.
  */
 #define CONSOLE_PORT CONFIG_CONS_INDEX
-#define baudRate CONFIG_BAUDRATE
 static volatile unsigned char *const port[] = CONFIG_PL01x_PORTS;
 #define NUM_PORTS (sizeof(port)/sizeof(port[0]))
 
 static void pl01x_putc (int portnum, char c);
 static int pl01x_getc (int portnum);
 static int pl01x_tstc (int portnum);
+unsigned int baudRate = CONFIG_BAUDRATE;
+DECLARE_GLOBAL_DATA_PTR;
 
 #ifdef CONFIG_PL010_SERIAL
 
@@ -183,6 +184,8 @@ int serial_tstc (void)
 
 void serial_setbrg (void)
 {
+	baudRate = gd->baudrate;
+	serial_init();
 }
 
 static void pl01x_putc (int portnum, char c)
-- 
1.7.0.4

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


[U-Boot] [PATCH 0/2] ARMV7: Add support for the Versatile Express Quad Cortex A9 platform

2010-07-27 Thread Matt Waddel
Adds support for the ARM quad-core Cortex-A9 processor.
This system includes a motherboard(Versatile Express),
daughterboard(Coretile), and an SOC(Cortex-A9 quad core).
The serial port, ethernet, and flash systems work with
these additions.

Fixes a bug in the "set baudrate xxx" functionality.

Matt Waddel (2):
  ARMV7: Versatile Express Coretile quad-core Cortex-A9 support
  ARMV7: Fix baudrate change capabilities

 MAINTAINERS|4 +
 MAKEALL|1 +
 arch/arm/cpu/armv7/ca9x4/Makefile  |   45 ++
 arch/arm/cpu/armv7/ca9x4/lowlevel_init.S   |   50 +++
 arch/arm/cpu/armv7/config.mk   |4 +
 arch/arm/include/asm/arch-ca9x4/sysctrl.h  |   68 +
 arch/arm/include/asm/arch-ca9x4/systimer.h |   50 +++
 arch/arm/include/asm/arch-ca9x4/wdt.h  |   55 +++
 board/armltd/vexpress/Makefile |   50 +++
 board/armltd/vexpress/ca9x4_ct_vxp.c   |  220 
 board/armltd/vexpress/config.mk|   26 
 board/armltd/vexpress/u-boot.lds   |   50 +++
 boards.cfg |1 +
 drivers/serial/serial_pl01x.c  |5 +-
 include/configs/ca9x4_ct_vxp.h |  186 +++
 15 files changed, 814 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/cpu/armv7/ca9x4/Makefile
 create mode 100644 arch/arm/cpu/armv7/ca9x4/lowlevel_init.S
 create mode 100644 arch/arm/include/asm/arch-ca9x4/sysctrl.h
 create mode 100644 arch/arm/include/asm/arch-ca9x4/systimer.h
 create mode 100644 arch/arm/include/asm/arch-ca9x4/wdt.h
 create mode 100644 board/armltd/vexpress/Makefile
 create mode 100644 board/armltd/vexpress/ca9x4_ct_vxp.c
 create mode 100644 board/armltd/vexpress/config.mk
 create mode 100644 board/armltd/vexpress/u-boot.lds
 create mode 100644 include/configs/ca9x4_ct_vxp.h

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


[U-Boot] [PATCH 1/2] ARMV7: Versatile Express Coretile quad-core Cortex-A9 support

2010-07-27 Thread Matt Waddel
Adds support for the ARM quad-core Cortex-A9 processor.
This system includes a motherboard(Versatile Express),
daughterboard(Coretile), and SOC(Cortex-A9 quad core).
The serial port, ethernet, and flash systems work with
these additions.  The naming convention is:

  SOC -> CortexA9 quad core = ca9x4
  daughterboard -> Coretile = ct
  motherboard -> Versatile Express = vxp

So ca9x4_ct_vxp.c is the board support file.

Signed-off-by: Matt Waddel 

 create mode 100644 arch/arm/cpu/armv7/ca9x4/Makefile
 create mode 100644 arch/arm/cpu/armv7/ca9x4/lowlevel_init.S
 create mode 100644 arch/arm/include/asm/arch-ca9x4/sysctrl.h
 create mode 100644 arch/arm/include/asm/arch-ca9x4/systimer.h
 create mode 100644 arch/arm/include/asm/arch-ca9x4/wdt.h
 create mode 100644 board/armltd/vexpress/Makefile
 create mode 100644 board/armltd/vexpress/ca9x4_ct_vxp.c
 create mode 100644 board/armltd/vexpress/config.mk
 create mode 100644 board/armltd/vexpress/u-boot.lds
 create mode 100644 include/configs/ca9x4_ct_vxp.h

diff --git a/MAINTAINERS b/MAINTAINERS
index a5db970..20bb2ad 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -803,6 +803,10 @@ Hugo Villeneuve 
 
 	SFFSDR		ARM926EJS
 
+Matt Waddel 
+
+	vexpress	ARM ARMV7 (quad core)
+
 Prafulla Wadaskar 
 
 	mv88f6281gtw_ge	ARM926EJS (Kirkwood SoC)
diff --git a/MAKEALL b/MAKEALL
index 5413f6d..6e5f6fd 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -658,6 +658,7 @@ LIST_ARMV7="		\
 	omap4_sdp4430		\
 	s5p_goni		\
 	smdkc100		\
+	ca9x4_ct_vxp		\
 "
 
 #
diff --git a/arch/arm/cpu/armv7/ca9x4/Makefile b/arch/arm/cpu/armv7/ca9x4/Makefile
new file mode 100644
index 000..71cdfcf
--- /dev/null
+++ b/arch/arm/cpu/armv7/ca9x4/Makefile
@@ -0,0 +1,45 @@
+#
+# (C) Copyright 2000-2003
+# 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
+
+SOBJS	+= lowlevel_init.o
+
+SRCS:= $(SOBJS:.o=.S)
+OBJS:= $(SOBJS)
+
+all:	$(obj) .depend $(LIB)
+
+$(LIB):	$(OBJS)
+	$(AR) $(ARFLAGS) $@ $(OBJS)
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/arch/arm/cpu/armv7/ca9x4/lowlevel_init.S b/arch/arm/cpu/armv7/ca9x4/lowlevel_init.S
new file mode 100644
index 000..a781b6f
--- /dev/null
+++ b/arch/arm/cpu/armv7/ca9x4/lowlevel_init.S
@@ -0,0 +1,50 @@
+/*
+ * Board specific setup info
+ *
+ * (C) Copyright 2003, ARM Ltd.
+ * Philippe Robin, 
+ *
+ * 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 
+
+.globl lowlevel_init
+lowlevel_init:
+
+	@Start all SMP cores, except core 0 to WFI or WFE
+	mrc	p15, 0, r0, c0, c0, 5
+	ands	r0, r0, #0x03
+	beq	done
+
+	cpsid	aif
+	ldr	r0, =0x1030		@1030 = system wide flags register
+
+loop_here:
+	wfe
+	ldr	r1, [r0]
+	cmp	r1, #0
+	beq	loop_here
+	bx	r1
+	b	loop_here
+	bne	loop_here
+
+done:
+	mov pc, lr
diff --git a/arch/arm/cpu/armv7/config.mk b/arch/arm/cpu/armv7/config.mk
index 49ac9c7..7b9b633 100644
--- a/arch/arm/cpu/armv7/config.mk
+++ b/arch/arm/cpu/armv7/config.mk
@@ -22,8 +22,12 @@
 #
 PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float
 
+ifdef CONFIG_VEXPRESS
+PLATFORM_CPPFLAGS += -march=armv7-a
+else
 # Make ARMv5 to allow more compilers t

Re: [U-Boot] [PATCH] TI: DaVinci DM365: Enabling net support on DM365

2009-09-14 Thread Matt Waddel
Hi Sandeep,

Is there another part to this patch still coming or did I miss a patch 
along the way?  This patch as-is doesn't compile:
...
dm365evm.c: In function ‘board_eth_init’:   
dm365evm.c:47: error: ‘GIO_DIR01’ undeclared (first use in this function)   
dm365evm.c:47: error: (Each undeclared identifier is reported only once 
dm365evm.c:47: error: for each function it appears in.) 
dm365evm.c:52: error: ‘GIO_OUT_DATA01’ undeclared (first use in this function)

Best regards,
Matt

On Monday 14 September 2009 01:16:38 pm s-paul...@ti.com wrote:
> From: Sandeep Paulraj 
> 
> This patch enables EMAC on the DM365 EVM.
> 
> Signed-off-by: Sandeep Paulraj 
> ---
>  board/davinci/dm365evm/dm365evm.c |   38 
> +
>  1 files changed, 38 insertions(+), 0 deletions(-)
> 
> diff --git a/board/davinci/dm365evm/dm365evm.c 
> b/board/davinci/dm365evm/dm365evm.c
> index 99392b3..2092324 100644
> --- a/board/davinci/dm365evm/dm365evm.c
> +++ b/board/davinci/dm365evm/dm365evm.c
> @@ -17,9 +17,11 @@
>  
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> +#include 
>  #include "../common/misc.h"
>  
>  DECLARE_GLOBAL_DATA_PTR;
> @@ -32,6 +34,42 @@ int board_init(void)
>   return 0;
>  }
>  
> +#ifdef CONFIG_DRIVER_TI_EMAC
> +int board_eth_init(bd_t *bis)
> +{
> + uint8_t eeprom_enetaddr[6];
> + int i;
> +
> + /* Configure PINMUX 3 to enable EMAC pins */
> + writel((readl(PINMUX3) | 0x1a), PINMUX3);
> +
> + /* Configure GPIO20 as output */
> + writel((readl(GIO_DIR01) & 0xffef), GIO_DIR01);
> +
> + /* Toggle GPIO 20 */
> + for (i = 0; i < 20; i++) {
> + /* GPIO 20 low */
> + writel((readl(GIO_OUT_DATA01) & 0xffef), GIO_OUT_DATA01);
> +
> + udelay(1000);
> +
> + /* GPIO 20 high */
> + writel((readl(GIO_OUT_DATA01) | 0x0010), GIO_OUT_DATA01);
> + }
> +
> + /* Configure I2C pins so that EEPROM can be read */
> + writel((readl(PINMUX3) | 0x0140), PINMUX3);
> +
> + /* Read Ethernet MAC address from EEPROM */
> + if (dvevm_read_mac_address(eeprom_enetaddr))
> + dv_configure_mac_address(eeprom_enetaddr);
> +
> + davinci_emac_initialize();
> +
> + return 0;
> +}
> +#endif
> +
>  #ifdef CONFIG_NAND_DAVINCI
>  static void nand_dm365evm_select_chip(struct mtd_info *mtd, int chip)
>  {
> -- 
> 1.6.0.4
> 
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
> 

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


Re: [U-Boot] [PATCH 2/2] MTD:NAND: ADD new ECC mode NAND_ECC_HW_OOB_FIRST

2009-09-01 Thread Matt Waddel
Hi Scott and Sandeep,

As long as we're looking at these patches again I had a question about 
patch 1 of 2 in this series.  

The following part of the patch added a definition for: 

chip->ecc.read_page = nand_read_page_hwecc_oob_first

but since there aren't any "break" statements until "case NAND_ECC_SOFT:" 
it looks like the chip->ecc.read_page definition ends up being set to:

chip->ecc.read_page = nand_read_page_swecc.

Maybe this is explains why things seem to be working???

Best regards,
Matt

+   case NAND_ECC_HW_OOB_FIRST:
+   /* Similar to NAND_ECC_HW, but a separate read_page handle */
+   if (!chip->ecc.calculate || !chip->ecc.correct ||
+!chip->ecc.hwctl) {
+   printk(KERN_WARNING "No ECC functions supplied, "
+  "Hardware ECC not possible\n");
+   BUG();
+   }
+   if (!chip->ecc.read_page)
+   chip->ecc.read_page = nand_read_page_hwecc_oob_first;
+


On Tuesday 01 September 2009 01:19:09 pm Scott Wood wrote:
> Paulraj, Sandeep wrote:
> >> John Rigby wrote:
> >>> Sorry for the late comments.  We have been trying to use this code with
> >>> the associated davinci 4-bit ecc patches and have some questions
> > We use this internally and it works. Are you having any issues because we 
> > don't see any!!
> 
> Calm down, just because it works doesn't mean nobody should ask 
> questions about the code.
> 
> >>> Here you calculate ecc then never use the result?
> >> Hmm, that looks wrong, both here and in the davinci driver.  Are the two
> >> calls to nand_davinci_4bit_readecc reading different things?  Does the
> >> calculate function have any side effects beyond producing data that is
> >> never used?
> > Have you reads the patch description. Maybe that might help a bit
> > 
> > This patch adds the new mode NAND_ECC_HW_OOB_FIRST in the nand code to
> > support 4-bit ECC on TI DaVinci devices with large page (up to 2K) NAND
> > chips.  This ECC mode is similar to NAND_ECC_HW, with the exception of
> > read_page API that first reads the OOB area, reads the data in chunks,
> > feeds the ECC from OOB area to the ECC hw engine and perform any
> > correction on the data as per the ECC status reported by the engine.
> 
> Yes, I've read that.  That doesn't explain why calculate_ecc is 
> producing data, *after* everything has been read, that is never consumed 
> by anything (hardware or software) AFAICT.  It doesn't explain why the 
> "generic" code is passing NULL to ecc.correct.
> 
> -Scott
> ___
> 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