[U-Boot] [PATCH] STx AMC8548: initial support for Silicon Turnkey Express AMC8548 board

2011-01-27 Thread Alex Dubov
AMC8548 is a RapidIO development board in AMC form factor, featuring MPC8548E
processor, DDR2 SO-DIMM slot, 16MB of hardwired NAND flash memory, real time
clock and additional serial EEPROM on i2c bus (enabled). USB controller is
available, but not presently enabled.

Additional board information is available at:
http://www.silicontkx.com/AMC8548.htm

Signed-off-by: Alex Dubov 
---
This is really a patch repost from Fall, 2009. The board is old and never was
that good, but I still got those running, so I propped up an u-boot config as
well. Nothing fancy here, just a fairly standard config.

 MAINTAINERS   |1 +
 board/stx/stxamc8548/Makefile |   53 ++
 board/stx/stxamc8548/law.c|   50 +
 board/stx/stxamc8548/stxamc8548.c |  120 
 board/stx/stxamc8548/tlb.c|   82 
 boards.cfg|1 +
 include/configs/stxamc8548.h  |  374 +
 7 files changed, 681 insertions(+), 0 deletions(-)
 create mode 100644 board/stx/stxamc8548/Makefile
 create mode 100644 board/stx/stxamc8548/law.c
 create mode 100644 board/stx/stxamc8548/stxamc8548.c
 create mode 100644 board/stx/stxamc8548/tlb.c
 create mode 100644 include/configs/stxamc8548.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 14d06ca..787db07 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -141,6 +141,7 @@ Jon Diekema 
 Alex Dubov 
 
mpq101  MPC8548
+   stxamc8548  MPC8548
 
 Dirk Eibach 
 
diff --git a/board/stx/stxamc8548/Makefile b/board/stx/stxamc8548/Makefile
new file mode 100644
index 000..58bc1b3
--- /dev/null
+++ b/board/stx/stxamc8548/Makefile
@@ -0,0 +1,53 @@
+#
+# Copyright 2007 Freescale Semiconductor, Inc.
+# (C) Copyright 2001-2006
+# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).o
+
+COBJS-y+= $(BOARD).o
+COBJS-y+= law.o
+COBJS-y+= tlb.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS-y))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(obj).depend $(OBJS) $(SOBJS)
+   $(call cmd_link_o_target, $(OBJS))
+
+clean:
+   rm -f $(OBJS) $(SOBJS)
+
+distclean: clean
+   rm -f $(LIB) core *.bak .depend
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/stx/stxamc8548/law.c b/board/stx/stxamc8548/law.c
new file mode 100644
index 000..0a435d9
--- /dev/null
+++ b/board/stx/stxamc8548/law.c
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2008 Freescale Semiconductor, Inc.
+ *
+ * (C) Copyright 2000
+ * Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include 
+#include 
+#include 
+
+/*
+ * LAW(Local Access Window) configuration:
+ *
+ * 0x_ 0x1fff_ DDR (set elsewhere) autodetect
+ * 0xc000_ 0xdfff_ RapidIO (set elsewhere) 512M
+ * 0xe000_ 0xe000_ CCSR(set elsewhere) 1M
+ * 0xf000_ 0x_ LBC options + FLASH 256M
+ *
+ * Notes:
+ *CCSRBAR and L2-as-SRAM don't need a configured Local Access Window.
+ *If flash is 8M at default position (last 8M), no LAW needed.
+ *
+ * LAW 0 i

Re: [U-Boot] [PATCH v8] mpq101: initial support for Mercury Computer Systems MPQ101 board

2011-01-27 Thread Alex Dubov
> 
> applied
> 
> - k

Thank you.
I have another board config for your consideration.



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


Re: [U-Boot] Boot count support on P1020

2011-01-27 Thread Felix Radensky
Hi Kumar,

On 01/27/2011 05:29 AM, Kumar Gala wrote:
> On Jan 26, 2011, at 4:00 PM, Wolfgang Denk wrote:
>
>> Dear Kumar Gala,
>>
>> In message  you 
>> wrote:
>>> What kinda reset do you expect to occur?  Depending on this the answer 
>>> might be that we dont have any such registers that persist across reboots.
>> external hard reset ?
> If so, there isnt any state saved across such a reset in the SoC
>
> - k

Thanks a lot for a prompt reply. Looks like a have to use board I2C EEPROM
to save state across reboots.

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


Re: [U-Boot] Build error with the master branch

2011-01-27 Thread Loïc Minier
On Thu, Jan 27, 2011, Jason Liu wrote:
> arm-none-linux-gnueabi-ld  -pie -r -o libstubs.o  stubs.o
> arm-none-linux-gnueabi-ld: -r and -shared may not be used together
> 
> I found this error is related with the following commit:
> commit 8aba9dceebb14144e07d19593111ee3a999c37fc

 I've noticed the same thing, this seems to break all ARM configs for
 me

 [ full build logs at:
 http://hudson.dooz.org/job/u-boot_master/63/ ]

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


Re: [U-Boot] [RFC][PATCH 12/36] sc520 - Sort Makefile

2011-01-27 Thread Wolfgang Denk
Dear Graeme Russ,

In message  you 
wrote:
> 
> I thought I did by moving sc520_pci between sc520 and sc520_ssi
> 
> Or should I sort based on CONFIG_ defines?

That's what I expected, but you are probably right.  Please ignore me.
You have my ACK.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
GUIs  are  virtually  useless.  Learn  tools.  They're  configurable,
scriptable, automatable, cron-able, interoperable, etc. We don't need
no brain-dead winslurping monolithic claptrap.
   -- Tom Christiansen in 371140df@csnews
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 00/14] powerpc/p4080: add support for FMan ethernet in Independent mode

2011-01-27 Thread Hu Mingkai-B21284


> -Original Message-
> From: Kumar Gala [mailto:ga...@kernel.crashing.org]
> Sent: Thursday, January 27, 2011 2:05 PM
> To: Hu Mingkai-B21284
> Cc: u-boot@lists.denx.de; Fleming Andy-AFLEMING; Zang Roy-R61911; Liu Dave-
> R63238; Medve Emilian-EMMEDVE1; Tabi Timur-B04825; Phillips Kim-R1AAHA; Haruki
> Dai-R35557; Radulescu Ruxandra Ioana-B05472
> Subject: Re: [PATCH 00/14] powerpc/p4080: add support for FMan ethernet in
> Independent mode
> 
> 
> On Jan 26, 2011, at 10:52 PM, Mingkai Hu wrote:
> 
> > This patchset add support for the P4080's datapath accelation
> > architecture in independent mode, and do some code refactor of the file 
> > tsec.c.
> >
> > 1. Add the releated MAC controller support, includeing dTSEC and 10GEC
> > 2. Add support for FMan ethernet in Independent mode 3. Add PHY
> > support (VSC8244 and VSC8234) to a new file fsl_phy.c which  can be
> > reused by other code, such tsec and uec code.
> > 4. tsec code cleanup
> > 5. Move all the PHY code in tsec.c to fsl_phy.c to make it reuseable.
> >
> > Based on the latest WD's U-Boot tree. Tested on P4080DS and MPC8536DS
> > board with SGMII card.
> >
> > [PATCH 01/14] powerpc/p4080: Add function to report which lane is used
> > for a prtcl [PATCH 02/14] powerpc/fman: add PHY support for dTSEC
> > [PATCH 03/14] powerpc/fman: add dTSEC controller support [PATCH 04/14]
> > powerpc/fman: add 10GEC controller and PHY support [PATCH 05/14]
> > powerpc/qoirq: Add support for FMan ethernet in Independent mode
> > [PATCH 06/14] powerpc/corenet_ds: Add fman support [PATCH 07/14] tsec:
> > use IO accessories to access the register [PATCH 08/14] tsec: arrange
> > the code to avoid useless function declaration [PATCH 09/14] tsec: use
> > general ethernet MII register struct(tsec_mii_t) [PATCH 10/14] tsec:
> > refactor the PHY code to make it reuseable [PATCH 11/14] PHY: add some
> > Vitesse phy support [PATCH 12/14] PHY: add some Broadcom phy support
> > [PATCH 13/14] PHY: add some Marvell phy support [PATCH 14/14] PHY: add
> > some misc phy code support
> >
> > Thanks,
> > Mingkai
> 
> I suggest we re-order these patches to first deal with tsec changes and 
> refactor
> of the phy code.  After which we should introduce fman driver code that shares
> fsl_phy.c
> 
> These patches also break some fundamental rules about patches:
> 1. some patches aren't used by anything
> 2. some patches break functionality
> 

OK, I'll reorder the patchset and take care of the above rules in the next 
version.
Thanks for your comments.

Thanks,
Mingkai

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


[U-Boot] [PATCH 13/14] PHY: add some Marvell phy support

2011-01-27 Thread Hu Mingkai-B21284
Hi Macpaul,

I totally agree with you, maybe there're some effort to get all the PHY chip's 
datasheet. :)
As you know, some datasheet is under NDA.

Thanks,
Mingkai

From: Macpaul Lin [mailto:macp...@gmail.com]
Sent: Thursday, January 27, 2011 1:44 PM
To: Hu Mingkai-B21284
Cc: u-boot@lists.denx.de; Phillips Kim-R1AAHA; Liu Dave-R63238; 
ga...@kernel.crashing.org; Medve Emilian-EMMEDVE1; Radulescu Ruxandra 
Ioana-B05472; Fleming Andy-AFLEMING; Haruki Dai-R35557; Tabi Timur-B04825; 
Wolfgang Denk
Subject: Re: [U-Boot] [PATCH 13/14] PHY: add some Marvell phy support

Hi Mingkai,
2011/1/27 Mingkai Hu mailto:mingkai...@freescale.com>>
Port from tsec.c file to add support for m88e1011s, m88es, m88e1118,
m88e1121r, m88e1145, m88e1149s.

Signed-off-by: Mingkai Hu 
mailto:mingkai...@freescale.com>>
---
 drivers/net/fsl_phy.c |  299 +
 drivers/net/fsl_phy.h |   36 ++
 2 files changed, 335 insertions(+), 0 deletions(-)

diff --git a/drivers/net/fsl_phy.c b/drivers/net/fsl_phy.c
index 7c22666..ad9d65e 100644
--- a/drivers/net/fsl_phy.c
+++ b/drivers/net/fsl_phy.c
@@ -457,6 +457,245 @@ static int bcm5482_startup(struct mii_info *mii_info)
   return 0;
 }

+/* Marvell 88E1011S */
+static int m88e1011s_config(struct mii_info *mii_info)
+{
+   /* Reset and configure the PHY */
+   tsec_phy_write(mii_info, 0, MII_BMCR, BMCR_RESET);
+
+   tsec_phy_write(mii_info, 0, 0x1d, 0x1f);
+   tsec_phy_write(mii_info, 0, 0x1e, 0x200c);
+   tsec_phy_write(mii_info, 0, 0x1d, 0x5);
+   tsec_phy_write(mii_info, 0, 0x1e, 0);
+   tsec_phy_write(mii_info, 0, 0x1e, 0x100);
+   tsec_phy_write(mii_info, 0, MII_CTRL1000, MII_CTRL1000_INIT);
+   tsec_phy_write(mii_info, 0, MII_ADVERTISE, MII_ADVERTISE_INIT);
+
+   tsec_phy_write(mii_info, 0, MII_BMCR, BMCR_RESET);
+   tsec_phy_write(mii_info, 0, MII_BMCR, MII_BMCR_INIT);
+
+   return 0;
+}

Is this possible to assign the clear definition about bit fields with phy 
registers
rather than hard-code hex value?
I think clear definitions will help both other vendor and your customers,
whom are the ODM/OEM vendors is easier to debug with these phy chips.

Hope you can agree with this suggestions.

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


Re: [U-Boot] Boot count support on P1020

2011-01-27 Thread Wolfgang Denk
Dear Kumar Gala,

In message <087ef8c3-9d3f-4228-8db8-c8f8ef61b...@kernel.crashing.org> you wrote:
> 
> > external hard reset ?
> 
> If so, there isnt any state saved across such a reset in the SoC

Hm, so really all registers are explicitly initialized?  What a pitty.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
When some people discover the truth, they just can't  understand  why
everybody isn't eager to hear it.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Build error with the master branch

2011-01-27 Thread Wolfgang Denk
Dear Jason Liu,

In message  you 
wrote:
> Hi, There,
> 
> I met an error when building on the latest master branch of uboot, the
> error as the following,
> 
> arm-none-linux-gnueabi-gcc  -g  -Os   -fno-common -ffixed-r8
> -msoft-float   -D__KERNEL__
> -DCONFIG_SYS_TEXT_BASE=0x9780 -I/home/r64343/work_space/u-boot-upstream
> /u-boot/include -fno-builtin -ffreestanding -nostdinc -isystem
> /opt/freescale/usr/local/
> gcc-4.3.3-glibc-2.8-cs2009q1-203/gcc-4.3.3-glibc-2.8-cs2009q1-203/arm-none-linux-gnueabi/bin
> /../lib/gcc/arm-none-linux-gnueabi/4.3.3/include -pipe  -DCONFIG_ARM
> -D__ARM__ -marm
> -mabi=aapcs-linux -mno-thumb-interwork -march=armv5 -Wall
> -Wstrict-prototypes -fno-stack-protector
>  -fno-toplevel-reorder   -o stubs.o stubs.c -c
> arm-none-linux-gnueabi-ld  -pie -r -o libstubs.o  stubs.o
> arm-none-linux-gnueabi-ld: -r and -shared may not be used together
> make[2]: *** [libstubs.o] Error 1
> make[2]: Leaving directory
> `/home/r64343/work_space/u-boot-upstream/u-boot/examples/standalone'
> make[1]: *** [examples/standalone] Error 2
> make[1]: Leaving directory `/home/r64343/work_space/u-boot-upstream/u-boot'
> make: *** [mx51evk] Error 2
> 
> I found this error is related with the following commit:
> 
> commit 8aba9dceebb14144e07d19593111ee3a999c37fc
> 
> Are you aware of that?

Thanks for reporting.

Added the author of this commit on Cc:

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
A memorandum is written not to inform the reader, but to protect  the
writer.   -- Dean Acheson
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Build error with the master branch

2011-01-27 Thread Stefano Babic
On 01/27/2011 08:42 AM, Jason Liu wrote:
> Hi, There,
> 

Hi Jason,

> 
> I found this error is related with the following commit:
> 
> commit 8aba9dceebb14144e07d19593111ee3a999c37fc
> 
> Are you aware of that?

I can confirm this problem, and it is relevant for arm only.
As far I can understand at the moment, it is due to the -pie settings in
arch/arm/config.mk.

However, it is not to me clear because -pie is added to PLATFORM_LDFLAGS
and not to LDFLAGS_u-boot. Also before the patch the -pie option is used
only for linking u-boot at the end of the build process and not for
partial linking. Probably does it come when we used libraries instead of
objects ?

Setting LDFLAGS_u-boot in arch/arm/config.mk to -pie and removing it
from PLATFORM_LDFLAGS removes the build error. Not yet tested, anyway.

Best regards,
Stefano Babic

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


Re: [U-Boot] [0/6] Patch serie UBI min I/O size fixes

2011-01-27 Thread Holger Brunck
Hi,

Brunck, Holger wrote:
> This patch serie fixes a problem in the UBI layer. The min I/O size has
> currently a fixed value of 1 for NOR flashes. But for NOR flashes the min I/O
> size has to be equal to the size of the writebuffer of the flash. Therefore 
> the
> mtd layer was enhanced with the writebuffer which was later on used in the ubi
> layer to set the min I/O size.
> 
> This patches fixes problems with flash types with a writebuffersize > 128 Byte
> and is mainly taken from the similar linux patches. See MTD mailing list 
> posts:
> http://lists.infradead.org/pipermail/linux-mtd/2010-December/033460.html
> 
> Without the u-boot patches attaching to a ubi device with a min I/O buffer
> larger than 128 would fail.
> 

with the same changes in the linux kernel we see incompatibilities for the
UBIFS. Due to this fact the patches should be restrained until this problem is
solved.

See:
http://lists.infradead.org/pipermail/linux-mtd/2011-January/033794.html

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


Re: [U-Boot] [PATCH v4 1/3] S5P: serial: Use the inline function instead of static value

2011-01-27 Thread Minkyu Kang
On 24 January 2011 16:33, Minkyu Kang  wrote:
> Signed-off-by: Minkyu Kang 
> ---
>  arch/arm/include/asm/arch-s5pc1xx/uart.h |    5 -
>  drivers/serial/serial_s5p.c              |    2 +-
>  2 files changed, 5 insertions(+), 2 deletions(-)
>
applied to u-boot-samsung

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


Re: [U-Boot] [PATCH v4 2/3] armv7: add support for S5PC210 SoC

2011-01-27 Thread Minkyu Kang
On 24 January 2011 16:33, Minkyu Kang  wrote:
> S5PC210 is a 32-bit RISC and Cortex-A9 Dual Core based micro-processor.
>
> Signed-off-by: Minkyu Kang 
> Signed-off-by: Kyungmin Park 
> ---
> v4
>  use inline function instead of static value
> v3
>  support EVT1 cpu_id
> v2
>  fix typo: RSIC -> RISC, Coretex -> Cortex
>
>  arch/arm/cpu/armv7/s5pc2xx/Makefile           |   42 
>  arch/arm/cpu/armv7/s5pc2xx/clock.c            |  220 +
>  arch/arm/cpu/armv7/s5pc2xx/soc.c              |   30 +++
>  arch/arm/include/asm/arch-s5pc2xx/adc.h       |   42 
>  arch/arm/include/asm/arch-s5pc2xx/clk.h       |   36 
>  arch/arm/include/asm/arch-s5pc2xx/clock.h     |  255 
> +
>  arch/arm/include/asm/arch-s5pc2xx/cpu.h       |  103 ++
>  arch/arm/include/asm/arch-s5pc2xx/gpio.h      |  112 +++
>  arch/arm/include/asm/arch-s5pc2xx/mmc.h       |   71 +++
>  arch/arm/include/asm/arch-s5pc2xx/pwm.h       |   55 ++
>  arch/arm/include/asm/arch-s5pc2xx/sys_proto.h |   32 +++
>  arch/arm/include/asm/arch-s5pc2xx/uart.h      |   58 ++
>  12 files changed, 1056 insertions(+), 0 deletions(-)
>  create mode 100644 arch/arm/cpu/armv7/s5pc2xx/Makefile
>  create mode 100644 arch/arm/cpu/armv7/s5pc2xx/clock.c
>  create mode 100644 arch/arm/cpu/armv7/s5pc2xx/soc.c
>  create mode 100644 arch/arm/include/asm/arch-s5pc2xx/adc.h
>  create mode 100644 arch/arm/include/asm/arch-s5pc2xx/clk.h
>  create mode 100644 arch/arm/include/asm/arch-s5pc2xx/clock.h
>  create mode 100644 arch/arm/include/asm/arch-s5pc2xx/cpu.h
>  create mode 100644 arch/arm/include/asm/arch-s5pc2xx/gpio.h
>  create mode 100644 arch/arm/include/asm/arch-s5pc2xx/mmc.h
>  create mode 100644 arch/arm/include/asm/arch-s5pc2xx/pwm.h
>  create mode 100644 arch/arm/include/asm/arch-s5pc2xx/sys_proto.h
>  create mode 100644 arch/arm/include/asm/arch-s5pc2xx/uart.h
>
applied to u-boot-samsung

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


Re: [U-Boot] [PATCH v4 3/3] armv7: add support for s5pc210 universal board

2011-01-27 Thread Minkyu Kang
On 24 January 2011 16:33, Minkyu Kang  wrote:
> This patch adds support for Samsung s5pc210 universal board
>
> Signed-off-by: Minkyu Kang 
> Signed-off-by: Kyungmin Park 
> ---
> v4
>  use get_ram_size function
>  fix the sp address
> v3
>  remove config.mk
>  don't add board to MAKEALL
> v2
>  remove debug message
>
>  MAINTAINERS                                  |    5 +-
>  board/samsung/universal_c210/Makefile        |   51 
>  board/samsung/universal_c210/lowlevel_init.S |  395 
> ++
>  board/samsung/universal_c210/onenand.c       |   34 +++
>  board/samsung/universal_c210/universal.c     |  250 
>  boards.cfg                                   |    1 +
>  include/configs/s5pc210_universal.h          |  244 
>  7 files changed, 978 insertions(+), 2 deletions(-)
>  create mode 100644 board/samsung/universal_c210/Makefile
>  create mode 100644 board/samsung/universal_c210/lowlevel_init.S
>  create mode 100644 board/samsung/universal_c210/onenand.c
>  create mode 100644 board/samsung/universal_c210/universal.c
>  create mode 100644 include/configs/s5pc210_universal.h
>
applied to u-boot-samsung

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


[U-Boot] Please pull u-boot-samsung/master

2011-01-27 Thread Minkyu Kang
Dear Albert ARIBAUD,

The following changes since commit b722e646f9a6e2ebcae4845afc596b4dad4f7bcb:

  DaVinci DM6467: Enhance board Support (2010-12-28 17:38:22 -0500)

are available in the git repository at:
  git://git.denx.de/u-boot-samsung master

Minkyu Kang (4):
  armv7: s5pc1xx: don't use function pointer for clock functions
  S5P: serial: Use the inline function instead of static value
  armv7: add support for S5PC210 SoC
  armv7: add support for s5pc210 universal board

 MAINTAINERS   |5 +-
 arch/arm/cpu/armv7/s5p-common/cpu_info.c  |2 -
 arch/arm/cpu/armv7/s5pc1xx/clock.c|   38 ++-
 arch/arm/cpu/armv7/s5pc2xx/Makefile   |   42 +++
 arch/arm/cpu/armv7/s5pc2xx/clock.c|  220 ++
 arch/arm/cpu/armv7/s5pc2xx/soc.c  |   30 ++
 arch/arm/include/asm/arch-s5pc1xx/clk.h   |   10 +-
 arch/arm/include/asm/arch-s5pc1xx/uart.h  |5 +-
 arch/arm/include/asm/arch-s5pc2xx/adc.h   |   42 +++
 arch/arm/include/asm/arch-s5pc2xx/clk.h   |   36 +++
 arch/arm/include/asm/arch-s5pc2xx/clock.h |  255 
 arch/arm/include/asm/arch-s5pc2xx/cpu.h   |  103 +++
 arch/arm/include/asm/arch-s5pc2xx/gpio.h  |  112 +++
 arch/arm/include/asm/arch-s5pc2xx/mmc.h   |   71 +
 arch/arm/include/asm/arch-s5pc2xx/pwm.h   |   55 
 arch/arm/include/asm/arch-s5pc2xx/sys_proto.h |   32 ++
 arch/arm/include/asm/arch-s5pc2xx/uart.h  |   58 
 board/samsung/universal_c210/Makefile |   51 
 board/samsung/universal_c210/lowlevel_init.S  |  395 +
 board/samsung/universal_c210/onenand.c|   34 +++
 board/samsung/universal_c210/universal.c  |  250 
 boards.cfg|1 +
 drivers/serial/serial_s5p.c   |2 +-
 include/configs/s5pc210_universal.h   |  244 +++
 24 files changed, 2066 insertions(+), 27 deletions(-)
 create mode 100644 arch/arm/cpu/armv7/s5pc2xx/Makefile
 create mode 100644 arch/arm/cpu/armv7/s5pc2xx/clock.c
 create mode 100644 arch/arm/cpu/armv7/s5pc2xx/soc.c
 create mode 100644 arch/arm/include/asm/arch-s5pc2xx/adc.h
 create mode 100644 arch/arm/include/asm/arch-s5pc2xx/clk.h
 create mode 100644 arch/arm/include/asm/arch-s5pc2xx/clock.h
 create mode 100644 arch/arm/include/asm/arch-s5pc2xx/cpu.h
 create mode 100644 arch/arm/include/asm/arch-s5pc2xx/gpio.h
 create mode 100644 arch/arm/include/asm/arch-s5pc2xx/mmc.h
 create mode 100644 arch/arm/include/asm/arch-s5pc2xx/pwm.h
 create mode 100644 arch/arm/include/asm/arch-s5pc2xx/sys_proto.h
 create mode 100644 arch/arm/include/asm/arch-s5pc2xx/uart.h
 create mode 100644 board/samsung/universal_c210/Makefile
 create mode 100644 board/samsung/universal_c210/lowlevel_init.S
 create mode 100644 board/samsung/universal_c210/onenand.c
 create mode 100644 board/samsung/universal_c210/universal.c
 create mode 100644 include/configs/s5pc210_universal.h
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] QEMU for VersatilePB and U-BOOT-2010.12

2011-01-27 Thread Dmitriy Kiselev
Hello List,

I am currently trying to build an emulated linux system for arm using all new 
U-BOOT, Kernel, rootfs stuff. And I was stucked with the problem that I cannot 
run u-boot-2010.12.tar.bz2 downloaded from ftp://ftp.denx.de/pub/u-boot/ under 
qemu. Meanwhile u-boot-2010.09.tar.bz2 runs perfectly. Here is what I have and 
what I did:

My platform:
Host PC: OpenSUSE 11.3 x86-64 with all latest patches (kernel 
2.6.34.7-0.7-desktop #1 SMP PREEMPT 2010-12-13 11:13:53 +0100 x86_64 x86_64 
x86_64)
GNU arm cross compiler: arm-none-eabi-gcc (Sourcery G++ Lite 2010.09-51) 4.5.1
QEMU: QEMU PC emulator version 0.12.4

What i did after I unpacked the archive:

$ ~/ARM/U-boot/u-boot-2010.12> make versatilepb_config ARCH=arm 
CROSS_COMPILE=arm-none-eabi-

This worked fine

$~/ARM/U-boot/u-boot-2010.12> make all ARCH=arm CROSS_COMPILE=arm-none-eabi-

This resulted into error not finding CONFIG_SYS_SDRAM_BASE and 
CONFIG_SYS_INIT_SP_ADDR definitions.

I edited the include/configs/versatile.h file adding there two definitions:
#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_TEXT_BASE \
- GENERATED_GBL_DATA_SIZE)

And then re-launched u-boot compilation envoking:
$~/ARM/U-boot/u-boot-2010.12> make all ARCH=arm CROSS_COMPILE=arm-none-eabi-

This time everything went smoothly and I got compiled u-boot.bin.

But when I started it under QEMU:
~/ARM/U-boot/u-boot-2010.12> qemu-system-arm -M versatilepb -m 128M -nographic 
-kernel u-boot.bin

This resulted in:

qemu: fatal: Trying to execute code outside RAM or ROM at 0xff000738

R00=fffcbf70 R01= R02= R03=0100
R04= R05=fffcbf70 R06= R07=
R08=0080 R09=feff R10=0101dd58 R11=
R12=fffcbfe8 R13=fffcbf68 R14=ff000738 R15=ff000738
PSR=61d3 -ZC- A svc32

I also tried to debug this problem trying to launch it under QEMU with -s -S 
flags and envoking DBG.
But still got nothing as remote DBG showed pretty strange startup dump
which does not correlate with u-boot startup source code at all:

(gdb) target remote localhost:1234
gdbarch_find_by_info: info.bfd_arch_info arm
gdbarch_find_by_info: info.byte_order 1 (little)
gdbarch_find_by_info: info.osabi 0 (none)
gdbarch_find_by_info: info.abfd 0x0
gdbarch_find_by_info: info.tdep_info 0x0
gdbarch_find_by_info: Previous architecture 0x83da790 (arm) selected
gdbarch_update_p: New architecture 0x83da790 (arm) selected
gdbarch_find_by_info: info.bfd_arch_info arm
gdbarch_find_by_info: info.byte_order 1 (little)
gdbarch_find_by_info: info.osabi 0 (none)
gdbarch_find_by_info: info.abfd 0x0
gdbarch_find_by_info: info.tdep_info 0x0
gdbarch_find_by_info: Previous architecture 0x83f2910 (arm) selected
gdbarch_update_p: New architecture 0x83f2910 (arm) selected
0x in ?? ()
=> 0x:   00 00 a0 e3mov r0, #0
(gdb) nexti
Prologue scan stopped at 0xe398
Prologue scan stopped at 0xe398
0x0004 in ?? ()
=> 0x0004:   83 10 a0 e3mov r1, #131; 0x83
(gdb)

Please help,

Dmitriy




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


[U-Boot] [PATCH] Fix NAND_SPL and ONENAND_IPL in Makefile

2011-01-27 Thread Haiying.Wang
From: Haiying Wang 

Signed-off-by: Haiying Wang 
Acked-by: Scott Wood 

---
 Makefile |   30 ++
 1 files changed, 14 insertions(+), 16 deletions(-)

diff --git a/Makefile b/Makefile
index 5f93646..0d1ea5d 100644
--- a/Makefile
+++ b/Makefile
@@ -287,17 +287,6 @@ LDPPFLAGS += \
$(shell $(LD) --version | \
  sed -ne 's/GNU ld version 
\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/-DLD_MAJOR=\1 -DLD_MINOR=\2/p')
 
-ifeq ($(CONFIG_NAND_U_BOOT),y)
-NAND_SPL = nand_spl
-U_BOOT_NAND = $(obj)u-boot-nand.bin
-endif
-
-ifeq ($(CONFIG_ONENAND_U_BOOT),y)
-ONENAND_IPL = onenand_ipl
-U_BOOT_ONENAND = $(obj)u-boot-onenand.bin
-ONENAND_BIN ?= $(obj)onenand_ipl/onenand-ipl-2k.bin
-endif
-
 __OBJS := $(subst $(obj),,$(OBJS))
 __LIBS := $(subst $(obj),,$(LIBS)) $(subst $(obj),,$(LIBBOARD))
 
@@ -320,7 +309,16 @@ BOARD_SIZE_CHECK =
 endif
 
 # Always append ALL so that arch config.mk's can add custom ones
-ALL += $(obj)u-boot.srec $(obj)u-boot.bin $(obj)System.map $(U_BOOT_NAND) 
$(U_BOOT_ONENAND)
+ALL += $(obj)u-boot.srec $(obj)u-boot.bin $(obj)System.map
+
+ifeq ($(CONFIG_NAND_U_BOOT),y)
+ALL += $(obj)u-boot-nand.bin
+endif
+
+ifeq ($(CONFIG_ONENAND_U_BOOT),y)
+ALL += $(obj)u-boot-onenand.bin
+ONENAND_BIN ?= $(obj)onenand_ipl/onenand-ipl-2k.bin
+endif
 
 all:   $(ALL)
 
@@ -401,16 +399,16 @@ $(LDSCRIPT):  depend
 $(obj)u-boot.lds: $(LDSCRIPT)
$(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ 
>$@
 
-$(NAND_SPL):   $(TIMESTAMP_FILE) $(VERSION_FILE) depend
+nand_spl:  $(TIMESTAMP_FILE) $(VERSION_FILE) $(obj)include/autoconf.mk
$(MAKE) -C nand_spl/board/$(BOARDDIR) all
 
-$(U_BOOT_NAND):$(NAND_SPL) $(obj)u-boot.bin
+$(obj)u-boot-nand.bin: nand_spl $(obj)u-boot.bin
cat $(obj)nand_spl/u-boot-spl-16k.bin $(obj)u-boot.bin > 
$(obj)u-boot-nand.bin
 
-$(ONENAND_IPL):$(TIMESTAMP_FILE) $(VERSION_FILE) 
$(obj)include/autoconf.mk
+onenand_ipl:   $(TIMESTAMP_FILE) $(VERSION_FILE) $(obj)include/autoconf.mk
$(MAKE) -C onenand_ipl/board/$(BOARDDIR) all
 
-$(U_BOOT_ONENAND): $(ONENAND_IPL) $(obj)u-boot.bin
+$(obj)u-boot-onenand.bin:  onenand_ipl $(obj)u-boot.bin
cat $(ONENAND_BIN) $(obj)u-boot.bin > $(obj)u-boot-onenand.bin
 
 $(VERSION_FILE):
-- 
1.7.3.1.50.g1e633


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


[U-Boot] [PATCH] mpc83xx: Use correct register to calculate clocks.

2011-01-27 Thread Joakim Tjernlund
Use SPMR instead of HRCWL when calculating clocks as HCRWL
may be changed and the CPU will not pick up all changes
until there is a POR. u-boot will think SPMF has changed and get
the clocks wrong.

Signed-off-by: Joakim Tjernlund 
---
 arch/powerpc/cpu/mpc83xx/speed.c |   15 ---
 include/mpc83xx.h|7 +++
 2 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/arch/powerpc/cpu/mpc83xx/speed.c b/arch/powerpc/cpu/mpc83xx/speed.c
index 500eef1..55290b4 100644
--- a/arch/powerpc/cpu/mpc83xx/speed.c
+++ b/arch/powerpc/cpu/mpc83xx/speed.c
@@ -159,7 +159,7 @@ int get_clocks(void)
 #endif
}
 
-   spmf = ((im->reset.rcwl & HRCWL_SPMF) >> HRCWL_SPMF_SHIFT);
+   spmf = ((im->clk.spmr & SPMR_SPMF) >> SPMR_SPMF_SHIFT);
csb_clk = pci_sync_in * (1 + clkin_div) * spmf;
 
sccr = im->clk.sccr;
@@ -387,7 +387,7 @@ int get_clocks(void)
 #endif
 
lbiu_clk = csb_clk *
-  (1 + ((im->reset.rcwl & HRCWL_LBIUCM) >> 
HRCWL_LBIUCM_SHIFT));
+  (1 + ((im->clk.spmr & SPMR_LBIUCM) >> SPMR_LBIUCM_SHIFT));
lcrr = (im->lbus.lcrr & LCRR_CLKDIV) >> LCRR_CLKDIV_SHIFT;
switch (lcrr) {
case 2:
@@ -401,11 +401,12 @@ int get_clocks(void)
}
 
mem_clk = csb_clk *
- (1 + ((im->reset.rcwl & HRCWL_DDRCM) >> HRCWL_DDRCM_SHIFT));
-   corepll = (im->reset.rcwl & HRCWL_COREPLL) >> HRCWL_COREPLL_SHIFT;
+ (1 + ((im->clk.spmr & SPMR_DDRCM) >> SPMR_DDRCM_SHIFT));
+   corepll = (im->clk.spmr & SPMR_COREPLL) >> SPMR_COREPLL_SHIFT;
+
 #if defined(CONFIG_MPC8360)
mem_sec_clk = csb_clk * (1 +
-  ((im->reset.rcwl & HRCWL_LBIUCM) >> HRCWL_LBIUCM_SHIFT));
+  ((im->clk.spmr & SPMR_LBIUCM) >> SPMR_LBIUCM_SHIFT));
 #endif
 
corecnf_tab_index = ((corepll & 0x1F) << 2) | ((corepll & 0x60) >> 5);
@@ -437,8 +438,8 @@ int get_clocks(void)
}
 
 #if defined(CONFIG_MPC8360) || defined(CONFIG_MPC832x)
-   qepmf = (im->reset.rcwl & HRCWL_CEPMF) >> HRCWL_CEPMF_SHIFT;
-   qepdf = (im->reset.rcwl & HRCWL_CEPDF) >> HRCWL_CEPDF_SHIFT;
+   qepmf = (im->clk.spmr & SPMR_CEPMF) >> SPMR_CEPMF_SHIFT;
+   qepdf = (im->clk.spmr & SPMR_CEPDF) >> SPMR_CEPDF_SHIFT;
qe_clk = (pci_sync_in * qepmf) / (1 + qepdf);
brg_clk = qe_clk / 2;
 #endif
diff --git a/include/mpc83xx.h b/include/mpc83xx.h
index 5214911..a46a3aa 100644
--- a/include/mpc83xx.h
+++ b/include/mpc83xx.h
@@ -642,14 +642,21 @@
 /* SPMR - System PLL Mode Register
  */
 #define SPMR_LBIUCM0x8000
+#define SPMR_LBIUCM_SHIFT  31
 #define SPMR_DDRCM 0x4000
+#define SPMR_DDRCM_SHIFT   30
 #define SPMR_SPMF  0x0F00
+#define SPMR_SPMF_SHIFT24
 #define SPMR_CKID  0x0080
 #define SPMR_CKID_SHIFT23
 #define SPMR_COREPLL   0x007F
+#define SPMR_COREPLL_SHIFT 16
 #define SPMR_CEVCOD0x00C0
+#define SPMR_CEVCOD_SHIFT  6
 #define SPMR_CEPDF 0x0020
+#define SPMR_CEPDF_SHIFT   5
 #define SPMR_CEPMF 0x001F
+#define SPMR_CEPMF_SHIFT   0
 
 /* OCCR - Output Clock Control Register
  */
-- 
1.7.3.4

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


[U-Boot] [PATCH] pm9g45_v1.3: make ethernet works

2011-01-27 Thread Asen Dimov

Signed-off-by: Asen Dimov 
---
 board/ronetix/pm9g45/pm9g45.c |   15 +++
 include/configs/pm9g45.h  |5 +
 2 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/board/ronetix/pm9g45/pm9g45.c b/board/ronetix/pm9g45/pm9g45.c
index 79b7c9d..0e1d6b2 100644
--- a/board/ronetix/pm9g45/pm9g45.c
+++ b/board/ronetix/pm9g45/pm9g45.c
@@ -96,6 +96,8 @@ static void pm9g45_nand_hw_init(void)
 static void pm9g45_macb_hw_init(void)
 {
at91_pmc_t  *pmc= (at91_pmc_t *) AT91_PMC_BASE;
+   at91_rstc_t *rstc   = (at91_rstc_t *) AT91_RSTC_BASE;
+   unsigned long   erstl;
 
/*
 * PD2 enables the 50MHz oscillator for Ethernet PHY
@@ -120,6 +122,19 @@ static void pm9g45_macb_hw_init(void)
at91_set_pio_pullup(AT91_PIO_PORTA, 12, 0);
at91_set_pio_pullup(AT91_PIO_PORTA, 13, 0);
 
+   erstl = readl(&rstc->mr) & AT91_RSTC_MR_ERSTL_MASK;
+
+   /* Need to reset PHY -> 500ms reset */
+   writel(AT91_RSTC_KEY | AT91_RSTC_MR_ERSTL(0x0D) |
+   AT91_RSTC_MR_URSTEN, &rstc->mr);
+   writel(AT91_RSTC_KEY | AT91_RSTC_CR_EXTRST, &rstc->cr);
+
+   /* Wait for end hardware reset */
+   while (!(readl(&rstc->sr) & AT91_RSTC_SR_NRSTL));
+
+   /* Restore NRST value */
+   writel(AT91_RSTC_KEY | erstl | AT91_RSTC_MR_URSTEN, &rstc->mr);
+
/* Re-enable pull-up */
at91_set_pio_pullup(AT91_PIO_PORTA, 15, 1);
at91_set_pio_pullup(AT91_PIO_PORTA, 12, 1);
diff --git a/include/configs/pm9g45.h b/include/configs/pm9g45.h
index ec51ccf..4d8089f 100644
--- a/include/configs/pm9g45.h
+++ b/include/configs/pm9g45.h
@@ -125,6 +125,11 @@
 #define CONFIG_NET_MULTI   1
 #define CONFIG_NET_RETRY_COUNT 20
 #define CONFIG_RESET_PHY_R 1
+#define CONFIG_MACB_SEARCH_PHY
+#define CONFIG_CMD_MII
+#define CONFIG_OVERWRITE_ETHADDR_ONCE
+/* MAC is Organizationally Unique Identifier + 3 octects user numbers */
+#define CONFIG_ETHADDR "02:00:00:fe:ed:00"
 
 /* USB */
 #define CONFIG_USB_ATMEL
-- 
1.5.5.6

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


[U-Boot] [PATCH] ARM: fix broken build of ARM

2011-01-27 Thread Stefano Babic
Commit 8aba9dceebb14144e07d19593111ee3a999c37fc breaks
ARM boards because for ARM the -pie option is used
for partial linking together with -r option.

The patch adds the -pie option to link u-boot.bin only.

Signed-off-by: Stefano Babic 
CC: Jason Liu 
CC: l...@dooz.org
CC: Wolfgang Denk 
CC: Albert Aribaud 

---
 arch/arm/config.mk |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/config.mk b/arch/arm/config.mk
index 4e165bf..a6a4742 100644
--- a/arch/arm/config.mk
+++ b/arch/arm/config.mk
@@ -67,5 +67,5 @@ LDSCRIPT := $(SRCTREE)/$(CPUDIR)/u-boot.lds
 
 # needed for relocation
 ifndef CONFIG_NAND_SPL
-PLATFORM_LDFLAGS += -pie
+LDFLAGS_u-boot += -pie
 endif
-- 
1.7.1

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


Re: [U-Boot] [PATCH V5 2/4] serial: Add Tegra2 serial port support

2011-01-27 Thread Tom Warren
Mike,

On Thu, Jan 27, 2011 at 12:41 AM, Mike Rapoport  wrote:
> Tom,
>
> On 01/26/11 19:05, Tom Warren wrote:
>> Mike,
>>
>> On Wed, Jan 26, 2011 at 1:13 AM, Mike Rapoport  wrote:
>>> My point was that pin muxing belongs to the board code rather than to the
>>> driver. Driver should just assume that pins are configured elsewhere and it 
>>> does
>>> not need to deal with pin muxing at all.
>> I understand that point - sorry if I wasn't clear. No objection to
>> having pinmux code in board files.
>>
>>> Moreover, I'd prefer to see pinmux_board_init or something similar that
>>> configures all the pins at once rather than collection of pinmux_init_uart,
>>> pinmux_init_sdmmc, pinmux_init_gmi etc that will grow as more drivers are 
>>> added.
>>>
>> I see a couple of reasons not to do it that way. First, I don't know
>> at this time what all the pinmux settings will be, since I haven't
>> ported all the periph driver code yet. It's vastly different from
>> what's acceptable in U-Boot, and will all need significant rewrite.
>> It'd take me a week to gather all that info, and I'm not at full BW on
>> this project (one of 4 on my plate right now).
>> Second, I've been chastised before for including code/features in this
>> initial patchset that aren't needed or used.  I'm trying to keep the
>> code as simple as possible to make it easier on reviewers and get
>> through the review in as short a time as possible. This has already
>> dragged on far longer than I thought it would.
>> I'm willing to change the pinmux code to make it as generic as
>> possible, but only if there's a consensus on the list that it has to
>> be that way to get accepted & pushed.
>
> I'm Ok with pinmux_init_uart in the board code for now. I think that the 
> generic
> pinmux functionality can be added afterwards.
>
Great. My main goal is to get the baseline Tegra2 support in upstream
U-Boot. I'm happy to refine the pinmux approach in the next patchset.
Either a generic pinmux as you propose, or a set of weak pinmux
configs that can be overridden by another board design, etc. as Peter
proposes.

>>>
>> Thanks,
>> Tom
>
>
> --
> Sincerely yours,
> Mike.
>
Thanks,
Tom
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 02/14] powerpc/fman: add PHY support for dTSEC

2011-01-27 Thread Timur Tabi
Mingkai Hu wrote:
> + u16 phy_reg;
> + u32 phy_ID;
> + int i;
> + struct phy_info *theInfo = NULL;
> +
> + /* Grab the bits from PHYIR1, and put them in the upper half */
> + phy_reg = tsec_phy_read(mii_info, 0, MII_PHYSID1);
> + phy_ID = (phy_reg & 0x) << 16;
> +
> + /* Grab the bits from PHYIR2, and put them in the lower half */
> + phy_reg = tsec_phy_read(mii_info, 0, MII_PHYSID2);
> + phy_ID |= (phy_reg & 0x);

The "& 0x" is unnecessary since phy_reg is a u16, so it can never be larger
than 0x.

> + theInfo = phy_info[i];

CamelCase variables?

> + * Copyright 2009-2010 Freescale Semiconductor, Inc.

Should any of these be 2011?

-- 
Timur Tabi
Linux kernel developer at Freescale

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


Re: [U-Boot] [PATCH 1/6] mtd: add writebufsize field to mtd_info struct

2011-01-27 Thread Detlev Zundel
Hi Stefan,

do you have any comment on this series?  I delegated the patches to you
in patchwork already :)  No seriously, the patches look sane and are in
accordance to what is done in Linux

> This field will be used to indicate the write buffer size
> of the MTD device. UBI will set it's minimal I/O unit size
> (min_io_size) to the indicated write buffer size. By this
> change we intend to fix failed recovery of UBIFS partitions
> we currently observe on NOR flash when mounting the partition
> after unclean unmount.
>
> Currently the min_io_size is set to mtd->writesize (which is 1
> byte for NOR flash). But flash programming is often done from
> prepared write buffer containing multiple bytes and is performed
> in one programming operation which could be interrupted by a power
> cut or a system reset causing corrupted (partially written) areas
> in a flash sector. Knowing the size of potentially corrupted areas
> UBIFS scanning and recovery algorithms are able to perform
> successful recovery.
>
> Signed-off-by: Holger Brunck 

Thanks
  Detlev

-- 
vi vi vi - the roman numeral of the beast.
--
DENX Software Engineering GmbH,  MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [0/6] Patch serie UBI min I/O size fixes

2011-01-27 Thread Detlev Zundel
Hi Holger,

> Hi,
>
> Brunck, Holger wrote:
>> This patch serie fixes a problem in the UBI layer. The min I/O size has
>> currently a fixed value of 1 for NOR flashes. But for NOR flashes the min I/O
>> size has to be equal to the size of the writebuffer of the flash. Therefore 
>> the
>> mtd layer was enhanced with the writebuffer which was later on used in the 
>> ubi
>> layer to set the min I/O size.
>> 
>> This patches fixes problems with flash types with a writebuffersize > 128 
>> Byte
>> and is mainly taken from the similar linux patches. See MTD mailing list 
>> posts:
>> http://lists.infradead.org/pipermail/linux-mtd/2010-December/033460.html
>> 
>> Without the u-boot patches attaching to a ubi device with a min I/O buffer
>> larger than 128 would fail.
>> 
>
> with the same changes in the linux kernel we see incompatibilities for the
> UBIFS. Due to this fact the patches should be restrained until this problem is
> solved.
>
> See:
> http://lists.infradead.org/pipermail/linux-mtd/2011-January/033794.html

Ah, I see.  Thanks for the info.

In defense of my overlapping mail, I can only state that the reference
header in this mail of yours does not point to the earlier thread (check
[1]) and thus I saw it only much later:

> References: <4d41331c.7000...@keymile.com>
> In-Reply-To: <4d41331c.7000...@keymile.com>

But anyway, sorry for the noise.

Cheers
  Detlev

[1] http://mid.gmane.org/4d41331c.7000...@keymile.com

-- 
Man against god... God against Man... Man against nature... Nature against
man...   God against nature...   Nature against god...  a very, very funny
religion. -- Zen Master D.T. Suzuki commenting on Christianity
--
DENX Software Engineering GmbH,  MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 05/14] powerpc/qoirq: Add support for FMan ethernet in Independent mode

2011-01-27 Thread Timur Tabi
Mingkai Hu wrote:
> +LIB  := $(obj)libfm.a

Libraries are now .o files, not .a files.  Take a look at the other Makefiles to
see how they've recently changed.

> +u32 fm_muram_alloc(struct fm_muram *mem, u32 size, u32 align)
> +{
> + u32 ret;
> + u32 align_mask, off;
> + u32 save;
> +
> + align_mask = align - 1;
> + save = mem->alloc;
> +
> + if ((off = (save & align_mask)) != 0)
> + mem->alloc += (align - off);
> + if ((off = size & align_mask) != 0)
> + size += (align - off);
> + if ((mem->alloc + size) >= mem->top) {
> + mem->alloc = save;
> + printf("%s: run out of ram.\n", __func__);
> + }

What exactly happens here?  If you run out of memory, you return a pointer
anyway?  Shouldn't you return NULL here or something?

> + /* Loop through each microcode. */
> + for (i = 0; i < firmware->count; i++) {
> + const struct qe_microcode *ucode = &firmware->microcode[i];
> +
> + /* Upload a microcode if it's present */
> + if (ucode->code_offset) {
> + printf("Fman: Uploading microcode version %u.%u.%u.\n",
> +ucode->major, ucode->minor, ucode->revision);
> + fm->ucode = (void *) CONFIG_SYS_FMAN_FW_ADDR +
> + ucode->code_offset;

Just FYI, this code will only work on systems that have NOR flash mapped to I/O
space.  If the customer boots from NAND and doesn't have any NOR flash on his
board, then CONFIG_SYS_FMAN_FW_ADDR will be invalid.  In addition, I don't see
any code that passes the value of CONFIG_SYS_FMAN_FW_ADDR to the kernel via
"fman_ucode".

> + /* setup TxBD */
> + txbd->buf_ptr_hi = 0;
> + txbd->buf_ptr_lo = (u32)buf;
> + txbd->len = len;
> + __asm__ __volatile__ ("sync");

Why do we sometimes do "asm("sync");" and sometimes we do "__asm__ __volatile__
("sync");"?  And why do we have hard-coded asm anyway?  There is a sync()
function that does this already.


> + txbd->status = TxBD_READY | TxBD_LAST;
> + __asm__ __volatile__ ("sync");
> +
> + /* update TxQD, let RISC to send the packet */
> + offset_in = muram_readw(&pram->txqd.offset_in);
> + offset_in += SIZEOFBD;
> + if (offset_in >= muram_readw(&pram->txqd.bd_ring_size))
> + offset_in = 0;
> + muram_writew(&pram->txqd.offset_in, offset_in);
> + __asm__ __volatile__ ("sync");
> +
> + /* wait for buffer to be transmitted */
> + for (i = 0; txbd->status & TxBD_READY; i++) {
> + udelay(1000);
> + if (i > 0x1) {
> + printf("%s: Tx error\n", dev->name);
> + return 0;
> + }
> + }

If you're going to do a timeout, do it the same way everyone else does.  Start
with the timeout value, and decrement the variable.  Something like this:

timeout = 0x1; (why a hex number anyway?)
while (!(txbd->status & TxBD_READY) && --timeout)
udelay(1000);

> +static void
> +__def_board_ft_fman_fixup_port(void *blob, char * prop, phys_addr_t pa,
> + enum fm_port port, int offset)
> +{
> + return ;

Delete this "return ;".  It doesn't do anything.

-- 
Timur Tabi
Linux kernel developer at Freescale

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


Re: [U-Boot] [PATCH 06/14] powerpc/corenet_ds: Add fman support

2011-01-27 Thread Timur Tabi
Mingkai Hu wrote:
> +enum board_slots {
> + SLOT1 = 1,
> + SLOT2,
> + SLOT3,
> + SLOT4,
> + SLOT5,
> + SLOT6,
> +};

This is silly.  SLOT1 == 1, SLOT2 == 2, etc.  Just delete this enum and use 
numbers.

-- 
Timur Tabi
Linux kernel developer at Freescale

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


Re: [U-Boot] [PATCH v2] Divides variable of linker flags to LDFLAGS-u-boot and LDFLAGS

2011-01-27 Thread Remy Bohmer
Hi,

2011/1/6 Nobuhiro Iwamatsu :
> Linker needs to use the proper endian/bfd flags even when doing partial 
> linking.
> LDFLAGS_u-boot sets linker option which is called it when U-boot is built
> (u-boot final).
> LDFLAGS sets necessary option by partial linking (use in cmd_link_o_target).
>
> CC: Mike Frysinger 
> Signed-off-by: Nobuhiro Iwamatsu 
> ---

This patch breaks compilation for some ARM based boards, I get for
example this error:
===
make -C examples/standalone all
make[1]: Entering directory `/home/bohm/Workarea/u-boot/examples/standalone'
arm-none-eabi-gcc  -g  -Os   -fno-common -ffixed-r8 -msoft-float
-D__KERNEL__ -DCONFIG_SYS_TEXT_BASE=0x23f0
-I/home/bohm/Workarea/u-boot/include -fno-builtin -ffreestanding
-nostdinc -isystem
/home/bohm/x-tools/CodeSourcery/arm-2009q1/bin/../lib/gcc/arm-none-eabi/4.3.3/include
-pipe  -DCONFIG_ARM -D__ARM__ -marm  -mabi=aapcs-linux
-mno-thumb-interwork -march=armv5te  -Wall -Wstrict-prototypes
-fno-stack-protector -fno-toplevel-reorder   -o hello_world.o
hello_world.c -c
arm-none-eabi-gcc  -g  -Os   -fno-common -ffixed-r8 -msoft-float
-D__KERNEL__ -DCONFIG_SYS_TEXT_BASE=0x23f0
-I/home/bohm/Workarea/u-boot/include -fno-builtin -ffreestanding
-nostdinc -isystem
/home/bohm/x-tools/CodeSourcery/arm-2009q1/bin/../lib/gcc/arm-none-eabi/4.3.3/include
-pipe  -DCONFIG_ARM -D__ARM__ -marm  -mabi=aapcs-linux
-mno-thumb-interwork -march=armv5te  -Wall -Wstrict-prototypes
-fno-stack-protector -fno-toplevel-reorder   -o stubs.o stubs.c -c
arm-none-eabi-ld  -pie -r -o libstubs.o  stubs.o

> arm-none-eabi-ld: -r and -shared may not be used together

make[1]: *** [libstubs.o] Error 1
make[1]: Leaving directory `/home/bohm/Workarea/u-boot/examples/standalone'
make: *** [examples/standalone] Error 2
===

It seems that the ' -pie' and '-r' flags may not be used together.

The ' -r' flag is defined at line 263 in config.mk:
cmd_link_o_target = $(if $(strip $1),\
  $(LD) $(LDFLAGS) -r -o $@ $1,\
  rm -f $@; $(AR) rcs $@ )

This patch now includes $(LDFLAGS) which was previously not included:
>  # Location of a usable BFD library, where we define "usable" as
> @@ -259,7 +261,7 @@ $(obj)%.s:  %.c
>
>  # If the list of objects to link is empty, just create an empty built-in.o
>  cmd_link_o_target = $(if $(strip $1),\
> - $(LD) -r -o $@ $1 ,\
> + $(LD) $(LDFLAGS) -r -o $@ $1,\
>  rm -f $@; $(AR) rcs $@ )
>

Since it is included the following flag is added from arch/arm/config.mk:
PLATFORM_LDFLAGS += -pie

This results in the error as listed above.

Any suggestions how to fix it?

Kind regards,

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


Re: [U-Boot] [PATCH v2] Divides variable of linker flags to LDFLAGS-u-boot and LDFLAGS

2011-01-27 Thread Remy Bohmer
Hi,

2011/1/27 Remy Bohmer :
> Hi,
>
> 2011/1/6 Nobuhiro Iwamatsu :
>> Linker needs to use the proper endian/bfd flags even when doing partial 
>> linking.
>> LDFLAGS_u-boot sets linker option which is called it when U-boot is built
>> (u-boot final).
>> LDFLAGS sets necessary option by partial linking (use in cmd_link_o_target).
>>
>> CC: Mike Frysinger 
>> Signed-off-by: Nobuhiro Iwamatsu 
>> ---
>
> This patch breaks compilation for some ARM based boards, I get for
> example this error:

Never mind...
This patch already solves this problem:
http://comments.gmane.org/gmane.comp.boot-loaders.u-boot/93537

Kind regards,

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


Re: [U-Boot] [PATCH v5 1/1] imximage: Add MX53 boot image support

2011-01-27 Thread Albert ARIBAUD
Le 25/01/2011 08:56, Jason Liu a écrit :
> Hi, Wolfgang,
>
> 2011/1/20 Jason Liu:
>> This patch add the MX53 boot image support.
>>
>> This patch has been tested on Freescale MX53EVK board
>> and MX51EVK board.
>>
>> Signed-off-by: Jason Liu
>>
>> ---
>> Changes for v2:
>> - Address the following comments from Stefano,
>>   - Get rid of  #ifdef in the imximage.h and .c file and use
>> the runtime check for imximage version
>>   - Document the IMXIMAGE_VERSION definiton in doc/README.imximage
>>   - Move mx53evk/config.mk and mx53evk/imximage.cfg to MX53EVK board
>> support patch.
>>
>> Changes for v3:
>> - Address the following comments from Stefano,
>>   - Not change the mx51evk file. The code should take VERSION=1 as default,
>>and we do not need to change the actual boards.
>>   - add a note in the documentation and raise an error in code if the
>>VERSION command is read after any other suitable commands.
>>   - Change command IMXIMAGE_VERSION simply to IMAGE_VERSION
>>   - Need recognize the version directly from its structure and not storing 
>> the
>>version into the header when do header verify and print.
>>   - Use function pointer to simpliy the code when the version of header is 
>> recognized
>> Changes for v4:
>> - Address the following comments from Wolfgang,
>>   - Keep the imximage_cmds table sorted,
>>   - Add braces for (expx)&&  (expy) gloably,
>>   - Return failure to upper call if met errors for function
>>   - Add comments for function set_dcd_rst_v1 alike,
>>   - Re-orgnize code to avoid deep nesting,
>> Changes for v5:
>>   - Remove the blank line before the only one line statement and
>>   not using braces for the one line statment for the sake of the
>>   same coding style of this file. For example,
>>   if (!exp)
>> return ret;
>> ---
>>   doc/README.imximage |   12 +-
>>   tools/imximage.c|  525 
>> +--
>>   tools/imximage.h|  110 +--
>>   3 files changed, 487 insertions(+), 160 deletions(-)
>>
>
> Any feedback about this patch?

I think Stefano should be added in Cc: as IMX custodian.

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


Re: [U-Boot] [PATCH V7 1/5] mv: seperate kirkwood and armada from common setting

2011-01-27 Thread Albert ARIBAUD
Hi Lei Wen,

Le 26/01/2011 11:31, Lei Wen a écrit :

> diff --git a/README b/README
> index 755d17c..e0341b5 100644
> --- a/README
> +++ b/README
> @@ -319,6 +319,11 @@ The following options need to be configured:
>   CONFIG_SYS_PQ2FADS  - PQ2FADS-ZU or PQ2FADS-VR
>   CONFIG_SYS_8272ADS  - MPC8272ADS
>
> +- Marvell Family Member
> + CONFIG_SYS_MVFS - define it if you want to enable
> +   multiply fs option at one time

Are you sure about this "multiply"?

> +   for marvell soc family
> +
>   - MPC824X Family Member (if CONFIG_MPC824X is defined)
>   Define exactly one of
>   CONFIG_MPC8240, CONFIG_MPC8245
> diff --git a/arch/arm/include/asm/arch-armada100/config.h 
> b/arch/arm/include/asm/arch-armada100/config.h
> new file mode 100644
> index 000..f16806e
> --- /dev/null
> +++ b/arch/arm/include/asm/arch-armada100/config.h
> @@ -0,0 +1,44 @@
> +/*
> + * (C) Copyright 2010

Maybe update the copyright year?

> + * Marvell Semiconductor
> + * Written-by: Lei Wen
> + *
> + * 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., 51 Franklin Street, Fifth Floor, Boston,
> + * MA 02110-1301 USA
> + */
> +
> +/*
> + * This file should be included in board config header file.
> + *
> + * It supports common definitions for Armada100 platform
> + */
> +
> +#ifndef _ARMD1_CONFIG_H
> +#define _ARMD1_CONFIG_H
> +
> +#define CONFIG_ARM926EJS 1   /* Basic Architecture */
> +
> +#define CONFIG_SYS_TCLK  (14745600)  /* NS16550 clk config */
> +#define CONFIG_SYS_HZ_CLOCK  (325)   /* Timer Freq. 3.25MHZ */
> +#define CONFIG_MARVELL_MFP   /* Enable mvmfp driver */
> +#define MV_MFPR_BASE ARMD1_MFPR_BASE
> +#define MV_UART_CONSOLE_BASE ARMD1_UART1_BASE
> +#define CONFIG_SYS_NS16550_IER   (1<<  6)/* Bit 6 in UART_IER 
> register
> + represents UART Unit Enable */
> +
> +#endif /* _ARMD1_CONFIG_H */
> diff --git a/arch/arm/include/asm/arch-kirkwood/config.h 
> b/arch/arm/include/asm/arch-kirkwood/config.h
> new file mode 100644
> index 000..7c6d63b
> --- /dev/null
> +++ b/arch/arm/include/asm/arch-kirkwood/config.h
> @@ -0,0 +1,145 @@
> +/*
> + * (C) Copyright 2010

Ditto

> + * Marvell Semiconductor
> + * Written-by: Lei Wen
> + *
> + * 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., 51 Franklin Street, Fifth Floor, Boston,
> + * MA 02110-1301 USA
> + */
> +
> +/*
> + * This file should be included in board config header file.
> + *
> + * It supports common definitions for Kirkwood platform
> + */
> +
> +#ifndef _KW_CONFIG_H
> +#define _KW_CONFIG_H
> +
> +#if defined (CONFIG_KW88F6281)
> +#include
> +#elif defined (CONFIG_KW88F6192)
> +#include
> +#else
> +#error "SOC Name not defined"
> +#endif /* CONFIG_KW88F6281 */
> +
> +#define CONFIG_ARM926EJS 1   /* Basic Architecture */
> +
> +#define CONFIG_MD5   /* get_random_hex on krikwood needs MD5 support */
> +#define CONFIG_KIRKWOOD_EGIGA_INIT   /* Enable GbePort0/1 for kernel */
> +#define CONFIG_KIRKWOOD_RGMII_PAD_1V8/* Set RGMII Pad voltage to 
> 1.8V */
> +#define CONFIG_KIRKWOOD_PCIE_INIT   /* Enable PCIE Port0 for kernel */
> +
> +/*
> + * By default kwbimage.cfg from board specific folder is used
> + * If for some board, different configuration file need to be used,
> + * CONFIG_SYS_KWD_CONFIG should be defined in board specific header file
> + */
> +

Re: [U-Boot] [PATCH V2] arm: Use optimized memcpy and memset from linux

2011-01-27 Thread Albert ARIBAUD
Hi Wolfgang,

Le 26/01/2011 14:07, Wolfgang Denk a écrit :
> Dear =?ISO-8859-15?Q?Matthias_Wei=DFer?=,
>
> In message<4d4018ad.7090...@arcor.de>  you wrote:
>>
>>> IIRC, the '---' line separates patch commit message (above) from
>>> freeform comments and history (below). Here, at least the version
>>> history should move below the '---' line.
>>
>> Wolfgang asked me that I add the numbers to the commit message. For the
>> changelog I will investigate the git commands on how to do that best
>> without manually editing the patch file before git send-email them.
>
> Indeed I find that these numbers are information that should go into
> the commit message so this data is available to users who have to
> decide whether they want to trade the increased speed for the
> increased memory footprint.

Can't we have thses numbers in a more compact form then? That makes a 
really big commit message.

 +- CONFIG_USE_ARCH_MEMCPY
 + CONFIG_USE_ARCH_MEMSET
 + If these options are used a optimized version of memcpy/memset will
 + be used if available. These functions may be faster under some
 + conditions but may increase the binary size.
 +
>>>
>>> The name of the options is not self-explaining to me. If the difference
>>> is "generic vs arch-optimal", then maybe CONFIG_USE_ARCH_OPTIMAL_MEMxxx
>>> would be a better name?
>>
>> Wolfgang didn't object on these names. If we use the OPTIMAL form it is
>> still not clear what optimal mean. There may be a size optimized version
>> and a speed optimized version. So we would need
>> CONFIG_USE_ARCH_SPEED_OPTIMAL_MEMxxx which I personally dislike a lot as
>> it is quite long. I also think that if there is an architecture specific
>> function that it should be clear that this is optimal in some way.
>
> Well, "optimal" is not a good idea as I am pretty sure that some
> clever person will still be able to spare some cycles here and there,
> so his code would be even "more optimal" ;-)

Granted.

> I think the names CONFIG_USE_ARCH_MEMCPY etc. are actually pretty
> good, because they are in line with the standard names
> __HAVE_ARCH_MEMCPY etc. that are used in a lot of libraries.

All right.

> Best regards,
>
> Wolfgang Denk

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


Re: [U-Boot] [PATCH v5 1/1] imximage: Add MX53 boot image support

2011-01-27 Thread Stefano Babic
On 01/27/2011 07:24 PM, Albert ARIBAUD wrote:
>>
>> Any feedback about this patch?
> 
> I think Stefano should be added in Cc: as IMX custodian.

I have already got it. This is the revisited patch that was too fast
merged in u-boot-imx.

Jason, I have no remarks on it and for testing purpose I have already
merged all pending imx patches into the next branch of u-boot-imx. If
there will be no further comments, all these patches will be part of my
next pull request.

Stefano

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


[U-Boot] [PATCH] Driver for AX88183 ethernet chip

2011-01-27 Thread root
From: Joe Xue 

---
 README|7 +
 drivers/net/Makefile  |1 +
 drivers/net/ax88183.c |  265 +++
 drivers/net/ax88183.h |  559 +
 4 files changed, 832 insertions(+), 0 deletions(-)
 create mode 100644 drivers/net/ax88183.c
 create mode 100644 drivers/net/ax88183.h

diff --git a/README b/README
index 68f5fb0..e389ec5 100644
--- a/README
+++ b/README
@@ -876,6 +876,13 @@ The following options need to be configured:
automatically converts one 32 bit word to two 16 bit
words you may also try CONFIG_SMC911X_32_BIT.
 
+   CONFIG_DRIVER_AX88183
+   Support for AXIS's AX88183 chips.
+
+   CONFIG_AX88183_BASE
+   Define this to hold the physical address
+   of the AX88183's I/O space
+
 - USB Support:
At the moment only the UHCI host controller is
supported (PIP405, MIP405, MPC5200); define
diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index b605eea..ab15d46 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -83,6 +83,7 @@ COBJS-$(CONFIG_TSI108_ETH) += tsi108_eth.o
 COBJS-$(CONFIG_ULI526X) += uli526x.o
 COBJS-$(CONFIG_VSC7385_ENET) += vsc7385.o
 COBJS-$(CONFIG_XILINX_EMACLITE) += xilinx_emaclite.o
+COBJS-$(CONFIG_DRIVER_AX88183) += ax88183.o
 
 COBJS  := $(sort $(COBJS-y))
 SRCS   := $(COBJS:.o=.c)
diff --git a/drivers/net/ax88183.c b/drivers/net/ax88183.c
new file mode 100644
index 000..ed41244
--- /dev/null
+++ b/drivers/net/ax88183.c
@@ -0,0 +1,265 @@
+
+/*
+ * (C) Copyright 2010  Joe Xue 
+ *
+ * This file is released under the terms of GPL v2 and any later version.
+ * See the file COPYING in the root directory of the source tree for details.
+*/
+
+/*
+ * This driver works on 32bit mode
+ * AX88783 has two ethernet ports, we only use port 0 in u-boot
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include "ax88183.h"
+
+static int ax88183_init(bd_t *bd)
+{
+volatile unsigned int tmp;
+int i;
+
+/* reset chip */
+tmp = CR;
+CR = (tmp & ~CR_CHIP_RESET);
+udelay(1000);
+CR = (tmp | CR_CHIP_RESET);
+
+/* disable interrupt */
+IMSR = IMSR_MASK_ALL;
+
+/* set mac address*/
+unsigned char mactmp[4];
+unsigned int * mac = (unsigned int *)mactmp;
+mactmp[0] = bd->bi_enetaddr[5];
+mactmp[1] = bd->bi_enetaddr[4];
+mactmp[2] = bd->bi_enetaddr[3];
+mactmp[3] = bd->bi_enetaddr[2];
+P0MAC0 = *mac;
+
+mactmp[0] = bd->bi_enetaddr[1];
+mactmp[1] = bd->bi_enetaddr[0];
+P0MAC1 = *mac;
+
+/* write mac to forward entry */
+mactmp[0] = bd->bi_enetaddr[3];
+mactmp[1] = bd->bi_enetaddr[2];
+mactmp[2] = bd->bi_enetaddr[1];
+mactmp[3] = bd->bi_enetaddr[0];
+FTDATA = *mac;
+FTCMD = bd->bi_enetaddr[4] | (bd->bi_enetaddr[5]<<8) | \
+FTCMD_FT_PORT(0x2) | FTCMD_FT_STATIC | \ 
+FTCMD_WRITE_FT;
+
+/* phy init */
+tmp = PCR;
+tmp |= PCR_PHY0_RESET_CLEAR;
+PCR = tmp;
+udelay(10);
+tmp = POLLCR;
+tmp &= POLLCR_PORT0_PHYID_MASK;
+tmp |= POLLCR_PORT0_PHYID(0x10); 
+POLLCR = tmp;
+
+/* write MII mode */
+tmp = (MIICR & 0xFF);
+tmp &= (~MIICR_PORT0_MII_CLK_GEN);
+tmp &= (~MIICR_PORT0_PHY_RMII);
+MIICR = tmp;
+
+/* set LED mode */
+tmp = LEDCR;
+tmp |= LEDCR_PORT_LED_ON(0) | LEDCR_LED0(PHY_LED_RX | PHY_LED_TX);
+tmp |= LEDCR_PORT_LED_ON(1) | LEDCR_LED1(PHY_LED_LINK);
+LEDCR= tmp;
+
+/* set auto polling */
+tmp = POLLCR;
+tmp |= (POLLCR_PORT0_AUTO_POOLING);
+POLLCR = tmp;
+
+/* set link speed */
+for(i=0 ;i<2; i++)
+{
+int reg = i*8+16;
+tmp = MDCR_READ | MDCR_PHY_ID(0x10) | MDCR_PHY_REG(reg);
+MDCR = tmp;
+while(1)
+{
+tmp = MDCR;
+if(tmp & MDCR_VALID)
+break;
+}
+tmp = MDCR & MDCR_VALUE_MASK;
+
+tmp = tmp | 0x1000 | MDCR_WRITE | MDCR_PHY_ID(0x10) | 
MDCR_PHY_REG(reg);
+MDCR = tmp;
+while(1)
+{
+tmp = MDCR;
+if(tmp & MDCR_VALID)
+break;
+}
+}
+
+/* media init */
+tmp = MDCR_READ | MDCR_PHY_ID(0x10) | MDCR_PHY_REG(MII_ADVERTISE);
+MDCR = tmp;
+while(1)
+{
+tmp = MDCR;
+if(tmp & MDCR_VALID)
+break;
+}
+
+tmp = MDCR & MDCR_VALUE_MASK;
+tmp &= (~ADVERTISE_ALL);
+tmp |= ADVERTISE_ALL | 0x400;
+tmp = tmp | MDCR_WRITE | MDCR_PHY_ID(0x10);
+MDCR = tmp;
+while(1)
+{
+tmp = MDCR;
+if(tmp & MDCR_VALID)
+break;
+}
+
+tmp = MDCR_WRITE | MDCR_PHY_ID(0x10) | MDCR_PHY_REG(MII_BMCR)| 
BMCR_ANRESTART | BMCR_ANENABLE;
+MDCR = tmp;
+while(1)
+{
+tmp = MDCR;
+if(tmp & MDCR_VALID)
+break;
+}
+

Re: [U-Boot] Build error with the master branch

2011-01-27 Thread Albert ARIBAUD
Le 27/01/2011 12:12, Stefano Babic a écrit :
> On 01/27/2011 08:42 AM, Jason Liu wrote:
>> Hi, There,
>>
>
> Hi Jason,
>
>>
>> I found this error is related with the following commit:
>>
>> commit 8aba9dceebb14144e07d19593111ee3a999c37fc
>>
>> Are you aware of that?
>
> I can confirm this problem, and it is relevant for arm only.
> As far I can understand at the moment, it is due to the -pie settings in
> arch/arm/config.mk.
>
> However, it is not to me clear because -pie is added to PLATFORM_LDFLAGS
> and not to LDFLAGS_u-boot. Also before the patch the -pie option is used
> only for linking u-boot at the end of the build process and not for
> partial linking. Probably does it come when we used libraries instead of
> objects ?
>
> Setting LDFLAGS_u-boot in arch/arm/config.mk to -pie and removing it
> from PLATFORM_LDFLAGS removes the build error. Not yet tested, anyway.
>
> Best regards,
> Stefano Babic

-pie is used to generate the ARM ELF relocation tables in U-Boot, and 
should indeed be used only for the final stage linking; so moving it to 
LDFLAGS_u-boot is sensible.

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


Re: [U-Boot] various at91 patches to make some boards compilable again

2011-01-27 Thread Remy Bohmer
Hi

2010/11/1 Reinhard Meyer :
> Dear Alexander Stein,
>> This patch series changes some at91 boards to SoC access and adds some 
>> defines
>> to make the boards compilable again.
>> Please note: All changes are untested!
>
> Ok, I will look over them, and apply them in a test branch here, if they 
> don't break
> my board I think they can be mainlined, BUT you would need to be the 
> maintainer of those
> boards.

If there is still no maintainer for the at91sam9261ek board, I am
volunteering...

Kind regards,

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


Re: [U-Boot] [PATCH] ARM: fix broken build of ARM

2011-01-27 Thread Alexander Holler
Hello,

Am 27.01.2011 17:03, schrieb Stefano Babic:
> Commit 8aba9dceebb14144e07d19593111ee3a999c37fc breaks
> ARM boards because for ARM the -pie option is used
> for partial linking together with -r option.
>
> The patch adds the -pie option to link u-boot.bin only.

Using native compilation with gcc 4.5.2 and binutils 2.21 this patch 
will result in an unusable u-boot. It halts here after DRAM: ... just 
like it was before some relocation fixes (regarding binutils).

Regards,

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


Re: [U-Boot] [PATCH] ARM: fix broken build of ARM

2011-01-27 Thread Albert ARIBAUD
Hi Alexander,

Le 27/01/2011 20:42, Alexander Holler a écrit :
> Hello,
>
> Am 27.01.2011 17:03, schrieb Stefano Babic:
>> Commit 8aba9dceebb14144e07d19593111ee3a999c37fc breaks
>> ARM boards because for ARM the -pie option is used
>> for partial linking together with -r option.
>>
>> The patch adds the -pie option to link u-boot.bin only.
>
> Using native compilation with gcc 4.5.2 and binutils 2.21 this patch
> will result in an unusable u-boot. It halts here after DRAM: ... just
> like it was before some relocation fixes (regarding binutils).

Which board do you compile?

> Regards,
>
> Alexander

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


Re: [U-Boot] [PATCH] ARM: fix broken build of ARM

2011-01-27 Thread Alexander Holler
Am 27.01.2011 21:20, schrieb Albert ARIBAUD:
> Hi Alexander,
>
> Le 27/01/2011 20:42, Alexander Holler a écrit :
>> Hello,
>>
>> Am 27.01.2011 17:03, schrieb Stefano Babic:
>>> Commit 8aba9dceebb14144e07d19593111ee3a999c37fc breaks
>>> ARM boards because for ARM the -pie option is used
>>> for partial linking together with -r option.
>>>
>>> The patch adds the -pie option to link u-boot.bin only.
>>
>> Using native compilation with gcc 4.5.2 and binutils 2.21 this patch
>> will result in an unusable u-boot. It halts here after DRAM: ... just
>> like it was before some relocation fixes (regarding binutils).
>
> Which board do you compile?

Upps, sorry, that one was on a BeagleBoard (armv7, omap3).

Regards,

Alexander

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


[U-Boot] [Patch V6 0/4] Add basic NVIDIA Tegra2 SoC support

2011-01-27 Thread Tom Warren
This series of patches adds preliminary/baseline support for NVIDIA's
Tegra2 SoC.  Basic CPU (AVP), RAM and UART init are covered so that the
system (Harmony or Seaboard) can boot to the U-Boot serial cmd prompt.

Further support (for Cortex-A9 CPU(s), USB, SD/MMC, etc.) to follow.

Changes for V2:
- Coding style cleanup
- Remove mach-types.h change; wait for ARM kernel sync-up
- Move serial driver changes to separate patch
- Use board/nvidia/ instead of /board/tegra
- Remove TRUE/FALSE defines
- Use standard NS16550 register/bit defines in UART init
- Change nv-common.h config file to tegra2-common.h

Changes for V3:
- Use I/O accessors for Tegra2 HW MMIO register access
- Allow conditional compile of UARTA/UARTD code to save space

Changes for V4:
- Use address of HW structs (&pmc, etc.) in readl/writel
- Remove empty lines, fix mixed case hex #s & comments in header(s)
- Move board/nvidia/common/board.c UART code & header to 
arch/arm/cpu/armv7/tegra2/
- Declare internal functions as static in UART code

Changes for V5:
- Move arch/arm/cpu/armv7/uart.c & board.h to drivers/serial and
rename to serial_tegra2.c
- Remove use of uart_num & UART_A/D in serial_tegra2, simplify code

Changes for V6:
- Fix uart.c add & delete in previous patchset
- Move pinmux & clock init code to common board file as per review
- Use #if defined() where possible in config files/UART code
- Drop all typedef and volatile struct declarations in header files

Tom Warren (4):
  arm: Tegra2: Add basic NVIDIA Tegra2 SoC support
  serial: Add Tegra2 serial port support
  arm: Tegra2: Add support for NVIDIA Harmony board
  arm: Tegra2: Add support for NVIDIA Seaboard board

 MAINTAINERS  |5 +
 arch/arm/cpu/armv7/tegra2/Makefile   |   48 +++
 arch/arm/cpu/armv7/tegra2/board.c|   88 
 arch/arm/cpu/armv7/tegra2/config.mk  |   28 
 arch/arm/cpu/armv7/tegra2/lowlevel_init.S|   65 +
 arch/arm/cpu/armv7/tegra2/sys_info.c |   35 +
 arch/arm/cpu/armv7/tegra2/timer.c|  122 
 arch/arm/include/asm/arch-tegra2/clk_rst.h   |  165 ++
 arch/arm/include/asm/arch-tegra2/pinmux.h|   55 
 arch/arm/include/asm/arch-tegra2/pmc.h   |  124 +
 arch/arm/include/asm/arch-tegra2/sys_proto.h |   35 +
 arch/arm/include/asm/arch-tegra2/tegra2.h|   49 +++
 arch/arm/include/asm/arch-tegra2/uart.h  |   47 ++
 board/nvidia/common/board.c  |  193 ++
 board/nvidia/harmony/Makefile|   50 +++
 board/nvidia/seaboard/Makefile   |   50 +++
 boards.cfg   |2 +
 common/serial.c  |3 +-
 drivers/serial/Makefile  |1 +
 drivers/serial/serial_tegra2.c   |   77 ++
 drivers/serial/serial_tegra2.h   |   29 
 include/configs/harmony.h|   49 +++
 include/configs/seaboard.h   |   43 ++
 include/configs/tegra2-common.h  |  160 +
 include/serial.h |3 +-
 25 files changed, 1524 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/cpu/armv7/tegra2/Makefile
 create mode 100644 arch/arm/cpu/armv7/tegra2/board.c
 create mode 100644 arch/arm/cpu/armv7/tegra2/config.mk
 create mode 100644 arch/arm/cpu/armv7/tegra2/lowlevel_init.S
 create mode 100644 arch/arm/cpu/armv7/tegra2/sys_info.c
 create mode 100644 arch/arm/cpu/armv7/tegra2/timer.c
 create mode 100644 arch/arm/include/asm/arch-tegra2/clk_rst.h
 create mode 100644 arch/arm/include/asm/arch-tegra2/pinmux.h
 create mode 100644 arch/arm/include/asm/arch-tegra2/pmc.h
 create mode 100644 arch/arm/include/asm/arch-tegra2/sys_proto.h
 create mode 100644 arch/arm/include/asm/arch-tegra2/tegra2.h
 create mode 100644 arch/arm/include/asm/arch-tegra2/uart.h
 create mode 100644 board/nvidia/common/board.c
 create mode 100644 board/nvidia/harmony/Makefile
 create mode 100644 board/nvidia/seaboard/Makefile
 create mode 100644 drivers/serial/serial_tegra2.c
 create mode 100644 drivers/serial/serial_tegra2.h
 create mode 100644 include/configs/harmony.h
 create mode 100644 include/configs/seaboard.h
 create mode 100644 include/configs/tegra2-common.h

-- 
1.7.3.5

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


[U-Boot] [Patch V6 1/4] arm: Tegra2: Add basic NVIDIA Tegra2 SoC support

2011-01-27 Thread Tom Warren
Signed-off-by: Tom Warren 
---
Changes for V2:
- Coding style cleanup
- Move serial driver changes to separate patch
- Use board/nvidia instead of board/tegra
- Remove TRUE/FALSE defines
- Use standard NS16550 registers/bit defines in UART init

Changes for V3:
- Use I/O accessors for Tegra2 HW MMIO register access
- Allow conditional compile of UARTA/UARTD code to save space

Changes for V4:
- Use address of HW structs (&pmc, etc.) in readl/writel
- Remove empty lines, fix mixed case hex #s & comments in header(s)
- Move board/nvidia/common/board.c UART code & header to 
arch/arm/cpu/armv7/tegra2/
- Declare internal functions as static in UART code

Changes for V6:
- Fix uart.c add & delete in previous patchset
- Move pinmux & clock init code to common board file as per review
- Use #if defined() where possible in config files/UART code
- Drop all typedef and volatile struct declarations in header files

 arch/arm/cpu/armv7/tegra2/Makefile   |   48 +++
 arch/arm/cpu/armv7/tegra2/board.c|   88 
 arch/arm/cpu/armv7/tegra2/config.mk  |   28 
 arch/arm/cpu/armv7/tegra2/lowlevel_init.S|   65 +
 arch/arm/cpu/armv7/tegra2/sys_info.c |   35 +
 arch/arm/cpu/armv7/tegra2/timer.c|  122 
 arch/arm/include/asm/arch-tegra2/clk_rst.h   |  165 ++
 arch/arm/include/asm/arch-tegra2/pinmux.h|   55 
 arch/arm/include/asm/arch-tegra2/pmc.h   |  124 +
 arch/arm/include/asm/arch-tegra2/sys_proto.h |   35 +
 arch/arm/include/asm/arch-tegra2/tegra2.h|   49 +++
 arch/arm/include/asm/arch-tegra2/uart.h  |   47 ++
 board/nvidia/common/board.c  |  193 ++
 13 files changed, 1054 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/cpu/armv7/tegra2/Makefile
 create mode 100644 arch/arm/cpu/armv7/tegra2/board.c
 create mode 100644 arch/arm/cpu/armv7/tegra2/config.mk
 create mode 100644 arch/arm/cpu/armv7/tegra2/lowlevel_init.S
 create mode 100644 arch/arm/cpu/armv7/tegra2/sys_info.c
 create mode 100644 arch/arm/cpu/armv7/tegra2/timer.c
 create mode 100644 arch/arm/include/asm/arch-tegra2/clk_rst.h
 create mode 100644 arch/arm/include/asm/arch-tegra2/pinmux.h
 create mode 100644 arch/arm/include/asm/arch-tegra2/pmc.h
 create mode 100644 arch/arm/include/asm/arch-tegra2/sys_proto.h
 create mode 100644 arch/arm/include/asm/arch-tegra2/tegra2.h
 create mode 100644 arch/arm/include/asm/arch-tegra2/uart.h
 create mode 100644 board/nvidia/common/board.c

diff --git a/arch/arm/cpu/armv7/tegra2/Makefile 
b/arch/arm/cpu/armv7/tegra2/Makefile
new file mode 100644
index 000..687c887
--- /dev/null
+++ b/arch/arm/cpu/armv7/tegra2/Makefile
@@ -0,0 +1,48 @@
+#
+# (C) Copyright 2010,2011 Nvidia Corporation.
+#
+# (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).o
+
+SOBJS  := lowlevel_init.o
+COBJS  := board.o sys_info.o timer.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS) $(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/tegra2/board.c 
b/arch/arm/cpu/armv7/tegra2/board.c
new file mode 100644
index 000..9061d18
--- /dev/null
+++ b/arch/arm/cpu/armv7/tegra2/board.c
@@ -0,0 +1,88 @@
+/*
+ *  (C) Copyright 2010,2011
+ *  NVIDIA Corporation 
+ *
+ * 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 op

[U-Boot] [Patch V6 2/4] serial: Add Tegra2 serial port support

2011-01-27 Thread Tom Warren
Signed-off-by: Tom Warren 
---
Changes for V2:
- Move serial driver to separate patch

Changes for V5:
- Move arch/arm/cpu/armv7/uart.c & board.h to drivers/serial and
rename to serial_tegra2.c
- Remove use of uart_num & UART_A/D in serial_tegra2, simplify code

Changes for V6:
- Fix uart.c add & delete in previous patchset
- Move pinmux & clock init code to common board file as per review
- Use #if defined() where possible in config files/UART code

 common/serial.c|3 +-
 drivers/serial/Makefile|1 +
 drivers/serial/serial_tegra2.c |   77 
 drivers/serial/serial_tegra2.h |   29 +++
 include/serial.h   |3 +-
 5 files changed, 111 insertions(+), 2 deletions(-)
 create mode 100644 drivers/serial/serial_tegra2.c
 create mode 100644 drivers/serial/serial_tegra2.h

diff --git a/common/serial.c b/common/serial.c
index 051ae4e..8ebf9a5 100644
--- a/common/serial.c
+++ b/common/serial.c
@@ -41,7 +41,8 @@ struct serial_device *__default_serial_console (void)
 #elif defined(CONFIG_4xx) \
|| defined(CONFIG_MB86R0x) || defined(CONFIG_MPC5xxx) \
|| defined(CONFIG_MPC83xx) || defined(CONFIG_MPC85xx) \
-   || defined(CONFIG_MPC86xx) || defined(CONFIG_SYS_SC520)
+   || defined(CONFIG_MPC86xx) || defined(CONFIG_SYS_SC520) \
+   || defined(CONFIG_TEGRA2)
 #if defined(CONFIG_CONS_INDEX) && defined(CONFIG_SYS_NS16550_SERIAL)
 #if (CONFIG_CONS_INDEX==1)
return &eserial1_device;
diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
index 7d221fc..5a6011e 100644
--- a/drivers/serial/Makefile
+++ b/drivers/serial/Makefile
@@ -55,6 +55,7 @@ COBJS-$(CONFIG_S3C24X0_SERIAL) += serial_s3c24x0.o
 COBJS-$(CONFIG_S3C44B0_SERIAL) += serial_s3c44b0.o
 COBJS-$(CONFIG_XILINX_UARTLITE) += serial_xuartlite.o
 COBJS-$(CONFIG_SCIF_CONSOLE) += serial_sh.o
+COBJS-$(CONFIG_TEGRA2) += serial_tegra2.o
 COBJS-$(CONFIG_USB_TTY) += usbtty.o
 
 COBJS  := $(sort $(COBJS-y))
diff --git a/drivers/serial/serial_tegra2.c b/drivers/serial/serial_tegra2.c
new file mode 100644
index 000..8ff34ea
--- /dev/null
+++ b/drivers/serial/serial_tegra2.c
@@ -0,0 +1,77 @@
+/*
+ *  (C) Copyright 2010,2011
+ *  NVIDIA Corporation 
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include "serial_tegra2.h"
+
+static void setup_uart(struct uart_ctlr *u)
+{
+   u32 reg;
+
+   /* Prepare the divisor value */
+   reg = NVRM_PLLP_FIXED_FREQ_KHZ * 1000 / NV_DEFAULT_DEBUG_BAUD / 16;
+
+   /* Set up UART parameters */
+   writel(UART_LCR_DLAB, &u->uart_lcr);
+   writel(reg, &u->uart_thr_dlab_0);
+   writel(0, &u->uart_ier_dlab_0);
+   writel(0, &u->uart_lcr);/* clear DLAB */
+   writel((UART_FCR_TRIGGER_3 | UART_FCR_FIFO_EN | \
+   UART_FCR_CLEAR_XMIT | UART_FCR_CLEAR_RCVR), &u->uart_iir_fcr);
+   writel(0, &u->uart_ier_dlab_0);
+   writel(UART_LCR_WLS_8, &u->uart_lcr);   /* 8N1 */
+   writel(UART_MCR_RTS, &u->uart_mcr);
+   writel(0, &u->uart_msr);
+   writel(0, &u->uart_spr);
+   writel(0, &u->uart_irda_csr);
+   writel(0, &u->uart_asr);
+   writel((UART_FCR_TRIGGER_3 | UART_FCR_FIFO_EN), &u->uart_iir_fcr);
+
+   /* Flush any old characters out of the RX FIFO */
+   reg = readl(&u->uart_lsr);
+
+   while (reg & UART_LSR_DR) {
+   reg = readl(&u->uart_thr_dlab_0);
+   reg = readl(&u->uart_lsr);
+   }
+}
+
+/*
+ * Routine: uart_init
+ * Description: init the UART clocks, muxes, and baudrate/parity/etc.
+ */
+void uart_init(void)
+{
+   struct uart_ctlr *uart = (struct uart_ctlr *)NV_PA_APB_UARTD_BASE;
+#if defined(CONFIG_TEGRA2_ENABLE_UARTD)
+   setup_uart(uart);
+#endif /* CONFIG_TEGRA2_ENABLE_UARTD */
+#if defined(CONFIG_TEGRA2_ENABLE_UARTA)
+   uart = (struct uart_ctlr *)NV_PA_APB_UARTA_BASE;
+
+   setup_uart(uart);
+#endif /* CONFIG_TEGRA2_ENABLE_UARTA */
+}
diff --git a/drivers/serial/serial_tegra2.h b/drivers/serial/serial_tegra2.h
new file mode 100644
index 000..5704800
--- /dev/null
+++ b/drivers/serial/serial_tegra2.h
@@ -0,

[U-Boot] [Patch V6 3/4] arm: Tegra2: Add support for NVIDIA Harmony board

2011-01-27 Thread Tom Warren
Signed-off-by: Tom Warren 
---
Changes for V2:
- Use board/nvidia/ instead of /board/tegra
- Change nv-common.h config file to tegra2-common.h

Changes for V6:
- Use #if defined() where possible in config files/UART code

 MAINTAINERS |4 +
 board/nvidia/harmony/Makefile   |   50 
 boards.cfg  |1 +
 include/configs/harmony.h   |   49 
 include/configs/tegra2-common.h |  160 +++
 5 files changed, 264 insertions(+), 0 deletions(-)
 create mode 100644 board/nvidia/harmony/Makefile
 create mode 100644 include/configs/harmony.h
 create mode 100644 include/configs/tegra2-common.h

diff --git a/MAINTAINERS b/MAINTAINERS
index ba83f71..b5cff19 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -841,6 +841,10 @@ Prafulla Wadaskar 
rd6281a ARM926EJS (Kirkwood SoC)
sheevaplug  ARM926EJS (Kirkwood SoC)
 
+Tom Warren 
+
+   harmony Tegra2 (ARM7 & A9 Dual Core)
+
 Matthias Weisser 
 
jadecpu ARM926EJS (MB86R01 SoC)
diff --git a/board/nvidia/harmony/Makefile b/board/nvidia/harmony/Makefile
new file mode 100644
index 000..3a146cb
--- /dev/null
+++ b/board/nvidia/harmony/Makefile
@@ -0,0 +1,50 @@
+#
+#  (C) Copyright 2010,2011
+#  NVIDIA Corporation 
+#
+#
+#  See file CREDITS for list of people who contributed to this
+#  project.
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License as
+#  published by the Free Software Foundation; either version 2 of
+#  the License, or (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+#  MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).o
+
+COBJS  += ../common/board.o
+
+SRCS   := $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+
+$(LIB):$(obj).depend $(OBJS)
+   $(AR) $(ARFLAGS) $@ $(OBJS)
+
+clean:
+   rm -f $(OBJS)
+
+distclean: clean
+   rm -f $(LIB) core *.bak $(obj).depend
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/boards.cfg b/boards.cfg
index 94b8745..ee7c4b7 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -122,6 +122,7 @@ omap4_panda  arm armv7   panda  
 ti
 omap4_sdp4430arm armv7   sdp4430 ti
 omap4
 s5p_goni arm armv7   goni
samsungs5pc1xx
 smdkc100 arm armv7   smdkc100
samsungs5pc1xx
+harmony  arm armv7   harmony 
nvidia tegra2
 actux1   arm ixp
 actux2   arm ixp
 actux3   arm ixp
diff --git a/include/configs/harmony.h b/include/configs/harmony.h
new file mode 100644
index 000..d004f31
--- /dev/null
+++ b/include/configs/harmony.h
@@ -0,0 +1,49 @@
+/*
+ *  (C) Copyright 2010,2011
+ *  NVIDIA Corporation 
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+#include 
+#include "tegra2-common.h"
+
+/* High-level configuration options */
+#define TEGRA2_SYSMEM  "mem=384M@0M nvmem=128M@384M mem=512M@512M"
+#define V_PROMPT   "Tegra2 (Harmony) # "
+#define CONFIG_TEGRA2_BOARD_STRING "NVIDIA Harmony"
+
+/* Board-specific serial config */
+#define CONFIG_SERIAL_MULTI
+#define CONFIG_TEGRA2_ENABLE_UARTD
+
+/* UARTD: keyboard satellite board UART, default */
+#define CONFI

[U-Boot] [Patch V6 4/4] arm: Tegra2: Add support for NVIDIA Seaboard board

2011-01-27 Thread Tom Warren
Signed-off-by: Tom Warren 
---
Changes for V2:
- Remove mach-types.h change; wait for ARM kernel sync-up
- Use board/nvidia instead of board/tegra

Changes for V6:
- Use #if defined() where possible in config files/UART code


 MAINTAINERS|1 +
 board/nvidia/seaboard/Makefile |   50 
 boards.cfg |1 +
 include/configs/seaboard.h |   43 ++
 4 files changed, 95 insertions(+), 0 deletions(-)
 create mode 100644 board/nvidia/seaboard/Makefile
 create mode 100644 include/configs/seaboard.h

diff --git a/MAINTAINERS b/MAINTAINERS
index b5cff19..f4795d3 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -844,6 +844,7 @@ Prafulla Wadaskar 
 Tom Warren 
 
harmony Tegra2 (ARM7 & A9 Dual Core)
+   seaboardTegra2 (ARM7 & A9 Dual Core)
 
 Matthias Weisser 
 
diff --git a/board/nvidia/seaboard/Makefile b/board/nvidia/seaboard/Makefile
new file mode 100644
index 000..3a146cb
--- /dev/null
+++ b/board/nvidia/seaboard/Makefile
@@ -0,0 +1,50 @@
+#
+#  (C) Copyright 2010,2011
+#  NVIDIA Corporation 
+#
+#
+#  See file CREDITS for list of people who contributed to this
+#  project.
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License as
+#  published by the Free Software Foundation; either version 2 of
+#  the License, or (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+#  MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).o
+
+COBJS  += ../common/board.o
+
+SRCS   := $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+
+$(LIB):$(obj).depend $(OBJS)
+   $(AR) $(ARFLAGS) $@ $(OBJS)
+
+clean:
+   rm -f $(OBJS)
+
+distclean: clean
+   rm -f $(LIB) core *.bak $(obj).depend
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/boards.cfg b/boards.cfg
index ee7c4b7..3c4c249 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -123,6 +123,7 @@ omap4_sdp4430arm armv7   
sdp4430 ti
 s5p_goni arm armv7   goni
samsungs5pc1xx
 smdkc100 arm armv7   smdkc100
samsungs5pc1xx
 harmony  arm armv7   harmony 
nvidia tegra2
+seaboard arm armv7   seaboard
nvidia tegra2
 actux1   arm ixp
 actux2   arm ixp
 actux3   arm ixp
diff --git a/include/configs/seaboard.h b/include/configs/seaboard.h
new file mode 100644
index 000..fd87560
--- /dev/null
+++ b/include/configs/seaboard.h
@@ -0,0 +1,43 @@
+/*
+ *  (C) Copyright 2010,2011
+ *  NVIDIA Corporation 
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+#include 
+#include "tegra2-common.h"
+
+/* High-level configuration options */
+#define TEGRA2_SYSMEM  "mem=384M@0M nvmem=128M@384M mem=512M@512M"
+#define V_PROMPT   "Tegra2 (SeaBoard) # "
+#define CONFIG_TEGRA2_BOARD_STRING "NVIDIA Seaboard"
+
+/* Board-specific serial config */
+#define CONFIG_SERIAL_MULTI
+#define CONFIG_TEGRA2_ENABLE_UARTD
+#define CONFIG_SYS_NS16550_COM1NV_PA_APB_UARTD_BASE
+
+#define CONFIG_MACH_TYPE   MACH_TYPE_TEGRA_SEABOARD
+#define CONFIG_SYS_BOARD_ODMDATA   0x300d8011 /* lp1, 1GB */
+
+#endif /* __CONFIG_H */
-- 
1.7

Re: [U-Boot] [PATCH] ARM: fix broken build of ARM

2011-01-27 Thread Albert ARIBAUD
Le 27/01/2011 21:55, Alexander Holler a écrit :
> Am 27.01.2011 21:20, schrieb Albert ARIBAUD:
>> Hi Alexander,
>>
>> Le 27/01/2011 20:42, Alexander Holler a écrit :
>>> Hello,
>>>
>>> Am 27.01.2011 17:03, schrieb Stefano Babic:
 Commit 8aba9dceebb14144e07d19593111ee3a999c37fc breaks
 ARM boards because for ARM the -pie option is used
 for partial linking together with -r option.

 The patch adds the -pie option to link u-boot.bin only.
>>>
>>> Using native compilation with gcc 4.5.2 and binutils 2.21 this patch
>>> will result in an unusable u-boot. It halts here after DRAM: ... just
>>> like it was before some relocation fixes (regarding binutils).
>>
>> Which board do you compile?
>
> Upps, sorry, that one was on a BeagleBoard (armv7, omap3).

I've just tried the following to compare make logs of before commit 
8aba9dceebb14144e07d19593111ee3a999c37fc on the one hand and after this 
commit and with the proposed fix on the other hand:

git checkout 8aba9dceebb14144e07d19593111ee3a999c37fc^

(that's the commit just before the one which split LD_FLAGS)

make distclean ; make edminiv2_config; make > ~/old.txt 2>&1

git checkout 8aba9dceebb14144e07d19593111ee3a999c37fc

(that's the commit which split LD_FLAGS)

(replace "PLATFORM_LDFLAGS += -pie" with "LDFLAGS_u-boot += -pie" in 
arch/arm/config.mk)

make distclean ; make edminiv2_config; make > ~/new.txt 2>&1

(and finally)

kdiff3 ~/old.txt ~/new.txt

The only difference I see between the make logs is the relative location 
of the -pie option in the final ld invocation: in the 'old' case options go

...  -Bstatic -T u-boot.lds  -pie -Ttext ...

whereas in the 'new' case, they go

... -pie -Bstatic -T u-boot.lds  -Ttext ...

So I think the binary should be pretty much the same in the 'old' and 
'new' cases, and that should be irrespective of the tool chain.

Alexander, can you run the same test with your BeagleBoard and let me 
know of any differences?

> Regards,
>
> Alexander

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


Re: [U-Boot] [PATCH] Driver for AX88183 ethernet chip

2011-01-27 Thread Wolfgang Denk
Dear root,

In message <1296154517-9577-1-git-send-email-lg...@hotmail.com> you wrote:
> From: Joe Xue 

Please add your Signed-off-by: line, and provide a real name in the
sender address.

And then please run your patch through checkpatch.pl; as is it
reports: total: 383 errors, 327 warnings

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Until you walk a mile in another man's moccasins, you  can't  imagine
the smell.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] ARM: fix broken build of ARM

2011-01-27 Thread Wolfgang Denk
Dear Albert ARIBAUD,

In message <4d41df41.4000...@free.fr> you wrote:
>
> So I think the binary should be pretty much the same in the 'old' and 
> 'new' cases, and that should be irrespective of the tool chain.
>
> Alexander, can you run the same test with your BeagleBoard and let me
> know of any differences?

Also running a diff over the System.map and u-boot.map files is
usually a good and easy test that images are identical.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
"More software projects have gone awry for lack of calendar time than
for all other causes combined."
 - Fred Brooks, Jr., _The Mythical Man Month_
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] ARM: fix broken build of ARM

2011-01-27 Thread Albert ARIBAUD
Le 27/01/2011 22:14, Wolfgang Denk a écrit :
> Dear Albert ARIBAUD,
>
> In message<4d41df41.4000...@free.fr>  you wrote:
>>
>> So I think the binary should be pretty much the same in the 'old' and
>> 'new' cases, and that should be irrespective of the tool chain.
>>
>> Alexander, can you run the same test with your BeagleBoard and let me
>> know of any differences?
>
> Also running a diff over the System.map and u-boot.map files is
> usually a good and easy test that images are identical.

Indeed -- my goal was to compare the build processes more than their 
products.

> Best regards,
>
> Wolfgang Denk

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


Re: [U-Boot] [PATCH] ARM: fix broken build of ARM

2011-01-27 Thread Alexander Holler
Am 27.01.2011 22:10, schrieb Albert ARIBAUD:
> Le 27/01/2011 21:55, Alexander Holler a écrit :
>> Am 27.01.2011 21:20, schrieb Albert ARIBAUD:
>>> Hi Alexander,
>>>
>>> Le 27/01/2011 20:42, Alexander Holler a écrit :
 Hello,

 Am 27.01.2011 17:03, schrieb Stefano Babic:
> Commit 8aba9dceebb14144e07d19593111ee3a999c37fc breaks
> ARM boards because for ARM the -pie option is used
> for partial linking together with -r option.
>
> The patch adds the -pie option to link u-boot.bin only.

 Using native compilation with gcc 4.5.2 and binutils 2.21 this patch
 will result in an unusable u-boot. It halts here after DRAM: ... just
 like it was before some relocation fixes (regarding binutils).
>>>
>>> Which board do you compile?
>>
>> Upps, sorry, that one was on a BeagleBoard (armv7, omap3).
>
> I've just tried the following to compare make logs of before commit
> 8aba9dceebb14144e07d19593111ee3a999c37fc on the one hand and after this
> commit and with the proposed fix on the other hand:

Oh, it seems I've got misunderstood, the patch from Stefano Babic breaks 
u-boot here and not the commit 8aba9dceebb14144e07d19593111ee3a999c37fc.

Regards,

Alexander

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


Re: [U-Boot] [PATCH v4 1/3] S5P: serial: Use the inline function instead of static value

2011-01-27 Thread Graeme Russ
Hi Minkyu,

On Mon, Jan 24, 2011 at 6:33 PM, Minkyu Kang  wrote:
> Signed-off-by: Minkyu Kang 
> ---
>  arch/arm/include/asm/arch-s5pc1xx/uart.h |    5 -
>  drivers/serial/serial_s5p.c              |    2 +-
>  2 files changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/include/asm/arch-s5pc1xx/uart.h 
> b/arch/arm/include/asm/arch-s5pc1xx/uart.h
> index f6eeab4..1c56739 100644
> --- a/arch/arm/include/asm/arch-s5pc1xx/uart.h
> +++ b/arch/arm/include/asm/arch-s5pc1xx/uart.h
> @@ -48,7 +48,10 @@ struct s5p_uart {
>        unsigned char   res3[0x3d0];
>  };
>
> -static int use_divslot = 1;
> +static inline int s5p_uart_divslot(void)
> +{
> +       return 1;
> +}
>
>  #endif /* __ASSEMBLY__ */
>
> diff --git a/drivers/serial/serial_s5p.c b/drivers/serial/serial_s5p.c
> index 9c1cbf4..f1ffa29 100644
> --- a/drivers/serial/serial_s5p.c
> +++ b/drivers/serial/serial_s5p.c
> @@ -72,7 +72,7 @@ void serial_setbrg_dev(const int dev_index)
>
>        writel(val / 16 - 1, &uart->ubrdiv);
>
> -       if (use_divslot)
> +       if (s5p_uart_divslot())
>                writew(udivslot[val % 16], &uart->rest.slot);
>        else
>                writeb(val % 16, &uart->rest.value);

Just for my own curiosity, what is the reason behind this?

I would have thought a #define would even work quite nicely.

Regards,

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


Re: [U-Boot] [PATCH] ARM: fix broken build of ARM

2011-01-27 Thread Albert ARIBAUD
Le 27/01/2011 22:32, Alexander Holler a écrit :
> Am 27.01.2011 22:10, schrieb Albert ARIBAUD:
>> Le 27/01/2011 21:55, Alexander Holler a écrit :
>>> Am 27.01.2011 21:20, schrieb Albert ARIBAUD:
 Hi Alexander,

 Le 27/01/2011 20:42, Alexander Holler a écrit :
> Hello,
>
> Am 27.01.2011 17:03, schrieb Stefano Babic:
>> Commit 8aba9dceebb14144e07d19593111ee3a999c37fc breaks
>> ARM boards because for ARM the -pie option is used
>> for partial linking together with -r option.
>>
>> The patch adds the -pie option to link u-boot.bin only.
>
> Using native compilation with gcc 4.5.2 and binutils 2.21 this patch
> will result in an unusable u-boot. It halts here after DRAM: ... just
> like it was before some relocation fixes (regarding binutils).

 Which board do you compile?
>>>
>>> Upps, sorry, that one was on a BeagleBoard (armv7, omap3).
>>
>> I've just tried the following to compare make logs of before commit
>> 8aba9dceebb14144e07d19593111ee3a999c37fc on the one hand and after this
>> commit and with the proposed fix on the other hand:
>
> Oh, it seems I've got misunderstood, the patch from Stefano Babic breaks
> u-boot here and not the commit 8aba9dceebb14144e07d19593111ee3a999c37fc.

I think I understood you: what I do is compile without commit 8aba9dce 
on the one hand, and with it _plus Stefano's patch_ on the other hand, 
in order to see how things compiled before we split LDFLAGS (8aba9dce^) 
with how things compile if we split LDFLAGS (8aba9dce) with -pie in the 
right place (Stefano's patch).

Can you try that?

> Regards,
>
> Alexander

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


[U-Boot] [PATCH] USB: Fix device stati for removable and powerctrl (typo)

2011-01-27 Thread Alexander Holler
I currently don't know if the error could have other consequences
than a wrong output when turning debug on.

Signed-off-by: Alexander Holler 
---
 common/usb.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/common/usb.c b/common/usb.c
index 10e23de..aa28de0 100644
--- a/common/usb.c
+++ b/common/usb.c
@@ -1220,7 +1220,7 @@ int usb_hub_configure(struct usb_device *dev)
hub->desc.DeviceRemovable[i] = descriptor->DeviceRemovable[i];
 
for (i = 0; i < ((hub->desc.bNbrPorts + 1 + 7)/8); i++)
-   hub->desc.DeviceRemovable[i] = descriptor->PortPowerCtrlMask[i];
+   hub->desc.PortPowerCtrlMask[i] = 
descriptor->PortPowerCtrlMask[i];
 
dev->maxchild = descriptor->bNbrPorts;
USB_HUB_PRINTF("%d ports detected\n", dev->maxchild);
-- 
1.7.3.4

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


Re: [U-Boot] Please pull u-boot-samsung/master

2011-01-27 Thread Albert ARIBAUD
Hi Minkyu Kang,

Le 27/01/2011 13:29, Minkyu Kang a écrit :
> Dear Albert ARIBAUD,
>
> The following changes since commit b722e646f9a6e2ebcae4845afc596b4dad4f7bcb:
>
>DaVinci DM6467: Enhance board Support (2010-12-28 17:38:22 -0500)
>
> are available in the git repository at:
>git://git.denx.de/u-boot-samsung master
>
> Minkyu Kang (4):
>armv7: s5pc1xx: don't use function pointer for clock functions
>S5P: serial: Use the inline function instead of static value
>armv7: add support for S5PC210 SoC
>armv7: add support for s5pc210 universal board

Applied to u-boot-arm, thanks.

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


Re: [U-Boot] [PATCH] ARM: fix broken build of ARM

2011-01-27 Thread Alexander Holler
Am 27.01.2011 22:40, schrieb Albert ARIBAUD:
> Le 27/01/2011 22:32, Alexander Holler a écrit :
>> Am 27.01.2011 22:10, schrieb Albert ARIBAUD:
>>> Le 27/01/2011 21:55, Alexander Holler a écrit :
 Am 27.01.2011 21:20, schrieb Albert ARIBAUD:
> Hi Alexander,
>
> Le 27/01/2011 20:42, Alexander Holler a écrit :
>> Hello,
>>
>> Am 27.01.2011 17:03, schrieb Stefano Babic:
>>> Commit 8aba9dceebb14144e07d19593111ee3a999c37fc breaks
>>> ARM boards because for ARM the -pie option is used
>>> for partial linking together with -r option.
>>>
>>> The patch adds the -pie option to link u-boot.bin only.
>>
>> Using native compilation with gcc 4.5.2 and binutils 2.21 this patch
>> will result in an unusable u-boot. It halts here after DRAM: ... just
>> like it was before some relocation fixes (regarding binutils).
>
> Which board do you compile?

 Upps, sorry, that one was on a BeagleBoard (armv7, omap3).
>>>
>>> I've just tried the following to compare make logs of before commit
>>> 8aba9dceebb14144e07d19593111ee3a999c37fc on the one hand and after this
>>> commit and with the proposed fix on the other hand:
>>
>> Oh, it seems I've got misunderstood, the patch from Stefano Babic breaks
>> u-boot here and not the commit 8aba9dceebb14144e07d19593111ee3a999c37fc.
>
> I think I understood you: what I do is compile without commit 8aba9dce
> on the one hand, and with it _plus Stefano's patch_ on the other hand,
> in order to see how things compiled before we split LDFLAGS (8aba9dce^)
> with how things compile if we split LDFLAGS (8aba9dce) with -pie in the
> right place (Stefano's patch).
>
> Can you try that?

Sorry, again. While hunting another problem I've applied Stefano's patch 
but haven't had 8aba9dceebb14144e07d19593111ee3a999c37fc (I was on the 
wrong branch here).
I've now rebased to the master (which includes the above commit) and 
applied Stefano's patch and it works.

Sorry for the noise.

Regards,

Alexander

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


Re: [U-Boot] [PATCH] ARM: fix broken build of ARM

2011-01-27 Thread Albert ARIBAUD
Le 27/01/2011 23:19, Alexander Holler a écrit :

> I've now rebased to the master (which includes the above commit) and
> applied Stefano's patch and it works.
>
> Sorry for the noise.

No problems. You can add your Tested-by: to Stefano's first post in this 
thread. :)

> Regards,
>
> Alexander

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


Re: [U-Boot] [PATCH] ARM: fix broken build of ARM

2011-01-27 Thread Alexander Holler
Am 27.01.2011 17:03, schrieb Stefano Babic:
> Commit 8aba9dceebb14144e07d19593111ee3a999c37fc breaks
> ARM boards because for ARM the -pie option is used
> for partial linking together with -r option.
>
> The patch adds the -pie option to link u-boot.bin only.
>
> Signed-off-by: Stefano Babic
> CC: Jason Liu
> CC: l...@dooz.org
> CC: Wolfgang Denk
> CC: Albert Aribaud

Tested-by: Alexander Holler 

Regards,

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


Re: [U-Boot] [PATCH 1/1] fix min/max macros in common.h

2011-01-27 Thread Aaron Williams
Any comments on this?  This bug caused me a lot of problems since we make use 
of 64-bit values quite a bit.

-Aaron

On Tuesday, January 25, 2011 02:30:55 pm Aaron Williams wrote:
> In some of my work with the Cavium Octeon 64-bit processor I ran into a
> problem with the min and max macros provided in common.h. The problem
> occurs if x is 32-bit and y is 64-bit. In this case, y will always be
> truncated to 32-bits.  This patch fixes this problem.
> 
> -Aaron
> 
> diff --git a/include/common.h b/include/common.h
> index d8c912d..cf5c076 100644
> --- a/include/common.h
> +++ b/include/common.h
> @@ -180,11 +180,13 @@ typedef void (interrupt_handler_t)(void *);
>   * General Purpose Utilities
>   */
>  #define min(X, Y)  \
> -   ({ typeof (X) __x = (X), __y = (Y); \
> +   ({ typeof (X) __x = (X);\
> +   typeof (Y) __y = (Y);   \
> (__x < __y) ? __x : __y; })
> 
>  #define max(X, Y)  \
> -   ({ typeof (X) __x = (X), __y = (Y); \
> +   ({ typeof (X) __x = (X);\
> +   typeof (Y) __y = (Y);   \
> (__x > __y) ? __x : __y; })
> 
>  #define MIN(x, y)  min(x, y)
> ___
> 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] ARM: fix broken build of ARM

2011-01-27 Thread Stefano Babic
On 01/27/2011 11:19 PM, Alexander Holler wrote:

> Sorry, again. While hunting another problem I've applied Stefano's patch
> but haven't had 8aba9dceebb14144e07d19593111ee3a999c37fc (I was on the
> wrong branch here).
> I've now rebased to the master (which includes the above commit) and
> applied Stefano's patch and it works.
> 
> Sorry for the noise.

Thanks for testing. I tested again on a ARM11 board, and I have not seen
any problems. However, I tested with an older gcc version, and I could
not exclude issues with gcc 4.5

Regards,
Stefano

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


[U-Boot] [PATCH 1/2] Fix timer usage of the Atmel SPI dataflash driver

2011-01-27 Thread Remy Bohmer
Signed-off-by: Remy Bohmer 
---
 drivers/spi/atmel_dataflash_spi.c |8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/atmel_dataflash_spi.c 
b/drivers/spi/atmel_dataflash_spi.c
index 4a5c4aa..2f23f54 100644
--- a/drivers/spi/atmel_dataflash_spi.c
+++ b/drivers/spi/atmel_dataflash_spi.c
@@ -133,7 +133,7 @@ unsigned int AT91F_SpiWrite1(AT91PS_DataflashDesc pDesc);
 
 unsigned int AT91F_SpiWrite(AT91PS_DataflashDesc pDesc)
 {
-   unsigned int timeout;
+   u32 time_start, timeout;
 
pDesc->state = BUSY;
 
@@ -158,12 +158,12 @@ unsigned int AT91F_SpiWrite(AT91PS_DataflashDesc pDesc)
}
 
/* arm simple, non interrupt dependent timer */
-   reset_timer_masked();
-   timeout = 0;
+   time_start = get_timer(0);
 
writel(AT91_SPI_TXTEN + AT91_SPI_RXTEN, AT91_BASE_SPI + AT91_SPI_PTCR);
while (!(readl(AT91_BASE_SPI + AT91_SPI_SR) & AT91_SPI_RXBUFF) &&
-   ((timeout = get_timer_masked()) < CONFIG_SYS_SPI_WRITE_TOUT));
+   ((timeout = get_timer(time_start)) < 
CONFIG_SYS_SPI_WRITE_TOUT));
+
writel(AT91_SPI_TXTDIS + AT91_SPI_RXTDIS, AT91_BASE_SPI + 
AT91_SPI_PTCR);
pDesc->state = IDLE;
 
-- 
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] at91sam9261ek: make operational again

2011-01-27 Thread Remy Bohmer
Since U-boot v2010.12 the at91sam9261ek board is broken.
This is solved and tested on this board.

Note: It requires that the 1st stage bootloader (like Atmel at91-bootstrap)
to load U-boot at a different address compared to previous releases of
U-boot due to conflicts in the BSS area during relocation.
(0x23f0 -> -0x23e0)

Derived from a patch of: Alexander Stein 

Signed-off-by: Remy Bohmer 
---
 board/atmel/at91sam9261ek/Makefile|   10 +-
 board/atmel/at91sam9261ek/at91sam9261ek.c |7 ---
 board/atmel/at91sam9261ek/config.mk   |1 -
 include/configs/at91sam9261ek.h   |   25 +
 4 files changed, 30 insertions(+), 13 deletions(-)
 delete mode 100644 board/atmel/at91sam9261ek/config.mk

diff --git a/board/atmel/at91sam9261ek/Makefile 
b/board/atmel/at91sam9261ek/Makefile
index 9d20ba0..1da810f 100644
--- a/board/atmel/at91sam9261ek/Makefile
+++ b/board/atmel/at91sam9261ek/Makefile
@@ -29,16 +29,16 @@ include $(TOPDIR)/config.mk
 
 LIB= $(obj)lib$(BOARD).o
 
-COBJS-y += at91sam9261ek.o
+COBJS-y += $(BOARD).o
 COBJS-y += led.o
 COBJS-$(CONFIG_HAS_DATAFLASH) += partition.o
 
-SRCS   := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
-OBJS   := $(addprefix $(obj),$(COBJS-y))
-SOBJS  := $(addprefix $(obj),$(SOBJS))
+SRCS   := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS-y) $(SOBJS-y))
+SOBJS  := $(addprefix $(obj),$(SOBJS-y))
 
 $(LIB):$(obj).depend $(OBJS) $(SOBJS)
-   $(call cmd_link_o_target, $(OBJS) $(SOBJS))
+   $(call cmd_link_o_target, $(OBJS))
 
 clean:
rm -f $(SOBJS) $(OBJS)
diff --git a/board/atmel/at91sam9261ek/at91sam9261ek.c 
b/board/atmel/at91sam9261ek/at91sam9261ek.c
index de5cfae..25c181e 100644
--- a/board/atmel/at91sam9261ek/at91sam9261ek.c
+++ b/board/atmel/at91sam9261ek/at91sam9261ek.c
@@ -246,7 +246,7 @@ int board_init(void)
gd->bd->bi_arch_number = MACH_TYPE_AT91SAM9261EK;
 #endif
/* adress of boot parameters */
-   gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
+   gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
 
at91_serial_hw_init();
 #ifdef CONFIG_CMD_NAND
@@ -273,8 +273,9 @@ int board_eth_init(bd_t *bis)
 
 int dram_init(void)
 {
-   gd->bd->bi_dram[0].start = PHYS_SDRAM;
-   gd->bd->bi_dram[0].size = PHYS_SDRAM_SIZE;
+   /* dram_init must store complete ramsize in gd->ram_size */
+   gd->ram_size = get_ram_size((volatile long *)CONFIG_SYS_SDRAM_BASE,
+   CONFIG_SYS_SDRAM_SIZE);
return 0;
 }
 
diff --git a/board/atmel/at91sam9261ek/config.mk 
b/board/atmel/at91sam9261ek/config.mk
deleted file mode 100644
index e554a45..000
--- a/board/atmel/at91sam9261ek/config.mk
+++ /dev/null
@@ -1 +0,0 @@
-CONFIG_SYS_TEXT_BASE = 0x23f0
diff --git a/include/configs/at91sam9261ek.h b/include/configs/at91sam9261ek.h
index 401478b..0cffd94 100644
--- a/include/configs/at91sam9261ek.h
+++ b/include/configs/at91sam9261ek.h
@@ -27,6 +27,8 @@
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
+#include 
+
 #define CONFIG_AT91_LEGACY
 
 /* ARM asynchronous clock */
@@ -39,6 +41,7 @@
 #else
 #define CONFIG_AT91SAM9261 1   /* It's an Atmel AT91SAM9261 SoC*/
 #endif
+#define CONFIG_AT91FAMILY
 #define CONFIG_ARCH_CPU_INIT
 #undef CONFIG_USE_IRQ  /* we don't need IRQ/FIQ stuff  */
 
@@ -105,11 +108,21 @@
 #define CONFIG_CMD_DHCP1
 #define CONFIG_CMD_NAND1
 #define CONFIG_CMD_USB 1
+#define CONFIG_CMD_CACHE   1
 
 /* SDRAM */
 #define CONFIG_NR_DRAM_BANKS   1
-#define PHYS_SDRAM 0x2000
-#define PHYS_SDRAM_SIZE0x0400  /* 64 megs */
+#define CONFIG_SYS_SDRAM_BASE  0x2000
+#define CONFIG_SYS_SDRAM_SIZE  SZ_64M  /* 64 megs */
+
+/*
+ * AT91-bootstrap expects that U-boot needs to be loaded at 0x23f0
+ * but since U-boot is now being relocated to the end of RAM which is
+ * almost in the same area, there will be an overlap in the BSS segment
+ * resulting in a lockup during boot. So, we need to tell the
+ * AT91-bootstrap code to load it at a lower address, namely 0x23e0
+ */
+#define CONFIG_SYS_TEXT_BASE   0x23e0
 
 /* DataFlash */
 #define CONFIG_ATMEL_DATAFLASH_SPI
@@ -168,7 +181,7 @@
 
 #define CONFIG_SYS_LOAD_ADDR   0x2200  /* load address 
*/
 
-#define CONFIG_SYS_MEMTEST_START   PHYS_SDRAM
+#define CONFIG_SYS_MEMTEST_START   CONFIG_SYS_SDRAM_BASE
 #define CONFIG_SYS_MEMTEST_END 0x23e0
 
 #ifdef CONFIG_SYS_USE_DATAFLASH_CS0
@@ -230,8 +243,12 @@
  * Size of malloc() pool
  */
 #define CONFIG_SYS_MALLOC_LEN  ROUND(3 * CONFIG_ENV_SIZE + 128*1024, 
0x1000)
+/* size in bytes reserved for initial data */
+
+#define CONFIG_SYS_INIT_SP_ADDR(CONFIG_SYS_SDRAM_BASE + SZ_4K \
+   - GENERATED_GBL_DATA_SIZE)
 
-#define CONFIG_STACKSIZE  

Re: [U-Boot] [PATCH 2/2] at91sam9261ek: make operational again

2011-01-27 Thread Remy Bohmer
Hi All,

2011/1/27 Remy Bohmer :
> Since U-boot v2010.12 the at91sam9261ek board is broken.
> This is solved and tested on this board.
>
> Note: It requires that the 1st stage bootloader (like Atmel at91-bootstrap)
> to load U-boot at a different address compared to previous releases of
> U-boot due to conflicts in the BSS area during relocation.
> (0x23f0 -> -0x23e0)
>
> Derived from a patch of: Alexander Stein 
> 
>
> Signed-off-by: Remy Bohmer 

For your information: This patch requires this patch applied to the
tree first to make it work:
http://permalink.gmane.org/gmane.comp.boot-loaders.u-boot/93537

Kind regards,

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


Re: [U-Boot] [PATCH] ARM: fix broken build of ARM

2011-01-27 Thread Albert ARIBAUD
Le 27/01/2011 23:44, Alexander Holler a écrit :
> Am 27.01.2011 17:03, schrieb Stefano Babic:
>> Commit 8aba9dceebb14144e07d19593111ee3a999c37fc breaks
>> ARM boards because for ARM the -pie option is used
>> for partial linking together with -r option.
>>
>> The patch adds the -pie option to link u-boot.bin only.
>>
>> Signed-off-by: Stefano Babic
>> CC: Jason Liu
>> CC: l...@dooz.org
>> CC: Wolfgang Denk
>> CC: Albert Aribaud
>
> Tested-by: Alexander Holler
>
> Regards,
>
> Alexander
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot

Applied to u-boot-arm as this is a fix.

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


Re: [U-Boot] [PATCH 2/2] at91sam9261ek: make operational again

2011-01-27 Thread Albert ARIBAUD
Hi Remy,

Le 27/01/2011 23:46, Remy Bohmer a écrit :
> Since U-boot v2010.12 the at91sam9261ek board is broken.
> This is solved and tested on this board.
>
> Note: It requires that the 1st stage bootloader (like Atmel at91-bootstrap)
> to load U-boot at a different address compared to previous releases of
> U-boot due to conflicts in the BSS area during relocation.
> (0x23f0 ->  -0x23e0)
>
> Derived from a patch of: Alexander 
> Stein
>
> Signed-off-by: Remy Bohmer
> ---
>   board/atmel/at91sam9261ek/Makefile|   10 +-
>   board/atmel/at91sam9261ek/at91sam9261ek.c |7 ---
>   board/atmel/at91sam9261ek/config.mk   |1 -
>   include/configs/at91sam9261ek.h   |   25 +
>   4 files changed, 30 insertions(+), 13 deletions(-)
>   delete mode 100644 board/atmel/at91sam9261ek/config.mk
>
> diff --git a/board/atmel/at91sam9261ek/Makefile 
> b/board/atmel/at91sam9261ek/Makefile
> index 9d20ba0..1da810f 100644
> --- a/board/atmel/at91sam9261ek/Makefile
> +++ b/board/atmel/at91sam9261ek/Makefile
> @@ -29,16 +29,16 @@ include $(TOPDIR)/config.mk
>
>   LIB = $(obj)lib$(BOARD).o
>
> -COBJS-y += at91sam9261ek.o
> +COBJS-y += $(BOARD).o
>   COBJS-y += led.o
>   COBJS-$(CONFIG_HAS_DATAFLASH) += partition.o
>
> -SRCS := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
> -OBJS := $(addprefix $(obj),$(COBJS-y))
> -SOBJS:= $(addprefix $(obj),$(SOBJS))
> +SRCS := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
> +OBJS := $(addprefix $(obj),$(COBJS-y) $(SOBJS-y))
> +SOBJS:= $(addprefix $(obj),$(SOBJS-y))

What is the rationale for putting both C *and* assembly language objects 
in OBJS?

>   $(LIB): $(obj).depend $(OBJS) $(SOBJS)
> - $(call cmd_link_o_target, $(OBJS) $(SOBJS))
> + $(call cmd_link_o_target, $(OBJS))

If there is a rationale for putting all objects in OBJS, then SOBJS 
should be removed from the dependencies of LIB. If there is not, then 
SOBJS should remain in the '$(call...)'.

>   clean:
>   rm -f $(SOBJS) $(OBJS)
> diff --git a/board/atmel/at91sam9261ek/at91sam9261ek.c 
> b/board/atmel/at91sam9261ek/at91sam9261ek.c
> index de5cfae..25c181e 100644
> --- a/board/atmel/at91sam9261ek/at91sam9261ek.c
> +++ b/board/atmel/at91sam9261ek/at91sam9261ek.c
> @@ -246,7 +246,7 @@ int board_init(void)
>   gd->bd->bi_arch_number = MACH_TYPE_AT91SAM9261EK;
>   #endif
>   /* adress of boot parameters */
> - gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
> + gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
>
>   at91_serial_hw_init();
>   #ifdef CONFIG_CMD_NAND
> @@ -273,8 +273,9 @@ int board_eth_init(bd_t *bis)
>
>   int dram_init(void)
>   {
> - gd->bd->bi_dram[0].start = PHYS_SDRAM;
> - gd->bd->bi_dram[0].size = PHYS_SDRAM_SIZE;
> + /* dram_init must store complete ramsize in gd->ram_size */
> + gd->ram_size = get_ram_size((volatile long *)CONFIG_SYS_SDRAM_BASE,
> + CONFIG_SYS_SDRAM_SIZE);
>   return 0;
>   }
>
> diff --git a/board/atmel/at91sam9261ek/config.mk 
> b/board/atmel/at91sam9261ek/config.mk
> deleted file mode 100644
> index e554a45..000
> --- a/board/atmel/at91sam9261ek/config.mk
> +++ /dev/null
> @@ -1 +0,0 @@
> -CONFIG_SYS_TEXT_BASE = 0x23f0
> diff --git a/include/configs/at91sam9261ek.h b/include/configs/at91sam9261ek.h
> index 401478b..0cffd94 100644
> --- a/include/configs/at91sam9261ek.h
> +++ b/include/configs/at91sam9261ek.h
> @@ -27,6 +27,8 @@
>   #ifndef __CONFIG_H
>   #define __CONFIG_H
>
> +#include
> +
>   #define CONFIG_AT91_LEGACY
>
>   /* ARM asynchronous clock */
> @@ -39,6 +41,7 @@
>   #else
>   #define CONFIG_AT91SAM9261  1   /* It's an Atmel AT91SAM9261 SoC*/
>   #endif
> +#define CONFIG_AT91FAMILY
>   #define CONFIG_ARCH_CPU_INIT
>   #undef CONFIG_USE_IRQ   /* we don't need IRQ/FIQ stuff  
> */
>
> @@ -105,11 +108,21 @@
>   #define CONFIG_CMD_DHCP 1
>   #define CONFIG_CMD_NAND 1
>   #define CONFIG_CMD_USB  1
> +#define CONFIG_CMD_CACHE 1
>
>   /* SDRAM */
>   #define CONFIG_NR_DRAM_BANKS1
> -#define PHYS_SDRAM   0x2000
> -#define PHYS_SDRAM_SIZE  0x0400  /* 64 megs */
> +#define CONFIG_SYS_SDRAM_BASE0x2000
> +#define CONFIG_SYS_SDRAM_SIZESZ_64M  /* 64 megs */
> +
> +/*
> + * AT91-bootstrap expects that U-boot needs to be loaded at 0x23f0
> + * but since U-boot is now being relocated to the end of RAM which is
> + * almost in the same area, there will be an overlap in the BSS segment
> + * resulting in a lockup during boot. So, we need to tell the
> + * AT91-bootstrap code to load it at a lower address, namely 0x23e0
> + */
> +#define CONFIG_SYS_TEXT_BASE 0x23e0
>
>   /* DataFlash */
>   #define CONFIG_ATMEL_DATAFLASH_SPI
> @@ -168,7 +181,7 @@
>
>   #define CONFIG_SYS_LOAD_ADDR0x2200  /* load 
> address */
>
> -#define CONFIG_SYS_MEMTE

Re: [U-Boot] [PATCH v2] Divides variable of linker flags to LDFLAGS-u-boot and LDFLAGS

2011-01-27 Thread Nobuhiro Iwamatsu
Hi,

2011/1/28 Remy Bohmer :
> Hi,
>
> 2011/1/27 Remy Bohmer :
>> Hi,
>>
>> 2011/1/6 Nobuhiro Iwamatsu :
>>> Linker needs to use the proper endian/bfd flags even when doing partial 
>>> linking.
>>> LDFLAGS_u-boot sets linker option which is called it when U-boot is built
>>> (u-boot final).
>>> LDFLAGS sets necessary option by partial linking (use in cmd_link_o_target).
>>>
>>> CC: Mike Frysinger 
>>> Signed-off-by: Nobuhiro Iwamatsu 
>>> ---
>>
>> This patch breaks compilation for some ARM based boards, I get for
>> example this error:
>
> Never mind...
> This patch already solves this problem:
> http://comments.gmane.org/gmane.comp.boot-loaders.u-boot/93537
>

Sorry, and Thanks !

Nobuhiro



-- 
Nobuhiro Iwamatsu
   iwamatsu at {nigauri.org / debian.org}
   GPG ID: 40AD1FA6
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] mtdparts fails with NAND >= 4GB

2011-01-27 Thread Aaron Williams
Hi all,

It looks like the mtd partitioning code fails if the flash size exceeds a u32. 
I am working with an 8GB flash chip on our board and was wondering if anyone 
else has any experience with MTD with a chip this large?

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


Re: [U-Boot] mtdparts fails with NAND >= 4GB

2011-01-27 Thread Scott Wood
On Thu, 27 Jan 2011 16:24:31 -0800
Aaron Williams  wrote:

> Hi all,
> 
> It looks like the mtd partitioning code fails if the flash size exceeds a 
> u32. 
> I am working with an 8GB flash chip on our board and was wondering if anyone 
> else has any experience with MTD with a chip this large?

There's been some effort to make the U-Boot NAND code work with large
devices, but it's not complete.  Patches to take care of the rest of
the problem spots are welcome, especially if you have hardware to
test.

-Scott

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


Re: [U-Boot] mtdparts fails with NAND >= 4GB

2011-01-27 Thread Aaron Williams
I'll probably have something later today.  I got it working with an earlier 
version of u-boot though it hasn't been thoroughly tested.

-Aaron

On Thursday, January 27, 2011 05:06:09 pm Scott Wood wrote:
> On Thu, 27 Jan 2011 16:24:31 -0800
> 
> Aaron Williams  wrote:
> > Hi all,
> > 
> > It looks like the mtd partitioning code fails if the flash size exceeds a
> > u32. I am working with an 8GB flash chip on our board and was wondering
> > if anyone else has any experience with MTD with a chip this large?
> 
> There's been some effort to make the U-Boot NAND code work with large
> devices, but it's not complete.  Patches to take care of the rest of
> the problem spots are welcome, especially if you have hardware to
> test.
> 
> -Scott
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] DEBUG macro granularity

2011-01-27 Thread Simon Glass
Hi,

There is a great big DEBUG define which determines whether debug() is a
printf() or a nop. This is used by various modules to make them more verbose
which is helpful sometimes.

Some modules have their own finer control over this, for example USB_DEBUG
in common/usb.c. Also:

$ grep -rsl _PRINTF\( .
./board/mpl/pati/pati.c
./board/mpl/common/usb_uhci.c
./board/esd/common/xilinx_jtag/micro.c
./common/usb_kbd.c
./common/usb_ether.c
./common/usb_storage.c
./common/usb.c
./arch/sparc/cpu/leon3/usb_uhci.c
./issue5563011_1.diff
./drivers/bios_emulator/x86emu/decode.c
./drivers/bios_emulator/x86emu/ops.c
./drivers/bios_emulator/x86emu/ops2.c
./drivers/bios_emulator/include/x86emu/debug.h

Recently I enabled DEBUG and got rather a lot of output, enough that it took
hours to boot a kernel (every MMC block printed a nice message from the GPIO
driver). I understand that creating these local DEBUG macros is frowned
upon, but without this it tends to make the U-Boot-wide DEBUG setting so
verbose as to be useless. It also means that every potentially verbose
module needs an '#undef DEBUG' at the top, which means the global flag is
overridden.

Can I suggest perhaps a way of allowing some sort of granularity in the
design, rather than just relying on hacking in DEBUG in each file? What is
the recommended approach, please?

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


Re: [U-Boot] [PATCH V7 1/5] mv: seperate kirkwood and armada from common setting

2011-01-27 Thread Lei Wen
Hi Albert,

On Fri, Jan 28, 2011 at 2:34 AM, Albert ARIBAUD  wrote:
> Hi Lei Wen,
>
> Le 26/01/2011 11:31, Lei Wen a écrit :
>
>> diff --git a/README b/README
>> index 755d17c..e0341b5 100644
>> --- a/README
>> +++ b/README
>> @@ -319,6 +319,11 @@ The following options need to be configured:
>>                       CONFIG_SYS_PQ2FADS      - PQ2FADS-ZU or PQ2FADS-VR
>>                       CONFIG_SYS_8272ADS      - MPC8272ADS
>>
>> +- Marvell Family Member
>> +             CONFIG_SYS_MVFS         - define it if you want to enable
>> +                                       multiply fs option at one time
>
> Are you sure about this "multiply"?

Should be multiple...
>
>> +                                       for marvell soc family
>> +
>>   - MPC824X Family Member (if CONFIG_MPC824X is defined)
>>               Define exactly one of
>>               CONFIG_MPC8240, CONFIG_MPC8245
>> diff --git a/arch/arm/include/asm/arch-armada100/config.h 
>> b/arch/arm/include/asm/arch-armada100/config.h
>> new file mode 100644
>> index 000..f16806e
>> --- /dev/null
>> +++ b/arch/arm/include/asm/arch-armada100/config.h
>> @@ -0,0 +1,44 @@
>> +/*
>> + * (C) Copyright 2010
>
> Maybe update the copyright year?
My fault...

>
>> + * Marvell Semiconductor
>> + * Written-by: Lei Wen
>> + *
>> + * 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., 51 Franklin Street, Fifth Floor, Boston,
>> + * MA 02110-1301 USA
>> + */
>> +
>> +/*
>> + * This file should be included in board config header file.
>> + *
>> + * It supports common definitions for Armada100 platform
>> + */
>> +
>> +#ifndef _ARMD1_CONFIG_H
>> +#define _ARMD1_CONFIG_H
>> +
>> +#define CONFIG_ARM926EJS     1       /* Basic Architecture */
>> +
>> +#define CONFIG_SYS_TCLK              (14745600)      /* NS16550 clk config 
>> */
>> +#define CONFIG_SYS_HZ_CLOCK  (325)       /* Timer Freq. 3.25MHZ */
>> +#define CONFIG_MARVELL_MFP                   /* Enable mvmfp driver */
>> +#define MV_MFPR_BASE         ARMD1_MFPR_BASE
>> +#define MV_UART_CONSOLE_BASE ARMD1_UART1_BASE
>> +#define CONFIG_SYS_NS16550_IER       (1<<  6)        /* Bit 6 in UART_IER 
>> register
>> +                                             represents UART Unit Enable */
>> +
>> +#endif /* _ARMD1_CONFIG_H */
>> diff --git a/arch/arm/include/asm/arch-kirkwood/config.h 
>> b/arch/arm/include/asm/arch-kirkwood/config.h
>> new file mode 100644
>> index 000..7c6d63b
>> --- /dev/null
>> +++ b/arch/arm/include/asm/arch-kirkwood/config.h
>> @@ -0,0 +1,145 @@
>> +/*
>> + * (C) Copyright 2010
>
> Ditto
>
>> + * Marvell Semiconductor
>> + * Written-by: Lei Wen
>> + *
>> + * 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., 51 Franklin Street, Fifth Floor, Boston,
>> + * MA 02110-1301 USA
>> + */
>> +
>> +/*
>> + * This file should be included in board config header file.
>> + *
>> + * It supports common definitions for Kirkwood platform
>> + */
>> +
>> +#ifndef _KW_CONFIG_H
>> +#define _KW_CONFIG_H
>> +
>> +#if defined (CONFIG_KW88F6281)
>> +#include
>> +#elif defined (CONFIG_KW88F6192)
>> +#include
>> +#else
>> +#error "SOC Name not defined"
>> +#endif /* CONFIG_KW88F6281 */
>> +
>> +#define CONFIG_ARM926EJS     1       /* Basic Architecture */
>> +
>> +#define CONFIG_MD5   /* get_random_hex on krikwood needs MD5 support */
>> +#define CONFIG_KIRKWOOD_EGIGA_INIT   /* Enable GbePort0/1 for kernel */
>> +#define CONFIG_KIRKWOOD_RGMII_PAD_1V8        /* Set RGMII Pad voltage to 
>> 1.8V */
>> +#define CONFIG_KIRKWOOD_PCIE_INIT       /* Enable PCIE Por

[U-Boot] [PATCH 1/1] NAND Re: mtdparts fails with NAND >= 4GB

2011-01-27 Thread Aaron Williams
I have included my preliminary patch which seems to be working.
It has not been extensively tested yet.  All of the changes were basically
making the sizes and offsets u64 instead of u32.  When looking at the Linux
kernel code it looks like they also use u64. I was mistaken and our NAND
flash chip is 4GiB in size so I can't test with any larger chips.

-Aaron

diff --git a/common/cmd_mtdparts.c b/common/cmd_mtdparts.c
index 5481c88..26d24b0 100644
--- a/common/cmd_mtdparts.c
+++ b/common/cmd_mtdparts.c
@@ -21,6 +21,11 @@
  *   $Id: cmdlinepart.c,v 1.17 2004/11/26 11:18:47 lavinen Exp $
  *   Copyright 2002 SYSGO Real-Time Solutions GmbH
  *
+ * (C) Copyright 2011
+ * Aaron Williams, Cavium Networks, Inc. 
+ *
+ *   Added support for partitions and flash greater than or equal to 4GiB.
+ *
  * See file CREDITS for list of people who contributed to this
  * project.
  *
@@ -174,7 +179,7 @@ static int device_del(struct mtd_device *dev);
  * @param retptr output pointer to next char after parse completes (output)
  * @return resulting unsigned int
  */
-static unsigned long memsize_parse (const char *const ptr, const char **retptr)
+static u64 memsize_parse (const char *const ptr, const char **retptr)
 {
unsigned long ret = simple_strtoul(ptr, (char **)retptr, 0);
 
@@ -207,20 +212,20 @@ static unsigned long memsize_parse (const char *const 
ptr, const char **retptr)
  * @param buf output buffer
  * @param size size to be converted to string
  */
-static void memsize_format(char *buf, u32 size)
+static void memsize_format(char *buf, u64 size)
 {
 #define SIZE_GB ((u32)1024*1024*1024)
 #define SIZE_MB ((u32)1024*1024)
 #define SIZE_KB ((u32)1024)
 
if ((size % SIZE_GB) == 0)
-   sprintf(buf, "%ug", size/SIZE_GB);
+   sprintf(buf, "%llug", size/SIZE_GB);
else if ((size % SIZE_MB) == 0)
-   sprintf(buf, "%um", size/SIZE_MB);
+   sprintf(buf, "%llum", size/SIZE_MB);
else if (size % SIZE_KB == 0)
-   sprintf(buf, "%uk", size/SIZE_KB);
+   sprintf(buf, "%lluk", size/SIZE_KB);
else
-   sprintf(buf, "%u", size);
+   sprintf(buf, "%llu", size);
 }
 
 /**
@@ -325,7 +330,7 @@ static int part_validate_eraseblock(struct mtdids *id, 
struct part_info *part)
 {
struct mtd_info *mtd = NULL;
int i, j;
-   ulong start;
+   u64 start;
 
if (get_mtd_info(id->type, id->num, &mtd))
return 1;
@@ -337,7 +342,7 @@ static int part_validate_eraseblock(struct mtdids *id, 
struct part_info *part)
 * Only one eraseregion (NAND, OneNAND or uniform NOR),
 * checking for alignment is easy here
 */
-   if ((unsigned long)part->offset % mtd->erasesize) {
+   if ((u64)part->offset % mtd->erasesize) {
printf("%s%d: partition (%s) start offset"
   "alignment incorrect\n",
   MTD_DEV_TYPE(id->type), id->num, part->name);
@@ -412,7 +417,7 @@ static int part_validate(struct mtdids *id, struct 
part_info *part)
part->size = id->size - part->offset;
 
if (part->offset > id->size) {
-   printf("%s: offset %08x beyond flash size %08x\n",
+   printf("%s: offset %08llx beyond flash size %08llx\n",
id->mtd_id, part->offset, id->size);
return 1;
}
@@ -595,8 +600,8 @@ static int part_add(struct mtd_device *dev, struct 
part_info *part)
 static int part_parse(const char *const partdef, const char **ret, struct 
part_info **retpart)
 {
struct part_info *part;
-   unsigned long size;
-   unsigned long offset;
+   u64 size;
+   u64 offset;
const char *name;
int name_len;
unsigned int mask_flags;
@@ -615,7 +620,7 @@ static int part_parse(const char *const partdef, const char 
**ret, struct part_i
} else {
size = memsize_parse(p, &p);
if (size < MIN_PART_SIZE) {
-   printf("partition size too small (%lx)\n", size);
+   printf("partition size too small (%llx)\n", size);
return 1;
}
}
@@ -687,14 +692,14 @@ static int part_parse(const char *const partdef, const 
char **ret, struct part_i
part->auto_name = 0;
} else {
/* auto generated name in form of size@offset */
-   sprintf(part->name, "0x%08lx@0x%08lx", size, offset);
+   sprintf(part->name, "0x%08llx@0x%08llx", size, offset);
part->auto_name = 1;
}
 
part->name[name_len - 1] = '\0';
INIT_LIST_HEAD(&part->link);
 
-   debug("+ partition: name %-22s size 0x%08x offset 0x%08x mask flags 
%d\n",
+   debug("+ partition: name %-22s size 0x%08llx offset 0x%08llx mask flags 
%d\n",
pa

[U-Boot] [PATCH 5/8 v3] P1021: add P1021MDS board support

2011-01-27 Thread Haiying.Wang
From: Haiying Wang 

Support P1021MDS board to boot from NAND flash (No NOR flash on this
board). And because P1021 only has 256K L2 SRAM, which can not used for final
uboot image, this patch also enables the TPL BOOT on P1021MDS so that DDR can
be initialized in L2 SRAM through SPD code. So there are three stage uboot
images:
* nand_spl, pad from 4KB size to 16KB, load tpl_boot from offset 16KB in NAND.
* tpl_boot, 112KB size. The env variables are copied to offset 128KB
  in L2 SRAM, so that ddr spd code can get the interleaving mode setting in env.
  It loads final uboot image from offset 128KB in NAND.
* final uboot image, size is variable depends on the functions enabled.

Signed-off-by: Haiying Wang 
Signed-off-by: Mohit Kumar 
Signed-off-by: Yu Liu 
Signed-off-by: Kai Jiang 
---
v3: use CONFIG_HAS_TPL and CONFIG_IN_TPL, update copyright year, remove pci.c,
incoperate with the changes in upstream.

 MAINTAINERS   |4 +
 board/freescale/p1021mds/Makefile |   52 +++
 board/freescale/p1021mds/config.mk|   31 ++
 board/freescale/p1021mds/ddr.c|  107 +
 board/freescale/p1021mds/law.c|   38 ++
 board/freescale/p1021mds/p1021mds.c   |  133 ++
 board/freescale/p1021mds/tlb.c|  102 +
 boards.cfg|1 +
 include/configs/P1021MDS.h|  571 +
 nand_spl/board/freescale/p1021mds/Makefile|  134 ++
 nand_spl/board/freescale/p1021mds/nand_boot.c |   69 +++
 nand_spl/nand_boot_fsl_elbc.c |6 +-
 tpl/board/freescale/p1021mds/Makefile |  256 +++
 tpl/board/freescale/p1021mds/tpl_boot.c   |   79 
 14 files changed, 1582 insertions(+), 1 deletions(-)
 create mode 100644 board/freescale/p1021mds/Makefile
 create mode 100644 board/freescale/p1021mds/config.mk
 create mode 100644 board/freescale/p1021mds/ddr.c
 create mode 100644 board/freescale/p1021mds/law.c
 create mode 100644 board/freescale/p1021mds/p1021mds.c
 create mode 100644 board/freescale/p1021mds/tlb.c
 create mode 100644 include/configs/P1021MDS.h
 create mode 100644 nand_spl/board/freescale/p1021mds/Makefile
 create mode 100644 nand_spl/board/freescale/p1021mds/nand_boot.c
 create mode 100644 tpl/board/freescale/p1021mds/Makefile
 create mode 100644 tpl/board/freescale/p1021mds/tpl_boot.c

diff --git a/MAINTAINERS b/MAINTAINERS
index edd1c5c..da1b2a3 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -17,6 +17,10 @@
 #  Board   CPU #
 #
 
+Haiying Wang 
+
+   P1021MDSP1021
+
 Poonam Aggrwal 
 
P2020RDBP2020
diff --git a/board/freescale/p1021mds/Makefile 
b/board/freescale/p1021mds/Makefile
new file mode 100644
index 000..50d4743
--- /dev/null
+++ b/board/freescale/p1021mds/Makefile
@@ -0,0 +1,52 @@
+#
+# Copyright (C) 2010-2011 Freescale Semiconductor, Inc.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).o
+
+COBJS-y+= $(BOARD).o
+COBJS-y+= law.o
+COBJS-y+= tlb.o
+COBJS-y+= ddr.o
+
+SRCS   := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS-y))
+SOBJS  := $(addprefix $(obj),$(SOBJS-y))
+
+$(LIB):$(obj).depend $(OBJS) $(SOBJS)
+   $(AR) $(ARFLAGS) $@ $(OBJS)
+
+clean:
+   rm -f $(OBJS) $(SOBJS)
+
+distclean: clean
+   rm -f $(LIB) core *.bak $(obj).depend
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/freescale/p1021mds/config.mk 
b/board/freescale/p1021mds/config.mk
new file mode 100644
index 000..3888f61
--- /dev/null
+++ b/board/freescale/p1021mds/config.mk
@@ -0,0 +1,31 @@
+#
+# Copyright (C) 2010 - 2011 Freescale Semiconductor, Inc.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribut

[U-Boot] [PATCH 8/8 v3] p1021mds: add QE and UEC support

2011-01-27 Thread Haiying.Wang
From: Haiying Wang 

P1021 has some QE pins which need to be set in pmuxcr register before using QE
functions. In this patch, pin QE0 and QE3 are set for UCC1 and UCC5 in Eth mode.
QE9 and QE12 are set for MII management. QE12 needs to be released after MII
access because QE12 pin is muxed with LBCTL signal.

P1021MDS has to load the microcode from NAND flash, this patch defines
misc_init_r() for loading ucode and initializing qe.

Signed-off-by: Haiying Wang 
---
v3:  make changes in p1021mds.c and P1021MDS.h according to the changes in patch
5/8, update the copyright years.

 arch/powerpc/cpu/mpc85xx/speed.c  |4 ++
 arch/powerpc/include/asm/immap_85xx.h |   13 +
 board/freescale/p1021mds/p1021mds.c   |   83 +
 drivers/qe/uec.c  |   40 +++-
 include/configs/P1021MDS.h|   47 ++
 5 files changed, 186 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/cpu/mpc85xx/speed.c b/arch/powerpc/cpu/mpc85xx/speed.c
index f2aa8d0..ae94ee8 100644
--- a/arch/powerpc/cpu/mpc85xx/speed.c
+++ b/arch/powerpc/cpu/mpc85xx/speed.c
@@ -165,10 +165,14 @@ void get_sys_info (sys_info_t * sysInfo)
 #endif
 
 #ifdef CONFIG_QE
+#ifdef CONFIG_P1021
+   sysInfo->freqQE =  sysInfo->freqSystemBus;
+#else
qe_ratio = ((gur->porpllsr) & MPC85xx_PORPLLSR_QE_RATIO)
>> MPC85xx_PORPLLSR_QE_RATIO_SHIFT;
sysInfo->freqQE = qe_ratio * CONFIG_SYS_CLK_FREQ;
 #endif
+#endif
 
 #if defined(CONFIG_FSL_LBC)
 #if defined(CONFIG_SYS_LBC_LCRR)
diff --git a/arch/powerpc/include/asm/immap_85xx.h 
b/arch/powerpc/include/asm/immap_85xx.h
index 77e3629..9b7de6b 100644
--- a/arch/powerpc/include/asm/immap_85xx.h
+++ b/arch/powerpc/include/asm/immap_85xx.h
@@ -1909,6 +1909,19 @@ typedef struct ccsr_gur {
 #define MPC85xx_PMUXCR_SD_DATA 0x8000
 #define MPC85xx_PMUXCR_SDHC_CD 0x4000
 #define MPC85xx_PMUXCR_SDHC_WP 0x2000
+#define MPC85xx_PMUXCR_QE0 0x8000
+#define MPC85xx_PMUXCR_QE1 0x4000
+#define MPC85xx_PMUXCR_QE2 0x2000
+#define MPC85xx_PMUXCR_QE3 0x1000
+#define MPC85xx_PMUXCR_QE4 0x0800
+#define MPC85xx_PMUXCR_QE5 0x0400
+#define MPC85xx_PMUXCR_QE6 0x0200
+#define MPC85xx_PMUXCR_QE7 0x0100
+#define MPC85xx_PMUXCR_QE8 0x0080
+#define MPC85xx_PMUXCR_QE9 0x0040
+#define MPC85xx_PMUXCR_QE100x0020
+#define MPC85xx_PMUXCR_QE110x0010
+#define MPC85xx_PMUXCR_QE120x0008
u32 pmuxcr2;/* Alt. function signal multiplex control 2 */
u8  res6[8];
u32 devdisr;/* Device disable control */
diff --git a/board/freescale/p1021mds/p1021mds.c 
b/board/freescale/p1021mds/p1021mds.c
index c7a7e57..e1ee1cf 100644
--- a/board/freescale/p1021mds/p1021mds.c
+++ b/board/freescale/p1021mds/p1021mds.c
@@ -37,6 +37,54 @@
 #include 
 #include 
 
+#ifdef CONFIG_QE
+#ifdef CONFIG_SYS_QE_FW_IN_NAND
+#include 
+#include 
+#endif
+extern void qe_init(uint qe_base);
+extern void qe_reset(void);
+#endif
+
+#ifdef CONFIG_QE
+const qe_iop_conf_t qe_iop_conf_tab[] = {
+   /* QE_MUX_MDC */
+   {1,  19, 1, 0, 1}, /* QE_MUX_MDC*/
+   /* QE_MUX_MDIO */
+   {1,  20, 3, 0, 1}, /* QE_MUX_MDIO   */
+
+   /* UCC_1_MII */
+   {0, 23, 2, 0, 2}, /* CLK12 */
+   {0, 24, 2, 0, 1}, /* CLK9 */
+   {0,  7, 1, 0, 2}, /* ENET1_TXD0_SER1_TXD0  */
+   {0,  9, 1, 0, 2}, /* ENET1_TXD1_SER1_TXD1  */
+   {0, 11, 1, 0, 2}, /* ENET1_TXD2_SER1_TXD2  */
+   {0, 12, 1, 0, 2}, /* ENET1_TXD3_SER1_TXD3  */
+   {0,  6, 2, 0, 2}, /* ENET1_RXD0_SER1_RXD0  */
+   {0, 10, 2, 0, 2}, /* ENET1_RXD1_SER1_RXD1  */
+   {0, 14, 2, 0, 2}, /* ENET1_RXD2_SER1_RXD2  */
+   {0, 15, 2, 0, 2}, /* ENET1_RXD3_SER1_RXD3  */
+   {0,  5, 1, 0, 2}, /* ENET1_TX_EN_SER1_RTS_B*/
+   {0, 13, 1, 0, 2}, /* ENET1_TX_ER   */
+   {0,  4, 2, 0, 2}, /* ENET1_RX_DV_SER1_CTS_B*/
+   {0,  8, 2, 0, 2}, /* ENET1_RX_ER_SER1_CD_B*/
+   {0, 17, 2, 0, 2}, /* ENET1_CRS*/
+   {0, 16, 2, 0, 2}, /* ENET1_COL*/
+
+   /* UCC_5_RMII */
+   {1, 11, 2, 0, 1}, /* CLK13 */
+   {1, 7,  1, 0, 2}, /* ENET5_TXD0_SER5_TXD0  */
+   {1, 10, 1, 0, 2}, /* ENET5_TXD1_SER5_TXD1  */
+   {1, 6, 2, 0, 2}, /* ENET5_RXD0_SER5_RXD0  */
+   {1, 9, 2, 0, 2}, /* ENET5_RXD1_SER5_RXD1  */
+   {1, 5, 1, 0, 2}, /* ENET5_TX_EN_SER5_RTS_B*/
+   {1, 4, 2, 0, 2}, /* ENET5_RX_DV_SER5_CTS_B*/
+   {1, 8, 2, 0, 2}, /* ENET5_RX_ER_SER5_CD_B*/
+
+   {0,  0, 0, 0, QE_IOP_TAB_END} /* END of table */
+};
+#endif
+
 int board_early_init_f(void)
 {
 
@@ -100,6 +148,14 @@ int board_eth_init(bd_t *bis)
 
tsec_eth_init(bis, tsec_info, num);
 
+#if defined(CONF

[U-Boot] [PATCH 4/8 v3] powerpc/85xx: add TPL support

2011-01-27 Thread Haiying.Wang
From: Haiying Wang 

Signed-off-by: Haiying Wang 
---
v3: Use HAS_TPL and IN_TPL, change initdram for TPL, fix the inconsistent
comments.

 arch/powerpc/cpu/mpc85xx/cpu.c   |7 ++
 arch/powerpc/cpu/mpc85xx/cpu_init_nand.c |   22 ++-
 arch/powerpc/cpu/mpc85xx/start.S |   12 ++--
 arch/powerpc/cpu/mpc85xx/u-boot-tpl.lds  |   99 ++
 4 files changed, 132 insertions(+), 8 deletions(-)
 create mode 100644 arch/powerpc/cpu/mpc85xx/u-boot-tpl.lds

diff --git a/arch/powerpc/cpu/mpc85xx/cpu.c b/arch/powerpc/cpu/mpc85xx/cpu.c
index 1aad2ba..e923547 100644
--- a/arch/powerpc/cpu/mpc85xx/cpu.c
+++ b/arch/powerpc/cpu/mpc85xx/cpu.c
@@ -296,6 +296,12 @@ void mpc85xx_reginfo(void)
 #ifndef CONFIG_FSL_CORENET
 phys_size_t initdram(int board_type)
 {
+#if defined(CONFIG_HAS_TPL) && !defined(CONFIG_IN_TPL)
+   /* ddr has been initialized in tpl boot stage thus we only need
+* to get the ddr dram size for the final uboot.
+*/
+   return fsl_ddr_sdram_size();
+#else
phys_size_t dram_size = 0;
 
 #if defined(CONFIG_SYS_FSL_ERRATUM_DDR_MSYNC_IN)
@@ -342,6 +348,7 @@ phys_size_t initdram(int board_type)
 
puts("DDR: ");
return dram_size;
+#endif /* CONFIG_HAS_TPL */
 }
 #endif
 
diff --git a/arch/powerpc/cpu/mpc85xx/cpu_init_nand.c 
b/arch/powerpc/cpu/mpc85xx/cpu_init_nand.c
index 8fb27ab..65c32d9 100644
--- a/arch/powerpc/cpu/mpc85xx/cpu_init_nand.c
+++ b/arch/powerpc/cpu/mpc85xx/cpu_init_nand.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2009 Freescale Semiconductor, Inc.
+ * Copyright 2009 - 2011 Freescale Semiconductor, Inc.
  *
  * See file CREDITS for list of people who contributed to this
  * project.
@@ -23,6 +23,8 @@
 #include 
 #include 
 
+DECLARE_GLOBAL_DATA_PTR;
+
 void cpu_init_f(void)
 {
fsl_lbc_t *lbc = LBC_BASE_ADDR;
@@ -40,7 +42,8 @@ void cpu_init_f(void)
 #error  CONFIG_NAND_BR_PRELIM, CONFIG_NAND_OR_PRELIM must be defined
 #endif
 
-#if defined(CONFIG_SYS_RAMBOOT) && defined(CONFIG_SYS_INIT_L2_ADDR)
+#if defined(CONFIG_SYS_RAMBOOT) && defined(CONFIG_SYS_INIT_L2_ADDR) \
+   && !defined(CONFIG_IN_TPL)
ccsr_l2cache_t *l2cache = (void *)CONFIG_SYS_MPC85xx_L2_ADDR;
char *l2srbar;
int i;
@@ -60,4 +63,19 @@ void cpu_init_f(void)
for (i = 0; i < CONFIG_SYS_L2_SIZE; i++)
l2srbar[i] = 0;
 #endif
+#ifdef CONFIG_IN_TPL
+   init_used_tlb_cams();
+#endif
+}
+
+#ifdef CONFIG_IN_TPL
+/*
+ * Because the primary cpu's info is enough for the 2nd stage,  we define the
+ * cpu number to 1 so as to keep code size for 2nd stage binary as small as
+ * possible.
+ */
+int cpu_numcores()
+{
+   return 1;
 }
+#endif /* CONFIG_IN_TPL */
diff --git a/arch/powerpc/cpu/mpc85xx/start.S b/arch/powerpc/cpu/mpc85xx/start.S
index fa98af6..5496fc4 100644
--- a/arch/powerpc/cpu/mpc85xx/start.S
+++ b/arch/powerpc/cpu/mpc85xx/start.S
@@ -58,12 +58,12 @@
GOT_ENTRY(_GOT2_TABLE_)
GOT_ENTRY(_FIXUP_TABLE_)
 
-#ifndef CONFIG_NAND_SPL
+#if !defined(CONFIG_NAND_SPL) && !defined(CONFIG_IN_TPL)
GOT_ENTRY(_start)
GOT_ENTRY(_start_of_vectors)
GOT_ENTRY(_end_of_vectors)
GOT_ENTRY(transfer_to_handler)
-#endif
+#endif /* !CONFIG_NAND_SPL && !CONFIG_IN_TPL*/
 
GOT_ENTRY(__init_end)
GOT_ENTRY(_end)
@@ -435,7 +435,7 @@ _start_cont:
 
/* NOTREACHED - board_init_f() does not return */
 
-#ifndef CONFIG_NAND_SPL
+#if !defined(CONFIG_NAND_SPL) && !defined(CONFIG_IN_TPL)
. = EXC_OFF_SYS_RESET
.globl  _start_of_vectors
 _start_of_vectors:
@@ -877,7 +877,7 @@ in32:
 in32r:
lwbrx   r3,r0,r3
blr
-#endif  /* !CONFIG_NAND_SPL */
+#endif  /* !CONFIG_NAND_SPL && !CONFIG_IN_TPL */
 
 
/*--*/
 
@@ -1067,7 +1067,7 @@ clear_bss:
mr  r4,r10  /* Destination Address  */
bl  board_init_r
 
-#ifndef CONFIG_NAND_SPL
+#if !defined(CONFIG_NAND_SPL) && !defined(CONFIG_IN_TPL)
/*
 * Copy exception vector code to low memory
 *
@@ -1207,4 +1207,4 @@ setup_ivors:
 
 #include "fixed_ivor.S"
blr
-#endif /* !CONFIG_NAND_SPL */
+#endif /* !CONFIG_NAND_SPL && !CONFIG_IN_TPL */
diff --git a/arch/powerpc/cpu/mpc85xx/u-boot-tpl.lds 
b/arch/powerpc/cpu/mpc85xx/u-boot-tpl.lds
new file mode 100644
index 000..d8ff62b
--- /dev/null
+++ b/arch/powerpc/cpu/mpc85xx/u-boot-tpl.lds
@@ -0,0 +1,99 @@
+/*
+ * Copyright 2010-2011 Freescale Semiconductor, Inc.
+ *
+ * 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 impl

[U-Boot] [PATCH 3/8 v3] Introduce the Tertiary Program loader

2011-01-27 Thread Haiying.Wang
From: Haiying Wang 

TPL is introduced to enable a loader stub that boots out of some type of RAM,
after being loaded by an SPL or similar platform-specific mechanism.

One example of using this tpl loader is to initialize the ddr through spd code
in case the L2 SRAM size is not big enough to hold the final uboot image and
the nand spl code needs to be limitated to 4K byte, then tpl code will load the
final uboot image after ddr is initialized.

Signed-off-by: Haiying Wang 
---
v3: remove TPL_BOOT, use HAS_TPL and IN_TPL
 Makefile |   15 ++-
 README   |   27 +++
 2 files changed, 41 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index 0d1ea5d..ae5db69 100644
--- a/Makefile
+++ b/Makefile
@@ -402,8 +402,19 @@ $(obj)u-boot.lds: $(LDSCRIPT)
 nand_spl:  $(TIMESTAMP_FILE) $(VERSION_FILE) $(obj)include/autoconf.mk
$(MAKE) -C nand_spl/board/$(BOARDDIR) all
 
+tpl:   $(TIMESTAMP_FILE) $(VERSION_FILE) depend
+   $(MAKE) -C tpl/board/$(BOARDDIR) all
+
+NAND_SPL_OBJS-y += $(obj)nand_spl/u-boot-spl-16k.bin
+NAND_SPL_OBJS-$(CONFIG_HAS_TPL) += $(obj)tpl/u-boot-tpl.bin
+NAND_SPL_OBJS-y += $(obj)u-boot.bin
+
+ifeq ($(CONFIG_HAS_TPL),y)
+$(obj)u-boot-nand.bin: nand_spl tpl $(obj)u-boot.bin
+else
 $(obj)u-boot-nand.bin: nand_spl $(obj)u-boot.bin
-   cat $(obj)nand_spl/u-boot-spl-16k.bin $(obj)u-boot.bin > 
$(obj)u-boot-nand.bin
+endif
+   cat $(NAND_SPL_OBJS-y) > $(obj)u-boot-nand.bin
 
 onenand_ipl:   $(TIMESTAMP_FILE) $(VERSION_FILE) $(obj)include/autoconf.mk
$(MAKE) -C onenand_ipl/board/$(BOARDDIR) all
@@ -1221,6 +1232,7 @@ clean:
@rm -f $(obj)lib/asm-offsets.s
@rm -f $(obj)nand_spl/{u-boot.lds,u-boot-spl,u-boot-spl.map,System.map}
@rm -f $(obj)onenand_ipl/onenand-{ipl,ipl.bin,ipl.map}
+   @rm -f $(obj)tpl/{u-boot-tpl,u-boot-tpl.map}
@rm -f $(ONENAND_BIN)
@rm -f $(obj)onenand_ipl/u-boot.lds
@rm -f $(TIMESTAMP_FILE) $(VERSION_FILE)
@@ -1245,6 +1257,7 @@ clobber:  clean
@rm -fr $(obj)include/generated
@[ ! -d $(obj)nand_spl ] || find $(obj)nand_spl -name "*" -type l 
-print | xargs rm -f
@[ ! -d $(obj)onenand_ipl ] || find $(obj)onenand_ipl -name "*" -type l 
-print | xargs rm -f
+   @[ ! -d $(obj)tpl ] || find $(obj)tpl -name "*" -type l -print | xargs 
rm -f
 
 ifeq ($(OBJTREE),$(SRCTREE))
 mrproper \
diff --git a/README b/README
index 755d17c..a37fdb1 100644
--- a/README
+++ b/README
@@ -2124,6 +2124,33 @@ FIT uImage format:
Adds the MTD partitioning infrastructure from the Linux
kernel. Needed for UBI support.
 
+- NAND Boot Support
+   CONFIG_NAND_U_BOOT
+
+   Builds a U-Boot image that boots from NAND, prefixed by a small
+   loader stub (secondary program loader -- SPL) that loads the
+   rest of U-Boot into RAM.  This symbol will be set in all build
+   phases.
+
+   CONFIG_NAND_SPL
+
+   This is set by the build system when compiling code to go into
+   the SPL.  It is not set when building the code that the SPL
+   loads.
+
+- TPL Boot Support
+   CONFIG_HAS_TPL
+
+   Builds a U-Boot image that contains a loader stub (tertiary
+   program loader -- TPL) that boots out of some type of RAM,
+   after being loaded by an SPL or similar platform-specific
+   mechanism.  This symbol will be set in all build phases.
+
+   CONFIG_IN_TPL
+
+   This is set by the build system when compiling code to go into
+   the TPL.  It is not set when building the code that the TPL
+   loads, or when building the SPL.
 
 Modem Support:
 --
-- 
1.7.3.1.50.g1e633


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


[U-Boot] [PATCH 7/7] add gc-sections to TPL boot

2011-01-27 Thread Haiying.Wang
From: Haiying Wang 

Signed-off-by: Haiying Wang 
---
 arch/powerpc/config.mk |4 
 config.mk  |7 ++-
 2 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/config.mk b/arch/powerpc/config.mk
index 64191c7..78e53c4 100644
--- a/arch/powerpc/config.mk
+++ b/arch/powerpc/config.mk
@@ -27,7 +27,11 @@ STANDALONE_LOAD_ADDR = 0x4
 LDFLAGS_u-boot = --gc-sections
 PLATFORM_RELFLAGS += -mrelocatable -ffunction-sections -fdata-sections
 PLATFORM_CPPFLAGS += -DCONFIG_PPC -D__powerpc__
+ifdef CONFIG_HAS_TPL
+PLATFORM_LDFLAGS  += -n --gc-sections
+else
 PLATFORM_LDFLAGS  += -n
+endif
 
 ifdef CONFIG_SYS_LDSCRIPT
 # need to strip off double quotes
diff --git a/config.mk b/config.mk
index 5147c35..d7bb07f 100644
--- a/config.mk
+++ b/config.mk
@@ -260,8 +260,13 @@ $(obj)%.s: %.c
 #
 
 # If the list of objects to link is empty, just create an empty built-in.o
+ifdef CONFIG_HAS_TPL
+cmd_link_o_target = $(if $(strip $1),\
+ $(LD) -r -o $@ $1,\
+ rm -f $@; $(AR) rcs $@ )
+else
 cmd_link_o_target = $(if $(strip $1),\
  $(LD) $(LDFLAGS) -r -o $@ $1,\
  rm -f $@; $(AR) rcs $@ )
-
+endif
 #
-- 
1.7.3.1.50.g1e633


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


Re: [U-Boot] [PATCH V7 1/5] mv: seperate kirkwood and armada from common setting

2011-01-27 Thread Albert ARIBAUD
Hi Lei,

Le 28/01/2011 02:28, Lei Wen a écrit :

>>> diff --git a/arch/arm/include/asm/arch-kirkwood/config.h 
>>> b/arch/arm/include/asm/arch-kirkwood/config.h
>>> new file mode 100644
>>> index 000..7c6d63b
>>> --- /dev/null
>>> +++ b/arch/arm/include/asm/arch-kirkwood/config.h
>>> @@ -0,0 +1,145 @@

...

>>> +#ifndef CONFIG_SYS_KWD_CONFIG
>>> +#define  CONFIG_SYS_KWD_CONFIG   
>>> $(SRCTREE)/$(CONFIG_BOARDDIR)/kwbimage.cfg
>>
>> What are the '$()' operators doing here ?
>
> This definition is served as generating kirkwood special image, which
> I just move it from mv-common.h
> $(obj)u-boot.kwb:   $(obj)u-boot.bin
>  $(obj)tools/mkimage -n $(CONFIG_SYS_KWD_CONFIG) -T kwbimage \
>  -a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_TEXT_BASE) -d $<  
> $@

What I would like to understand is, the '$(X)' macro expansion operator 
indeed has meaning and makes sense for some tools such as Make, but not 
for a C preprocessor or compiler. Is this  config.h file included by a 
makefile somehow?

> Best regards,
> Lei

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


Re: [U-Boot] [PATCH V7 1/5] mv: seperate kirkwood and armada from common setting

2011-01-27 Thread Lei Wen
Hi Albert,

On Fri, Jan 28, 2011 at 2:47 PM, Albert ARIBAUD  wrote:
> Hi Lei,
>
> Le 28/01/2011 02:28, Lei Wen a écrit :
>
 diff --git a/arch/arm/include/asm/arch-kirkwood/config.h
 b/arch/arm/include/asm/arch-kirkwood/config.h
 new file mode 100644
 index 000..7c6d63b
 --- /dev/null
 +++ b/arch/arm/include/asm/arch-kirkwood/config.h
 @@ -0,0 +1,145 @@
>
> ...
>
 +#ifndef CONFIG_SYS_KWD_CONFIG
 +#define      CONFIG_SYS_KWD_CONFIG
 $(SRCTREE)/$(CONFIG_BOARDDIR)/kwbimage.cfg
>>>
>>> What are the '$()' operators doing here ?
>>
>> This definition is served as generating kirkwood special image, which
>> I just move it from mv-common.h
>> $(obj)u-boot.kwb:       $(obj)u-boot.bin
>>                 $(obj)tools/mkimage -n $(CONFIG_SYS_KWD_CONFIG) -T
>> kwbimage \
>>                 -a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_TEXT_BASE) -d
>> $<  $@
>
> What I would like to understand is, the '$(X)' macro expansion operator
> indeed has meaning and makes sense for some tools such as Make, but not for
> a C preprocessor or compiler. Is this  config.h file included by a makefile
> somehow?
>

Yes, it would be included by the makefile as below:
Makefile: line 471:
$(obj)include/autoconf.mk: $(obj)include/config.h

Take guruplug as example.
Its guruplug.h would be include in the include/config.h.
While guruplug would involve the mv-common.h, in which the
arch/arm/include/asm/arch-kirkwood/config.h would be included.

I know this maybe a little complicated, but that is what it works.

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


Re: [U-Boot] [PATCH V7 1/5] mv: seperate kirkwood and armada from common setting

2011-01-27 Thread Albert ARIBAUD
Le 28/01/2011 07:59, Lei Wen a écrit :
> Hi Albert,
>
> On Fri, Jan 28, 2011 at 2:47 PM, Albert ARIBAUD  
> wrote:
>> Hi Lei,
>>
>> Le 28/01/2011 02:28, Lei Wen a écrit :
>>
> diff --git a/arch/arm/include/asm/arch-kirkwood/config.h
> b/arch/arm/include/asm/arch-kirkwood/config.h
> new file mode 100644
> index 000..7c6d63b
> --- /dev/null
> +++ b/arch/arm/include/asm/arch-kirkwood/config.h
> @@ -0,0 +1,145 @@
>>
>> ...
>>
> +#ifndef CONFIG_SYS_KWD_CONFIG
> +#define  CONFIG_SYS_KWD_CONFIG
> $(SRCTREE)/$(CONFIG_BOARDDIR)/kwbimage.cfg

 What are the '$()' operators doing here ?
>>>
>>> This definition is served as generating kirkwood special image, which
>>> I just move it from mv-common.h
>>> $(obj)u-boot.kwb:   $(obj)u-boot.bin
>>>  $(obj)tools/mkimage -n $(CONFIG_SYS_KWD_CONFIG) -T
>>> kwbimage \
>>>  -a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_TEXT_BASE) -d
>>> $<$@
>>
>> What I would like to understand is, the '$(X)' macro expansion operator
>> indeed has meaning and makes sense for some tools such as Make, but not for
>> a C preprocessor or compiler. Is this  config.h file included by a makefile
>> somehow?
>>
>
> Yes, it would be included by the makefile as below:
> Makefile: line 471:
> $(obj)include/autoconf.mk: $(obj)include/config.h
>
> Take guruplug as example.
> Its guruplug.h would be include in the include/config.h.
> While guruplug would involve the mv-common.h, in which the
> arch/arm/include/asm/arch-kirkwood/config.h would be included.

Understood. Maybe a comment right before the surprising '$()' line 
indicating why they're here would avoid other people wondering as I did.

> I know this maybe a little complicated, but that is what it works.

So be it. :)

> Best regards,
> Lei

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