[U-Boot] [PATCH v3 1/5] 85xx: add boot from NAND/eSDHC/eSPI support

2009-09-11 Thread Mingkai Hu
The MPC8536E is capable of booting form NAND/eSDHC/eSPI, this patch
implements these three bootup methods in a unified way - all of these
use the general cpu/mpc85xx/start.S, and load the main image to L2SRAM
which lets us use the SPD to initialize the SDRAM.

For all three bootup methods, the bootup process can be divided into two
stages: the first stage will initialize the corresponding controller,
configure the L2SRAM, then copy the second stage image to L2SRAM and
jump to it. The second stage image is just like the general U-Boot image
to configure all the hardware and boot up to U-Boot command line.

When boot from NAND, the eLBC controller will first load the first stage
image to internal 4K RAM buffer because it's also stored on the NAND
flash. The first stage image, also call 4K NADN loader, will initialize
the L2SRAM, load the second stage image to L2SRAM and jump to it. The 4K
NAND loader's code comes from the corresponding nand_spl directory, along
with the code twisted by CONFIG_NAND_SPL.

When boot from eSDHC/eSPI, there's no such a first stage image because
the CPU ROM code does the same work. It will initialize the L2SRAM
according to the config addr/word pairs on the fixed address and
initialize the eSDHC/eSPI controller, then load the second stage image
to L2SRAM and jump to it.

The macro CONFIG_SYS_RAMBOOT is used to control the code to produce the
second stage image for all different bootup methods. It's set in the
board config file when one of the bootup methods above is selected.

Signed-off-by: Mingkai Hu mingkai...@freescale.com
---

 - Move u-boot-nand.lds from board directory to cpu/mpc85xx, which make it
   avalible for 85xx platform
 - Some modification on u-boot-nand.lds accoring to u-boot.lds

  cpu/mpc85xx/cpu_init.c  |   19 ++
 cpu/mpc85xx/start.S |   23 +++-
 cpu/mpc85xx/tlb.c   |6 ++
 cpu/mpc85xx/u-boot-nand.lds |  140 +++
 drivers/misc/fsl_law.c  |2 +
 5 files changed, 189 insertions(+), 1 deletions(-)
 create mode 100644 cpu/mpc85xx/u-boot-nand.lds

diff --git a/cpu/mpc85xx/cpu_init.c b/cpu/mpc85xx/cpu_init.c
index a54cf5d..5f66511 100644
--- a/cpu/mpc85xx/cpu_init.c
+++ b/cpu/mpc85xx/cpu_init.c
@@ -291,6 +291,25 @@ int cpu_init_r(void)
 
asm(msync;isync);
cache_ctl = l2cache-l2ctl;
+
+#if defined(CONFIG_SYS_RAMBOOT)  defined(CONFIG_SYS_INIT_L2_ADDR)
+   if (cache_ctl  MPC85xx_L2CTL_L2E) {
+   /* Clear L2 SRAM memory-mapped base address */
+   out_be32(l2cache-l2srbar0, 0x0);
+   out_be32(l2cache-l2srbar1, 0x0);
+
+   /* set MBECCDIS=0, SBECCDIS=0 */
+   clrbits_be32(l2cache-l2errdis,
+   (MPC85xx_L2ERRDIS_MBECC |
+MPC85xx_L2ERRDIS_SBECC));
+
+   /* set L2E=0, L2SRAM=0 */
+   clrbits_be32(l2cache-l2ctl,
+   (MPC85xx_L2CTL_L2E |
+MPC85xx_L2CTL_L2SRAM_ENTIRE));
+   }
+#endif
+
l2siz_field = (cache_ctl  28)  0x3;
 
switch (l2siz_field) {
diff --git a/cpu/mpc85xx/start.S b/cpu/mpc85xx/start.S
index e21a4eb..c5b6bd9 100644
--- a/cpu/mpc85xx/start.S
+++ b/cpu/mpc85xx/start.S
@@ -57,10 +57,12 @@
GOT_ENTRY(_GOT2_TABLE_)
GOT_ENTRY(_FIXUP_TABLE_)
 
+#ifndef CONFIG_NAND_SPL
GOT_ENTRY(_start)
GOT_ENTRY(_start_of_vectors)
GOT_ENTRY(_end_of_vectors)
GOT_ENTRY(transfer_to_handler)
+#endif
 
GOT_ENTRY(__init_end)
GOT_ENTRY(_end)
@@ -235,10 +237,11 @@ _start_e500:
 
 #endif /* CONFIG_MPC8569 */
 
-   /* create a temp mapping in AS=1 to the 4M boot window */
lis r6,FSL_BOOKE_MAS0(1, 15, 0)@h
ori r6,r6,FSL_BOOKE_MAS0(1, 15, 0)@l
 
+#ifndef CONFIG_SYS_RAMBOOT
+   /* create a temp mapping in AS=1 to the 4M boot window */
lis r7,FSL_BOOKE_MAS1(1, 1, 0, 1, BOOKE_PAGESZ_4M)@h
ori r7,r7,FSL_BOOKE_MAS1(1, 1, 0, 1, BOOKE_PAGESZ_4M)@l
 
@@ -248,6 +251,20 @@ _start_e500:
/* The 85xx has the default boot window 0xff80 - 0x */
lis r9,FSL_BOOKE_MAS3(0xffc0, 0, (MAS3_SX|MAS3_SW|MAS3_SR))@h
ori r9,r9,FSL_BOOKE_MAS3(0xffc0, 0, (MAS3_SX|MAS3_SW|MAS3_SR))@l
+#else
+   /*
+* create a temp mapping in AS=1 to the 1M TEXT_BASE space, the main
+* image has been relocated to TEXT_BASE on the second stage.
+*/
+   lis r7,FSL_BOOKE_MAS1(1, 1, 0, 1, BOOKE_PAGESZ_1M)@h
+   ori r7,r7,FSL_BOOKE_MAS1(1, 1, 0, 1, BOOKE_PAGESZ_1M)@l
+
+   lis r8,FSL_BOOKE_MAS2(TEXT_BASE, (MAS2_I|MAS2_G))@h
+   ori r8,r8,FSL_BOOKE_MAS2(TEXT_BASE, (MAS2_I|MAS2_G))@l
+
+   lis r9,FSL_BOOKE_MAS3(TEXT_BASE, 0, (MAS3_SX|MAS3_SW|MAS3_SR))@h
+   ori r9,r9,FSL_BOOKE_MAS3(TEXT_BASE, 0, (MAS3_SX|MAS3_SW|MAS3_SR))@l
+#endif
 
mtspr   MAS0,r6
mtspr   MAS1,r7
@@ -359,6 

[U-Boot] [PATCH v3 3/5] NAND boot: MPC8536DS support

2009-09-11 Thread Mingkai Hu
MPC8536E can support booting from NAND flash which uses the
image u-boot-nand.bin. This image contains two parts: a 4K
NAND loader and a main U-Boot image. The former is appended
to the latter to produce u-boot-nand.bin. The 4K NAND loader
includes the corresponding nand_spl directory, along with the
code twisted by CONFIG_NAND_SPL. The main U-Boot image just
like a general U-Boot image except the parts that included by
CONFIG_SYS_RAMBOOT.

When power on, eLBC will automatically load from bank 0 the
4K NAND loader into the FCM buffer RAM where CPU can execute
the boot code directly. In the first stage, the NAND loader
copies itself to RAM or L2SRAM to free up the FCM buffer RAM,
then loads the main image from NAND flash to RAM or L2SRAM
and boot from it.

This patch implements the NAND loader to load the main image
into L2SRAM, so the main image can configure the RAM by using
SPD EEPROM. In the first stage, the NAND loader copies itself
to the second to last 4K address space, and uses the last 4K
address space as the initial RAM for stack.

Obviously, the size of L2SRAM shouldn't be less than the size
of the image used. If so, the workaround is to generate another
image that includes the code to configure the RAM by SPD and
load it to L2SRAM first, then relocate the main image to RAM
to boot up.

Signed-off-by: Mingkai Hu mingkai...@freescale.com
---
 Makefile   |1 +
 board/freescale/mpc8536ds/config.mk|7 ++
 board/freescale/mpc8536ds/tlb.c|   11 ++
 cpu/mpc85xx/nand_init.c|  109 ++
 cpu/mpc85xx/u-boot-nand.lds|4 +-
 include/configs/MPC8536DS.h|   96 +++
 nand_spl/board/freescale/mpc8536ds/Makefile|  119 
 nand_spl/board/freescale/mpc8536ds/nand_boot.c |   99 
 nand_spl/board/freescale/mpc8536ds/u-boot.lds  |   67 +
 9 files changed, 490 insertions(+), 23 deletions(-)
 create mode 100644 cpu/mpc85xx/nand_init.c
 create mode 100644 nand_spl/board/freescale/mpc8536ds/Makefile
 create mode 100644 nand_spl/board/freescale/mpc8536ds/nand_boot.c
 create mode 100644 nand_spl/board/freescale/mpc8536ds/u-boot.lds

diff --git a/Makefile b/Makefile
index 8fd9979..681242e 100644
--- a/Makefile
+++ b/Makefile
@@ -2442,6 +2442,7 @@ vme8349_config:   unconfig
 ATUM8548_config:   unconfig
@$(MKCONFIG) $(@:_config=) ppc mpc85xx atum8548
 
+MPC8536DS_NAND_config \
 MPC8536DS_36BIT_config \
 MPC8536DS_config:   unconfig
@$(MKCONFIG) -n $(@:_config=) MPC8536DS ppc mpc85xx mpc8536ds freescale
diff --git a/board/freescale/mpc8536ds/config.mk 
b/board/freescale/mpc8536ds/config.mk
index f030876..bf8dd76 100644
--- a/board/freescale/mpc8536ds/config.mk
+++ b/board/freescale/mpc8536ds/config.mk
@@ -23,6 +23,13 @@
 #
 # mpc8536ds board
 #
+ifndef NAND_SPL
+ifeq ($(CONFIG_MK_MPC8536DS_NAND), y)
+TEXT_BASE = $(CONFIG_RAMBOOT_TEXT_BASE)
+LDSCRIPT := $(TOPDIR)/cpu/$(CPU)/u-boot-nand.lds
+endif
+endif
+
 ifndef TEXT_BASE
 TEXT_BASE = 0xeff8
 endif
diff --git a/board/freescale/mpc8536ds/tlb.c b/board/freescale/mpc8536ds/tlb.c
index 35a13d4..dc52d7f 100644
--- a/board/freescale/mpc8536ds/tlb.c
+++ b/board/freescale/mpc8536ds/tlb.c
@@ -71,6 +71,17 @@ struct fsl_e_tlb_entry tlb_table[] = {
SET_TLB_ENTRY(1, CONFIG_SYS_NAND_BASE, CONFIG_SYS_NAND_BASE_PHYS,
  MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
  0, 4, BOOKE_PAGESZ_1M, 1),
+
+#if defined(CONFIG_SYS_RAMBOOT)  defined(CONFIG_SYS_INIT_L2_ADDR)
+   /* *I*G - L2SRAM */
+   SET_TLB_ENTRY(1, CONFIG_SYS_INIT_L2_ADDR, CONFIG_SYS_INIT_L2_ADDR_PHYS,
+ MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
+ 0, 5, BOOKE_PAGESZ_256K, 1),
+   SET_TLB_ENTRY(1, CONFIG_SYS_INIT_L2_ADDR + 0x4,
+ CONFIG_SYS_INIT_L2_ADDR_PHYS + 0x4,
+ MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
+ 0, 6, BOOKE_PAGESZ_256K, 1),
+#endif
 };
 
 int num_tlb_entries = ARRAY_SIZE(tlb_table);
diff --git a/cpu/mpc85xx/nand_init.c b/cpu/mpc85xx/nand_init.c
new file mode 100644
index 000..c29b22d
--- /dev/null
+++ b/cpu/mpc85xx/nand_init.c
@@ -0,0 +1,109 @@
+/*
+ * Copyright (C) 2009 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 

Re: [U-Boot] [PATCH 1/1] at91: Update MEESC board support

2009-09-11 Thread Daniel Gorsulowski
Dear Wolfgang Denk,

Wolfgang Denk wrote:
 Dear Daniel Gorsulowski,
 
 In message 4aa90821.1060...@esd.eu you wrote:
 -  /* arch number of MEESC-Board */
 -  gd-bd-bi_arch_number = MACH_TYPE_MEESC;
 +  /* initialize ET1100 Controller */
 +  meesc_ethercat_hw_init();
 I thought we had agreed not to initialize the Ethernet hardware if it
 not used by U-Boot?

 We had, but this does not initialize unused hardware. This is needed for
 detecting hw_type and setting correct arch_number.
 
 meesc_ethercat_hw_init() is needed for ... setting correct
 arch_number ??
 
 Best regards,
 
 Wolfgang Denk
 
Please take a look at function checkboard().
There is a call hw_type = readb(CONFIG_ET1100_BASE); to read the ET1100
type register. The read value is used to determine the correct arch_number.
  valid value (ET1100 present)  -- arch_number = MACH_TYPE_MEESC
  invalid value (no ET1100 present) -- arch_number = MACH_TYPE_ETHERCAN2

For accessing the ET1100 type register, it is mandatory to initialize the
memory controller. Thus, meesc_ethercat_hw_init() is needed and does not
initialize unused hardware!


Btw. the function meesc_ethercat_hw_init() is not new in this patch. I
entirely moved the function call.


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


[U-Boot] Uboot Standalone Applications- Test_burst

2009-09-11 Thread vneethv

Hi,

I am trying to run the uboot example - the standalone application,
Test_burst to test my SRAM on Powerpc 440x5 board. Seems like the
application always crashes when i try to execute the same and it always
thrown some exception.
When i checked the code i found that there are some opcodes which are not
supported in ppc440x5 processor. And ppc440x5 also wont support creating a
pagesize 8MB. 

Please let me know if this application has to be rewritten or can be
modified so that i can use it for ppc440x5 powered board.

Thanks  Regards,
Vineeth V
-- 
View this message in context: 
http://www.nabble.com/Uboot-Standalone-Applications--Test_burst-tp25396448p25396448.html
Sent from the Uboot - Users mailing list archive at Nabble.com.

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


Re: [U-Boot] Uboot Standalone Applications- Test_burst

2009-09-11 Thread Wolfgang Denk
Dear vneethv,

In message 25396448.p...@talk.nabble.com you wrote:
 
 I am trying to run the uboot example - the standalone application,
 Test_burst to test my SRAM on Powerpc 440x5 board. Seems like the
 application always crashes when i try to execute the same and it always
 thrown some exception.

No big surprise, I think.

If you look at the history of changes for this code, youc an see (in
the first commit, ID 931da93e: MPC8xx/PowerPC only).

 When i checked the code i found that there are some opcodes which are not
 supported in ppc440x5 processor. And ppc440x5 also wont support creating a
 pagesize 8MB. 
 
 Please let me know if this application has to be rewritten or can be
 modified so that i can use it for ppc440x5 powered board.

Yes, the code has to be rewritten for other hardware. Thorough
understanding of the inner workings will be needed to do that.

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
Wisdom is one of the few things that looks bigger the further away it
is.   - Terry Pratchett, _Witches Abroad_
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 1/2] mkconfig: split the board make target to multiple config targets

2009-09-11 Thread Wolfgang Denk
Dear Mingkai Hu,

In message 1252466603-25103-1-git-send-email-mingkai...@freescale.com you 
wrote:
 To simplify the top level makefile it useful to be able to parse
 the top level makefile target to multiple individual target, then
 put them to the config.h, leave the board config file to handle
 the different targets.
 
 Note that this method uses the '_'(underline) as the delimiter when
 splits the board make target.
 
 Signed-off-by: Mingkai Hu mingkai...@freescale.com
 ---
 
 According to the comments from Wolfgang and Scott, I modified
 the patch and made some modification over v1:
 
  - remove the sectence thats puts the splited variables to the
config.mk, we can use the CONFIG_MK_* in the board config file
to override the variable in the board config file.
 
  - change CONFIG_OPT_* to CONFIG_MK_*
 
  mkconfig |7 +++
  1 files changed, 7 insertions(+), 0 deletions(-)

Arghhh... It seems this patch has not been well tested. Obviously
never ever ran a MAKEALL over all PPC boards. It causes tons of
messages like that:

include/config.h:2:25: warning: missing whitespace after the macro name

This patch breaks building for a number of boards / configurations,
especially:

xilinx-ppc405-generic_flash
xilinx-ppc405-generic
xilinx-ppc440-generic_flash
xilinx-ppc440-generic
VoVPN-GW_66MHz
VoVPN-GW_100MHz
EB+MCF-EV123
EB+MCF-EV123_internal
microblaze-generic
favr-32-ezkit


Shall I revert that patch?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Nature is very un-American.  Nature never hurries.
- William George Jordan
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 1/2] mkconfig: split the board make target to multiple config targets

2009-09-11 Thread Stefan Roese
On Friday 11 September 2009 10:07:46 Wolfgang Denk wrote:
 Arghhh... It seems this patch has not been well tested. Obviously
 never ever ran a MAKEALL over all PPC boards. It causes tons of
 messages like that:
 
 include/config.h:2:25: warning: missing whitespace after the macro name
 
 This patch breaks building for a number of boards / configurations,
 especially:
 
 xilinx-ppc405-generic_flash
 xilinx-ppc405-generic
 xilinx-ppc440-generic_flash
 xilinx-ppc440-generic
 VoVPN-GW_66MHz
 VoVPN-GW_100MHz
 EB+MCF-EV123
 EB+MCF-EV123_internal
 microblaze-generic
 favr-32-ezkit

Yes, I just stumbled over the build failure here as well. It seems to be a 
problem with the - in the board target name. Not sure how this could be 
solved though.
 
Cheers,
Stefan

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


[U-Boot] [PATCH v2] Support for the OpenRD base board

2009-09-11 Thread Simon Kagstrom
Support for the OpenRD base board

The implementation is borrowed from the sheevaplug board and the Marvell
1.1.4 code and likely to be a bit incomplete.

Signed-off-by: Simon Kagstrom simon.kagst...@netinsight.net
---
The configuration does not include UBIFS support, which still needs
he remaining patches for the bitops cleanup and fixes:

  http://lists.denx.de/pipermail/u-boot/2009-August/059285.html

to build. Until those are applied, it's turned off here.


I get run-time problems when building for armv5te for OpenRD base
(apparently the same problem occurs for other Kirkwood boards). This
patch fixes that:

  http://lists.denx.de/pipermail/u-boot/2009-September/059896.html


The second version contains the kwbimage.cfg needed to produce an image
to install on the NAND flash.

 MAINTAINERS |4 +
 MAKEALL |1 +
 Makefile|3 +
 board/Marvell/openrd_base/Makefile  |   51 +++
 board/Marvell/openrd_base/config.mk |   28 
 board/Marvell/openrd_base/kwbimage.cfg  |  168 
 board/Marvell/openrd_base/openrd_base.c |  158 ++
 board/Marvell/openrd_base/openrd_base.h |   46 +++
 include/configs/openrd_base.h   |  218 +++
 9 files changed, 677 insertions(+), 0 deletions(-)
 create mode 100644 board/Marvell/openrd_base/Makefile
 create mode 100644 board/Marvell/openrd_base/config.mk
 create mode 100644 board/Marvell/openrd_base/kwbimage.cfg
 create mode 100644 board/Marvell/openrd_base/openrd_base.c
 create mode 100644 board/Marvell/openrd_base/openrd_base.h
 create mode 100644 include/configs/openrd_base.h

diff --git a/MAINTAINERS b/MAINTAINERS
index e9db278..99cdc12 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -588,6 +588,10 @@ Gary Jennejohn ga...@denx.de
 Konstantin Kletschke kletsc...@synertronixx.de
scb9328 ARM920T
 
+Simon Kagstrom simon.kagst...@netinsight.net
+
+   openrd_base ARM926EJS (Kirkwood SoC)
+
 Nishant Kamat nska...@ti.com
 
omap1610h2  ARM926EJS
diff --git a/MAKEALL b/MAKEALL
index f0ed8ea..9e6eee2 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -533,6 +533,7 @@ LIST_ARM9= \
omap1610inn \
omap5912osk \
omap730p2   \
+   openrd_base \
rd6281a \
sbc2410x\
scb9328 \
diff --git a/Makefile b/Makefile
index 9764cea..6cef82a 100644
--- a/Makefile
+++ b/Makefile
@@ -3022,6 +3022,9 @@ omap1610h2_cs_autoboot_config:unconfig
 omap5912osk_config :   unconfig
@$(MKCONFIG) $(@:_config=) arm arm926ejs omap5912osk ti omap
 
+openrd_base_config: unconfig
+   @$(MKCONFIG) $(@:_config=) arm arm926ejs $(@:_config=) Marvell kirkwood
+
 xtract_omap730p2 = $(subst _cs0boot,,$(subst _cs3boot,, $(subst _config,,$1)))
 
 omap730p2_config \
diff --git a/board/Marvell/openrd_base/Makefile 
b/board/Marvell/openrd_base/Makefile
new file mode 100644
index 000..defbb08
--- /dev/null
+++ b/board/Marvell/openrd_base/Makefile
@@ -0,0 +1,51 @@
+#
+# (C) Copyright 2009
+# Marvell Semiconductor www.marvell.com
+# Written-by: Prafulla Wadaskar prafu...@marvell.com
+#
+# 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
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).a
+
+COBJS  := openrd_base.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(obj).depend $(OBJS) $(SOBJS)
+   $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
+
+clean:
+   rm -f $(SOBJS) $(OBJS)
+
+distclean: clean
+   rm -f $(LIB) core *.bak .depend
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/Marvell/openrd_base/config.mk 
b/board/Marvell/openrd_base/config.mk
new file mode 100644
index 000..2bd9f79
--- /dev/null
+++ b/board/Marvell/openrd_base/config.mk
@@ -0,0 +1,28 @@
+#
+# (C) Copyright 2009
+# 

Re: [U-Boot] [PATCH v2 1/2] mkconfig: split the board make target to multiple config targets

2009-09-11 Thread Wolfgang Denk
Dear Stefan Roese,

In message 200909111012.07310...@denx.de you wrote:

  This patch breaks building for a number of boards / configurations,
  especially:
  
  xilinx-ppc405-generic_flash
  xilinx-ppc405-generic
  xilinx-ppc440-generic_flash
  xilinx-ppc440-generic
  VoVPN-GW_66MHz
  VoVPN-GW_100MHz
  EB+MCF-EV123
  EB+MCF-EV123_internal
  microblaze-generic
  favr-32-ezkit
 
 Yes, I just stumbled over the build failure here as well. It seems to be a 
 problem with the - in the board target name. Not sure how this could be 
 solved though.

Yes. The modification was based on the assumption that Make target
names _and_ board config file names could be used as valid C
identifiers, which is obviously not the case.

Of course we could rename the respective Make targets and
directories, but this is (1) some effort and (2) requires negotiation
with the respective board maintainers, as documentation, build
scripts and other things may be effected by such a change.

Alternatively, we could filter out such problematic characters, but
then again we have to check which side effects this may cause.

All together: this patch needs a lot more thinking and more careful
testing.

I tend to revert it.

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
People are always a lot more complicated than you  think.  It's  very
important to remember that. - Terry Pratchett, _Truckers_
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4] ppc4xx: Rename compactcenter to intip

2009-09-11 Thread Stefan Roese
On Wednesday 09 September 2009 12:36:07 Dirk Eibach wrote:
 Signed-off-by: Dirk Eibach eib...@gdsys.de

Applied to u-boot-ppc4xx. Thanks.

Cheers,
Stefan

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


Re: [U-Boot] fsl_i2c: increase I2C timeout values and make them configurable

2009-09-11 Thread Joakim Tjernlund

 Timur Tabi ti...@freescale.com wrote on 10/09/2009 18:13:03:
 
  Joakim Tjernlund wrote:
 
   This calculation does not seem to match AN2919.
 
  When I wrote the code, AN2919 was much smaller than what you have today.
 
   Suppose one used only Table 7(almost what we have if you exclude dfsr!= 1)
   Table 7 is valid for 1 = dfsr =5 so how about replacing the current dfsr
   with:
   #ifdef __PPC__
u8 dfsr;
dfsr = (5*(i2c_clk/1000))/(10);
if (dfsr  5)
   dfsr = 5;
if (!dfsr)
   dfsr = 1;
debug(i2c_clk:%d, dfsr:%d\n, i2c_clk, dfsr);
writeb(dfsr, dev-dfsrr);   /* set default filter */
   #endif
 
  The value of FDR is dependent on the value of DFSR, so if I calculate DFSR, 
  I
  have to also calculate FDR.  This means the table goes away.  I'm okay with
  that (since my table is no longer a viable approach, it seems), but it's 
  more
  work than I'm willing to do at the moment.  Especically since this is going 
  to
  need a lot of testing before I'm willing to push it.

 I could not resist so I did a quick start:
[SNIP]

So I completed the function, here it is:

#include stdlib.h
#include stdio.h
#define I2C_CLK 12000

int main(int argc, char *argv[])
{
  unsigned long A,B,C;
  unsigned long Ga,Gb;
  unsigned long divisor, req_div;
  unsigned long est_div, bin_Gb, bin_Ga, est_FDR;
  unsigned long speed;

  if (argc != 2) {
printf(%s speed in HZ\n, argv[0]);
exit(1);
  }
  speed = atol(argv[1]);
  req_div = I2C_CLK/speed;
  C = (5*(I2C_CLK/1000))/(10);
  if (!C)
C = 1;
  est_div = ~0;
  for(Ga=0x4, A=10; A=30; Ga++, A+=2) {
for (Gb=0; Gb8; Gb++) {
  B = 16  Gb;
  divisor = B * (A + ((3*C)/B)*2);
  if (divisor = req_div  divisor  est_div) {
est_div = divisor;
bin_Gb = Gb  2;
bin_Ga = (Ga  0x3) | ((Ga  0x4)  3);
est_FDR = bin_Gb | bin_Ga;
//printf(div:%d, A:%d, B:%d b:%x, a:%x\n, divisor, A, B, Gb, Ga);
//printf(bin_Gb:0x%x, bin_Ga:0x%x\n, bin_Gb, bin_Ga);
//printf(FDR:0x%.2x, div:%d\n, est_FDR, est_div);
//printf(speed:%d\n\n, I2C_CLK/est_div);
#if 0
/* Condition 2 not accounted for */
{
  unsigned long T = 10/I2C_CLK;

  printf(%d*%d = Tr\n, (B-3*C), T);
  printf(%d = Tr\n, (B-3*C)* T);
}
#endif
  }
}
/* The old table in u-boot miss this */
if (A == 20)
  A+=2;
if (A == 24)
  A+=4;
  }

#if 1
  printf(\nreq_div:%d, est_div:%d, DFSR:%d\n, req_div, est_div, C);
  printf(bin_Gb:0x%x, bin_Ga:0x%x\n, bin_Gb, bin_Ga);
  printf(FDR:0x%.2x\n, est_FDR);
  printf(speed:%d\n, I2C_CLK/est_div);
#endif
}

This will generate the same divisor tables as AN2919, tables 6-9.
I do not take condition 2 into consideration as it not clear how to
deal with it and it does not seem to have an significant impact.

What do you think?

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


Re: [U-Boot] [PATCH v2 1/2] mkconfig: split the board make target to multiple config targets

2009-09-11 Thread Hu Mingkai-B21284
 

 -Original Message-
 From: Wolfgang Denk [mailto:w...@denx.de] 
 Sent: Friday, September 11, 2009 4:08 PM
 To: Hu Mingkai-B21284
 Cc: u-boot@lists.denx.de; ga...@kernel.crashing.org; Wood Scott-B07421
 Subject: Re: [PATCH v2 1/2] mkconfig: split the board make 
 target to multiple config targets
 
 Dear Mingkai Hu,
 
 In message 
 1252466603-25103-1-git-send-email-mingkai...@freescale.com 
 you wrote:
  To simplify the top level makefile it useful to be able to 
 parse the 
  top level makefile target to multiple individual target, 
 then put them 
  to the config.h, leave the board config file to handle the 
 different 
  targets.
  
  Note that this method uses the '_'(underline) as the delimiter when 
  splits the board make target.
  
  Signed-off-by: Mingkai Hu mingkai...@freescale.com
  ---
  
  According to the comments from Wolfgang and Scott, I modified the 
  patch and made some modification over v1:
  
   - remove the sectence thats puts the splited variables to the
 config.mk, we can use the CONFIG_MK_* in the board config file
 to override the variable in the board config file.
  
   - change CONFIG_OPT_* to CONFIG_MK_*
  
   mkconfig |7 +++
   1 files changed, 7 insertions(+), 0 deletions(-)
 
 Arghhh... It seems this patch has not been well tested. 
 Obviously never ever ran a MAKEALL over all PPC boards. It 
 causes tons of messages like that:
 
 include/config.h:2:25: warning: missing whitespace after the 
 macro name
 
 This patch breaks building for a number of boards / configurations,
 especially:
 
 xilinx-ppc405-generic_flash
 xilinx-ppc405-generic
 xilinx-ppc440-generic_flash
 xilinx-ppc440-generic
 VoVPN-GW_66MHz
 VoVPN-GW_100MHz
 EB+MCF-EV123
 EB+MCF-EV123_internal
 microblaze-generic
 favr-32-ezkit
 
 
 Shall I revert that patch?
 

Oh..., sorry, I don't run makeall to test and fell free to revert it,
but not this patch,
 this patch doesn't be included on your git tree, I think you means the
following patch:
http://git.denx.de/cgi-bin/gitweb.cgi?p=u-boot.git;a=commit;h=511c02f611
cb5afa1b8ca5980cbaa0de377f

Obviously, this patch also causes these issues, so can I parse the board
config name
in the top make file by using the findstring method which will make
the top make file
a little lengthy? If yes, I'll resend the patchset for boot from
NAND/eSDHC/eSPI again.

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


[U-Boot] Please pull u-boot-ppc4xx

2009-09-11 Thread Stefan Roese
The following changes since commit e7963772eb78a6aa1fa65063d64eab3a8626daac:
  Marcel Ziswiler (1):
muas3001: remove BRG clock node fixup to use common mpc8260 code.

are available in the git repository at:

  git://www.denx.de/git/u-boot-ppc4xx.git master

Dirk Eibach (1):
  ppc4xx: Rename compactcenter to intip

Stefan Roese (1):
  ppc4xx: Big cleanup of PPC4xx defines

 MAINTAINERS|2 +-
 MAKEALL|2 +-
 Makefile   |   16 +-
 board/amcc/acadia/acadia.c |   12 +-
 board/amcc/acadia/memory.c |   18 +-
 board/amcc/acadia/pll.c|   52 ++--
 board/amcc/bamboo/bamboo.c |  104 +++---
 board/amcc/bamboo/flash.c  |2 +-
 board/amcc/bubinga/bubinga.c   |4 +-
 board/amcc/bubinga/flash.c |   20 +-
 board/amcc/canyonlands/canyonlands.c   |4 +-
 board/amcc/ebony/ebony.c   |   32 +-
 board/amcc/katmai/katmai.c |6 +-
 board/amcc/luan/luan.c |   18 +-
 board/amcc/ocotea/ocotea.c |   48 ++--
 board/amcc/redwood/redwood.c   |   18 +-
 board/amcc/sequoia/sequoia.c   |   60 ++--
 board/amcc/taihu/taihu.c   |6 +-
 board/amcc/taishan/showinfo.c  |   70 ++--
 board/amcc/taishan/taishan.c   |   44 +-
 board/amcc/walnut/flash.c  |   20 +-
 board/amcc/yosemite/yosemite.c |   58 ++--
 board/amcc/yucca/flash.c   |2 +-
 board/amcc/yucca/yucca.c   |   20 +-
 board/cray/L1/L1.c |   38 +-
 board/cray/L1/init.S   |   24 +-
 board/csb272/csb272.c  |   18 +-
 board/csb272/init.S|   50 ++--
 board/csb472/csb472.c  |   18 +-
 board/csb472/init.S|   54 ++--
 board/dave/PPChameleonEVB/PPChameleonEVB.c |6 +-
 board/dave/PPChameleonEVB/flash.c  |8 +-
 board/eric/eric.c  |2 +-
 board/eric/flash.c |   20 +-
 board/eric/init.S  |  126 +++---
 board/esd/apc405/apc405.c  |   26 +-
 board/esd/ar405/flash.c|8 +-
 board/esd/ash405/ash405.c  |2 +-
 board/esd/ash405/flash.c   |8 +-
 board/esd/canbt/canbt.c|8 +-
 board/esd/canbt/flash.c|   10 +-
 board/esd/cms700/cms700.c  |2 +-
 board/esd/cms700/flash.c   |8 +-
 board/esd/cpci2dp/cpci2dp.c|   12 +-
 board/esd/cpci2dp/flash.c  |   10 +-
 board/esd/cpci405/cpci405.c|   22 +-
 board/esd/cpci405/flash.c  |   20 +-
 board/esd/cpciiser4/flash.c|   10 +-
 board/esd/dp405/dp405.c|2 +-
 board/esd/dp405/flash.c|8 +-
 board/esd/du405/du405.c|8 +-
 board/esd/du405/flash.c|   20 +-
 board/esd/du440/du440.c|   56 ++--
 board/esd/hh405/flash.c|8 +-
 board/esd/hh405/hh405.c|2 +-
 board/esd/hub405/flash.c   |8 +-
 board/esd/hub405/hub405.c  |2 +-
 board/esd/ocrtc/flash.c|   20 +-
 board/esd/ocrtc/ocrtc.c|2 +-
 board/esd/pci405/flash.c   |8 +-
 board/esd/pci405/pci405.c  |   28 +-
 board/esd/plu405/flash.c   |8 +-
 board/esd/plu405/plu405.c  |2 +-
 board/esd/pmc405/pmc405.c  |6 +-
 board/esd/pmc405de/pmc405de.c  |2 +-
 board/esd/pmc440/pmc440.c  |   66 ++--
 board/esd/voh405/flash.c   |8 +-
 board/esd/voh405/voh405.c  |2 +-
 board/esd/vom405/flash.c   |8 +-
 board/esd/vom405/vom405.c  |2 +-
 board/esd/wuh405/flash.c   |8 +-
 board/esd/wuh405/wuh405.c  |2 +-
 board/exbitgen/exbitgen.c  |   16 +-
 board/exbitgen/init.S  |  

[U-Boot] tigon3 Ethernet - any users / testers out there?

2009-09-11 Thread Wolfgang Denk
Hi,

I'm looking for users / testers for the TIGON3 Ethernet driver. The
only board that uses it is the BMW board, which is orphaned.

I'm trying to fix the compiler warnings raised by this driver:

tigon3.c: In function 'LM_InitializeAdapter':
tigon3.c:1625: warning: dereferencing type-punned pointer will break 
strict-aliasing rules
tigon3.c: In function 'LM_ResetAdapter':
tigon3.c:2616: warning: dereferencing type-punned pointer will break 
strict-aliasing rules
tigon3.c:2630: warning: dereferencing type-punned pointer will break 
strict-aliasing rules

The first one is trivial to fix.

The other two are caused by cod ethat looks like this (after preprocessing):

Value16 = readl(((pDevice)-pMemView-PciCfg.PciXCommand));

However, according to tigon3.h, PciXCommand is a 16 bit register:

...
T3_16BIT_REGISTER PciXCommand;
...

I wonder if accessing the 16 bit register using a 32 bit accessor
macro is OK at all, or if we should rather use a 16 bit accessor -
and if the resultung code would still work if we did.


Comments welcome.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
The trouble with our times is that the future is not what it used  to
be. - Paul Valery
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] kwbimage.c: Fix compile warning when building on 64 bit systems

2009-09-11 Thread Wolfgang Denk
Fix this warning when building on 64 bit systems:
tools/kwbimage.c: In function 'kwbimage_checksum32':
tools/kwbimage.c:135: warning: format '%d' expects type 'int',
but argument 4 has type 'long unsigned int'

Signed-off-by: Wolfgang Denk w...@denx.de
Cc: Prafulla Wadaskar prafu...@marvell.com
---
 tools/kwbimage.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/kwbimage.c b/tools/kwbimage.c
index 28dc2d6..ee067cb 100644
--- a/tools/kwbimage.c
+++ b/tools/kwbimage.c
@@ -131,7 +131,7 @@ static uint32_t kwbimage_checksum32 (uint32_t *start, 
uint32_t len, uint32_t csu
return 0;
 
if (len % sizeof(uint32_t)) {
-   printf (Error:%s[%d] - lenght is not in multiple of %d\n,
+   printf (Error:%s[%d] - lenght is not in multiple of %ld\n,
__FUNCTION__, len, sizeof(uint32_t));
return 0;
}
-- 
1.6.0.6

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


[U-Boot] [PATCH] sk98lin: fix compile warnings

2009-09-11 Thread Wolfgang Denk
Fix warnings:
skge.c: In function 'BoardInitMem':
skge.c:1389: warning: dereferencing type-punned pointer will break 
strict-aliasing rules
skge.c:1390: warning: dereferencing type-punned pointer will break 
strict-aliasing rules
skge.c:1391: warning: dereferencing type-punned pointer will break 
strict-aliasing rules
skgesirq.c: In function 'SkGePortCheckUpXmac':
skgesirq.c:1301: warning: dereferencing type-punned pointer will break 
strict-aliasing rules
skgesirq.c:1301: warning: dereferencing type-punned pointer will break 
strict-aliasing rules
skgesirq.c:1398: warning: dereferencing type-punned pointer will break 
strict-aliasing rules
skgesirq.c:1398: warning: dereferencing type-punned pointer will break 
strict-aliasing rules
skrlmt.c: In function 'SkRlmtInit':
skrlmt.c:661: warning: dereferencing type-punned pointer will break 
strict-aliasing rules
skxmac2.c: In function 'SkMacPromiscMode':
skxmac2.c:753: warning: dereferencing type-punned pointer will break 
strict-aliasing rules
skxmac2.c:753: warning: dereferencing type-punned pointer will break 
strict-aliasing rules
skxmac2.c: In function 'SkMacHashing':
skxmac2.c:803: warning: dereferencing type-punned pointer will break 
strict-aliasing rules
skxmac2.c:803: warning: dereferencing type-punned pointer will break 
strict-aliasing rules
skxmac2.c: In function 'SkMacFlushTxFifo':
skxmac2.c:1115: warning: dereferencing type-punned pointer will break 
strict-aliasing rules
skxmac2.c:1115: warning: dereferencing type-punned pointer will break 
strict-aliasing rules
skxmac2.c: In function 'SkMacFlushRxFifo':
skxmac2.c:1145: warning: dereferencing type-punned pointer will break 
strict-aliasing rules
skxmac2.c:1145: warning: dereferencing type-punned pointer will break 
strict-aliasing rules
skxmac2.c: In function 'SkXmInitPauseMd':
skxmac2.c:1987: warning: dereferencing type-punned pointer will break 
strict-aliasing rules
skxmac2.c:1987: warning: dereferencing type-punned pointer will break 
strict-aliasing rules
skxmac2.c: In function 'SkXmOverflowStatus':
skxmac2.c:4236: warning: dereferencing type-punned pointer will break 
strict-aliasing rules
skxmac2.c:4236: warning: dereferencing type-punned pointer will break 
strict-aliasing rules
skxmac2.c:4242: warning: dereferencing type-punned pointer will break 
strict-aliasing rules
skxmac2.c:4242: warning: dereferencing type-punned pointer will break 
strict-aliasing rules

Signed-off-by: Wolfgang Denk w...@denx.de
Cc: Ben Warren biggerbadder...@gmail.com
---
 drivers/net/sk98lin/skge.c |   12 +---
 drivers/net/sk98lin/skgesirq.c |7 +--
 drivers/net/sk98lin/skrlmt.c   |3 ++-
 drivers/net/sk98lin/skxmac2.c  |   20 +---
 4 files changed, 29 insertions(+), 13 deletions(-)

diff --git a/drivers/net/sk98lin/skge.c b/drivers/net/sk98lin/skge.c
index c815480..df764b4 100644
--- a/drivers/net/sk98lin/skge.c
+++ b/drivers/net/sk98lin/skge.c
@@ -1382,13 +1382,19 @@ int TxDescrSize;/* the size of a tx descriptor 
rounded up to alignment*/
pAC-TxDescrPerRing = TX_RING_SIZE / RxDescrSize;
 
for (i=0; ipAC-GIni.GIMacsFound; i++) {
+   TXD **txd_head, **txd_tail, **txd_prev;
+
+   txd_head = pAC-TxPort[i][0].pTxdRingHead;
+   txd_tail = pAC-TxPort[i][0].pTxdRingTail;
+   txd_prev = pAC-TxPort[i][0].pTxdRingPrev;
+
SetupRing(
pAC,
pAC-TxPort[i][0].pTxDescrRing,
pAC-TxPort[i][0].VTxDescrRing,
-   (RXD**)pAC-TxPort[i][0].pTxdRingHead,
-   (RXD**)pAC-TxPort[i][0].pTxdRingTail,
-   (RXD**)pAC-TxPort[i][0].pTxdRingPrev,
+   (RXD**)txd_head,
+   (RXD**)txd_tail,
+   (RXD**)txd_prev,
pAC-TxPort[i][0].TxdRingFree,
SK_TRUE);
SetupRing(
diff --git a/drivers/net/sk98lin/skgesirq.c b/drivers/net/sk98lin/skgesirq.c
index 106fe48..53229d2 100644
--- a/drivers/net/sk98lin/skgesirq.c
+++ b/drivers/net/sk98lin/skgesirq.c
@@ -1266,6 +1266,7 @@ int   Port)   /* Which port should be 
checked */
SK_GEPORT   *pPrt;  /* GIni Port struct pointer */
int Done;
SK_U32  GpReg;  /* General Purpose register value */
+   SK_U32  *pGpReg;/* Pointer to --  -- */
SK_U16  Isrc;   /* Interrupt source register */
SK_U16  IsrcSum;/* Interrupt source register sum */
SK_U16  LpAb;   /* Link Partner Ability */
@@ -1274,6 +1275,8 @@ int   Port)   /* Which port should be 
checked */
SK_BOOL AutoNeg;/* Is Auto-negotiation used ? */
SK_U8   NextMode;   /* Next AutoSensing Mode */
 
+   pGpReg = GpReg;
+
pPrt = 

[U-Boot] [PATCH] board/esd/common/flash.c: Fix compile warning

2009-09-11 Thread Wolfgang Denk
Fix warning: ../common/flash.c:635: warning: dereferencing type-punned
pointer will break strict-aliasing rules

Signed-off-by: Wolfgang Denk w...@denx.de
Cc: Matthias Fuchs matthias.fu...@esd-electronics.com
Cc: Stefan Roese s...@denx.de
---
 board/esd/common/flash.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/board/esd/common/flash.c b/board/esd/common/flash.c
index 3ea053b..38a58fb 100644
--- a/board/esd/common/flash.c
+++ b/board/esd/common/flash.c
@@ -630,9 +630,10 @@ int write_buff (flash_info_t *info, uchar *src, ulong 
addr, ulong cnt)
  */
 static int write_word (flash_info_t *info, ulong dest, ulong data)
 {
+   ulong *data_ptr = data;
volatile CONFIG_SYS_FLASH_WORD_SIZE *addr2 = 
(CONFIG_SYS_FLASH_WORD_SIZE *)(info-start[0]);
volatile CONFIG_SYS_FLASH_WORD_SIZE *dest2 = 
(CONFIG_SYS_FLASH_WORD_SIZE *)dest;
-   volatile CONFIG_SYS_FLASH_WORD_SIZE *data2 = 
(CONFIG_SYS_FLASH_WORD_SIZE *)data;
+   volatile CONFIG_SYS_FLASH_WORD_SIZE *data2 = 
(CONFIG_SYS_FLASH_WORD_SIZE *)data_ptr;
ulong start;
int flag;
int i;
-- 
1.6.0.6

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


[U-Boot] [PATCH] net/bootp.c: fix compile warning

2009-09-11 Thread Wolfgang Denk
Fix warning: bootp.c:695: warning: dereferencing type-punned pointer
will break strict-aliasing rules

Signed-off-by: Wolfgang Denk w...@denx.de
Cc: Ben Warren biggerbadder...@gmail.com
---
 net/bootp.c |6 +-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/net/bootp.c b/net/bootp.c
index 0799ae2..3093852 100644
--- a/net/bootp.c
+++ b/net/bootp.c
@@ -683,6 +683,9 @@ static void DhcpOptionsProcess (uchar * popt, Bootp_t *bp)
 {
uchar *end = popt + BOOTP_HDR_SIZE;
int oplen, size;
+#if defined(CONFIG_CMD_SNTP)  defined(CONFIG_BOOTP_TIMEOFFSET)
+   int *to_ptr;
+#endif
 
while (popt  end  *popt != 0xff) {
oplen = *(popt + 1);
@@ -692,7 +695,8 @@ static void DhcpOptionsProcess (uchar * popt, Bootp_t *bp)
break;
 #if defined(CONFIG_CMD_SNTP)  defined(CONFIG_BOOTP_TIMEOFFSET)
case 2: /* Time offset  */
-   NetCopyLong ((ulong *)NetTimeOffset, (ulong *) (popt + 
2));
+   to_ptr = NetTimeOffset;
+   NetCopyLong ((ulong *)to_ptr, (ulong *)(popt + 2));
NetTimeOffset = ntohl (NetTimeOffset);
break;
 #endif
-- 
1.6.0.6

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


[U-Boot] [PATCH] board/flagadm/flash.c: fix compile warning

2009-09-11 Thread Wolfgang Denk
Fix warning: flash.c:531: warning: dereferencing type-punned pointer
will break strict-aliasing rules

Signed-off-by: Wolfgang Denk w...@denx.de
Cc: K�ri Dav��sson k...@flaga.is
---
 board/flagadm/flash.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/board/flagadm/flash.c b/board/flagadm/flash.c
index bbefbac..ff37d9e 100644
--- a/board/flagadm/flash.c
+++ b/board/flagadm/flash.c
@@ -528,7 +528,8 @@ int write_word (flash_info_t *info, ulong dest, ulong da)
ulong start;
char csr;
int flag;
-   ushort * d = (ushort*)da;
+   ulong *dla = da;
+   ushort *d = (ushort*)dla;
int i;
 
/* Check if Flash is (sufficiently) erased */
-- 
1.6.0.6

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


[U-Boot] [PATCH] drivers/net/natsemi.c: fix compile warning

2009-09-11 Thread Wolfgang Denk
Fix warning: natsemi.c:757: warning: dereferencing type-punned pointer
will break strict-aliasing rules

Signed-off-by: Wolfgang Denk w...@denx.de
Cc: Ben Warren biggerbadder...@gmail.com
---
 drivers/net/natsemi.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/net/natsemi.c b/drivers/net/natsemi.c
index ce12c3b..e09da1d 100644
--- a/drivers/net/natsemi.c
+++ b/drivers/net/natsemi.c
@@ -754,7 +754,8 @@ natsemi_send(struct eth_device *dev, volatile void *packet, 
int length)
 {
u32 i, status = 0;
u32 tx_status = 0;
-   vu_long *res = (vu_long *)tx_status;
+   u32 *tx_ptr = tx_status;
+   vu_long *res = (vu_long *)tx_ptr;
 
/* Stop the transmitter */
OUTL(dev, TxOff, ChipCmd);
-- 
1.6.0.6

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


[U-Boot] [PATCH] board/esd/cpci750/ide.c: fix compile warning

2009-09-11 Thread Wolfgang Denk
Fix warning: ide.c:54: warning: dereferencing type-punned pointer will
break strict-aliasing rules

Signed-off-by: Wolfgang Denk w...@denx.de
Cc: Matthias Fuchs matthias.fu...@esd-electronics.com
Cc: Stefan Roese s...@denx.de
---
 board/esd/cpci750/ide.c |8 ++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/board/esd/cpci750/ide.c b/board/esd/cpci750/ide.c
index 638219f..a3bd1b7 100644
--- a/board/esd/cpci750/ide.c
+++ b/board/esd/cpci750/ide.c
@@ -48,14 +48,18 @@ int ide_preinit (void)
if (devbusfn == -1)
devbusfn = pci_find_device (0x1095, 0x3114, 0);
if (devbusfn != -1) {
+   ulong *ide_bus_offset_ptr;
+
status = 0;
 
+   ide_bus_offset_ptr = ide_bus_offset[0];
pci_read_config_dword (devbusfn, PCI_BASE_ADDRESS_0,
-  (u32 *)  ide_bus_offset[0]);
+  (u32 *)ide_bus_offset_ptr);
ide_bus_offset[0] = 0xfffe;
ide_bus_offset[0] += CONFIG_SYS_PCI0_IO_SPACE;
+   ide_bus_offset_ptr = ide_bus_offset[1];
pci_read_config_dword (devbusfn, PCI_BASE_ADDRESS_2,
-  (u32 *)  ide_bus_offset[1]);
+  (u32 *)ide_bus_offset_ptr);
ide_bus_offset[1] = 0xfffe;
ide_bus_offset[1] += CONFIG_SYS_PCI0_IO_SPACE;
}
-- 
1.6.0.6

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


[U-Boot] [PATCH 2/2 v2] Blackfin: tweak embedded env config option

2009-09-11 Thread Mike Frysinger
Use the common config option for extracting the environment for embedding
into LDR files.

Signed-off-by: Mike Frysinger vap...@gentoo.org
---
v2
- do not call envcrc in ldr target if env isnt embedded

 Makefile |2 +-
 include/configs/bf518f-ezbrd.h   |2 +-
 include/configs/bf526-ezbrd.h|2 +-
 include/configs/bf527-ezkit.h|2 +-
 include/configs/bf533-stamp.h|2 +-
 include/configs/bf537-minotaur.h |2 +-
 include/configs/bf537-pnav.h |2 +-
 include/configs/bf537-srv1.h |2 +-
 include/configs/bf537-stamp.h|2 +-
 include/configs/bf538f-ezkit.h   |2 +-
 include/configs/bf548-ezkit.h|4 ++--
 include/configs/bf561-ezkit.h|2 +-
 include/configs/cm-bf527.h   |2 +-
 include/configs/cm-bf537e.h  |2 +-
 include/configs/cm-bf537u.h  |2 +-
 include/configs/cm-bf548.h   |2 +-
 include/configs/ibf-dsp561.h |2 +-
 include/configs/tcm-bf537.h  |2 +-
 lib_blackfin/config.mk   |   10 +++---
 19 files changed, 26 insertions(+), 22 deletions(-)

diff --git a/Makefile b/Makefile
index 0449a5b..046a22f 100644
--- a/Makefile
+++ b/Makefile
@@ -308,7 +308,7 @@ $(obj)u-boot.bin:   $(obj)u-boot
$(OBJCOPY) ${OBJCFLAGS} -O binary $ $@
 
 $(obj)u-boot.ldr:  $(obj)u-boot
-   $(obj)tools/envcrc --binary  $(obj)env-ldr.o
+   $(CREATE_LDR_ENV)
$(LDR) -T $(CONFIG_BFIN_CPU) -c $@ $ $(LDR_FLAGS)
 
 $(obj)u-boot.ldr.hex:  $(obj)u-boot.ldr
diff --git a/include/configs/bf518f-ezbrd.h b/include/configs/bf518f-ezbrd.h
index 3db8171..8c97ee4 100644
--- a/include/configs/bf518f-ezbrd.h
+++ b/include/configs/bf518f-ezbrd.h
@@ -109,7 +109,7 @@
 #define CONFIG_ENV_SIZE0x2000
 #define CONFIG_ENV_SECT_SIZE   0x2000
 #endif
-#define ENV_IS_EMBEDDED_CUSTOM
+#define CONFIG_ENV_IS_EMBEDDED_CUSTOM
 
 
 /*
diff --git a/include/configs/bf526-ezbrd.h b/include/configs/bf526-ezbrd.h
index 97853af..866e15a 100644
--- a/include/configs/bf526-ezbrd.h
+++ b/include/configs/bf526-ezbrd.h
@@ -126,7 +126,7 @@
 #define CONFIG_ENV_SIZE0x2000
 #define CONFIG_ENV_SECT_SIZE   0x2000
 #endif
-#define ENV_IS_EMBEDDED_CUSTOM
+#define CONFIG_ENV_IS_EMBEDDED_CUSTOM
 
 
 /*
diff --git a/include/configs/bf527-ezkit.h b/include/configs/bf527-ezkit.h
index 0d02354..fdada41 100644
--- a/include/configs/bf527-ezkit.h
+++ b/include/configs/bf527-ezkit.h
@@ -125,7 +125,7 @@
 #define CONFIG_ENV_SIZE0x2000
 #define CONFIG_ENV_SECT_SIZE   0x2000
 #endif
-#define ENV_IS_EMBEDDED_CUSTOM
+#define CONFIG_ENV_IS_EMBEDDED_CUSTOM
 
 
 /*
diff --git a/include/configs/bf533-stamp.h b/include/configs/bf533-stamp.h
index 4be2a5c..33f3264 100644
--- a/include/configs/bf533-stamp.h
+++ b/include/configs/bf533-stamp.h
@@ -115,7 +115,7 @@
 #if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_BYPASS)
 #define ENV_IS_EMBEDDED
 #else
-#define ENV_IS_EMBEDDED_CUSTOM
+#define CONFIG_ENV_IS_EMBEDDED_CUSTOM
 #endif
 #ifdef ENV_IS_EMBEDDED
 /* WARNING - the following is hand-optimized to fit within
diff --git a/include/configs/bf537-minotaur.h b/include/configs/bf537-minotaur.h
index 463b7d0..0beae4b 100644
--- a/include/configs/bf537-minotaur.h
+++ b/include/configs/bf537-minotaur.h
@@ -115,7 +115,7 @@
 #define CONFIG_ENV_OFFSET  0x1
 #define CONFIG_ENV_SIZE0x1
 #define CONFIG_ENV_SECT_SIZE   0x1
-#define ENV_IS_EMBEDDED_CUSTOM
+#define CONFIG_ENV_IS_EMBEDDED_CUSTOM
 
 
 /*
diff --git a/include/configs/bf537-pnav.h b/include/configs/bf537-pnav.h
index 0f908ef..bdf8b22 100644
--- a/include/configs/bf537-pnav.h
+++ b/include/configs/bf537-pnav.h
@@ -94,7 +94,7 @@
  * Env Storage Settings
  */
 #if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_SPI_MASTER)
-#define ENV_IS_EMBEDDED_CUSTOM
+#define CONFIG_ENV_IS_EMBEDDED_CUSTOM
 #define CONFIG_ENV_IS_IN_SPI_FLASH
 #define CONFIG_ENV_OFFSET  0x4000
 #else
diff --git a/include/configs/bf537-srv1.h b/include/configs/bf537-srv1.h
index 7368629..f82753a 100644
--- a/include/configs/bf537-srv1.h
+++ b/include/configs/bf537-srv1.h
@@ -115,7 +115,7 @@
 #define CONFIG_ENV_OFFSET  0x1
 #define CONFIG_ENV_SIZE0x1
 #define CONFIG_ENV_SECT_SIZE   0x1
-#define ENV_IS_EMBEDDED_CUSTOM
+#define CONFIG_ENV_IS_EMBEDDED_CUSTOM
 
 
 /*
diff --git a/include/configs/bf537-stamp.h b/include/configs/bf537-stamp.h
index 74b9ecd..aedd230 100644
--- a/include/configs/bf537-stamp.h
+++ b/include/configs/bf537-stamp.h
@@ -113,7 +113,7 @@
 #if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_BYPASS)
 #define ENV_IS_EMBEDDED
 #else
-#define ENV_IS_EMBEDDED_CUSTOM
+#define CONFIG_ENV_IS_EMBEDDED_CUSTOM
 #endif
 #ifdef ENV_IS_EMBEDDED
 /* WARNING - the following is hand-optimized to fit within
diff --git a/include/configs/bf538f-ezkit.h b/include/configs/bf538f-ezkit.h
index 535687f..fbda43c 100644
--- a/include/configs/bf538f-ezkit.h
+++ b/include/configs/bf538f-ezkit.h
@@ -109,7 +109,7 @@
 

[U-Boot] Does u-boot support nand flash boot

2009-09-11 Thread Sun, Peng 2
From the code we can know that u-boot didn't support boot from nand for 
smdk2410. If you want to do that you need to hack the code by yourself. It's 
not an hard task. You can look at the code under directory nand_spl for 
reference. In fact I'm doing it now, maybe next week I can work out the code 
and I'm glad to share the code with you.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] board/linkstation/ide.c: Fix compile warning

2009-09-11 Thread Wolfgang Denk
Fix warning: ide.c:60: warning: dereferencing type-punned pointer will
break strict-aliasing rules

Signed-off-by: Wolfgang Denk w...@denx.de
Cc: Guennadi Liakhovetski l...@denx.de
---
 board/linkstation/ide.c |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/board/linkstation/ide.c b/board/linkstation/ide.c
index 2c89d62..5dd1d0e 100644
--- a/board/linkstation/ide.c
+++ b/board/linkstation/ide.c
@@ -54,10 +54,12 @@ int ide_preinit (void)
if (devbusfn == -1)
devbusfn = 
pci_find_device(PCI_VENDOR_ID_ITE,PCI_DEVICE_ID_ITE_8212,0);
if (devbusfn != -1) {
+   ulong *ide_bus_offset_ptr = ide_bus_offset[0];
+
status = 0;
 
pci_read_config_dword (devbusfn, PCI_BASE_ADDRESS_0,
-  (u32 *) 
ide_bus_offset[0]);
+  (u32 
*)ide_bus_offset_ptr);
ide_bus_offset[0] = 0xfffe;
ide_bus_offset[0] = pci_hose_bus_to_phys(hose,
 ide_bus_offset[0]  
0xfffe,
-- 
1.6.0.6

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


[U-Boot] [PATCH] board/amcc/common/flash.c: Fix compile warning

2009-09-11 Thread Wolfgang Denk
Fix warning: ../common/flash.c:917: warning: dereferencing type-punned
pointer will break strict-aliasing rules

Signed-off-by: Wolfgang Denk w...@denx.de
Cc: Stefan Roese s...@denx.de
---
 board/amcc/common/flash.c |7 ---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/board/amcc/common/flash.c b/board/amcc/common/flash.c
index 9943c74..9aaf256 100644
--- a/board/amcc/common/flash.c
+++ b/board/amcc/common/flash.c
@@ -912,9 +912,10 @@ static int flash_erase_2(flash_info_t * info, int s_first, 
int s_last)
 
 static int write_word_2(flash_info_t * info, ulong dest, ulong data)
 {
-   volatile CONFIG_SYS_FLASH_WORD_SIZE *addr2 = 
(CONFIG_SYS_FLASH_WORD_SIZE *) (info-start[0]);
-   volatile CONFIG_SYS_FLASH_WORD_SIZE *dest2 = 
(CONFIG_SYS_FLASH_WORD_SIZE *) dest;
-   volatile CONFIG_SYS_FLASH_WORD_SIZE *data2 = 
(CONFIG_SYS_FLASH_WORD_SIZE *)  data;
+   ulong *data_ptr = data;
+   volatile CONFIG_SYS_FLASH_WORD_SIZE *addr2 = 
(CONFIG_SYS_FLASH_WORD_SIZE *)(info-start[0]);
+   volatile CONFIG_SYS_FLASH_WORD_SIZE *dest2 = 
(CONFIG_SYS_FLASH_WORD_SIZE *)dest;
+   volatile CONFIG_SYS_FLASH_WORD_SIZE *data2 = 
(CONFIG_SYS_FLASH_WORD_SIZE *)data_ptr;
ulong start;
int i;
 
-- 
1.6.0.6

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


[U-Boot] [PATCH] board/amcc/taihu/flash.c: Fix compile warning

2009-09-11 Thread Wolfgang Denk
Fix warnings:
flash.c: In function 'write_word_1':
flash.c:696: warning: dereferencing type-punned pointer will break 
strict-aliasing rules
flash.c: In function 'write_word_2':
flash.c:1044: warning: dereferencing type-punned pointer will break 
strict-aliasing rules

Signed-off-by: Wolfgang Denk w...@denx.de
Cc: Stefan Roese s...@denx.de
---
 board/amcc/taihu/flash.c |   14 --
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/board/amcc/taihu/flash.c b/board/amcc/taihu/flash.c
index 110cbe5..497fdb9 100644
--- a/board/amcc/taihu/flash.c
+++ b/board/amcc/taihu/flash.c
@@ -691,9 +691,10 @@ static int write_word_1(flash_info_t * info, ulong dest, 
ulong data)
 static int write_word(flash_info_t * info, ulong dest, ulong data)
 #endif
 {
-   volatile CONFIG_SYS_FLASH_WORD_SIZE *addr2 = 
(CONFIG_SYS_FLASH_WORD_SIZE *) (info-start[0]);
-   volatile CONFIG_SYS_FLASH_WORD_SIZE *dest2 = 
(CONFIG_SYS_FLASH_WORD_SIZE *) dest;
-   volatile CONFIG_SYS_FLASH_WORD_SIZE *data2 = 
(CONFIG_SYS_FLASH_WORD_SIZE *)  data;
+   ulong *data_ptr = data;
+   volatile CONFIG_SYS_FLASH_WORD_SIZE *addr2 = 
(CONFIG_SYS_FLASH_WORD_SIZE *)(info-start[0]);
+   volatile CONFIG_SYS_FLASH_WORD_SIZE *dest2 = 
(CONFIG_SYS_FLASH_WORD_SIZE *)dest;
+   volatile CONFIG_SYS_FLASH_WORD_SIZE *data2 = 
(CONFIG_SYS_FLASH_WORD_SIZE *)data_ptr;
ulong start;
int i;
 
@@ -1039,9 +1040,10 @@ static int flash_erase_2(flash_info_t * info, int 
s_first, int s_last)
 
 static int write_word_2(flash_info_t * info, ulong dest, ulong data)
 {
-   volatile CONFIG_SYS_FLASH_WORD_SIZE *addr2 = 
(CONFIG_SYS_FLASH_WORD_SIZE *) (info-start[0]);
-   volatile CONFIG_SYS_FLASH_WORD_SIZE *dest2 = 
(CONFIG_SYS_FLASH_WORD_SIZE *) dest;
-   volatile CONFIG_SYS_FLASH_WORD_SIZE *data2 = 
(CONFIG_SYS_FLASH_WORD_SIZE *)  data;
+   ulong *data_ptr = data;
+   volatile CONFIG_SYS_FLASH_WORD_SIZE *addr2 = 
(CONFIG_SYS_FLASH_WORD_SIZE *)(info-start[0]);
+   volatile CONFIG_SYS_FLASH_WORD_SIZE *dest2 = 
(CONFIG_SYS_FLASH_WORD_SIZE *)dest;
+   volatile CONFIG_SYS_FLASH_WORD_SIZE *data2 = 
(CONFIG_SYS_FLASH_WORD_SIZE *)data_ptr;
ulong start;
int i;
 
-- 
1.6.0.6

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


[U-Boot] [PATCH] board/dave/common/flash.c: fix compile warning

2009-09-11 Thread Wolfgang Denk
Fix warning: ../common/flash.c:668: warning: dereferencing type-punned
pointer will break strict-aliasing rules

Signed-off-by: Wolfgang Denk w...@denx.de
Cc: Andrea Marson andrea.mar...@dave-tech.it
---
 board/dave/common/flash.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/board/dave/common/flash.c b/board/dave/common/flash.c
index b6af63b..29caf47 100644
--- a/board/dave/common/flash.c
+++ b/board/dave/common/flash.c
@@ -663,9 +663,10 @@ int write_buff (flash_info_t *info, uchar *src, ulong 
addr, ulong cnt)
  */
 static int write_word (flash_info_t *info, ulong dest, ulong data)
 {
+   ulong *data_ptr = data;
volatile CONFIG_SYS_FLASH_WORD_SIZE *addr2 = 
(CONFIG_SYS_FLASH_WORD_SIZE *)(info-start[0]);
volatile CONFIG_SYS_FLASH_WORD_SIZE *dest2 = 
(CONFIG_SYS_FLASH_WORD_SIZE *)dest;
-   volatile CONFIG_SYS_FLASH_WORD_SIZE *data2 = 
(CONFIG_SYS_FLASH_WORD_SIZE *)data;
+   volatile CONFIG_SYS_FLASH_WORD_SIZE *data2 = 
(CONFIG_SYS_FLASH_WORD_SIZE *)data_ptr;
ulong start;
int flag;
int i;
-- 
1.6.0.6

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


[U-Boot] [PATCH] board/etin/debris/phantom.c: Fix compile error

2009-09-11 Thread Wolfgang Denk
Fix build problem caused by commit e84aba13: Replace BCD2BIN and
BIN2BCD macros with inline functions

phantom.c:163: error: redefinition of 'bcd2bin'
/home/wd/git/u-boot/work/include/bcd.h:16: error: previous definition of 
'bcd2bin' was here
phantom.c:168: error: redefinition of 'bin2bcd'
/home/wd/git/u-boot/work/include/bcd.h:21: error: previous definition of 
'bin2bcd' was here

Signed-off-by: Wolfgang Denk w...@denx.de
Cc: Sangmoon Kim dog...@etinsys.com
---
 board/etin/debris/phantom.c |   10 --
 1 files changed, 0 insertions(+), 10 deletions(-)

diff --git a/board/etin/debris/phantom.c b/board/etin/debris/phantom.c
index fcb4c40..63feb7c 100644
--- a/board/etin/debris/phantom.c
+++ b/board/etin/debris/phantom.c
@@ -159,16 +159,6 @@ void rtc_reset(void)
}
 }
 
-inline unsigned bcd2bin (uchar n)
-{
-   return n  4)  0x0F) * 10) + (n  0x0F));
-}
-
-inline unsigned char bin2bcd (unsigned int n)
-{
-   return (((n / 10)  4) | (n % 10));
-}
-
 static int get_century_flag(void)
 {
int flag = 0;
-- 
1.6.0.6

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


[U-Boot] [PATCH] board/amcc/yucca/flash.c: Fix compile warning

2009-09-11 Thread Wolfgang Denk
Fix warning: flash.c:919: warning: dereferencing type-punned pointer
will break strict-aliasing rules

Signed-off-by: Wolfgang Denk w...@denx.de
Cc: Stefan Roese s...@denx.de
---
 board/amcc/yucca/flash.c |7 ---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/board/amcc/yucca/flash.c b/board/amcc/yucca/flash.c
index eda49eb..d8c3b32 100644
--- a/board/amcc/yucca/flash.c
+++ b/board/amcc/yucca/flash.c
@@ -914,9 +914,10 @@ static int flash_erase_2(flash_info_t * info, int s_first, 
int s_last)
 
 static int write_word_2(flash_info_t * info, ulong dest, ulong data)
 {
-   volatile CONFIG_SYS_FLASH_WORD_SIZE *addr2 = 
(CONFIG_SYS_FLASH_WORD_SIZE *) (info-start[0]);
-   volatile CONFIG_SYS_FLASH_WORD_SIZE *dest2 = 
(CONFIG_SYS_FLASH_WORD_SIZE *) dest;
-   volatile CONFIG_SYS_FLASH_WORD_SIZE *data2 = 
(CONFIG_SYS_FLASH_WORD_SIZE *)  data;
+   ulong *data_ptr = data;
+   volatile CONFIG_SYS_FLASH_WORD_SIZE *addr2 = 
(CONFIG_SYS_FLASH_WORD_SIZE *)(info-start[0]);
+   volatile CONFIG_SYS_FLASH_WORD_SIZE *dest2 = 
(CONFIG_SYS_FLASH_WORD_SIZE *)dest;
+   volatile CONFIG_SYS_FLASH_WORD_SIZE *data2 = 
(CONFIG_SYS_FLASH_WORD_SIZE *)data_ptr;
ulong start;
int i;
 
-- 
1.6.0.6

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


Re: [U-Boot] [PATCH] AT91RM9200 BGA port D defines

2009-09-11 Thread Jens Scharsig
Hello Jean-Christophe 

you said:

 
 applied
 

But the patch isn't present in current git.

What's wrong?

Best Regards

Jens Scharsig

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


[U-Boot] Fix compile warning / error

2009-09-11 Thread Wolfgang Denk
Hi,

I've just sent a batch of patches to fix compiler warnings and
errors.

ACK's are welcoem :-)

Ben, Stefan: if you agree I apply these patches directly, just send
your ACK / NAK.  Thanks.

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
Copy from one, it's plagiarism; copy from two, it's research.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/4 v2] s5pc1xx: support Samsung s5pc1xx SoC

2009-09-11 Thread Minkyu Kang
Dear Wolfgang

2009/9/10 Wolfgang Denk w...@denx.de:
 Dear Minkyu Kang,

 In message 4aa8ac30.2070...@samsung.com you wrote:
 This patch adds support for the Samsung s5pc100 and s5pc110
 SoCs. The s5pc1xx SoC is an ARM Cortex A8 processor.

 Signed-off-by: Minkyu Kang mk7.k...@samsung.com
 Signed-off-by: HeungJun, Kim riverful@samsung.com

 When posting new versions of patches, please always make sure to set
 appropriate In-reply-to: and References: headers, so your new
 versions get correctly threaded with the previous discussion, which
 makes it much easier to check previous review comments against what
 you actually changed.

 Also, please always include a list of changed between the current and
 the previous version of the patch, otherwise we have to review the
 whole code completely again.

 Please consider using git send-email to submit patches which will
 make your (and our) life easier, for example because it prompts you
 for the message IDs to be used in the In-reply-to: and
 References: headers.


I see.



 But the biggest problem with your new version is that you obviously
 ignore some (large) parts of my previous review comments. This is not
 the way it is supposed to work.

 I don't waste my time on reviewing your code if you don't bother to
 fix it.

 If you want to get your code into mainline, than please clean it up
 as requested. If you don't understand what changes are required, then
 please ask. If you think a change request is unreasonable, the ask.
 But silently ignoring review comments is not helpful.



hm.. did I?
sorry, I just missing..
I'll check all of your comments again..
I'm sorry to your time


 +unsigned long get_pll_clk(int pllreg)
 +{
 +     struct s5pc100_clock *clk_c100 =
 +             (struct s5pc100_clock *)S5PC1XX_CLOCK_BASE;
 +     struct s5pc110_clock *clk_c110 =
 +             (struct s5pc110_clock *)S5PC1XX_CLOCK_BASE;
 +     unsigned long r, m, p, s, mask, fout;
 +     unsigned int freq;
 +
 +     switch (pllreg) {
 +     case APLL:
 +             if (cpu_is_s5pc110())
 +                     r = readl(clk_c110-APLL_CON);
 +             else
 +                     r = readl(clk_c100-APLL_CON);
 +             break;
 +     case MPLL:
 +             if (cpu_is_s5pc110())
 +                     r = readl(clk_c110-MPLL_CON);
 +             else
 +                     r = readl(clk_c100-MPLL_CON);
 +             break;
 +     case EPLL:
 +             if (cpu_is_s5pc110())
 +                     r = readl(clk_c110-EPLL_CON);
 +             else
 +                     r = readl(clk_c100-EPLL_CON);
 +             break;
 +     case HPLL:
 +             if (cpu_is_s5pc110()) {
 +                     puts(s5pc110 don't use HPLL\n);
 +                     return 0;
 +             }
 +             r = readl(clk_c100-HPLL_CON);
 +             break;
 +     case VPLL:
 +             if (cpu_is_s5pc100()) {
 +                     puts(s5pc100 don't use VPLL\n);
 +                     return 0;
 +             }
 +             r = readl(clk_c110-VPLL_CON);
 +             break;

 I think this code is inefficient, and it does not scale at all if you
 ever have to add additional processors. I recomment we don't try to
 mix this code all in a single function that covers all processors.

 Instead, provide two separate functions, one for each of the CPU
 types, and then set a fuction pointer to the right function. This way
 we have only a single test for the CPU type (when stting the function
 pointer). And this allows easily to add support for other CPU types,
 and even then the code will remain readable.


I'll split the function.
and I  think we don't need the function pointer fully.
get_pclkd0, get_pclkd1, get_hclk_sys and get_pclk_sys are not generic functions.
but, get_pll_clk, get_arm_clk and get_pclk can be make function pointer.


 +     if (cpu_is_s5pc110()) {
 +             freq = CONFIG_SYS_CLK_FREQ_C110;
 +             if (pllreg == APLL) {
 +                     if (s  1)
 +                             s = 1;
 +                     /* FOUT = MDIV * FIN / (PDIV * 2^(SDIV - 1)) */
 +                     fout = m * (freq / (p * (1  (s - 1;
 +             } else
 +                     /* FOUT = MDIV * FIN / (PDIV * 2^SDIV) */
 +                     fout = m * (freq / (p * (1  s)));
 +     } else {
 +             /* FOUT = MDIV * FIN / (PDIV * 2^SDIV) */
 +             freq = CONFIG_SYS_CLK_FREQ_C100;
 +             fout = m * (freq / (p * (1  s)));
 +     }

 Similar here. I suggest you move this CPU dependent code into separate
 functions. There will be more such places below. In the end, you can
 probably even split the CPU specific code off into separate files, and
 set up a table with method pointers.  At a central place a single test
 for the CPU type will be done, and the right method table be selected.

 The code here will then be lean and completely independent of CPU
 types.  Thsi will be much easier to read, and easier to maintain.

 +unsigned long 

Re: [U-Boot] [PATCH 4/4 v2] s5pc1xx: add support SMDKC100 board

2009-09-11 Thread Minkyu Kang
Dear Wolfgang

2009/9/10 Wolfgang Denk w...@denx.de:
 Dear Minkyu Kang,

 In message 4aa8ac52.4010...@samsung.com you wrote:
 Add new board SMDKC100 that uses s5pc100 SoC

 Signed-off-by: Minkyu Kang mk7.k...@samsung.com
 Signed-off-by: HeungJun, Kim riverful@samsung.com
 ...
 +#ifndef __CONFIG_H
 +#define __CONFIG_H
 +#include asm/sizes.h

 Please don't use this header; it will probably be removed soon.


ok, I'll also remove SZ_XX defines

 ...
 +/*
 + * Architecture magic and machine type
 + */
 +#define MACH_TYPE_SMDKC100   1826

 Please don't. Only use the constants defined in mach-types.h


it will be deleted

 ...
 +/*---
 + * Boot configuration (define only one of next 3)
 + */
 +#define CONFIG_ENV_IS_IN_ONENAND     1
 +#define CONFIG_ENV_SIZE                      SZ_128K         /* 128KB, 
 0x2 */
 +#define CONFIG_ENV_ADDR                      SZ_256K         /* 256KB, 
 0x4 */
 +#define CONFIG_ENV_OFFSET            SZ_256K         /* 256KB, 0x4 */

 What does the define only one of next 3 part mean?


ah.. SMDKC100 can boot by onenand, nand and flash.
that means.. must define one of three..
anyway it will be deleted.


 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
 Though a program be but three lines long,
 someday it will have to be maintained.
 - The Tao of Programming
 ___
 U-Boot mailing list
 U-Boot@lists.denx.de
 http://lists.denx.de/mailman/listinfo/u-boot


thanks

-- 
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 v2] Support for the OpenRD base board

2009-09-11 Thread Prafulla Wadaskar


 -Original Message-
 From: Simon Kagstrom [mailto:simon.kagst...@netinsight.net]
 Sent: Friday, September 11, 2009 1:45 PM
 To: U-Boot ML
 Cc: Prafulla Wadaskar; Dhaval Vasa; Prabhanjan Sarnaik; Ashish Karkare
 Subject: [PATCH v2] Support for the OpenRD base board

 Support for the OpenRD base board

 The implementation is borrowed from the sheevaplug board and
 the Marvell
 1.1.4 code and likely to be a bit incomplete.

 Signed-off-by: Simon Kagstrom simon.kagst...@netinsight.net
 ---
 The configuration does not include UBIFS support, which still needs
 he remaining patches for the bitops cleanup and fixes:
Pls correct typo here


   http://lists.denx.de/pipermail/u-boot/2009-August/059285.html

 to build. Until those are applied, it's turned off here.


 I get run-time problems when building for armv5te for OpenRD base
 (apparently the same problem occurs for other Kirkwood boards). This
 patch fixes that:

   http://lists.denx.de/pipermail/u-boot/2009-September/059896.html


 The second version contains the kwbimage.cfg needed to
 produce an image
 to install on the NAND flash.

  MAINTAINERS |4 +
  MAKEALL |1 +
  Makefile|3 +
  board/Marvell/openrd_base/Makefile  |   51 +++
  board/Marvell/openrd_base/config.mk |   28 
  board/Marvell/openrd_base/kwbimage.cfg  |  168
 
  board/Marvell/openrd_base/openrd_base.c |  158 ++
  board/Marvell/openrd_base/openrd_base.h |   46 +++
  include/configs/openrd_base.h   |  218
 +++
  9 files changed, 677 insertions(+), 0 deletions(-)
  create mode 100644 board/Marvell/openrd_base/Makefile
  create mode 100644 board/Marvell/openrd_base/config.mk
  create mode 100644 board/Marvell/openrd_base/kwbimage.cfg
  create mode 100644 board/Marvell/openrd_base/openrd_base.c
  create mode 100644 board/Marvell/openrd_base/openrd_base.h
  create mode 100644 include/configs/openrd_base.h

 diff --git a/MAINTAINERS b/MAINTAINERS
 index e9db278..99cdc12 100644
 --- a/MAINTAINERS
 +++ b/MAINTAINERS
 @@ -588,6 +588,10 @@ Gary Jennejohn ga...@denx.de
  Konstantin Kletschke kletsc...@synertronixx.de
   scb9328 ARM920T

 +Simon Kagstrom simon.kagst...@netinsight.net
 +
 +   openrd_base ARM926EJS (Kirkwood SoC)
 +
  Nishant Kamat nska...@ti.com

   omap1610h2  ARM926EJS
 diff --git a/MAKEALL b/MAKEALL
 index f0ed8ea..9e6eee2 100755
 --- a/MAKEALL
 +++ b/MAKEALL
 @@ -533,6 +533,7 @@ LIST_ARM9=   \
   omap1610inn \
   omap5912osk \
   omap730p2   \
 + openrd_base \
   rd6281a \
   sbc2410x\
   scb9328 \
 diff --git a/Makefile b/Makefile
 index 9764cea..6cef82a 100644
 --- a/Makefile
 +++ b/Makefile
 @@ -3022,6 +3022,9 @@ omap1610h2_cs_autoboot_config:  unconfig
  omap5912osk_config : unconfig
   @$(MKCONFIG) $(@:_config=) arm arm926ejs omap5912osk ti omap

 +openrd_base_config: unconfig
 + @$(MKCONFIG) $(@:_config=) arm arm926ejs $(@:_config=)
 Marvell kirkwood
 +
  xtract_omap730p2 = $(subst _cs0boot,,$(subst _cs3boot,,
 $(subst _config,,$1)))

  omap730p2_config \
 diff --git a/board/Marvell/openrd_base/Makefile
 b/board/Marvell/openrd_base/Makefile
 new file mode 100644
 index 000..defbb08
 --- /dev/null
 +++ b/board/Marvell/openrd_base/Makefile
 @@ -0,0 +1,51 @@
 +#
 +# (C) Copyright 2009
 +# Marvell Semiconductor www.marvell.com
 +# Written-by: Prafulla Wadaskar prafu...@marvell.com
I think you must add your reference here..


+#
 +# 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
 +#
 +
 +include $(TOPDIR)/config.mk
 +
 +LIB  = $(obj)lib$(BOARD).a
 +
 +COBJS:= openrd_base.o
 +
 +SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 +OBJS := $(addprefix $(obj),$(COBJS))
 +SOBJS:= $(addprefix $(obj),$(SOBJS))
 +
 +$(LIB):  $(obj).depend $(OBJS) $(SOBJS)
 + $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
 +
 +clean:
 + rm -f $(SOBJS) $(OBJS)
 +
 +distclean:   clean
 + rm -f $(LIB) core *.bak .depend
 +
 

Re: [U-Boot] [PATCH 3/4 v2] s5pc1xx: support serial driver

2009-09-11 Thread Minkyu Kang
Dear Wolfgang,

2009/9/10 Wolfgang Denk w...@denx.de:
 Dear Minkyu Kang,

 In message 4aa8ac42.50...@samsung.com you wrote:
 This patch includes the serial driver for s5pc1xx

 Signed-off-by: Minkyu Kang mk7.k...@samsung.com
 ...
 +static inline struct s5pc1xx_uart *s5pc1xx_get_base_uart(int dev_index)
 +{
 +     u32 offset = dev_index * 0x400;
 +
 +     if (cpu_is_s5pc100())
 +             return (struct s5pc1xx_uart *)(S5PC100_PA_UART + offset);
 +     else
 +             return (struct s5pc1xx_uart *)(S5PC110_PA_UART + offset);

 Please do not hard-wire the size of the struct s5pc1xx_uart here; use
 sizeof() instead of the magic constant 0x400.

agreed.


 +#if defined(CONFIG_SERIAL_MULTI)
 +static inline void
 +serial_setbrg_dev(unsigned int dev_index)
 +{
 +     _serial_setbrg(dev_index);
 +}
 +#else
 +void serial_setbrg(void)
 +{
 +     _serial_setbrg(UART_NR);
 +}
 +#endif

 Why do we need these basicly empty wrapper functions?

 +#if !defined(CONFIG_SERIAL_MULTI)
 +int serial_init(void)
 +{
 +     return serial_init_dev(UART_NR);
 +}
 +#endif
 ...
 +#if defined(CONFIG_SERIAL_MULTI)
 +static inline int serial_getc_dev(unsigned int dev_index)
 +{
 +     return _serial_getc(dev_index);
 +}
 +#else
 +int serial_getc(void)
 +{
 +     return _serial_getc(UART_NR);
 +}
 +#endif
 ...
 +#if defined(CONFIG_SERIAL_MULTI)
 +static inline void serial_putc_dev(unsigned int dev_index, const char c)
 +{
 +     _serial_putc(c, dev_index);
 +}
 +#else
 +void serial_putc(const char c)
 +{
 +     _serial_putc(c, UART_NR);
 +}
 +#endif
 ...
 +#if defined(CONFIG_SERIAL_MULTI)
 +static inline int serial_tstc_dev(unsigned int dev_index)
 +{
 +     return _serial_tstc(dev_index);
 +}
 +#else
 +int serial_tstc(void)
 +{
 +     return _serial_tstc(UART_NR);
 +}
 +#endif
 ...
 +#if defined(CONFIG_SERIAL_MULTI)
 +static inline void serial_puts_dev(int dev_index, const char *s)
 +{
 +     _serial_puts(s, dev_index);
 +}
 +#else
 +void serial_puts(const char *s)
 +{
 +     _serial_puts(s, UART_NR);
 +}
 +#endif

 Do we really need all this?


I referenced the serial_s3c24x0.c and serial.c for multi serial api.
so,..
please let me know the correct way-


 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
 Don't tell me how hard you work.  Tell me how much you get done.
 - James J. Ling
 ___
 U-Boot mailing list
 U-Boot@lists.denx.de
 http://lists.denx.de/mailman/listinfo/u-boot




-- 
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] board/linkstation/ide.c: Fix compile warning

2009-09-11 Thread Guennadi Liakhovetski
Hi Wolfgang

On Fri, 11 Sep 2009, Wolfgang Denk wrote:

 Fix warning: ide.c:60: warning: dereferencing type-punned pointer will
 break strict-aliasing rules
 
 Signed-off-by: Wolfgang Denk w...@denx.de
 Cc: Guennadi Liakhovetski l...@denx.de
 ---
  board/linkstation/ide.c |4 +++-
  1 files changed, 3 insertions(+), 1 deletions(-)
 
 diff --git a/board/linkstation/ide.c b/board/linkstation/ide.c
 index 2c89d62..5dd1d0e 100644
 --- a/board/linkstation/ide.c
 +++ b/board/linkstation/ide.c
 @@ -54,10 +54,12 @@ int ide_preinit (void)
   if (devbusfn == -1)
   devbusfn = 
 pci_find_device(PCI_VENDOR_ID_ITE,PCI_DEVICE_ID_ITE_8212,0);
   if (devbusfn != -1) {
 + ulong *ide_bus_offset_ptr = ide_bus_offset[0];
 +
   status = 0;
  
   pci_read_config_dword (devbusfn, PCI_BASE_ADDRESS_0,
 -(u32 *) 
 ide_bus_offset[0]);
 +(u32 
 *)ide_bus_offset_ptr);

Can we also use this occasion to get rid of this typecast?

   ide_bus_offset[0] = 0xfffe;
   ide_bus_offset[0] = pci_hose_bus_to_phys(hose,
ide_bus_offset[0]  
 0xfffe,
 -- 
 1.6.0.6

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


Re: [U-Boot] [PATCH][v2] FDT: remove obsolete OF_CPU and OF_SOC macros.

2009-09-11 Thread Guennadi Liakhovetski
On Wed, 9 Sep 2009, Marcel Ziswiler wrote:

 Signed-off-by: Marcel Ziswiler marcel.ziswi...@noser.com

Acked-by: Guennadi Liakhovetski g.liakhovet...@gmx.de

 ---
 Changes since v1:
 - CC all respective board maintainers
 
  README|6 --
  include/configs/IDS8247.h |2 --
  include/configs/MPC8260ADS.h  |1 -
  include/configs/linkstation.h |2 --
  include/configs/mgcoge.h  |2 --
  include/configs/mpc7448hpc2.h |1 -
  include/configs/muas3001.h|2 --
  include/configs/stxxtc.h  |1 -
  8 files changed, 4 insertions(+), 13 deletions(-)
 
 diff --git a/README b/README
 index ff4ed8b..3cb7786 100644
 --- a/README
 +++ b/README
 @@ -368,8 +368,10 @@ The following options need to be configured:
* Adds the fdt command
* The bootm command automatically updates the fdt
  
 - OF_CPU - The proper name of the cpus node.
 - OF_SOC - The proper name of the soc node.
 + OF_CPU - The proper name of the cpus node (only required for
 + MPC512X and MPC5xxx based boards).
 + OF_SOC - The proper name of the soc node (only required for
 + MPC512X and MPC5xxx based boards).
   OF_TBCLK - The timebase frequency.
   OF_STDOUT_PATH - The path to the console device
  
 diff --git a/include/configs/IDS8247.h b/include/configs/IDS8247.h
 index 4c4af05..147a8b2 100644
 --- a/include/configs/IDS8247.h
 +++ b/include/configs/IDS8247.h
 @@ -125,8 +125,6 @@
  #define CONFIG_OF_LIBFDT 1
  #define CONFIG_OF_BOARD_SETUP1
  
 -#define OF_CPU   PowerPC,8...@0
 -#define OF_SOC   s...@f000
  #define OF_TBCLK (bd-bi_busfreq / 4)
  #define OF_STDOUT_PATH   /s...@f000/serial8...@e0008000
  
 diff --git a/include/configs/MPC8260ADS.h b/include/configs/MPC8260ADS.h
 index 942a4cc..677a143 100644
 --- a/include/configs/MPC8260ADS.h
 +++ b/include/configs/MPC8260ADS.h
 @@ -209,7 +209,6 @@
  #define CONFIG_OF_LIBFDT 1
  #define CONFIG_OF_BOARD_SETUP1
  #if defined(CONFIG_OF_LIBFDT)
 -#define OF_CPU   c...@0
  #define OF_TBCLK (bd-bi_busfreq / 4)
  #endif
  
 diff --git a/include/configs/linkstation.h b/include/configs/linkstation.h
 index 2feb3ae..16b464c 100644
 --- a/include/configs/linkstation.h
 +++ b/include/configs/linkstation.h
 @@ -96,8 +96,6 @@
  
  #define CONFIG_OF_LIBFDT 1
  
 -#define OF_CPU   PowerPC,603e
 -#define OF_SOC   soc...@8000
  #define OF_STDOUT_PATH   /soc10x/ser...@80004600
  
  /* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
 diff --git a/include/configs/mgcoge.h b/include/configs/mgcoge.h
 index b955749..55d1fc9 100644
 --- a/include/configs/mgcoge.h
 +++ b/include/configs/mgcoge.h
 @@ -347,8 +347,6 @@
  #define CONFIG_OF_LIBFDT 1
  #define CONFIG_OF_BOARD_SETUP1
  
 -#define OF_CPU   PowerPC,8...@0
 -#define OF_SOC   s...@f000
  #define OF_TBCLK (bd-bi_busfreq / 4)
  #define OF_STDOUT_PATH   /soc/cpm/ser...@11a90
  
 diff --git a/include/configs/mpc7448hpc2.h b/include/configs/mpc7448hpc2.h
 index 4f98ba4..be12186 100644
 --- a/include/configs/mpc7448hpc2.h
 +++ b/include/configs/mpc7448hpc2.h
 @@ -79,7 +79,6 @@
  #define CONFIG_OF_LIBFDT 1
  #define CONFIG_OF_BOARD_SETUP1
  
 -#define OF_CPU   PowerPC,7...@0
  #define OF_TSI   tsi...@c000
  #define OF_TBCLK (bd-bi_busfreq / 8)
  #define OF_STDOUT_PATH   /tsi...@c000/ser...@7808
 diff --git a/include/configs/muas3001.h b/include/configs/muas3001.h
 index ae033b2..c94daa3 100644
 --- a/include/configs/muas3001.h
 +++ b/include/configs/muas3001.h
 @@ -405,8 +405,6 @@
  #define CONFIG_OF_LIBFDT 1
  #define CONFIG_OF_BOARD_SETUP1
  
 -#define OF_CPU   PowerPC,8...@0
 -#define OF_SOC   s...@f000
  #define OF_TBCLK (bd-bi_busfreq / 4)
  #if defined(CONFIG_MUAS_DEV_BOARD)
  #define OF_STDOUT_PATH   /soc/cpm/ser...@11a90
 diff --git a/include/configs/stxxtc.h b/include/configs/stxxtc.h
 index d16262b..5854366 100644
 --- a/include/configs/stxxtc.h
 +++ b/include/configs/stxxtc.h
 @@ -509,7 +509,6 @@ typedef unsigned int led_id_t;
  /* pass open firmware flattened device tree */
  #define CONFIG_OF_LIBFDT 1
  
 -#define OF_CPU   PowerPC,mpc...@0
  #define OF_TBCLK (MPC8XX_HZ / 16)
  
  #endif   /* __CONFIG_H */
 -- 
 1.6.4.2
 
 
 

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


[U-Boot] [PATCH] Support for Calao USB A9263 board based on AT91SAM9263 CPU

2009-09-11 Thread Thomas Petazzoni
The Calao USB A9263 board is a board manufactured and sold by Calao
Systems http://www.calao-systems.com. Its components are very
similar to the AT91SAM9263EK board, so its configuration is based
on the configuration of this board. There are however some
differences: different clocks, no LCD, etc.

Signed-off-by: Thomas Petazzoni thomas.petazz...@free-electrons.com
Signed-off-by: Albin Tonnerre albin.tonne...@free-electrons.com
---
 MAINTAINERS   |4 +
 MAKEALL   |1 +
 Makefile  |3 +
 board/calao/usb-a9263/Makefile|   58 +++
 board/calao/usb-a9263/config.mk   |   24 +
 board/calao/usb-a9263/partition.c |   38 +++
 board/calao/usb-a9263/usb-a9263.c |  198 +
 include/configs/usb-a9263.h   |  184 ++
 8 files changed, 510 insertions(+), 0 deletions(-)
 create mode 100644 board/calao/usb-a9263/Makefile
 create mode 100644 board/calao/usb-a9263/config.mk
 create mode 100644 board/calao/usb-a9263/partition.c
 create mode 100644 board/calao/usb-a9263/usb-a9263.c
 create mode 100644 include/configs/usb-a9263.h

diff --git a/MAINTAINERS b/MAINTAINERS
index e9db278..28fe0ae 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -643,6 +643,10 @@ Peter Pearse peter.pea...@arm.com
versatile   ARM926EJ-S
versatile   ARM926EJ-S
 
+Thomas Petazzoni thomas.petazz...@free-electrons.com
+
+   usb-a9263   ARM926EJS (AT91SAM9263 SoC)
+
 Dave Peverley dpever...@mpc-data.co.uk
 
omap730p2   ARM926EJS
diff --git a/MAKEALL b/MAKEALL
index f0ed8ea..c0200a9 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -617,6 +617,7 @@ LIST_at91= \
SBC35_A9G20 \
TNY_A9260   \
TNY_A9G20   \
+   usb9263 \
 
 
 #
diff --git a/Makefile b/Makefile
index 0449a5b..087c592 100644
--- a/Makefile
+++ b/Makefile
@@ -2914,6 +2914,9 @@ TNY_A9260_config  :   unconfig
@echo #define CONFIG_$(@:_config=) 1 $(obj)include/config.h
@$(MKCONFIG) -a tny_a9260 arm arm926ejs tny_a9260 calao at91
 
+usb_a9263_config   :   unconfig
+   @$(MKCONFIG) -a usb-a9263 arm arm926ejs usb-a9263 calao at91
+
 
 ## ARM Integrator boards - see doc/README-integrator for more info.
 integratorap_config\
diff --git a/board/calao/usb-a9263/Makefile b/board/calao/usb-a9263/Makefile
new file mode 100644
index 000..ec79872
--- /dev/null
+++ b/board/calao/usb-a9263/Makefile
@@ -0,0 +1,58 @@
+#
+# (C) Copyright 2003-2008
+# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+#
+# (C) Copyright 2008
+# Stelian Pop stelian@leadtechdesign.com
+# Lead Tech Design www.leadtechdesign.com
+#
+# (C) Copyright 2009
+# Thomas Petazzoni, Free Electrons, thomas.petazz...@free-electrons.com
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).a
+
+COBJS-y += usb-a9263.o
+COBJS-$(CONFIG_HAS_DATAFLASH) += partition.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS-y))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(obj).depend $(OBJS) $(SOBJS)
+   $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
+
+clean:
+   rm -f $(SOBJS) $(OBJS)
+
+distclean: clean
+   rm -f $(LIB) core *.bak $(obj).depend
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/calao/usb-a9263/config.mk b/board/calao/usb-a9263/config.mk
new file mode 100644
index 000..2724a7d
--- /dev/null
+++ b/board/calao/usb-a9263/config.mk
@@ -0,0 +1,24 @@
+#
+# (C) Copyright 2009
+# Thomas Petazzoni, Free Electrons, thomas.petazz...@free-electrons.com
+#
+# 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 

Re: [U-Boot] [PATCH] board/esd/common/flash.c: Fix compile warning

2009-09-11 Thread Matthias Fuchs
Acked-by: Matthias Fuchs matthias.fu...@esd.eu

On Friday 11 September 2009 11:18, Wolfgang Denk wrote:
 Fix warning: ../common/flash.c:635: warning: dereferencing type-punned
 pointer will break strict-aliasing rules
 
 Signed-off-by: Wolfgang Denk w...@denx.de
 Cc: Matthias Fuchs matthias.fu...@esd-electronics.com
 Cc: Stefan Roese s...@denx.de
 ---
  board/esd/common/flash.c |3 ++-
  1 files changed, 2 insertions(+), 1 deletions(-)
 
 diff --git a/board/esd/common/flash.c b/board/esd/common/flash.c
 index 3ea053b..38a58fb 100644
 --- a/board/esd/common/flash.c
 +++ b/board/esd/common/flash.c
 @@ -630,9 +630,10 @@ int write_buff (flash_info_t *info, uchar *src, ulong 
 addr, ulong cnt)
   */
  static int write_word (flash_info_t *info, ulong dest, ulong data)
  {
 + ulong *data_ptr = data;
   volatile CONFIG_SYS_FLASH_WORD_SIZE *addr2 = 
 (CONFIG_SYS_FLASH_WORD_SIZE *)(info-start[0]);
   volatile CONFIG_SYS_FLASH_WORD_SIZE *dest2 = 
 (CONFIG_SYS_FLASH_WORD_SIZE *)dest;
 - volatile CONFIG_SYS_FLASH_WORD_SIZE *data2 = 
 (CONFIG_SYS_FLASH_WORD_SIZE *)data;
 + volatile CONFIG_SYS_FLASH_WORD_SIZE *data2 = 
 (CONFIG_SYS_FLASH_WORD_SIZE *)data_ptr;
   ulong start;
   int flag;
   int i;
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH][v3] mpc8260: remove Ethernet node fixup to use generic FDT code.

2009-09-11 Thread Marcel Ziswiler
Remove Ethernet node fixup from mgcoge and muas3001 boards and modify its
configs for the common mpc8260 code to use generic Ethernet fixup.

Signed-off-by: Marcel Ziswiler marcel.ziswi...@noser.com
Tested-by: Heiko Schocher h...@denx.de
---
Changes since v1:
- Added Heiko's tested-by
Changes since v2:
- Re-based to origin/master

 board/keymile/mgcoge/mgcoge.c |5 -
 board/muas3001/muas3001.c |   15 ---
 include/configs/mgcoge.h  |1 +
 include/configs/muas3001.h|1 +
 4 files changed, 2 insertions(+), 20 deletions(-)

diff --git a/board/keymile/mgcoge/mgcoge.c b/board/keymile/mgcoge/mgcoge.c
index d24a4b5..b16a01c 100644
--- a/board/keymile/mgcoge/mgcoge.c
+++ b/board/keymile/mgcoge/mgcoge.c
@@ -25,7 +25,6 @@
 #include mpc8260.h
 #include ioports.h
 #include malloc.h
-#include net.h
 #include asm/io.h
 
 #if defined(CONFIG_OF_BOARD_SETUP)  defined(CONFIG_OF_LIBFDT)
@@ -373,10 +372,6 @@ void ft_blob_update (void *blob, bd_t *bd)
flash_reg[5] = cpu_to_be32 (info-size);
fdt_set_node_and_value (blob, /localbus/fl...@5,0, reg, flash_reg,
sizeof (flash_reg));
-
-   /* MAC addr */
-   fdt_set_node_and_value (blob, /soc/cpm/ethernet, mac-address,
-   bd-bi_enetaddr, sizeof (u8) * 6);
 }
 
 void ft_board_setup (void *blob, bd_t *bd)
diff --git a/board/muas3001/muas3001.c b/board/muas3001/muas3001.c
index bf4ccb6..36caed8 100644
--- a/board/muas3001/muas3001.c
+++ b/board/muas3001/muas3001.c
@@ -342,21 +342,6 @@ void ft_blob_update (void *blob, bd_t *bd)
printf (ft_blob_update(): cannot find /localbus node 
err:%s\n, fdt_strerror (nodeoffset));
}
-   /* MAC Adresse */
-   nodeoffset = fdt_path_offset (blob, /soc/cpm/ethernet);
-   if (nodeoffset = 0) {
-   uchar ethaddr[6];
-   eth_getenv_enetaddr(ethaddr, ethaddr);
-   ret = fdt_setprop (blob, nodeoffset, mac-address, ethaddr,
-   sizeof (uchar) * 6);
-   if (ret  0)
-   printf (ft_blob_update): cannot set 
/soc/cpm/ethernet/mac-address 
-   property err:%s\n, fdt_strerror (ret));
-   } else {
-   /* memory node is required in dts */
-   printf (ft_blob_update(): cannot find /soc/cpm/ethernet node 
-   err:%s\n, fdt_strerror (nodeoffset));
-   }
 
/* baudrate */
nodeoffset = fdt_path_offset (blob, /soc/cpm/serial);
diff --git a/include/configs/mgcoge.h b/include/configs/mgcoge.h
index ea14948..b955749 100644
--- a/include/configs/mgcoge.h
+++ b/include/configs/mgcoge.h
@@ -70,6 +70,7 @@
 #define CONFIG_NET_MULTI   1
 
 #define CONFIG_ETHER_INDEX 4
+#define CONFIG_HAS_ETH0
 #define CONFIG_SYS_SCC_TOUT_LOOP   1000
 
 # define CONFIG_SYS_CMXSCR_VALUE   (CMXSCR_RS4CS_CLK7 | CMXSCR_TS4CS_CLK8)
diff --git a/include/configs/muas3001.h b/include/configs/muas3001.h
index f031a17..ae033b2 100644
--- a/include/configs/muas3001.h
+++ b/include/configs/muas3001.h
@@ -74,6 +74,7 @@
 
 #define CONFIG_ETHER_INDEX 1
 #define CONFIG_ETHER_ON_FCC1
+#define CONFIG_HAS_ETH0
 #define FCC_ENET
 
 /*
-- 
1.6.4.2
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] board/linkstation/ide.c: Fix compile warning

2009-09-11 Thread Wolfgang Denk
Dear Guennadi Liakhovetski,

In message pine.lnx.4.64.0909111259280.6...@axis700.grange you wrote:
 Hi Wolfgang
 
 On Fri, 11 Sep 2009, Wolfgang Denk wrote:
 
  Fix warning: ide.c:60: warning: dereferencing type-punned pointer will
  break strict-aliasing rules
  
  Signed-off-by: Wolfgang Denk w...@denx.de
  Cc: Guennadi Liakhovetski l...@denx.de
  ---
   board/linkstation/ide.c |4 +++-
   1 files changed, 3 insertions(+), 1 deletions(-)
  
  diff --git a/board/linkstation/ide.c b/board/linkstation/ide.c
  index 2c89d62..5dd1d0e 100644
  --- a/board/linkstation/ide.c
  +++ b/board/linkstation/ide.c
  @@ -54,10 +54,12 @@ int ide_preinit (void)
  if (devbusfn == -1)
  devbusfn = 
  pci_find_device(PCI_VENDOR_ID_ITE,PCI_DEVICE_ID_ITE_8212,0);
  if (devbusfn != -1) {
  +   ulong *ide_bus_offset_ptr = ide_bus_offset[0];
  +
  status = 0;
   
  pci_read_config_dword (devbusfn, PCI_BASE_ADDRESS_0,
  -  (u32 *) 
  ide_bus_offset[0]);
  +  (u32 
  *)ide_bus_offset_ptr);
 
 Can we also use this occasion to get rid of this typecast?

No, as this would result in

ide.c:62: warning: passing argument 3 of 'pci_read_config_dword' from
incompatible pointer type

OK, we can declare ide_bus_offset_ptr as u32 8, but then we need the
cast there to avoid a initialization from incompatible pointer type
warning - so this isn't exactly an improvement.

I suggest we leave it as is, as this is the minimal-invasive change.

If you want to submit a more general cleanup patch (unifying data
types) you are welcome (but that would be a separate action in any
case).

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
If I had to live my life again,  I'd  make  the  same  mistakes, only
sooner.  -- Tallulah Bankhead
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] board/linkstation/ide.c: Fix compile warning

2009-09-11 Thread Guennadi Liakhovetski
On Fri, 11 Sep 2009, Wolfgang Denk wrote:

 Dear Guennadi Liakhovetski,
 
 In message pine.lnx.4.64.0909111259280.6...@axis700.grange you wrote:
  Hi Wolfgang
  
  On Fri, 11 Sep 2009, Wolfgang Denk wrote:
  
   Fix warning: ide.c:60: warning: dereferencing type-punned pointer will
   break strict-aliasing rules
   
   Signed-off-by: Wolfgang Denk w...@denx.de
   Cc: Guennadi Liakhovetski l...@denx.de
   ---
board/linkstation/ide.c |4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
   
   diff --git a/board/linkstation/ide.c b/board/linkstation/ide.c
   index 2c89d62..5dd1d0e 100644
   --- a/board/linkstation/ide.c
   +++ b/board/linkstation/ide.c
   @@ -54,10 +54,12 @@ int ide_preinit (void)
 if (devbusfn == -1)
 devbusfn = 
   pci_find_device(PCI_VENDOR_ID_ITE,PCI_DEVICE_ID_ITE_8212,0);
 if (devbusfn != -1) {
   + ulong *ide_bus_offset_ptr = ide_bus_offset[0];
   +
 status = 0;

 pci_read_config_dword (devbusfn, PCI_BASE_ADDRESS_0,
   -(u32 *) 
   ide_bus_offset[0]);
   +(u32 
   *)ide_bus_offset_ptr);
  
  Can we also use this occasion to get rid of this typecast?
 
 No, as this would result in
 
 ide.c:62: warning: passing argument 3 of 'pci_read_config_dword' from
 incompatible pointer type
 
 OK, we can declare ide_bus_offset_ptr as u32 8, but then we need the
 cast there to avoid a initialization from incompatible pointer type
 warning - so this isn't exactly an improvement.

Ok, understand.

Acked-by: Guennadi Liakhovetski g.liakhovet...@gmx.de

 
 I suggest we leave it as is, as this is the minimal-invasive change.
 
 If you want to submit a more general cleanup patch (unifying data
 types) you are welcome (but that would be a separate action in any
 case).
 
 Best regards,
 
 Wolfgang Denk

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


[U-Boot] Maintainer Yuli Barcohen

2009-09-11 Thread Marcel Ziswiler
Hi there

Anybody knows the whereabouts of Yuli Barcohen, maintainer amongst others of 
the ep8248 and MPC8260ADS boards? It looks like his last known email address as 
noted in MAINTAINERS bounces (see transcript below).

Cheers

Marcel


---
This message was created automatically by mail delivery software.

A message that you sent has not yet been delivered to one or more of
its recipients after 26 hours.

The message has not yet been delivered to the following addresses:

y...@arabellasw.com

host arabellasw.com[212.227.34.3]:
connection to mail exchanger failed with timeout

No action is required on your part. Delivery attempts will continue for
some time, and this warning may be repeated at intervals if the message
remains undelivered. Eventually the mail delivery software will give up,
and when that happens, the message will be returned to you.

--- The header of the original message is following. ---

Received: from [10.10.1.46] (69-167.2-85.cust.bluewin.ch [85.2.167.69])
by mrelay.perfora.net (node=mrus1) with ESMTP (Nemesis)
id 0MKpCa-1MlSia2hYk-000Can; Wed, 09 Sep 2009 15:20:43 -0400
Subject: [PATCH][v3] mpc8260: move FDT memory node fixup into common CPU
code.
From: Marcel Ziswiler mar...@ziswiler.com
Reply-To: 1252423922.5386.17.ca...@com-21
To: u-boot@lists.denx.de
Cc: pty...@xes-inc.com, h...@denx.de, y...@arabellasw.com, w...@denx.de
In-Reply-To: 1252423922.5386.17.ca...@com-21
References: 1252423922.5386.17.ca...@com-21
Content-Type: text/plain
Date: Wed, 09 Sep 2009 21:20:34 +0200
Message-Id: 1252524034.3643.10.ca...@com-21
Mime-Version: 1.0
X-Mailer: Evolution 2.26.1
Content-Transfer-Encoding: 7bit
X-Provags-ID: V01U2FsdGVkX18q/47KahaahtxmPn/kHC3ABN14jxJlK0gRMMC
jP8DJba0m2nsYVMlFijeWu80NwsCiou0aJy+P3tfTx+dHkDeD4
Mj0fiAcNOrr6y8/PmSWrEdfcxf4fcKo
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] Support for the OpenRD base board

2009-09-11 Thread Simon Kagstrom
Thanks for the comments Prafulla!

I'll update the patch according to them, but have some questions:

On Fri, 11 Sep 2009 03:43:04 -0700
Prafulla Wadaskar prafu...@marvell.com wrote:

  +#define CONFIG_ENV_SIZE  0x2 /* 128k */
  +#define CONFIG_ENV_ADDR  0xa
  +#define CONFIG_ENV_OFFSET0xa /* env starts here */
 Do you really need this address? the u-boot binary is within 256kb, at the 
 most it can go till 512kb

This is where the default environment (for the U-boot shipped by
Marvell) resides. Like on Sheevaplug, it uses 4-bit ECC, so current
U-boot won't be able to read it, but I know you're working on it.

  +#define MTDIDS_DEFAULT   nand0=nand_mtd
  +#define MTDPARTS_DEFAULT
  mtdparts=nand_mtd:0x100...@0x00(uboot),0x400...@0x10(
  uImage),\
  + 0x1fb00...@0x50(rootfs)
 This is must be the default setup in board setup file for openrd_base (if it 
 is again derived from sheevaplug)
 In that case this settings not required

I don't quite understand this. This is also the default addresses
shipped with the board.

  +#define CONFIG_EXTRA_ENV_SETTINGSx_bootargs=console\
  + =ttyS0,115200 MTDPARTS_DEFAULT  rw ubi.mtd=2,2048\0 \
  + x_bootcmd_kernel=nand read 0x640 0x10 0x30\0 \
  + x_bootcmd_usb=usb start\0 \
 You must add x_bootcmd_eth for program MAC addrss in hardware before kernel 
 boot.

Well, we need to figure out some generic way of giving Linux the MAC
address on these boards, but I've understood that initializing the
interface without using it is not popular, so in this case I'd just let
the problem remain (no x_bootcmd_eth).

Or did I misunderstand your comment?

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


[U-Boot] [PATCH] Streamlined mpc512x fixed_sdram init sequence allowing for

2009-09-11 Thread Martha M Stan
Signed-off-by: Martha M Stan mm...@silicontkx.com
---
 board/davedenx/aria/aria.c  |2 +-
 board/esd/mecp5123/mecp5123.c   |2 +-
 board/freescale/mpc5121ads/mpc5121ads.c |2 +-
 cpu/mpc512x/fixed_sdram.c   |   94 ---
 include/asm-ppc/immap_512x.h|5 +-
 include/asm-ppc/mpc512x.h   |2 +-
 include/configs/aria.h  |6 +--
 include/configs/mecp5123.h  |5 +-
 include/configs/mpc5121ads.h|6 +--
 9 files changed, 72 insertions(+), 52 deletions(-)

diff --git a/board/davedenx/aria/aria.c b/board/davedenx/aria/aria.c
index 2064aa2..cc69c9d 100644
--- a/board/davedenx/aria/aria.c
+++ b/board/davedenx/aria/aria.c
@@ -101,7 +101,7 @@ int board_early_init_f(void)
 
 phys_size_t initdram (int board_type)
 {
-   return fixed_sdram();
+   return fixed_sdram(NULL, NULL, 0);
 }
 
 int misc_init_r(void)
diff --git a/board/esd/mecp5123/mecp5123.c b/board/esd/mecp5123/mecp5123.c
index f591e32..5139358 100644
--- a/board/esd/mecp5123/mecp5123.c
+++ b/board/esd/mecp5123/mecp5123.c
@@ -135,7 +135,7 @@ int board_early_init_f(void)
 
 phys_size_t initdram(int board_type)
 {
-   return get_ram_size(0, fixed_sdram());
+   return get_ram_size(0, fixed_sdram(NULL, NULL, 0));
 }
 
 int misc_init_r(void)
diff --git a/board/freescale/mpc5121ads/mpc5121ads.c 
b/board/freescale/mpc5121ads/mpc5121ads.c
index a0d7a82..8defb00 100644
--- a/board/freescale/mpc5121ads/mpc5121ads.c
+++ b/board/freescale/mpc5121ads/mpc5121ads.c
@@ -137,7 +137,7 @@ phys_size_t initdram(int board_type)
 {
u32 msize = 0;
 
-   msize = fixed_sdram();
+   msize = fixed_sdram(NULL, NULL, 0);
 
return msize;
 }
diff --git a/cpu/mpc512x/fixed_sdram.c b/cpu/mpc512x/fixed_sdram.c
index d906903..eb0811c 100644
--- a/cpu/mpc512x/fixed_sdram.c
+++ b/cpu/mpc512x/fixed_sdram.c
@@ -20,23 +20,73 @@
  * MA 02111-1307 USA
  *
  */
-
+#define DEBUG 0xff
 #include common.h
 #include asm/io.h
 #include asm/mpc512x.h
 
+/* config settings in order of the 4 mddrc cfg registers */
+u32 default_mddrc_config[4] = {
+   CONFIG_SYS_MDDRC_SYS_CFG,
+   CONFIG_SYS_MDDRC_TIME_CFG0,
+   CONFIG_SYS_MDDRC_TIME_CFG1,
+   CONFIG_SYS_MDDRC_TIME_CFG2
+};
+
+u32 default_init_sequence[] = {
+   CONFIG_SYS_MICRON_NOP,
+   CONFIG_SYS_MICRON_NOP,
+   CONFIG_SYS_MICRON_NOP,
+   CONFIG_SYS_MICRON_NOP,
+   CONFIG_SYS_MICRON_NOP,
+   CONFIG_SYS_MICRON_NOP,
+   CONFIG_SYS_MICRON_NOP,
+   CONFIG_SYS_MICRON_NOP,
+   CONFIG_SYS_MICRON_NOP,
+   CONFIG_SYS_MICRON_NOP,
+   CONFIG_SYS_MICRON_PCHG_ALL,
+   CONFIG_SYS_MICRON_NOP,
+   CONFIG_SYS_MICRON_RFSH,
+   CONFIG_SYS_MICRON_NOP,
+   CONFIG_SYS_MICRON_RFSH,
+   CONFIG_SYS_MICRON_NOP,
+   CONFIG_SYS_MICRON_INIT_DEV_OP,
+   CONFIG_SYS_MICRON_NOP,
+   CONFIG_SYS_MICRON_EM2,
+   CONFIG_SYS_MICRON_NOP,
+   CONFIG_SYS_MICRON_PCHG_ALL,
+   CONFIG_SYS_MICRON_EM2,
+   CONFIG_SYS_MICRON_EM3,
+   CONFIG_SYS_MICRON_EN_DLL,
+   CONFIG_SYS_MICRON_INIT_DEV_OP,
+   CONFIG_SYS_MICRON_PCHG_ALL,
+   CONFIG_SYS_MICRON_RFSH,
+   CONFIG_SYS_MICRON_INIT_DEV_OP,
+   CONFIG_SYS_MICRON_OCD_DEFAULT,
+   CONFIG_SYS_MICRON_PCHG_ALL,
+   CONFIG_SYS_MICRON_NOP
+};
+
 /*
  * fixed sdram init:
  * The board doesn't use memory modules that have serial presence
  * detect or similar mechanism for discovery of the DRAM settings
  */
-long int fixed_sdram(void)
+long int fixed_sdram(u32 *mddrc_config, u32 *dram_init_sequence, int 
seq_table_size)
 {
volatile immap_t *im = (immap_t *)CONFIG_SYS_IMMR;
u32 msize = CONFIG_SYS_DDR_SIZE * 1024 * 1024;
u32 msize_log2 = __ilog2(msize);
u32 i;
 
+   /* take default settings and init sequence if necessary */
+   if (mddrc_config == 0)
+   mddrc_config = default_mddrc_config;
+   if (dram_init_sequence == 0) {
+   dram_init_sequence = default_init_sequence;
+   seq_table_size = sizeof(default_init_sequence)/sizeof(u32);
+   }
+
/* Initialize IO Control */
out_be32(im-io_ctrl.io_control_mem, IOCTRL_MUX_DDR);
 
@@ -46,7 +96,7 @@ long int fixed_sdram(void)
sync_law(im-sysconf.ddrlaw.ar);
 
/* Enable DDR */
-   out_be32(im-mddrc.ddr_sys_config, CONFIG_SYS_MDDRC_SYS_CFG_EN);
+   out_be32(im-mddrc.ddr_sys_config, MDDRC_SYS_CFG_EN);
 
/* Initialize DDR Priority Manager */
out_be32(im-mddrc.prioman_config1, CONFIG_SYS_MDDRCGRP_PM_CFG1);
@@ -74,40 +124,18 @@ long int fixed_sdram(void)
out_be32(im-mddrc.lut_table4_alternate_lower, 
CONFIG_SYS_MDDRCGRP_LUT4_AL);
 
/* Initialize MDDRC */
-   out_be32(im-mddrc.ddr_sys_config, CONFIG_SYS_MDDRC_SYS_CFG);
-   out_be32(im-mddrc.ddr_time_config0, CONFIG_SYS_MDDRC_TIME_CFG0);
-   out_be32(im-mddrc.ddr_time_config1, 

Re: [U-Boot] [PATCH] board/esd/common/flash.c: Fix compile warning

2009-09-11 Thread Stefan Roese
On Friday 11 September 2009 11:18:22 Wolfgang Denk wrote:
 Fix warning: ../common/flash.c:635: warning: dereferencing type-punned
 pointer will break strict-aliasing rules
 
 Signed-off-by: Wolfgang Denk w...@denx.de
 Cc: Matthias Fuchs matthias.fu...@esd-electronics.com
 Cc: Stefan Roese s...@denx.de

Acked-by: Stefan Roese s...@denx.de

Thanks.

Cheers,
Stefan

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


Re: [U-Boot] [PATCH] board/amcc/common/flash.c: Fix compile warning

2009-09-11 Thread Stefan Roese
On Friday 11 September 2009 11:49:19 Wolfgang Denk wrote:
 Fix warning: ../common/flash.c:917: warning: dereferencing type-punned
 pointer will break strict-aliasing rules
 
 Signed-off-by: Wolfgang Denk w...@denx.de
 Cc: Stefan Roese s...@denx.de

Acked-by: Stefan Roese s...@denx.de

Thanks.

Cheers,
Stefan

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


Re: [U-Boot] [PATCH] board/amcc/taihu/flash.c: Fix compile warning

2009-09-11 Thread Stefan Roese
On Friday 11 September 2009 11:49:22 Wolfgang Denk wrote:
 Fix warnings:
 flash.c: In function 'write_word_1':
 flash.c:696: warning: dereferencing type-punned pointer will break
  strict-aliasing rules flash.c: In function 'write_word_2':
 flash.c:1044: warning: dereferencing type-punned pointer will break
  strict-aliasing rules
 
 Signed-off-by: Wolfgang Denk w...@denx.de
 Cc: Stefan Roese s...@denx.de

Acked-by: Stefan Roese s...@denx.de

Thanks.
Cheers,
Stefan

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


Re: [U-Boot] [PATCH] board/amcc/yucca/flash.c: Fix compile warning

2009-09-11 Thread Stefan Roese
On Friday 11 September 2009 11:49:23 Wolfgang Denk wrote:
 Fix warning: flash.c:919: warning: dereferencing type-punned pointer
 will break strict-aliasing rules
 
 Signed-off-by: Wolfgang Denk w...@denx.de
 Cc: Stefan Roese s...@denx.de

Acked-by: Stefan Roese s...@denx.de

Thanks.

Cheers,
Stefan

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


Re: [U-Boot] [PATCH] board/esd/cpci750/ide.c: fix compile warning

2009-09-11 Thread Stefan Roese
On Friday 11 September 2009 11:18:23 Wolfgang Denk wrote:
 Fix warning: ide.c:54: warning: dereferencing type-punned pointer will
 break strict-aliasing rules
 
 Signed-off-by: Wolfgang Denk w...@denx.de
 Cc: Matthias Fuchs matthias.fu...@esd-electronics.com
 Cc: Stefan Roese s...@denx.de

I added Reinhard Arlt to Cc, as he's the maintainer for this board.

But I can't spot any problems, so here my:

Acked-by: Stefan Roese s...@denx.de

Thanks.

Cheers,
Stefan

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


Re: [U-Boot] configure ppc440spe as pci adapter

2009-09-11 Thread Stefan Roese
On Thursday 10 September 2009 21:01:57 dbrazeau wrote:
 I'm trying to get my ppc440spe (Katmai) board to initialize in PCI adapter
 mode.  I was hoping that someone could give me some pointers on what
  changes I need in the katmai config file, i.e. do I need to define
 CONFIG_SYS_PCI_MASTER_INIT.  Also I noticed that some ppc4xx have
 PCI_HOST_ADAPTER defined, but this is not defined in the Katmai config
  file. Should I define it and define CONFIG_PCI_HOST to it?  Any comments
  are greatly appreciated.  Thanks.

I don't know of any 440SPe based board used in PCI adapter mode. But you could 
probably check the esd PMC440 board. This is a PPC440EPx based PMC module 
which can be configured/built either as PCI host or as PCI adapter.

Cheers,
Stefan

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


Re: [U-Boot] Maintainer Yuli Barcohen

2009-09-11 Thread Frank Svendsbøe
Hi Marcel,

I asked him a year ago about some details regarding the Adder port done by him:

Frank Hi Yuli!  I see you're the maintainer for the u-boot port for
 Frank this card.

  I was. Arabella was bought by Entropic Communications and I'm out of
  PowerPC world for more than a year.

 Frank First, is it ok to ask you questions directly using this
 Frank address?

  The address is going to disappear in near future.


So, we should either try to get his new address at Entropic Comm., or
remove him from
the maintainer list.

Regards,
Frank

On Fri, Sep 11, 2009 at 2:17 PM, Marcel Ziswiler mar...@ziswiler.com wrote:
 Hi there

 Anybody knows the whereabouts of Yuli Barcohen, maintainer amongst others of 
 the ep8248 and MPC8260ADS boards? It looks like his last known email address 
 as noted in MAINTAINERS bounces (see transcript below).

 Cheers

 Marcel


 ---
 This message was created automatically by mail delivery software.

 A message that you sent has not yet been delivered to one or more of
 its recipients after 26 hours.

 The message has not yet been delivered to the following addresses:

 y...@arabellasw.com

 host arabellasw.com[212.227.34.3]:
 connection to mail exchanger failed with timeout

 No action is required on your part. Delivery attempts will continue for
 some time, and this warning may be repeated at intervals if the message
 remains undelivered. Eventually the mail delivery software will give up,
 and when that happens, the message will be returned to you.

 --- The header of the original message is following. ---

 Received: from [10.10.1.46] (69-167.2-85.cust.bluewin.ch [85.2.167.69])
 by mrelay.perfora.net (node=mrus1) with ESMTP (Nemesis)
 id 0MKpCa-1MlSia2hYk-000Can; Wed, 09 Sep 2009 15:20:43 -0400
 Subject: [PATCH][v3] mpc8260: move FDT memory node fixup into common CPU
 code.
 From: Marcel Ziswiler mar...@ziswiler.com
 Reply-To: 1252423922.5386.17.ca...@com-21
 To: u-boot@lists.denx.de
 Cc: pty...@xes-inc.com, h...@denx.de, y...@arabellasw.com, w...@denx.de
 In-Reply-To: 1252423922.5386.17.ca...@com-21
 References: 1252423922.5386.17.ca...@com-21
 Content-Type: text/plain
 Date: Wed, 09 Sep 2009 21:20:34 +0200
 Message-Id: 1252524034.3643.10.ca...@com-21
 Mime-Version: 1.0
 X-Mailer: Evolution 2.26.1
 Content-Transfer-Encoding: 7bit
 X-Provags-ID: V01U2FsdGVkX18q/47KahaahtxmPn/kHC3ABN14jxJlK0gRMMC
 jP8DJba0m2nsYVMlFijeWu80NwsCiou0aJy+P3tfTx+dHkDeD4
 Mj0fiAcNOrr6y8/PmSWrEdfcxf4fcKo
 ___
 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] configure ppc440spe as pci adapter

2009-09-11 Thread Wolfgang Denk
Dear dbrazeau,

In message 25389144.p...@talk.nabble.com you wrote:
 
 I'm trying to get my ppc440spe (Katmai) board to initialize in PCI adapter
 mode.  I was hoping that someone could give me some pointers on what changes

You are really talking about the PCI-X port on the Katmai board, are
you? You don't by any chance mean PCIe?

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
Never underestimate the bandwidth of a station wagon full of tapes.
-- Dr. Warren Jackson, Director, UTCS
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] Support for the OpenRD base board

2009-09-11 Thread Prafulla Wadaskar
 

 -Original Message-
 From: Simon Kagstrom [mailto:simon.kagst...@netinsight.net] 
 Sent: Friday, September 11, 2009 5:48 PM
 To: Prafulla Wadaskar
 Cc: U-Boot ML; Dhaval Vasa; Prabhanjan Sarnaik; Ashish Karkare
 Subject: Re: [PATCH v2] Support for the OpenRD base board
 
 Thanks for the comments Prafulla!
 
 I'll update the patch according to them, but have some questions:
 
 On Fri, 11 Sep 2009 03:43:04 -0700
 Prafulla Wadaskar prafu...@marvell.com wrote:
 
   +#define CONFIG_ENV_SIZE  0x2 /* 128k */
   +#define CONFIG_ENV_ADDR  0xa
   +#define CONFIG_ENV_OFFSET0xa /* env 
 starts here */
  Do you really need this address? the u-boot binary is 
 within 256kb, at the most it can go till 512kb
 
 This is where the default environment (for the U-boot shipped by
 Marvell) resides. Like on Sheevaplug, it uses 4-bit ECC, so current
 U-boot won't be able to read it, but I know you're working on it.
So I think, you want to retain both environment variables untouched
 ( i.e. latest u-boot and u-boot shipped by Marvell)
But so far as mainlined u-boot is considered,
doesn't it make sense to pack uboot-bin and environment sector together?
like sheevaplug, I think first 2 sectors for u-boot and next once sector for 
env should be better to choose.

 
   +#define MTDIDS_DEFAULT   nand0=nand_mtd
   +#define MTDPARTS_DEFAULT
   mtdparts=nand_mtd:0x100...@0x00(uboot),0x400...@0x10(
   uImage),\
   + 0x1fb00...@0x50(rootfs)
  This is must be the default setup in board setup file for 
 openrd_base (if it is again derived from sheevaplug)
  In that case this settings not required
 
 I don't quite understand this. This is also the default addresses
 shipped with the board.
W..r.to line 24 at 
http://git.marvell.com/?p=orion.git;a=blob;f=arch/arm/mach-kirkwood/openrd_base-setup.c;h=947dfb8cd5b252bf326d691ee5179e29ad07a9a9;hb=HEAD
By default kernel has same mdtpart configuration as you are describing here.
So you don't need this default setup here, you should skip it

 
   +#define CONFIG_EXTRA_ENV_SETTINGSx_bootargs=console\
   + =ttyS0,115200 MTDPARTS_DEFAULT  rw ubi.mtd=2,2048\0 \
   + x_bootcmd_kernel=nand read 0x640 0x10 0x30\0 \
   + x_bootcmd_usb=usb start\0 \
  You must add x_bootcmd_eth for program MAC addrss in 
 hardware before kernel boot.
 
 Well, we need to figure out some generic way of giving Linux the MAC
 address on these boards, but I've understood that initializing the
 interface without using it is not popular, so in this case 
 I'd just let
 the problem remain (no x_bootcmd_eth).
Okay,

 
 Or did I misunderstand your comment?
No you understood it properly

As per my knowledge, I don't this the any hack for this in kernel will be 
accepted.
The same is with u-boot arm net drivers.
At both places fingures are crossed. s/w guys thinks h/w should take care of 
this.
But unfortunately this is not happening with this h/w (may be there are few 
more).
I personally feel that u-boot should handle this (copying ben for this)

Regards..
Prafulla . .

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


Re: [U-Boot] [PATCH v2 1/5] 85xx: add boot from NAND/eSDHC/eSPI support

2009-09-11 Thread Wolfgang Denk
Dear Mingkai Hu,

In message 1252639077-29277-1-git-send-email-mingkai...@freescale.com you 
wrote:
 The MPC8536E is capable of booting form NAND/eSDHC/eSPI, this patch
 implements these three bootup methods in a unified way - all of these
 use the general cpu/mpc85xx/start.S, and load the main image to L2SRAM
 which lets us use the SPD to initialize the SDRAM.

...

I'm confused.

Is this v2 reposted? Or an updated version?

Could you please be so kind and always note (below the --- line)
what has changed against the previous version of the patch?

Thanks.

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
You have the capacity to learn from  mistakes.  You'll  learn  a  lot
today.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Maintainer Yuli Barcohen

2009-09-11 Thread Wolfgang Denk
Dear Marcel Ziswiler,

In message 4369831.100411252671459841.javamail.serv...@perfora you wrote:
 
 Anybody knows the whereabouts of Yuli Barcohen, maintainer amongst
 others of the ep8248 and MPC8260ADS boards? It looks like his last
 known email address as noted in MAINTAINERS bounces (see transcript
 below).

Arabella was bought by Entropic Communications, so maybe we have more
luck with @entropic.com (see 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
There is no statute of limitations on stupidity.
- Randomly produced by a computer program called Markov3.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] Support for the OpenRD base board

2009-09-11 Thread Simon Kagstrom
On Fri, 11 Sep 2009 06:33:44 -0700
Prafulla Wadaskar prafu...@marvell.com wrote:

+#define CONFIG_ENV_SIZE  0x2 /* 128k */
+#define CONFIG_ENV_ADDR  0xa
+#define CONFIG_ENV_OFFSET0xa /* env 
  starts here */
   Do you really need this address? the u-boot binary is 
  within 256kb, at the most it can go till 512kb
  
  This is where the default environment (for the U-boot shipped by
  Marvell) resides. Like on Sheevaplug, it uses 4-bit ECC, so current
  U-boot won't be able to read it, but I know you're working on it.
 So I think, you want to retain both environment variables untouched
  ( i.e. latest u-boot and u-boot shipped by Marvell)
 But so far as mainlined u-boot is considered,
 doesn't it make sense to pack uboot-bin and environment sector together?
 like sheevaplug, I think first 2 sectors for u-boot and next once sector for 
 env should be better to choose.

Right, makes sense. I'll update that and skip the current address.

+#define MTDIDS_DEFAULT   nand0=nand_mtd
+#define MTDPARTS_DEFAULT
mtdparts=nand_mtd:0x100...@0x00(uboot),0x400...@0x10(
uImage),\
+ 0x1fb00...@0x50(rootfs)

  I don't quite understand this. This is also the default addresses
  shipped with the board.

 W..r.to line 24 at 
 http://git.marvell.com/?p=orion.git;a=blob;f=arch/arm/mach-kirkwood/openrd_base-setup.c;h=947dfb8cd5b252bf326d691ee5179e29ad07a9a9;hb=HEAD
 By default kernel has same mdtpart configuration as you are describing here.
 So you don't need this default setup here, you should skip it

OK, I understand. However, but it might also be useful from U-boot.
Locally, I've loaded the kernel from the ubifs partition, and then it's
useful to have this defined in U-boot as well. If it shouldn't be there
by default, I'll remove it though.

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


Re: [U-Boot] [PATCH] TI DaVinci: DM646x: Initial Support for DM646x SOC

2009-09-11 Thread Paulraj, Sandeep

 
 From: Sandeep Paulraj s-paul...@ti.com
 
 DM646x is an SOC from TI which has both an ARM and a DSP.
 There are multiple variants of the SOC mainly dealing with different
 core speeds.
 This patch adds the initial framework for the DM646x SOC.
 
 Signed-off-by: Sandeep Paulraj s-paul...@ti.com
 ---
  cpu/arm926ejs/davinci/Makefile  |1 +
  cpu/arm926ejs/davinci/dm646x.c  |   41
 +++
  include/asm-arm/arch-davinci/hardware.h |   11 
  3 files changed, 53 insertions(+), 0 deletions(-)
  create mode 100644 cpu/arm926ejs/davinci/dm646x.c

Pushing to u-boot-ti master

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


Re: [U-Boot] [PATCH v2 3/5] NAND boot: MPC8536DS support

2009-09-11 Thread Kumar Gala

On Sep 11, 2009, at 12:43 AM, Hu Mingkai-B21284 wrote:



 -Original Message-
 From: Kumar Gala [mailto:ga...@kernel.crashing.org]
 Sent: Friday, September 11, 2009 12:21 PM
 To: Gala Kumar-B11780
 Cc: Hu Mingkai-B21284; Wood Scott-B07421; u-boot@lists.denx.de
 Subject: Re: [U-Boot] [PATCH v2 3/5] NAND boot: MPC8536DS support


 On Sep 10, 2009, at 11:11 PM, Kumar Gala wrote:


 On Sep 10, 2009, at 9:53 PM, Mingkai Hu wrote:

 board/freescale/mpc8536ds/u-boot-nand.lds  |  140
 +++
 +

 Do we really need a specific linker script for this?

 More specifically, can we move it into
 cpu/mpc85xx/u-boot-nand.lds and match cpu/mpc85xx/u-boot.lds.


 I think it can be moved to cpu/mpc85xx/*, but it's a little trouble to
 match u-boot.lds
 when load the boot-from-nand image to L2 SRAM.

 The script u-boot.lds will expand the image to 512K, along with the 4K
 NAND loader,
 the image size wil over 512K, so we place the boot page on the  
 beginning
 of the
 boot-from-nand image.

 When load the image to DDR, I think it can match u-boot.lds.

When I say match I just meant the differences should only be the one's  
required.

For example I don't believe this difference is necessary:

@@ -69,8 +65,10 @@
  PROVIDE (etext = .);
  .rodata:
 {
+*(.rodata)
+*(.rodata1)
+*(.rodata.str1.4)
  *(.eh_frame)
-*(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
} :text
.fini  : { *(.fini)} =0
.ctors : { *(.ctors)   }

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


Re: [U-Boot] [PATCH v2 1/2] mkconfig: split the board make target to multiple config targets

2009-09-11 Thread Scott Wood
On Fri, Sep 11, 2009 at 10:07:46AM +0200, Wolfgang Denk wrote:
 In message 1252466603-25103-1-git-send-email-mingkai...@freescale.com you 
 wrote:
  To simplify the top level makefile it useful to be able to parse
  the top level makefile target to multiple individual target, then
  put them to the config.h, leave the board config file to handle
  the different targets.

[snip]

 Arghhh... It seems this patch has not been well tested. Obviously
 never ever ran a MAKEALL over all PPC boards. It causes tons of
 messages like that:
 
 include/config.h:2:25: warning: missing whitespace after the macro name
 
 This patch breaks building for a number of boards / configurations,

Actually, I think the patch you quoted would not have had this problem --
unlike the one you merged, it doesn't create #defines for all boards,
only those which request it by passing -t to mkconfig.

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


Re: [U-Boot] fsl_i2c: increase I2C timeout values and make them configurable

2009-09-11 Thread Timur Tabi
Joakim Tjernlund wrote:

 This will generate the same divisor tables as AN2919, tables 6-9.
 I do not take condition 2 into consideration as it not clear how to
 deal with it and it does not seem to have an significant impact.
 
 What do you think?

I really don't have time to deal with it right now.  Sorry.


-- 
Timur Tabi
Linux kernel developer at Freescale
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] ppc4xx: Fix 405EZ uart base baud calculation

2009-09-11 Thread Stefan Roese
With this fix, Linux correctly configures the baudrate when booting
with FDT passed from U-Boot to Linux.

Signed-off-by: Stefan Roese s...@denx.de
---
 cpu/ppc4xx/speed.c |6 +-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/cpu/ppc4xx/speed.c b/cpu/ppc4xx/speed.c
index 1f75137..9c4bc09 100644
--- a/cpu/ppc4xx/speed.c
+++ b/cpu/ppc4xx/speed.c
@@ -914,6 +914,7 @@ void get_sys_info (PPC4xx_SYS_INFO * sysInfo)
unsigned long sysClkPeriodPs = ONE_BILLION / (CONFIG_SYS_CLK_FREQ/1000);
unsigned long primad_cpudv;
unsigned long m;
+   unsigned long plloutb;
 
/*
 * Read PLL Mode registers
@@ -999,7 +1000,10 @@ void get_sys_info (PPC4xx_SYS_INFO * sysInfo)
sysInfo-freqEBC = (CONFIG_SYS_CLK_FREQ * sysInfo-pllFbkDiv) /
sysInfo-pllExtBusDiv;
 
-   sysInfo-freqUART = sysInfo-freqVCOHz;
+   plloutb = ((CONFIG_SYS_CLK_FREQ * ((cpr_pllc  PLLC_SRC_MASK) ?
+   sysInfo-pllFwdDivB : sysInfo-pllFwdDiv) * sysInfo-pllFbkDiv) 
/
+   sysInfo-pllFwdDivB);
+   sysInfo-freqUART = plloutb;
 }
 
 /
-- 
1.6.4.1

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


[U-Boot] [PATCH] ppc4xx: Enable commands for FDT enabled Linux booting on AMCC Acadia

2009-09-11 Thread Stefan Roese
Acadia still used the old arch/ppc bootm commands for booting
Linux images without FDT. This patch now enables these fdt-aware
boot commands for Acadia as well.

Signed-off-by: Stefan Roese s...@denx.de
---
 include/configs/acadia.h |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/include/configs/acadia.h b/include/configs/acadia.h
index b710107..2fb48b6 100644
--- a/include/configs/acadia.h
+++ b/include/configs/acadia.h
@@ -225,7 +225,8 @@
  */
 #defineCONFIG_EXTRA_ENV_SETTINGS   
\
CONFIG_AMCC_DEF_ENV \
-   CONFIG_AMCC_DEF_ENV_PPC \
+   CONFIG_AMCC_DEF_ENV_POWERPC \
+   CONFIG_AMCC_DEF_ENV_PPC_OLD \
CONFIG_AMCC_DEF_ENV_NOR_UPD \
CONFIG_AMCC_DEF_ENV_NAND_UPD\
kernel_addr=fff1\0\
-- 
1.6.4.1

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


Re: [U-Boot] [PATCH v2 1/2] mkconfig: split the board make target to multiple config targets

2009-09-11 Thread Kumar Gala

On Sep 11, 2009, at 10:20 AM, Scott Wood wrote:

 On Fri, Sep 11, 2009 at 10:07:46AM +0200, Wolfgang Denk wrote:
 In message 1252466603-25103-1-git-send-email-mingkai...@freescale.com 
  you wrote:
 To simplify the top level makefile it useful to be able to parse
 the top level makefile target to multiple individual target, then
 put them to the config.h, leave the board config file to handle
 the different targets.

 [snip]

 Arghhh... It seems this patch has not been well tested. Obviously
 never ever ran a MAKEALL over all PPC boards. It causes tons of
 messages like that:

 include/config.h:2:25: warning: missing whitespace after the macro  
 name

 This patch breaks building for a number of boards / configurations,

 Actually, I think the patch you quoted would not have had this  
 problem --
 unlike the one you merged, it doesn't create #defines for all boards,
 only those which request it by passing -t to mkconfig.

I'm with Scott on this.  Why not just have it be a new explicit option  
to mkconfig?

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


Re: [U-Boot] [PATCH] cmd_fdt.c: fix parse of byte streams and strings

2009-09-11 Thread Scott Wood
On Thu, Sep 10, 2009 at 08:23:27PM -0400, Jerry Van Baren wrote:
fdt set /ether...@f00 interrupts this is a string
 can now handle multiple strings (words) by concatenating them with 
 spaces (quoted strings still work the same as before because of hush's 
 argument parsing)
fdt set /ether...@f00 interrupts this is a string

How do you set a string list, then?

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


Re: [U-Boot] [PATCH] cmd_fdt.c: fix parse of byte streams and strings

2009-09-11 Thread Jerry Van Baren
Scott Wood wrote:
 On Thu, Sep 10, 2009 at 08:23:27PM -0400, Jerry Van Baren wrote:
fdt set /ether...@f00 interrupts this is a string
 can now handle multiple strings (words) by concatenating them with 
 spaces (quoted strings still work the same as before because of hush's 
 argument parsing)
fdt set /ether...@f00 interrupts this is a string
 
 How do you set a string list, then?
 
 -Scott

Hi Scott,

That *is* a string, the two examples are equivalent.  The proposed 
parser change glues all the parameters together with a single space. 
The string parsing doesn't worry me because it is 100% backward 
compatible with the original parsing, e.g. these two commands will 
result in the same string being stored in the FDT:
   fdt set /ether...@f00 interrupts this is a string
(one parameter with explicit spaces)
   fdt set /ether...@f00 interrupts this is a string
(five parameters with implicit spaces).

If you want two spaces between words, you would have to use the 
explicitly quoted version:
   fdt set /ether...@f00 interrupts this  is  a  string

Strings are backwards compatible because the hush parser strips the 
quotes so all that that part of Ken's patch does is to extend it to 
paste together multiple arguments rather than limiting it to exactly one 
argument.  The following also produces the original string:
   fdt set /ether...@f00 interrupts this is a string

I'm more concerned with the [] form because that really is a syntax 
change.  The original syntax with a single quoted argument will no 
longer be parsed if I understand the change (I need to apply the patch 
and confirm this):
Old:
fdt set /ether...@f00 interrupts [33 2 34 2 36 2]
becomes
fdt set /ether...@f00 interrupts [ 33 2 34 2 36 2 ]
Note that the *must* be a space between [ and 33 and between 2 and 
] because the [ and ] now have to be separate arguments.  This is 
what Andy did with  and  with no public outcry, so it is probably OK.

--
 Does anybody have a problem with this syntax change? 
--

If humans are typing the commands it shouldn't be a big deal.  If 
someone has those commands embedded in a script, their script will break 
and they will have to update it per the new syntax.

FWIIW, Andy's syntax is much cleaner than my original (must quote) 
syntax (other than the need for spaces between the [ ]   
symbols and the numbers, but I can accept that).

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


Re: [U-Boot] [PATCH] board/flagadm/flash.c: fix compile warning

2009-09-11 Thread Scott Wood
On Fri, Sep 11, 2009 at 11:18:19AM +0200, Wolfgang Denk wrote:
 Fix warning: flash.c:531: warning: dereferencing type-punned pointer
 will break strict-aliasing rules
 
 Signed-off-by: Wolfgang Denk w...@denx.de
 Cc: K?ri Dav??sson k...@flaga.is
 ---
  board/flagadm/flash.c |3 ++-
  1 files changed, 2 insertions(+), 1 deletions(-)
 
 diff --git a/board/flagadm/flash.c b/board/flagadm/flash.c
 index bbefbac..ff37d9e 100644
 --- a/board/flagadm/flash.c
 +++ b/board/flagadm/flash.c
 @@ -528,7 +528,8 @@ int write_word (flash_info_t *info, ulong dest, ulong da)
   ulong start;
   char csr;
   int flag;
 - ushort * d = (ushort*)da;
 + ulong *dla = da;
 + ushort *d = (ushort*)dla;

I don't see how this is any more legal under strict aliasing rules -- you
just made it a little more complicated and fooled the compiler into not
warning.

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


Re: [U-Boot] [PATCH] cmd_fdt.c: fix parse of byte streams and strings

2009-09-11 Thread Scott Wood
Jerry Van Baren wrote:
 Scott Wood wrote:
 On Thu, Sep 10, 2009 at 08:23:27PM -0400, Jerry Van Baren wrote:
fdt set /ether...@f00 interrupts this is a string
 can now handle multiple strings (words) by concatenating them with 
 spaces (quoted strings still work the same as before because of 
 hush's argument parsing)
fdt set /ether...@f00 interrupts this is a string

 How do you set a string list, then?
 
 That *is* a string, 

No, a string list is not a string.  It is a set of strings that have been 
concatenated, but which retain their individual null terminators (as in the 
compatible property).

 Strings are backwards compatible because the hush parser strips the 
 quotes so all that that part of Ken's patch does is to extend it to 
 paste together multiple arguments rather than limiting it to exactly one 
 argument.  The following also produces the original string:
   fdt set /ether...@f00 interrupts this is a string
 
 I'm more concerned with the [] form because that really is a syntax 
 change.  The original syntax with a single quoted argument will no 
 longer be parsed if I understand the change (I need to apply the patch 
 and confirm this):
 Old:
fdt set /ether...@f00 interrupts [33 2 34 2 36 2]
 becomes
fdt set /ether...@f00 interrupts [ 33 2 34 2 36 2 ]
 Note that the *must* be a space between [ and 33 and between 2 and 
 ] because the [ and ] now have to be separate arguments.  This is 
 what Andy did with  and  with no public outcry, so it is probably OK.
 
 --
  Does anybody have a problem with this syntax change? 
 --

I'm not thrilled with it...  I'd think the code could be made to handle the [, 
], , or  being in the same parameter as one of the numbers.

-Scott

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


[U-Boot] [PATCH 1/2] ppc/85xx: Introduce low level write_tlb function

2009-09-11 Thread Kumar Gala
Factor out the code we use to actually write a tlb entry.

set_tlb is a logical view of the TLB while write_tlb is a low level
matching the MAS registers.

Signed-off-by: Kumar Gala ga...@kernel.crashing.org
---
 cpu/mpc85xx/start.S   |   19 +++
 cpu/mpc85xx/tlb.c |   12 +---
 include/asm-ppc/mmu.h |2 ++
 3 files changed, 22 insertions(+), 11 deletions(-)

diff --git a/cpu/mpc85xx/start.S b/cpu/mpc85xx/start.S
index 7a23b4f..ea32659 100644
--- a/cpu/mpc85xx/start.S
+++ b/cpu/mpc85xx/start.S
@@ -1127,6 +1127,25 @@ flush_dcache:
 
blr
 
+   .globl  write_tlb
+write_tlb:
+   mtspr   MAS0,r3
+   mtspr   MAS1,r4
+   mtspr   MAS2,r5
+   mtspr   MAS3,r6
+#ifdef CONFIG_ENABLE_36BIT_PHYS
+   mtspr   MAS7,r7
+#endif
+   li  r3,0
+#ifdef CONFIG_SYS_BOOK3E_HV
+   mtspr   MAS8,r3
+#endif
+   isync
+   tlbwe
+   msync
+   isync
+   blr
+
 .globl setup_ivors
 setup_ivors:
 
diff --git a/cpu/mpc85xx/tlb.c b/cpu/mpc85xx/tlb.c
index 03c2449..3e502ac 100644
--- a/cpu/mpc85xx/tlb.c
+++ b/cpu/mpc85xx/tlb.c
@@ -44,17 +44,7 @@ void set_tlb(u8 tlb, u32 epn, u64 rpn,
_mas3 = FSL_BOOKE_MAS3(rpn, 0, perms);
_mas7 = rpn  32;
 
-   mtspr(MAS0, _mas0);
-   mtspr(MAS1, _mas1);
-   mtspr(MAS2, _mas2);
-   mtspr(MAS3, _mas3);
-#ifdef CONFIG_ENABLE_36BIT_PHYS
-   mtspr(MAS7, _mas7);
-#endif
-#ifdef CONFIG_SYS_BOOK3E_HV
-   mtspr(MAS8, 0);
-#endif
-   asm volatile(isync;msync;tlbwe;isync);
+   write_tlb(_mas0, _mas1, _mas2, _mas3, _mas7);
 
 #ifdef CONFIG_ADDR_MAP
if ((tlb == 1)  (gd-flags  GD_FLG_RELOC))
diff --git a/include/asm-ppc/mmu.h b/include/asm-ppc/mmu.h
index eda2959..d311ba2 100644
--- a/include/asm-ppc/mmu.h
+++ b/include/asm-ppc/mmu.h
@@ -480,6 +480,8 @@ extern int find_tlb_idx(void *addr, u8 tlbsel);
 
 extern unsigned int setup_ddr_tlbs(unsigned int memsize_in_meg);
 
+extern void write_tlb(u32 _mas0, u32 _mas1, u32 _mas2, u32 _mas3, u32 _mas7);
+
 #define SET_TLB_ENTRY(_tlb, _epn, _rpn, _perms, _wimge, _ts, _esel, _sz, 
_iprot) \
{ .tlb = _tlb, .epn = _epn, .rpn = _rpn, .perms = _perms, \
  .wimge = _wimge, .ts = _ts, .esel = _esel, .tsize = _sz, .iprot = 
_iprot }
-- 
1.6.0.6

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


[U-Boot] [PATCH 2/2] ppc/85xx: Repack tlb_table to save space

2009-09-11 Thread Kumar Gala
We can pack the initial tlb_table in MAS register format and use
write_tlb to set things up.  This savings can be helpful for NAND
style first stage boot loaders.

Signed-off-by: Kumar Gala ga...@kernel.crashing.org
---
 cpu/mpc85xx/tlb.c |9 +
 include/asm-ppc/mmu.h |   21 ++---
 2 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/cpu/mpc85xx/tlb.c b/cpu/mpc85xx/tlb.c
index 3e502ac..857908e 100644
--- a/cpu/mpc85xx/tlb.c
+++ b/cpu/mpc85xx/tlb.c
@@ -90,10 +90,11 @@ void init_tlbs(void)
int i;
 
for (i = 0; i  num_tlb_entries; i++) {
-   set_tlb(tlb_table[i].tlb, tlb_table[i].epn, tlb_table[i].rpn,
-   tlb_table[i].perms, tlb_table[i].wimge,
-   tlb_table[i].ts, tlb_table[i].esel, tlb_table[i].tsize,
-   tlb_table[i].iprot);
+   write_tlb(tlb_table[i].mas0,
+ tlb_table[i].mas1,
+ tlb_table[i].mas2,
+ tlb_table[i].mas3,
+ tlb_table[i].mas7);
}
 
return ;
diff --git a/include/asm-ppc/mmu.h b/include/asm-ppc/mmu.h
index d311ba2..3fa98fa 100644
--- a/include/asm-ppc/mmu.h
+++ b/include/asm-ppc/mmu.h
@@ -483,19 +483,18 @@ extern unsigned int setup_ddr_tlbs(unsigned int 
memsize_in_meg);
 extern void write_tlb(u32 _mas0, u32 _mas1, u32 _mas2, u32 _mas3, u32 _mas7);
 
 #define SET_TLB_ENTRY(_tlb, _epn, _rpn, _perms, _wimge, _ts, _esel, _sz, 
_iprot) \
-   { .tlb = _tlb, .epn = _epn, .rpn = _rpn, .perms = _perms, \
- .wimge = _wimge, .ts = _ts, .esel = _esel, .tsize = _sz, .iprot = 
_iprot }
+   { .mas0 = FSL_BOOKE_MAS0(_tlb, _esel, 0), \
+ .mas1 = FSL_BOOKE_MAS1(1, _iprot, 0, _ts, _sz), \
+ .mas2 = FSL_BOOKE_MAS2(_epn, _wimge), \
+ .mas3 = FSL_BOOKE_MAS3(_rpn, 0, _perms), \
+ .mas7 = ((u64)_rpn)  32, }
 
 struct fsl_e_tlb_entry {
-   u8  tlb;
-   u32 epn;
-   u64 rpn;
-   u8  perms;
-   u8  wimge;
-   u8  ts;
-   u8  esel;
-   u8  tsize;
-   u8  iprot;
+   u32 mas0;
+   u32 mas1;
+   u32 mas2;
+   u32 mas3;
+   u32 mas7;
 };
 
 extern struct fsl_e_tlb_entry tlb_table[];
-- 
1.6.0.6

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


Re: [U-Boot] [PATCH] cmd_fdt.c: fix parse of byte streams and strings

2009-09-11 Thread Andy Fleming


Strings are backwards compatible because the hush parser strips the  
quotes so all that that part of Ken's patch does is to extend it to  
paste together multiple arguments rather than limiting it to  
exactly one argument.  The following also produces the original  
string:

 fdt set /ether...@f00 interrupts this is a string
I'm more concerned with the [] form because that really is a syntax  
change.  The original syntax with a single quoted argument will no  
longer be parsed if I understand the change (I need to apply the  
patch and confirm this):

Old:
  fdt set /ether...@f00 interrupts [33 2 34 2 36 2]
becomes
  fdt set /ether...@f00 interrupts [ 33 2 34 2 36 2 ]
Note that the *must* be a space between [ and 33 and between  
2 and ] because the [ and ] now have to be separate  
arguments.  This is what Andy did with  and  with no public  
outcry, so it is probably OK.

--
 Does anybody have a problem with this syntax change? 
--


I'm not thrilled with it...  I'd think the code could be made to  
handle the [, ], , or  being in the same parameter as one of the  
numbers.


I agree.  Also, I don't think the capability of creating string  
parameters without using quotes is necessary, or necessarily a good  
idea.  The goal should be to make the values we pass in reflect the  
syntax of the device tree, itself, as that is what the naive observer  
would attempt.  If I required spaces around  and , then shame on  
me!  :)


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


Re: [U-Boot] [PATCH] cmd_fdt.c: fix parse of byte streams and strings

2009-09-11 Thread Jerry Van Baren
Andy Fleming wrote:

 Strings are backwards compatible because the hush parser strips the 
 quotes so all that that part of Ken's patch does is to extend it to 
 paste together multiple arguments rather than limiting it to exactly 
 one argument.  The following also produces the original string:
  fdt set /ether...@f00 interrupts this is a string
 I'm more concerned with the [] form because that really is a syntax 
 change.  The original syntax with a single quoted argument will no 
 longer be parsed if I understand the change (I need to apply the 
 patch and confirm this):
 Old:
   fdt set /ether...@f00 interrupts [33 2 34 2 36 2]
 becomes
   fdt set /ether...@f00 interrupts [ 33 2 34 2 36 2 ]
 Note that the *must* be a space between [ and 33 and between 2 
 and ] because the [ and ] now have to be separate arguments. 
  This is what Andy did with  and  with no public outcry, so it 
 is probably OK.
 --
  Does anybody have a problem with this syntax change? 
 --

 I'm not thrilled with it...  I'd think the code could be made to 
 handle the [, ], , or  being in the same parameter as one of the 
 numbers.
 
 I agree.  Also, I don't think the capability of creating string 
 parameters without using quotes is necessary, or necessarily a good 
 idea.  The goal should be to make the values we pass in reflect the 
 syntax of the device tree, itself, as that is what the naive observer 
 would attempt.  If I required spaces around  and , then shame on 
 me!  :)
 
 Andy

I need to try
   fdt set /ether...@f00 interrupts 33 2 34 2 36 2
to confirm my reading of the code, it could be a limitation in my mental 
parsing, not the parsing code.

...and shame on me too if that is the case since I accepted your change. 
;-/  If true, fixing it shouldn't be difficult.

I really need to make some time to create automated regression tests. :-/

Best regards,
gvb

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


[U-Boot] [PATCH] Add support for the Calao QIL-A9G20 board

2009-09-11 Thread Albin Tonnerre
The Calao SBC35-A9G20 board is manufactured and sold by Calao Systems
http://www.calao-systems.com. It is built around an AT91SAM9G20 ARM SoC
running at 400MHz. It features an Ethernet port, an SPI RTC backed by an onboard
battery , an SD/MMC slot, a CompactFlash slot, 64Mo of SDRAM, 256Mo of NAND
flash, two USB host ports, and an USB device port. More informations can be
found at http://www.calao-systems.com/articles.php?lng=enpg=5936

Signed-off-by: Albin Tonnerre albin.tonne...@free-electrons.com
---
 MAINTAINERS   |2 +
 MAKEALL   |2 +
 Makefile  |   10 ++
 board/calao/qil_a9g20/Makefile|   55 ++
 board/calao/qil_a9g20/config.mk   |1 +
 board/calao/qil_a9g20/qil_a9g20.c |  201 +
 board/calao/qil_a9g20/spi.c   |   57 +++
 include/configs/qil_a9g20.h   |  200 
 8 files changed, 528 insertions(+), 0 deletions(-)
 create mode 100644 board/calao/qil_a9g20/Makefile
 create mode 100644 board/calao/qil_a9g20/config.mk
 create mode 100644 board/calao/qil_a9g20/qil_a9g20.c
 create mode 100644 board/calao/qil_a9g20/spi.c
 create mode 100644 include/configs/qil_a9g20.h

diff --git a/MAINTAINERS b/MAINTAINERS
index e9db278..b1e82f4 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -696,6 +696,8 @@ Andrea Scian andrea.sc...@dave-tech.it
 
 Albin Tonnerre albin.tonne...@free-electrons.com
 
+   qil_a9260   ARM926EJS (AT91SAM9260 SoC)
+   qil_a9g20   ARM926EJS (AT91SAM9G20 SoC)
sbc35_a9g20 ARM926EJS (AT91SAM9G20 SoC)
tny_a9260   ARM926EJS (AT91SAM9260 SoC)
tny_a9g20   ARM926EJS (AT91SAM9G20 SoC)
diff --git a/MAKEALL b/MAKEALL
index f0ed8ea..531a667 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -614,6 +614,8 @@ LIST_at91= \
m501sk  \
pm9261  \
pm9263  \
+   QIL_A9260   \
+   QIL_A9G20   \
SBC35_A9G20 \
TNY_A9260   \
TNY_A9G20   \
diff --git a/Makefile b/Makefile
index 0449a5b..eb542a4 100644
--- a/Makefile
+++ b/Makefile
@@ -2897,6 +2897,16 @@ at91sam9g45ekes_config   :   unconfig
 pm9263_config  :   unconfig
@$(MKCONFIG) $(@:_config=) arm arm926ejs pm9263 ronetix at91
 
+QIL_A9G20_NANDFLASH_config \
+QIL_A9G20_EEPROM_config \
+QIL_A9G20_config \
+QIL_A9260_NANDFLASH_config \
+QIL_A9260_EEPROM_config \
+QIL_A9260_config   :   unconfig
+   @mkdir -p $(obj)include
+   @echo #define CONFIG_$(@:_config=) 1 $(obj)include/config.h
+   @$(MKCONFIG) -a qil_a9g20 arm arm926ejs qil_a9g20 calao at91
+
 SBC35_A9G20_NANDFLASH_config \
 SBC35_A9G20_EEPROM_config \
 SBC35_A9G20_config :   unconfig
diff --git a/board/calao/qil_a9g20/Makefile b/board/calao/qil_a9g20/Makefile
new file mode 100644
index 000..07783bf
--- /dev/null
+++ b/board/calao/qil_a9g20/Makefile
@@ -0,0 +1,55 @@
+#
+# (C) Copyright 2003-2008
+# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+#
+# (C) Copyright 2008
+# Stelian Pop stelian@leadtechdesign.com
+# Lead Tech Design www.leadtechdesign.com
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).a
+
+COBJS-y+= qil_a9g20.o
+COBJS-$(CONFIG_ATMEL_SPI)  += spi.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS-y))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(obj).depend $(OBJS) $(SOBJS)
+   $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
+
+clean:
+   rm -f $(SOBJS) $(OBJS)
+
+distclean: clean
+   rm -f $(LIB) core *.bak $(obj).depend
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/calao/qil_a9g20/config.mk b/board/calao/qil_a9g20/config.mk
new file mode 100644
index 000..ff2cfd1
--- /dev/null
+++ b/board/calao/qil_a9g20/config.mk
@@ -0,0 +1 @@
+TEXT_BASE = 0x23f0
diff --git 

[U-Boot] [PATCH 2/2] ppc/85xx: Repack tlb_table to save space

2009-09-11 Thread Kumar Gala
We can pack the initial tlb_table in MAS register format and use
write_tlb to set things up.  This savings can be helpful for NAND
style first stage boot loaders.

Signed-off-by: Kumar Gala ga...@kernel.crashing.org
---
* Use new FSL_BOOKE_MAS7 macro

 cpu/mpc85xx/tlb.c |9 +
 include/asm-ppc/mmu.h |   21 ++---
 2 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/cpu/mpc85xx/tlb.c b/cpu/mpc85xx/tlb.c
index d39712a..b8ea5c5 100644
--- a/cpu/mpc85xx/tlb.c
+++ b/cpu/mpc85xx/tlb.c
@@ -90,10 +90,11 @@ void init_tlbs(void)
int i;
 
for (i = 0; i  num_tlb_entries; i++) {
-   set_tlb(tlb_table[i].tlb, tlb_table[i].epn, tlb_table[i].rpn,
-   tlb_table[i].perms, tlb_table[i].wimge,
-   tlb_table[i].ts, tlb_table[i].esel, tlb_table[i].tsize,
-   tlb_table[i].iprot);
+   write_tlb(tlb_table[i].mas0,
+ tlb_table[i].mas1,
+ tlb_table[i].mas2,
+ tlb_table[i].mas3,
+ tlb_table[i].mas7);
}
 
return ;
diff --git a/include/asm-ppc/mmu.h b/include/asm-ppc/mmu.h
index 8f382fd..a019d0b 100644
--- a/include/asm-ppc/mmu.h
+++ b/include/asm-ppc/mmu.h
@@ -485,19 +485,18 @@ extern unsigned int setup_ddr_tlbs(unsigned int 
memsize_in_meg);
 extern void write_tlb(u32 _mas0, u32 _mas1, u32 _mas2, u32 _mas3, u32 _mas7);
 
 #define SET_TLB_ENTRY(_tlb, _epn, _rpn, _perms, _wimge, _ts, _esel, _sz, 
_iprot) \
-   { .tlb = _tlb, .epn = _epn, .rpn = _rpn, .perms = _perms, \
- .wimge = _wimge, .ts = _ts, .esel = _esel, .tsize = _sz, .iprot = 
_iprot }
+   { .mas0 = FSL_BOOKE_MAS0(_tlb, _esel, 0), \
+ .mas1 = FSL_BOOKE_MAS1(1, _iprot, 0, _ts, _sz), \
+ .mas2 = FSL_BOOKE_MAS2(_epn, _wimge), \
+ .mas3 = FSL_BOOKE_MAS3(_rpn, 0, _perms), \
+ .mas7 = FSL_BOOKE_MAS7(_rpn), }
 
 struct fsl_e_tlb_entry {
-   u8  tlb;
-   u32 epn;
-   u64 rpn;
-   u8  perms;
-   u8  wimge;
-   u8  ts;
-   u8  esel;
-   u8  tsize;
-   u8  iprot;
+   u32 mas0;
+   u32 mas1;
+   u32 mas2;
+   u32 mas3;
+   u32 mas7;
 };
 
 extern struct fsl_e_tlb_entry tlb_table[];
-- 
1.6.0.6

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


[U-Boot] [PATCH 1/2] ppc/85xx: Introduce low level write_tlb function

2009-09-11 Thread Kumar Gala
Factor out the code we use to actually write a tlb entry.

set_tlb is a logical view of the TLB while write_tlb is a low level
matching the MAS registers.

Signed-off-by: Kumar Gala ga...@kernel.crashing.org
---
* Added update to copyright
* introduced FSL_BOOKE_MAS7 macro

 cpu/mpc85xx/start.S   |   21 -
 cpu/mpc85xx/tlb.c |   16 +++-
 include/asm-ppc/mmu.h |4 
 3 files changed, 27 insertions(+), 14 deletions(-)

diff --git a/cpu/mpc85xx/start.S b/cpu/mpc85xx/start.S
index 7a23b4f..49256b3 100644
--- a/cpu/mpc85xx/start.S
+++ b/cpu/mpc85xx/start.S
@@ -1,5 +1,5 @@
 /*
- * Copyright 2004, 2007 Freescale Semiconductor.
+ * Copyright 2004, 2007-2009 Freescale Semiconductor.
  * Copyright (C) 2003  Motorola,Inc.
  *
  * See file CREDITS for list of people who contributed to this
@@ -1127,6 +1127,25 @@ flush_dcache:
 
blr
 
+   .globl  write_tlb
+write_tlb:
+   mtspr   MAS0,r3
+   mtspr   MAS1,r4
+   mtspr   MAS2,r5
+   mtspr   MAS3,r6
+#ifdef CONFIG_ENABLE_36BIT_PHYS
+   mtspr   MAS7,r7
+#endif
+   li  r3,0
+#ifdef CONFIG_SYS_BOOK3E_HV
+   mtspr   MAS8,r3
+#endif
+   isync
+   tlbwe
+   msync
+   isync
+   blr
+
 .globl setup_ivors
 setup_ivors:
 
diff --git a/cpu/mpc85xx/tlb.c b/cpu/mpc85xx/tlb.c
index 03c2449..d39712a 100644
--- a/cpu/mpc85xx/tlb.c
+++ b/cpu/mpc85xx/tlb.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2008 Freescale Semiconductor, Inc.
+ * Copyright 2008-2009 Freescale Semiconductor, Inc.
  *
  * (C) Copyright 2000
  * Wolfgang Denk, DENX Software Engineering, w...@denx.de.
@@ -42,19 +42,9 @@ void set_tlb(u8 tlb, u32 epn, u64 rpn,
_mas1 = FSL_BOOKE_MAS1(1, iprot, 0, ts, tsize);
_mas2 = FSL_BOOKE_MAS2(epn, wimge);
_mas3 = FSL_BOOKE_MAS3(rpn, 0, perms);
-   _mas7 = rpn  32;
+   _mas7 = FSL_BOOKE_MAS7(rpn);
 
-   mtspr(MAS0, _mas0);
-   mtspr(MAS1, _mas1);
-   mtspr(MAS2, _mas2);
-   mtspr(MAS3, _mas3);
-#ifdef CONFIG_ENABLE_36BIT_PHYS
-   mtspr(MAS7, _mas7);
-#endif
-#ifdef CONFIG_SYS_BOOK3E_HV
-   mtspr(MAS8, 0);
-#endif
-   asm volatile(isync;msync;tlbwe;isync);
+   write_tlb(_mas0, _mas1, _mas2, _mas3, _mas7);
 
 #ifdef CONFIG_ADDR_MAP
if ((tlb == 1)  (gd-flags  GD_FLG_RELOC))
diff --git a/include/asm-ppc/mmu.h b/include/asm-ppc/mmu.h
index eda2959..8f382fd 100644
--- a/include/asm-ppc/mmu.h
+++ b/include/asm-ppc/mmu.h
@@ -450,6 +450,8 @@ extern void print_bats(void);
(((epn)  MAS3_RPN) | (wimge))
 #define FSL_BOOKE_MAS3(rpn, user, perms) \
(((rpn)  MAS3_RPN) | (user) | (perms))
+#define FSL_BOOKE_MAS7(rpn) \
+   (((u64)(rpn))  32)
 
 #define BOOKE_PAGESZ_1K 0
 #define BOOKE_PAGESZ_4K 1
@@ -480,6 +482,8 @@ extern int find_tlb_idx(void *addr, u8 tlbsel);
 
 extern unsigned int setup_ddr_tlbs(unsigned int memsize_in_meg);
 
+extern void write_tlb(u32 _mas0, u32 _mas1, u32 _mas2, u32 _mas3, u32 _mas7);
+
 #define SET_TLB_ENTRY(_tlb, _epn, _rpn, _perms, _wimge, _ts, _esel, _sz, 
_iprot) \
{ .tlb = _tlb, .epn = _epn, .rpn = _rpn, .perms = _perms, \
  .wimge = _wimge, .ts = _ts, .esel = _esel, .tsize = _sz, .iprot = 
_iprot }
-- 
1.6.0.6

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


[U-Boot] [PATCH v2 2/2] ppc/85xx: Repack tlb_table to save space

2009-09-11 Thread Kumar Gala
We can pack the initial tlb_table in MAS register format and use
write_tlb to set things up.  This savings can be helpful for NAND
style first stage boot loaders.

Signed-off-by: Kumar Gala ga...@kernel.crashing.org
---
* Use new FSL_BOOKE_MAS7 macro

 cpu/mpc85xx/tlb.c |9 +
 include/asm-ppc/mmu.h |   21 ++---
 2 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/cpu/mpc85xx/tlb.c b/cpu/mpc85xx/tlb.c
index d39712a..b8ea5c5 100644
--- a/cpu/mpc85xx/tlb.c
+++ b/cpu/mpc85xx/tlb.c
@@ -90,10 +90,11 @@ void init_tlbs(void)
int i;
 
for (i = 0; i  num_tlb_entries; i++) {
-   set_tlb(tlb_table[i].tlb, tlb_table[i].epn, tlb_table[i].rpn,
-   tlb_table[i].perms, tlb_table[i].wimge,
-   tlb_table[i].ts, tlb_table[i].esel, tlb_table[i].tsize,
-   tlb_table[i].iprot);
+   write_tlb(tlb_table[i].mas0,
+ tlb_table[i].mas1,
+ tlb_table[i].mas2,
+ tlb_table[i].mas3,
+ tlb_table[i].mas7);
}
 
return ;
diff --git a/include/asm-ppc/mmu.h b/include/asm-ppc/mmu.h
index 8f382fd..a019d0b 100644
--- a/include/asm-ppc/mmu.h
+++ b/include/asm-ppc/mmu.h
@@ -485,19 +485,18 @@ extern unsigned int setup_ddr_tlbs(unsigned int 
memsize_in_meg);
 extern void write_tlb(u32 _mas0, u32 _mas1, u32 _mas2, u32 _mas3, u32 _mas7);
 
 #define SET_TLB_ENTRY(_tlb, _epn, _rpn, _perms, _wimge, _ts, _esel, _sz, 
_iprot) \
-   { .tlb = _tlb, .epn = _epn, .rpn = _rpn, .perms = _perms, \
- .wimge = _wimge, .ts = _ts, .esel = _esel, .tsize = _sz, .iprot = 
_iprot }
+   { .mas0 = FSL_BOOKE_MAS0(_tlb, _esel, 0), \
+ .mas1 = FSL_BOOKE_MAS1(1, _iprot, 0, _ts, _sz), \
+ .mas2 = FSL_BOOKE_MAS2(_epn, _wimge), \
+ .mas3 = FSL_BOOKE_MAS3(_rpn, 0, _perms), \
+ .mas7 = FSL_BOOKE_MAS7(_rpn), }
 
 struct fsl_e_tlb_entry {
-   u8  tlb;
-   u32 epn;
-   u64 rpn;
-   u8  perms;
-   u8  wimge;
-   u8  ts;
-   u8  esel;
-   u8  tsize;
-   u8  iprot;
+   u32 mas0;
+   u32 mas1;
+   u32 mas2;
+   u32 mas3;
+   u32 mas7;
 };
 
 extern struct fsl_e_tlb_entry tlb_table[];
-- 
1.6.0.6

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


[U-Boot] [PATCH v2 1/2] ppc/85xx: Introduce low level write_tlb function

2009-09-11 Thread Kumar Gala
Factor out the code we use to actually write a tlb entry.

set_tlb is a logical view of the TLB while write_tlb is a low level
matching the MAS registers.

Signed-off-by: Kumar Gala ga...@kernel.crashing.org
---
* Added update to copyright
* introduced FSL_BOOKE_MAS7 macro

 cpu/mpc85xx/start.S   |   21 -
 cpu/mpc85xx/tlb.c |   16 +++-
 include/asm-ppc/mmu.h |4 
 3 files changed, 27 insertions(+), 14 deletions(-)

diff --git a/cpu/mpc85xx/start.S b/cpu/mpc85xx/start.S
index 7a23b4f..49256b3 100644
--- a/cpu/mpc85xx/start.S
+++ b/cpu/mpc85xx/start.S
@@ -1,5 +1,5 @@
 /*
- * Copyright 2004, 2007 Freescale Semiconductor.
+ * Copyright 2004, 2007-2009 Freescale Semiconductor.
  * Copyright (C) 2003  Motorola,Inc.
  *
  * See file CREDITS for list of people who contributed to this
@@ -1127,6 +1127,25 @@ flush_dcache:
 
blr
 
+   .globl  write_tlb
+write_tlb:
+   mtspr   MAS0,r3
+   mtspr   MAS1,r4
+   mtspr   MAS2,r5
+   mtspr   MAS3,r6
+#ifdef CONFIG_ENABLE_36BIT_PHYS
+   mtspr   MAS7,r7
+#endif
+   li  r3,0
+#ifdef CONFIG_SYS_BOOK3E_HV
+   mtspr   MAS8,r3
+#endif
+   isync
+   tlbwe
+   msync
+   isync
+   blr
+
 .globl setup_ivors
 setup_ivors:
 
diff --git a/cpu/mpc85xx/tlb.c b/cpu/mpc85xx/tlb.c
index 03c2449..d39712a 100644
--- a/cpu/mpc85xx/tlb.c
+++ b/cpu/mpc85xx/tlb.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2008 Freescale Semiconductor, Inc.
+ * Copyright 2008-2009 Freescale Semiconductor, Inc.
  *
  * (C) Copyright 2000
  * Wolfgang Denk, DENX Software Engineering, w...@denx.de.
@@ -42,19 +42,9 @@ void set_tlb(u8 tlb, u32 epn, u64 rpn,
_mas1 = FSL_BOOKE_MAS1(1, iprot, 0, ts, tsize);
_mas2 = FSL_BOOKE_MAS2(epn, wimge);
_mas3 = FSL_BOOKE_MAS3(rpn, 0, perms);
-   _mas7 = rpn  32;
+   _mas7 = FSL_BOOKE_MAS7(rpn);
 
-   mtspr(MAS0, _mas0);
-   mtspr(MAS1, _mas1);
-   mtspr(MAS2, _mas2);
-   mtspr(MAS3, _mas3);
-#ifdef CONFIG_ENABLE_36BIT_PHYS
-   mtspr(MAS7, _mas7);
-#endif
-#ifdef CONFIG_SYS_BOOK3E_HV
-   mtspr(MAS8, 0);
-#endif
-   asm volatile(isync;msync;tlbwe;isync);
+   write_tlb(_mas0, _mas1, _mas2, _mas3, _mas7);
 
 #ifdef CONFIG_ADDR_MAP
if ((tlb == 1)  (gd-flags  GD_FLG_RELOC))
diff --git a/include/asm-ppc/mmu.h b/include/asm-ppc/mmu.h
index eda2959..8f382fd 100644
--- a/include/asm-ppc/mmu.h
+++ b/include/asm-ppc/mmu.h
@@ -450,6 +450,8 @@ extern void print_bats(void);
(((epn)  MAS3_RPN) | (wimge))
 #define FSL_BOOKE_MAS3(rpn, user, perms) \
(((rpn)  MAS3_RPN) | (user) | (perms))
+#define FSL_BOOKE_MAS7(rpn) \
+   (((u64)(rpn))  32)
 
 #define BOOKE_PAGESZ_1K 0
 #define BOOKE_PAGESZ_4K 1
@@ -480,6 +482,8 @@ extern int find_tlb_idx(void *addr, u8 tlbsel);
 
 extern unsigned int setup_ddr_tlbs(unsigned int memsize_in_meg);
 
+extern void write_tlb(u32 _mas0, u32 _mas1, u32 _mas2, u32 _mas3, u32 _mas7);
+
 #define SET_TLB_ENTRY(_tlb, _epn, _rpn, _perms, _wimge, _ts, _esel, _sz, 
_iprot) \
{ .tlb = _tlb, .epn = _epn, .rpn = _rpn, .perms = _perms, \
  .wimge = _wimge, .ts = _ts, .esel = _esel, .tsize = _sz, .iprot = 
_iprot }
-- 
1.6.0.6

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


Re: [U-Boot] [PATCH] board/linkstation/ide.c: Fix compile warning

2009-09-11 Thread Scott Wood
On Fri, Sep 11, 2009 at 02:00:06PM +0200, Wolfgang Denk wrote:
 In message pine.lnx.4.64.0909111259280.6...@axis700.grange you wrote:
  On Fri, 11 Sep 2009, Wolfgang Denk wrote:
   Fix warning: ide.c:60: warning: dereferencing type-punned pointer will
   break strict-aliasing rules
   
   Signed-off-by: Wolfgang Denk w...@denx.de
   Cc: Guennadi Liakhovetski l...@denx.de
   ---
board/linkstation/ide.c |4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
   
   diff --git a/board/linkstation/ide.c b/board/linkstation/ide.c
   index 2c89d62..5dd1d0e 100644
   --- a/board/linkstation/ide.c
   +++ b/board/linkstation/ide.c
   @@ -54,10 +54,12 @@ int ide_preinit (void)
 if (devbusfn == -1)
 devbusfn = 
   pci_find_device(PCI_VENDOR_ID_ITE,PCI_DEVICE_ID_ITE_8212,0);
 if (devbusfn != -1) {
   + ulong *ide_bus_offset_ptr = ide_bus_offset[0];
   +
 status = 0;

 pci_read_config_dword (devbusfn, PCI_BASE_ADDRESS_0,
   -(u32 *) 
   ide_bus_offset[0]);
   +(u32 
   *)ide_bus_offset_ptr);
  
  Can we also use this occasion to get rid of this typecast?
 
 No, as this would result in
 
 ide.c:62: warning: passing argument 3 of 'pci_read_config_dword' from
 incompatible pointer type

What about something like:

u32 ide_bus_offset32;
pci_read_config_dword(..., ide_bus_offset32);
ide_bus_offset[0] = ide_bus_offset32;

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


[U-Boot] [PATCH] ppc/85xx: Move code around to prep for NAND_SPL

2009-09-11 Thread Kumar Gala
If we move some of the functions in tlb.c around we need less
ifdefs.  The first stage loader just needs invalidate_tlb and
init_tlbs.

Signed-off-by: Kumar Gala ga...@kernel.crashing.org
---
 cpu/mpc85xx/tlb.c |   46 +++---
 1 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/cpu/mpc85xx/tlb.c b/cpu/mpc85xx/tlb.c
index f87a10d..44e80b1 100644
--- a/cpu/mpc85xx/tlb.c
+++ b/cpu/mpc85xx/tlb.c
@@ -32,6 +32,29 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+void invalidate_tlb(u8 tlb)
+{
+   if (tlb == 0)
+   mtspr(MMUCSR0, 0x4);
+   if (tlb == 1)
+   mtspr(MMUCSR0, 0x2);
+}
+
+void init_tlbs(void)
+{
+   int i;
+
+   for (i = 0; i  num_tlb_entries; i++) {
+   write_tlb(tlb_table[i].mas0,
+ tlb_table[i].mas1,
+ tlb_table[i].mas2,
+ tlb_table[i].mas3,
+ tlb_table[i].mas7);
+   }
+
+   return ;
+}
+
 void set_tlb(u8 tlb, u32 epn, u64 rpn,
 u8 perms, u8 wimge,
 u8 ts, u8 esel, u8 tsize, u8 iprot)
@@ -77,29 +100,6 @@ void disable_tlb(u8 esel)
 #endif
 }
 
-void invalidate_tlb(u8 tlb)
-{
-   if (tlb == 0)
-   mtspr(MMUCSR0, 0x4);
-   if (tlb == 1)
-   mtspr(MMUCSR0, 0x2);
-}
-
-void init_tlbs(void)
-{
-   int i;
-
-   for (i = 0; i  num_tlb_entries; i++) {
-   write_tlb(tlb_table[i].mas0,
- tlb_table[i].mas1,
- tlb_table[i].mas2,
- tlb_table[i].mas3,
- tlb_table[i].mas7);
-   }
-
-   return ;
-}
-
 static void tlbsx (const volatile unsigned *addr)
 {
__asm__ __volatile__ (tlbsx 0,%0 : : r (addr), m (*addr));
-- 
1.6.0.6

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


Re: [U-Boot] [PATCH] cmd_fdt.c: fix parse of byte streams and strings

2009-09-11 Thread Scott Wood
Ken MacLeod wrote:
 On Fri, Sep 11, 2009 at 11:30 AM, Jerry Van Baren 
 gerald.vanba...@ge.com mailto:gerald.vanba...@ge.com wrote:
 
 Scott Wood wrote:
   On Thu, Sep 10, 2009 at 08:23:27PM -0400, Jerry Van Baren wrote:
  fdt set /ether...@f00 interrupts this is a string
   can now handle multiple strings (words) by concatenating them with
   spaces (quoted strings still work the same as before because of
 hush's
   argument parsing)
  fdt set /ether...@f00 interrupts this is a string
  
   How do you set a string list, then?
 
 
 The original code did not support string lists and this patch does not 
 address string lists.

This patch takes the most obvious syntax for supporting a string list in the 
future, and makes it mean something else.

-Scott

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


Re: [U-Boot] [PATCH] cmd_fdt.c: fix parse of byte streams and strings

2009-09-11 Thread Ken MacLeod
On Fri, Sep 11, 2009 at 11:30 AM, Jerry Van Baren gerald.vanba...@ge.comwrote:

 Scott Wood wrote:
  On Thu, Sep 10, 2009 at 08:23:27PM -0400, Jerry Van Baren wrote:
 fdt set /ether...@f00 interrupts this is a string
  can now handle multiple strings (words) by concatenating them with
  spaces (quoted strings still work the same as before because of hush's
  argument parsing)
 fdt set /ether...@f00 interrupts this is a string
 
  How do you set a string list, then?


The original code did not support string lists and this patch does not
address string lists.


 I'm more concerned with the [] form because that really is a syntax
 change.  The original syntax with a single quoted argument will no
 longer be parsed if I understand the change (I need to apply the patch
 and confirm this):
 Old:
 fdt set /ether...@f00 interrupts [33 2 34 2 36 2]
 becomes
 fdt set /ether...@f00 interrupts [ 33 2 34 2 36 2 ]
 Note that the *must* be a space between [ and 33 and between 2 and
 ] because the [ and ] now have to be separate arguments.  This is
 what Andy did with  and  with no public outcry, so it is probably OK.

 --
  Does anybody have a problem with this syntax change? 
 --


There is no change in syntax as far as I can tell, it should parse byte
strings the same as one argument with spaces or as multiple arguments.
There remains a side effect (bug?) that if the the '[' and the next value
are separate arguments, a 0x00 gets inserted into the data.  The original
code either didn't parse the complete byte list (incrementing stridx early)
or hung in an endless loop.  This patch fixes that case.

The fix on strings is that in the original code if there were multiple
arguments then only the last argument was stored, at least now it stores
multiple arguments (collapsing inter-argument space, if any).

I don't have Hush enabled right now and the non-Hush quoting rules are still
a little fuzzy for me right now.  The 'fdt set' wasn't working at all for me
without this patch.

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


[U-Boot] [PATCH v4] ppc/85xx: add boot from NAND/eSDHC/eSPI support

2009-09-11 Thread Kumar Gala
From: Mingkai Hu mingkai...@freescale.com

The MPC8536E is capable of booting form NAND/eSDHC/eSPI, this patch
implements these three bootup methods in a unified way - all of these
use the general cpu/mpc85xx/start.S, and load the main image to L2SRAM
which lets us use the SPD to initialize the SDRAM.

For all three bootup methods, the bootup process can be divided into two
stages: the first stage will initialize the corresponding controller,
configure the L2SRAM, then copy the second stage image to L2SRAM and
jump to it. The second stage image is just like the general U-Boot image
to configure all the hardware and boot up to U-Boot command line.

When boot from NAND, the eLBC controller will first load the first stage
image to internal 4K RAM buffer because it's also stored on the NAND
flash. The first stage image, also call 4K NADN loader, will initialize
the L2SRAM, load the second stage image to L2SRAM and jump to it. The 4K
NAND loader's code comes from the corresponding nand_spl directory, along
with the code twisted by CONFIG_NAND_SPL.

When boot from eSDHC/eSPI, there's no such a first stage image because
the CPU ROM code does the same work. It will initialize the L2SRAM
according to the config addr/word pairs on the fixed address and
initialize the eSDHC/eSPI controller, then load the second stage image
to L2SRAM and jump to it.

The macro CONFIG_SYS_RAMBOOT is used to control the code to produce the
second stage image for all different bootup methods. It's set in the
board config file when one of the bootup methods above is selected.

Signed-off-by: Mingkai Hu mingkai...@freescale.com
Signed-off-by: Kumar Gala ga...@kernel.crashing.org
---
* Merged in changes from other patch into u-boot-nand.lds
* Fixed up and simplified tlb.c changes 

- k

 cpu/mpc85xx/cpu_init.c  |   19 ++
 cpu/mpc85xx/start.S |   23 +++-
 cpu/mpc85xx/tlb.c   |2 +
 cpu/mpc85xx/u-boot-nand.lds |  138 +++
 drivers/misc/fsl_law.c  |2 +
 5 files changed, 183 insertions(+), 1 deletions(-)
 create mode 100644 cpu/mpc85xx/u-boot-nand.lds

diff --git a/cpu/mpc85xx/cpu_init.c b/cpu/mpc85xx/cpu_init.c
index a54cf5d..5f66511 100644
--- a/cpu/mpc85xx/cpu_init.c
+++ b/cpu/mpc85xx/cpu_init.c
@@ -291,6 +291,25 @@ int cpu_init_r(void)
 
asm(msync;isync);
cache_ctl = l2cache-l2ctl;
+
+#if defined(CONFIG_SYS_RAMBOOT)  defined(CONFIG_SYS_INIT_L2_ADDR)
+   if (cache_ctl  MPC85xx_L2CTL_L2E) {
+   /* Clear L2 SRAM memory-mapped base address */
+   out_be32(l2cache-l2srbar0, 0x0);
+   out_be32(l2cache-l2srbar1, 0x0);
+
+   /* set MBECCDIS=0, SBECCDIS=0 */
+   clrbits_be32(l2cache-l2errdis,
+   (MPC85xx_L2ERRDIS_MBECC |
+MPC85xx_L2ERRDIS_SBECC));
+
+   /* set L2E=0, L2SRAM=0 */
+   clrbits_be32(l2cache-l2ctl,
+   (MPC85xx_L2CTL_L2E |
+MPC85xx_L2CTL_L2SRAM_ENTIRE));
+   }
+#endif
+
l2siz_field = (cache_ctl  28)  0x3;
 
switch (l2siz_field) {
diff --git a/cpu/mpc85xx/start.S b/cpu/mpc85xx/start.S
index 7a9..c9e91a9 100644
--- a/cpu/mpc85xx/start.S
+++ b/cpu/mpc85xx/start.S
@@ -57,10 +57,12 @@
GOT_ENTRY(_GOT2_TABLE_)
GOT_ENTRY(_FIXUP_TABLE_)
 
+#ifndef CONFIG_NAND_SPL
GOT_ENTRY(_start)
GOT_ENTRY(_start_of_vectors)
GOT_ENTRY(_end_of_vectors)
GOT_ENTRY(transfer_to_handler)
+#endif
 
GOT_ENTRY(__init_end)
GOT_ENTRY(_end)
@@ -239,10 +241,11 @@ _start_e500:
 
 #endif /* CONFIG_MPC8569 */
 
-   /* create a temp mapping in AS=1 to the 4M boot window */
lis r6,FSL_BOOKE_MAS0(1, 15, 0)@h
ori r6,r6,FSL_BOOKE_MAS0(1, 15, 0)@l
 
+#ifndef CONFIG_SYS_RAMBOOT
+   /* create a temp mapping in AS=1 to the 4M boot window */
lis r7,FSL_BOOKE_MAS1(1, 1, 0, 1, BOOKE_PAGESZ_4M)@h
ori r7,r7,FSL_BOOKE_MAS1(1, 1, 0, 1, BOOKE_PAGESZ_4M)@l
 
@@ -252,6 +255,20 @@ _start_e500:
/* The 85xx has the default boot window 0xff80 - 0x */
lis r9,FSL_BOOKE_MAS3(0xffc0, 0, (MAS3_SX|MAS3_SW|MAS3_SR))@h
ori r9,r9,FSL_BOOKE_MAS3(0xffc0, 0, (MAS3_SX|MAS3_SW|MAS3_SR))@l
+#else
+   /*
+* create a temp mapping in AS=1 to the 1M TEXT_BASE space, the main
+* image has been relocated to TEXT_BASE on the second stage.
+*/
+   lis r7,FSL_BOOKE_MAS1(1, 1, 0, 1, BOOKE_PAGESZ_1M)@h
+   ori r7,r7,FSL_BOOKE_MAS1(1, 1, 0, 1, BOOKE_PAGESZ_1M)@l
+
+   lis r8,FSL_BOOKE_MAS2(TEXT_BASE, (MAS2_I|MAS2_G))@h
+   ori r8,r8,FSL_BOOKE_MAS2(TEXT_BASE, (MAS2_I|MAS2_G))@l
+
+   lis r9,FSL_BOOKE_MAS3(TEXT_BASE, 0, (MAS3_SX|MAS3_SW|MAS3_SR))@h
+   ori r9,r9,FSL_BOOKE_MAS3(TEXT_BASE, 0, (MAS3_SX|MAS3_SW|MAS3_SR))@l
+#endif
 
mtspr   MAS0,r6

Re: [U-Boot] [PATCH v2 1/5] 85xx: add boot from NAND/eSDHC/eSPI support

2009-09-11 Thread Scott Wood
Mingkai Hu wrote:
 The MPC8536E is capable of booting form NAND/eSDHC/eSPI, this patch
 implements these three bootup methods in a unified way - all of these
 use the general cpu/mpc85xx/start.S, and load the main image to L2SRAM
 which lets us use the SPD to initialize the SDRAM.
 
 For all three bootup methods, the bootup process can be divided into two
 stages: the first stage will initialize the corresponding controller,
 configure the L2SRAM, then copy the second stage image to L2SRAM and
 jump to it. The second stage image is just like the general U-Boot image
 to configure all the hardware and boot up to U-Boot command line.
 
 When boot from NAND, the eLBC controller will first load the first stage
 image to internal 4K RAM buffer because it's also stored on the NAND
 flash. The first stage image, also call 4K NADN loader, will initialize

s/NADN/NAND/ here...

 +#ifdef CONFIG_NADN_SPL
  static void tlbsx (const volatile unsigned *addr)

And more importantly, here.

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


Re: [U-Boot] [PATCH v2 1/5] 85xx: add boot from NAND/eSDHC/eSPI support

2009-09-11 Thread Kumar Gala

On Sep 11, 2009, at 1:06 PM, Scott Wood wrote:

 Mingkai Hu wrote:
 The MPC8536E is capable of booting form NAND/eSDHC/eSPI, this patch
 implements these three bootup methods in a unified way - all of these
 use the general cpu/mpc85xx/start.S, and load the main image to  
 L2SRAM
 which lets us use the SPD to initialize the SDRAM.

 For all three bootup methods, the bootup process can be divided  
 into two
 stages: the first stage will initialize the corresponding controller,
 configure the L2SRAM, then copy the second stage image to L2SRAM and
 jump to it. The second stage image is just like the general U-Boot  
 image
 to configure all the hardware and boot up to U-Boot command line.

 When boot from NAND, the eLBC controller will first load the first  
 stage
 image to internal 4K RAM buffer because it's also stored on the NAND
 flash. The first stage image, also call 4K NADN loader, will  
 initialize

 s/NADN/NAND/ here...

will fix this one.

 +#ifdef CONFIG_NADN_SPL
 static void tlbsx (const volatile unsigned *addr)

 And more importantly, here.

I've fixed that one.. see my latest v4 patch.

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


Re: [U-Boot] [PATCH v2 1/2] mkconfig: split the board make target to multiple config targets

2009-09-11 Thread Wolfgang Denk
Dear Kumar Gala,

In message c93d00e1-0d25-40ab-aad9-707ddfd30...@kernel.crashing.org you wrote:
 
  Actually, I think the patch you quoted would not have had this  
  problem --

Seems I used a bad reference; sorry for that.

  unlike the one you merged, it doesn't create #defines for all boards,
  only those which request it by passing -t to mkconfig.
 
 I'm with Scott on this.  Why not just have it be a new explicit option  
 to mkconfig?

It's OK with me - and probably the least difficult way to solve the
issue.  Who will prepare a patch?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Our OS who art in CPU, UNIX be thy name.
Thy programs run, thy syscalls done,
In kernel as it is in user!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] board/flagadm/flash.c: fix compile warning

2009-09-11 Thread Wolfgang Denk
Dear Scott Wood,

In message 20090911163321.gb13...@b07421-ec1.am.freescale.net you wrote:

  -   ushort * d = (ushort*)da;
  +   ulong *dla = da;
  +   ushort *d = (ushort*)dla;
 
 I don't see how this is any more legal under strict aliasing rules -- you
 just made it a little more complicated and fooled the compiler into not
 warning.

Hm... I apologize if I don;t understand this any better, but for me
silencing the compiler was all that I intended at this moment ;-)

Do you have any better approach?

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
Eureka! -- Archimedes
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] board/flagadm/flash.c: fix compile warning

2009-09-11 Thread Scott Wood
Wolfgang Denk wrote:
 Dear Scott Wood,
 
 In message 20090911163321.gb13...@b07421-ec1.am.freescale.net you wrote:
 -   ushort * d = (ushort*)da;
 +   ulong *dla = da;
 +   ushort *d = (ushort*)dla;
 I don't see how this is any more legal under strict aliasing rules -- you
 just made it a little more complicated and fooled the compiler into not
 warning.
 
 Hm... I apologize if I don;t understand this any better, but for me
 silencing the compiler was all that I intended at this moment ;-)

I find that ironic given the previous claim that -fno-strict-aliasing was just 
silencing warnings. :-)

Especially since that actually turned off the problematic language feature 
(which is more intended for number crunching code than device drivers).

Much like your argument in favor of leaving d-cache disabled, this is a 
bootloader -- why complicate it to deal with a fancy compiler optimization that 
isn't going to make any performance difference that matters, could break things 
even in places where GCC doesn't warn, and is easily disabled?

 Do you have any better approach?

union {
u32 data32;
u16 data16[2];
} data;

data.data32 = da;

if ((addr[0]  data.data16[0]) != data.data16[0] ||
 (addr[1]  data.data16[1]) != data.data16[1])
return 2;

etc.

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


Re: [U-Boot] All rights reserved in drivers/mtd/nand/nand_util.c

2009-09-11 Thread Scott Wood
Paulraj, Sandeep wrote:
 I don't think we received a patch.
 
 How are we moving forward as this is required for the NAND driver to work.

I guess we start rewriting it -- and/or try to find any upstream code Guido may 
have based it on.

-Scott

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


Re: [U-Boot] [PATCH v2 2/5] NAND boot: change NAND loader's relocate SP to CONFIG param

2009-09-11 Thread Scott Wood
Mingkai Hu wrote:
 So that we can set the NAND loader's relocate stack pointer
 to the value other than the relocate address + 0x1.
 
 Signed-off-by: Mingkai Hu mingkai...@freescale.com
 ---
  board/freescale/mpc8313erdb/mpc8313erdb.c |2 +-
  board/sheldon/simpc8313/simpc8313.c   |2 +-
  include/configs/MPC8313ERDB.h |1 +
  include/configs/SIMPC8313.h   |1 +
  4 files changed, 4 insertions(+), 2 deletions(-)

Acked-by: Scott Wood scottw...@freescale.com

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


Re: [U-Boot] [PATCH v2 2/5] NAND boot: change NAND loader's relocate SP to CONFIG param

2009-09-11 Thread Kumar Gala

On Sep 11, 2009, at 2:04 PM, Scott Wood wrote:

 Mingkai Hu wrote:
 So that we can set the NAND loader's relocate stack pointer
 to the value other than the relocate address + 0x1.

 Signed-off-by: Mingkai Hu mingkai...@freescale.com
 ---
 board/freescale/mpc8313erdb/mpc8313erdb.c |2 +-
 board/sheldon/simpc8313/simpc8313.c   |2 +-
 include/configs/MPC8313ERDB.h |1 +
 include/configs/SIMPC8313.h   |1 +
 4 files changed, 4 insertions(+), 2 deletions(-)

 Acked-by: Scott Wood scottw...@freescale.com

applied to 85xx

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


[U-Boot] [RFC][PATCH] NAND boot: MPC8536DS support

2009-09-11 Thread Kumar Gala
MPC8536E can support booting from NAND flash which uses the
image u-boot-nand.bin. This image contains two parts: a 4K
NAND loader and a main U-Boot image. The former is appended
to the latter to produce u-boot-nand.bin. The 4K NAND loader
includes the corresponding nand_spl directory, along with the
code twisted by CONFIG_NAND_SPL. The main U-Boot image just
like a general U-Boot image except the parts that included by
CONFIG_SYS_RAMBOOT.

When power on, eLBC will automatically load from bank 0 the
4K NAND loader into the FCM buffer RAM where CPU can execute
the boot code directly. In the first stage, the NAND loader
copies itself to RAM or L2SRAM to free up the FCM buffer RAM,
then loads the main image from NAND flash to RAM or L2SRAM
and boot from it.

This patch implements the NAND loader to load the main image
into L2SRAM, so the main image can configure the RAM by using
SPD EEPROM. In the first stage, the NAND loader copies itself
to the second to last 4K address space, and uses the last 4K
address space as the initial RAM for stack.

Obviously, the size of L2SRAM shouldn't be less than the size
of the image used. If so, the workaround is to generate another
image that includes the code to configure the RAM by SPD and
load it to L2SRAM first, then relocate the main image to RAM
to boot up.

Signed-off-by: Mingkai Hu mingkai...@freescale.com
Signed-off-by: Kumar Gala ga...@kernel.crashing.org
---
I've made some changes:

* Fixed white space in mpc8536ds/u-boot.lds
* Fixed nand_spl/board/freescale/mpc8536ds/Makefile:
  - added dependancy on fixed_ivor.S (fixes build issue w/-jN)
  - added cpu_init_early.c to files we pull in from cpu/mpc85xx
* Use cpu_init_early.c and killed code out of nand_init.c

I'll follow up with other's that still need to be made.

- k

 Makefile   |1 +
 board/freescale/mpc8536ds/config.mk|7 ++
 board/freescale/mpc8536ds/tlb.c|   11 ++
 cpu/mpc85xx/nand_init.c|   73 ++
 include/configs/MPC8536DS.h|   96 ++
 nand_spl/board/freescale/mpc8536ds/Makefile|  127 
 nand_spl/board/freescale/mpc8536ds/nand_boot.c |   99 ++
 nand_spl/board/freescale/mpc8536ds/u-boot.lds  |   67 +
 8 files changed, 461 insertions(+), 20 deletions(-)
 create mode 100644 cpu/mpc85xx/nand_init.c
 create mode 100644 nand_spl/board/freescale/mpc8536ds/Makefile
 create mode 100644 nand_spl/board/freescale/mpc8536ds/nand_boot.c
 create mode 100644 nand_spl/board/freescale/mpc8536ds/u-boot.lds

diff --git a/Makefile b/Makefile
index 9764cea..de1ba50 100644
--- a/Makefile
+++ b/Makefile
@@ -2446,6 +2446,7 @@ vme8349_config:   unconfig
 ATUM8548_config:   unconfig
@$(MKCONFIG) $(@:_config=) ppc mpc85xx atum8548

+MPC8536DS_NAND_config \
 MPC8536DS_36BIT_config \
 MPC8536DS_config:   unconfig
@mkdir -p $(obj)include
diff --git a/board/freescale/mpc8536ds/config.mk 
b/board/freescale/mpc8536ds/config.mk
index c1d0525..b59df48 100644
--- a/board/freescale/mpc8536ds/config.mk
+++ b/board/freescale/mpc8536ds/config.mk
@@ -23,6 +23,13 @@
 #
 # mpc8536ds board
 #
+ifndef NAND_SPL
+ifeq ($(CONFIG_MK_MPC8536DS_NAND), y)
+TEXT_BASE = $(CONFIG_RAMBOOT_TEXT_BASE)
+LDSCRIPT := $(TOPDIR)/cpu/$(CPU)/u-boot-nand.lds
+endif
+endif
+
 ifndef TEXT_BASE
 TEXT_BASE = 0xeff8
 endif
diff --git a/board/freescale/mpc8536ds/tlb.c b/board/freescale/mpc8536ds/tlb.c
index 35a13d4..dc52d7f 100644
--- a/board/freescale/mpc8536ds/tlb.c
+++ b/board/freescale/mpc8536ds/tlb.c
@@ -71,6 +71,17 @@ struct fsl_e_tlb_entry tlb_table[] = {
SET_TLB_ENTRY(1, CONFIG_SYS_NAND_BASE, CONFIG_SYS_NAND_BASE_PHYS,
  MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
  0, 4, BOOKE_PAGESZ_1M, 1),
+
+#if defined(CONFIG_SYS_RAMBOOT)  defined(CONFIG_SYS_INIT_L2_ADDR)
+   /* *I*G - L2SRAM */
+   SET_TLB_ENTRY(1, CONFIG_SYS_INIT_L2_ADDR, CONFIG_SYS_INIT_L2_ADDR_PHYS,
+ MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
+ 0, 5, BOOKE_PAGESZ_256K, 1),
+   SET_TLB_ENTRY(1, CONFIG_SYS_INIT_L2_ADDR + 0x4,
+ CONFIG_SYS_INIT_L2_ADDR_PHYS + 0x4,
+ MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
+ 0, 6, BOOKE_PAGESZ_256K, 1),
+#endif
 };

 int num_tlb_entries = ARRAY_SIZE(tlb_table);
diff --git a/cpu/mpc85xx/nand_init.c b/cpu/mpc85xx/nand_init.c
new file mode 100644
index 000..dcbbc8d
--- /dev/null
+++ b/cpu/mpc85xx/nand_init.c
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 2009 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 

Re: [U-Boot] [RFC][PATCH] NAND boot: MPC8536DS support

2009-09-11 Thread Kumar Gala

On Sep 11, 2009, at 2:17 PM, Kumar Gala

 Makefile   |1 +
 board/freescale/mpc8536ds/config.mk|7 ++
 board/freescale/mpc8536ds/tlb.c|   11 ++
 cpu/mpc85xx/nand_init.c|   73 ++

how about renaming nand_init.c to cpu_init_nand.c

[snip]

 diff --git a/cpu/mpc85xx/nand_init.c b/cpu/mpc85xx/nand_init.c
 new file mode 100644
 index 000..dcbbc8d
 --- /dev/null
 +++ b/cpu/mpc85xx/nand_init.c
 @@ -0,0 +1,73 @@
 +/*
 + * Copyright (C) 2009 Freescale Semiconductor, Inc.

the '(C)' isnt needed.

 + *
 + * 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 common.h
 +#include asm/io.h
 +#include asm/mmu.h
 +#include asm/fsl_law.h
 +
 +DECLARE_GLOBAL_DATA_PTR;
 +
 +void cpu_init_f(void)
 +{
 + ccsr_lbc_t *lbc = (void *)(CONFIG_SYS_MPC85xx_LBC_ADDR);
 +
 + /*
 +  * LCRR - Clock Ratio Register - set up local bus timing
 +  * when needed
 +  */
 + out_be32(lbc-lcrr, LCRR_DBYP | LCRR_CLKDIV_8);
 +
 +#if defined(CONFIG_NAND_BR_PRELIM)  \
 +  defined(CONFIG_NAND_OR_PRELIM)
 + out_be32(lbc-br0, CONFIG_NAND_BR_PRELIM);
 + out_be32(lbc-or0, CONFIG_NAND_OR_PRELIM);
 + /* for FPGA */
 + out_be32(lbc-br3, CONFIG_SYS_BR3_PRELIM);
 + out_be32(lbc-or3, CONFIG_SYS_OR3_PRELIM);
 +#else
 +#error  CONFIG_NAND_BR_PRELIM, CONFIG_NAND_OR_PRELIM must be defined
 +#endif
 +
 +#if defined(CONFIG_SYS_RAMBOOT)  defined(CONFIG_SYS_INIT_L2_ADDR)
 + ccsr_l2cache_t *l2cache = (void *)CONFIG_SYS_MPC85xx_L2_ADDR;
 + uint l2srbar;
 + int i;
 +
 + l2srbar = CONFIG_SYS_INIT_L2_ADDR;
 + out_be32(l2cache-l2srbar0, l2srbar);
 +
 + /* set MBECCDIS=1, SBECCDIS=1 */
 + out_be32(l2cache-l2errdis,
 + (MPC85xx_L2ERRDIS_MBECC |
 +  MPC85xx_L2ERRDIS_SBECC));
 +
 + /* set L2E=1  L2SRAM=001 */
 + out_be32(l2cache-l2ctl,
 + (MPC85xx_L2CTL_L2E |
 +  MPC85xx_L2CTL_L2SRAM_ENTIRE));
 +
 + /* Initialize L2 SRAM to zero */
 + for (i = 0; i  CONFIG_SYS_L2_SIZE; i++)
 + ((char *)l2srbar)[i] = 0;
 +#endif
 +}


 diff --git a/include/configs/MPC8536DS.h b/include/configs/MPC8536DS.h
 index 4746e2e..6fab240 100644
 --- a/include/configs/MPC8536DS.h
 +++ b/include/configs/MPC8536DS.h
 @@ -31,6 +31,12 @@
 #define CONFIG_PHYS_64BIT 1
 #endif

 +#ifdef CONFIG_MPC8536DS_NAND

I think I changed this to make it build.  Once we resolve how we are  
tweaking mkconfig we can figure this out.

 +#define CONFIG_NAND_U_BOOT   1
 +#define CONFIG_RAMBOOT_NAND  1
 +#define CONFIG_RAMBOOT_TEXT_BASE 0xf8f82000
 +#endif
 +

[snip]

 diff --git a/nand_spl/board/freescale/mpc8536ds/nand_boot.c b/ 
 nand_spl/board/freescale/mpc8536ds/nand_boot.c
 new file mode 100644
 index 000..77973d1
 --- /dev/null
 +++ b/nand_spl/board/freescale/mpc8536ds/nand_boot.c
 @@ -0,0 +1,99 @@
 +/*
 + * Copyright (C) 2009 Freescale Semiconductor, Inc. All rights  
 reserved.

'All rights reserved' isn't acceptable (remove it).  Also get rid of  
'(C)'

 + *
 + * 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
 + *
 + */
[snip]


Also, we need to add MPC8536DS_NAND to MAKEALL

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


Re: [U-Boot] [PATCH] cmd_fdt.c: fix parse of byte streams and strings

2009-09-11 Thread Jerry Van Baren
Ken MacLeod wrote:
 On Fri, Sep 11, 2009 at 11:30 AM, Jerry Van Baren 
 gerald.vanba...@ge.com mailto:gerald.vanba...@ge.com wrote:
 
 Scott Wood wrote:
   On Thu, Sep 10, 2009 at 08:23:27PM -0400, Jerry Van Baren wrote:
  fdt set /ether...@f00 interrupts this is a string
   can now handle multiple strings (words) by concatenating them with
   spaces (quoted strings still work the same as before because of
 hush's
   argument parsing)
  fdt set /ether...@f00 interrupts this is a string
  
   How do you set a string list, then?
 
 The original code did not support string lists and this patch does not 
 address string lists.

The limitations of my original parsing shouldn't be taken as valid. ;-)

Scott has a very good point: the string parsing should take multiple 
(quoted) strings and turn them into proper string lists.  This is useful 
for things like compatibility lists.

 I'm more concerned with the [] form because that really is a syntax
 change.  The original syntax with a single quoted argument will no
 longer be parsed if I understand the change (I need to apply the patch
 and confirm this):
 Old:
fdt set /ether...@f00 interrupts [33 2 34 2 36 2]
 becomes
fdt set /ether...@f00 interrupts [ 33 2 34 2 36 2 ]
 Note that the *must* be a space between [ and 33 and between 2 and
 ] because the [ and ] now have to be separate arguments.  This is
 what Andy did with  and  with no public outcry, so it is
 probably OK.
 
 --
  Does anybody have a problem with this syntax change? 
 --
 
 
 There is no change in syntax as far as I can tell, it should parse byte 
 strings the same as one argument with spaces or as multiple arguments.  
 There remains a side effect (bug?) that if the the '[' and the next 

Bug. :-(

 value are separate arguments, a 0x00 gets inserted into the data.  The 
 original code either didn't parse the complete byte list (incrementing 
 stridx early) or hung in an endless loop.  This patch fixes that case.

OK, you made it better.  :-)

 The fix on strings is that in the original code if there were multiple 
 arguments then only the last argument was stored, at least now it stores 
 multiple arguments (collapsing inter-argument space, if any).

I agree with Scott, this is not good.  We should create lists.  If a 
user types
   fdt set /ether...@f00 interrupts this is a string
he probably won't get what he wanted, but he will get what he deserves[1]:
   this,is,a,string
i.e. a list of four strings.

 I don't have Hush enabled right now and the non-Hush quoting rules are 
 still a little fuzzy for me right now.  The 'fdt set' wasn't working at 
 all for me without this patch.

I have not run with non-Hush in quite a while.  Sounds like I need to. 
The quoting rules should be the same.  Ahhh, you need to quote with 
apostrophes ' not double-quotes .
   http://www.denx.de/wiki/DULG/CommandLineParsing
I don't know if spaces can be escaped with back-slashes off-hand, the 
page is silent on that.

   -- Ken

Thanks,
gvb

[1]http://www.lyricsdomain.com/18/rolling_stones/you_cant_always_get_what_you_want.html

And I went down to the corporation
To get my fair share of abuse
Singing, We're gonna vent our frustration
If we don't we're gonna blow a 50-amp fuse
Sing it to me now...

You can't always get what you want
You can't always get what you want
You can't always get what you want
But if you try sometimes well you just might find
You get what you need

(yes, I changed one word)
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] ppc/85xx: Ensure that MAS8 is zero when writing TLB entries.

2009-09-11 Thread Kumar Gala

On Sep 10, 2009, at 2:14 PM, Kumar Gala wrote:

 From: Scott Wood scottw...@freescale.com

 Its reset value is random, and we sometimes read uninitialized TLB
 arrays.  Make sure that we don't retain MAS8 from reading such an  
 entry
 if the VF bit in MAS8 is set, attempts to use the mapping will trap.

 Signed-off-by: Scott Wood scottw...@freescale.com
 ---
 cpu/mpc85xx/start.S |4 
 cpu/mpc85xx/tlb.c   |3 +++
 include/asm-ppc/processor.h |2 ++
 3 files changed, 9 insertions(+), 0 deletions(-)

applied to 85xx

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


Re: [U-Boot] [PATCH] ppc/85xx: Remove some bogus code from external interrupt handler.

2009-09-11 Thread Kumar Gala

On Sep 10, 2009, at 2:14 PM, Kumar Gala wrote:

 From: Scott Wood scottw...@freescale.com

 Skipping the interrupted instruction will accomplish nothing other
 than turning a spurious interrupt into a crash.

 External interrupts are not machine checks, so don't count them as  
 such.

 Signed-off-by: Scott Wood scottw...@freescale.com
 ---
 cpu/mpc85xx/traps.c |9 +
 1 files changed, 1 insertions(+), 8 deletions(-)

applied to 85xx

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


Re: [U-Boot] [PATCH] ppc/8xxx: Misc DDR related fixes

2009-09-11 Thread Kumar Gala

On Sep 10, 2009, at 3:30 PM, Kumar Gala wrote:

 * Fix setting of ESDMODE (MR1) register - the bit shifting was wrong
 * Fix the format string to match size in a debug print

 Signed-off-by: Kumar Gala ga...@kernel.crashing.org
 ---
 cpu/mpc8xxx/ddr/ctrl_regs.c|   10 +-
 cpu/mpc8xxx/ddr/ddr3_dimm_params.c |4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

applied to 85xx

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


[U-Boot] [PATCH 1/2] ppc/85xx: Change cpu_init_early_f so we can use with NAND SPL

2009-09-11 Thread Kumar Gala
Use write_tlb and don't use memset so we can use the same code for
cpu_init_early_f between NAND SPL and not.

Signed-off-by: Kumar Gala ga...@kernel.crashing.org
---
 cpu/mpc85xx/cpu_init.c |   34 +-
 1 files changed, 25 insertions(+), 9 deletions(-)

diff --git a/cpu/mpc85xx/cpu_init.c b/cpu/mpc85xx/cpu_init.c
index 5f66511..07856c2 100644
--- a/cpu/mpc85xx/cpu_init.c
+++ b/cpu/mpc85xx/cpu_init.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2007 Freescale Semiconductor.
+ * Copyright 2007-2009 Freescale Semiconductor, Inc.
  *
  * (C) Copyright 2003 Motorola Inc.
  * Modified by Xianghua Xiao, x.x...@motorola.com
@@ -132,15 +132,26 @@ void config_8560_ioports (volatile ccsr_cpm_t * cpm)
 /* We run cpu_init_early_f in AS = 1 */
 void cpu_init_early_f(void)
 {
+   u32 mas0, mas1, mas2, mas3, mas7;
+   int i;
+
/* Pointer is writable since we allocated a register for it */
gd = (gd_t *) (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_GBL_DATA_OFFSET);
 
-   /* Clear initial global data */
-   memset ((void *) gd, 0, sizeof (gd_t));
+   /*
+* Clear initial global data
+*   we don't use memset so we can share this code with NAND_SPL
+*/
+   for (i = 0; i  sizeof(gd_t); i++)
+   ((char *)gd)[i] = 0;
 
-   set_tlb(0, CONFIG_SYS_CCSRBAR, CONFIG_SYS_CCSRBAR_PHYS,
-   MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
-   1, 0, BOOKE_PAGESZ_4K, 0);
+   mas0 = MAS0_TLBSEL(0) | MAS0_ESEL(0);
+   mas1 = MAS1_VALID | MAS1_TID(0) | MAS1_TS | MAS1_TSIZE(BOOKE_PAGESZ_4K);
+   mas2 = FSL_BOOKE_MAS2(CONFIG_SYS_CCSRBAR, MAS2_I|MAS2_G);
+   mas3 = FSL_BOOKE_MAS3(CONFIG_SYS_CCSRBAR_PHYS, 0, MAS3_SW|MAS3_SR);
+   mas7 = FSL_BOOKE_MAS7(CONFIG_SYS_CCSRBAR_PHYS);
+
+   write_tlb(mas0, mas1, mas2, mas3, mas7);
 
/* set up CCSR if we want it moved */
 #if (CONFIG_SYS_CCSRBAR_DEFAULT != CONFIG_SYS_CCSRBAR_PHYS)
@@ -149,9 +160,14 @@ void cpu_init_early_f(void)
volatile u32 *ccsr_virt =
(volatile u32 *)(CONFIG_SYS_CCSRBAR + 0x1000);
 
-   set_tlb(0, (u32)ccsr_virt, CONFIG_SYS_CCSRBAR_DEFAULT,
-   MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
-   1, 1, BOOKE_PAGESZ_4K, 0);
+   mas0 = MAS0_TLBSEL(0) | MAS0_ESEL(1);
+   /* mas1 is the same as above */
+   mas2 = FSL_BOOKE_MAS2((u32)ccsr_virt, MAS2_I|MAS2_G);
+   mas3 = FSL_BOOKE_MAS3(CONFIG_SYS_CCSRBAR_DEFAULT, 0,
+   MAS3_SW|MAS3_SR);
+   mas7 = FSL_BOOKE_MAS7(CONFIG_SYS_CCSRBAR_DEFAULT);
+
+   write_tlb(mas0, mas1, mas2, mas3, mas7);
 
temp = in_be32(ccsr_virt);
out_be32(ccsr_virt, CONFIG_SYS_CCSRBAR_PHYS  12);
-- 
1.6.0.6

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


[U-Boot] [PATCH 2/2] ppc/85xx: Split out cpu_init_early into its own file for NAND_SPL

2009-09-11 Thread Kumar Gala
By pulling out cpu_init_early we can build just it and not all of
cpu_init for NAND_SPL.

Signed-off-by: Kumar Gala ga...@kernel.crashing.org
---
 cpu/mpc85xx/Makefile |1 +
 cpu/mpc85xx/cpu_init.c   |   51 
 cpu/mpc85xx/cpu_init_early.c |   76 ++
 3 files changed, 77 insertions(+), 51 deletions(-)
 create mode 100644 cpu/mpc85xx/cpu_init_early.c

diff --git a/cpu/mpc85xx/Makefile b/cpu/mpc85xx/Makefile
index a177f42..3ef00e8 100644
--- a/cpu/mpc85xx/Makefile
+++ b/cpu/mpc85xx/Makefile
@@ -65,6 +65,7 @@ COBJS-$(CONFIG_CPM2)  += serial_scc.o
 COBJS  = $(COBJS-y)
 COBJS  += cpu.o
 COBJS  += cpu_init.o
+COBJS  += cpu_init_early.o
 COBJS  += interrupts.o
 COBJS  += speed.o
 COBJS  += tlb.o
diff --git a/cpu/mpc85xx/cpu_init.c b/cpu/mpc85xx/cpu_init.c
index 07856c2..48a82ed 100644
--- a/cpu/mpc85xx/cpu_init.c
+++ b/cpu/mpc85xx/cpu_init.c
@@ -129,57 +129,6 @@ void config_8560_ioports (volatile ccsr_cpm_t * cpm)
 }
 #endif
 
-/* We run cpu_init_early_f in AS = 1 */
-void cpu_init_early_f(void)
-{
-   u32 mas0, mas1, mas2, mas3, mas7;
-   int i;
-
-   /* Pointer is writable since we allocated a register for it */
-   gd = (gd_t *) (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_GBL_DATA_OFFSET);
-
-   /*
-* Clear initial global data
-*   we don't use memset so we can share this code with NAND_SPL
-*/
-   for (i = 0; i  sizeof(gd_t); i++)
-   ((char *)gd)[i] = 0;
-
-   mas0 = MAS0_TLBSEL(0) | MAS0_ESEL(0);
-   mas1 = MAS1_VALID | MAS1_TID(0) | MAS1_TS | MAS1_TSIZE(BOOKE_PAGESZ_4K);
-   mas2 = FSL_BOOKE_MAS2(CONFIG_SYS_CCSRBAR, MAS2_I|MAS2_G);
-   mas3 = FSL_BOOKE_MAS3(CONFIG_SYS_CCSRBAR_PHYS, 0, MAS3_SW|MAS3_SR);
-   mas7 = FSL_BOOKE_MAS7(CONFIG_SYS_CCSRBAR_PHYS);
-
-   write_tlb(mas0, mas1, mas2, mas3, mas7);
-
-   /* set up CCSR if we want it moved */
-#if (CONFIG_SYS_CCSRBAR_DEFAULT != CONFIG_SYS_CCSRBAR_PHYS)
-   {
-   u32 temp;
-   volatile u32 *ccsr_virt =
-   (volatile u32 *)(CONFIG_SYS_CCSRBAR + 0x1000);
-
-   mas0 = MAS0_TLBSEL(0) | MAS0_ESEL(1);
-   /* mas1 is the same as above */
-   mas2 = FSL_BOOKE_MAS2((u32)ccsr_virt, MAS2_I|MAS2_G);
-   mas3 = FSL_BOOKE_MAS3(CONFIG_SYS_CCSRBAR_DEFAULT, 0,
-   MAS3_SW|MAS3_SR);
-   mas7 = FSL_BOOKE_MAS7(CONFIG_SYS_CCSRBAR_DEFAULT);
-
-   write_tlb(mas0, mas1, mas2, mas3, mas7);
-
-   temp = in_be32(ccsr_virt);
-   out_be32(ccsr_virt, CONFIG_SYS_CCSRBAR_PHYS  12);
-   temp = in_be32((volatile u32 *)CONFIG_SYS_CCSRBAR);
-   }
-#endif
-
-   init_laws();
-   invalidate_tlb(0);
-   init_tlbs();
-}
-
 /*
  * Breathe some life into the CPU...
  *
diff --git a/cpu/mpc85xx/cpu_init_early.c b/cpu/mpc85xx/cpu_init_early.c
new file mode 100644
index 000..7886f86
--- /dev/null
+++ b/cpu/mpc85xx/cpu_init_early.c
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2009 Freescale Semiconductor, Inc
+ *
+ * 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 common.h
+#include asm/processor.h
+#include asm/mmu.h
+#include asm/fsl_law.h
+
+DECLARE_GLOBAL_DATA_PTR;
+
+/* We run cpu_init_early_f in AS = 1 */
+void cpu_init_early_f(void)
+{
+   u32 mas0, mas1, mas2, mas3, mas7;
+   int i;
+
+   /* Pointer is writable since we allocated a register for it */
+   gd = (gd_t *) (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_GBL_DATA_OFFSET);
+
+   /*
+* Clear initial global data
+*   we don't use memset so we can share this code with NAND_SPL
+*/
+   for (i = 0; i  sizeof(gd_t); i++)
+   ((char *)gd)[i] = 0;
+
+   mas0 = MAS0_TLBSEL(0) | MAS0_ESEL(0);
+   mas1 = MAS1_VALID | MAS1_TID(0) | MAS1_TS | MAS1_TSIZE(BOOKE_PAGESZ_4K);
+   mas2 = FSL_BOOKE_MAS2(CONFIG_SYS_CCSRBAR, MAS2_I|MAS2_G);
+   mas3 = FSL_BOOKE_MAS3(CONFIG_SYS_CCSRBAR_PHYS, 0, MAS3_SW|MAS3_SR);
+   mas7 = FSL_BOOKE_MAS7(CONFIG_SYS_CCSRBAR_PHYS);
+
+   write_tlb(mas0, mas1, mas2, mas3, mas7);
+
+   /* set up CCSR if we want it moved */
+#if (CONFIG_SYS_CCSRBAR_DEFAULT != CONFIG_SYS_CCSRBAR_PHYS)
+   {
+

[U-Boot] [PATCH v2] cmd_fdt.c: fix parse of byte streams and strings

2009-09-11 Thread Ken MacLeod
Commit 4abd844d8e extended the fdt command parser to handle property
strings which are split across multiple arguments but it was broken for
byte streams and strings.

Byte stream parsing:

 * Fixes where it would terminate early or go into an endless loop.

 * Fixes a 0x00 being inserted into the data if there is a space after
   '[' or a separate argument.

 * Fixes dereferencing the argument pointer after the last argument.

 * Checks for bad characters.

String parsing:

 * Treat multiple arguments as a string list.  This fixes an issue where
   only the last argument was stored.

Signed-off-by: Ken MacLeod k...@bitsko.slc.ut.us
---

The previous version of this patch 1) only fixed the first byte stream
issue above and 2) concatenated the string arguments rather than
creating a list (pointed out by Scott Wood).

 common/cmd_fdt.c |   23 +++
 1 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/common/cmd_fdt.c b/common/cmd_fdt.c
index 8683772..919a0bf 100644
--- a/common/cmd_fdt.c
+++ b/common/cmd_fdt.c
@@ -574,14 +574,18 @@ static int fdt_parse_prop(char **newval, int count, char 
*data, int *len)
 * Byte stream.  Convert the values.
 */
newp++;
-   while ((*newp != ']')  (stridx  count)) {
-   tmp = simple_strtoul(newp, newp, 16);
-   *data++ = tmp  0xFF;
-   *len= *len + 1;
+   while ((stridx  count)  (*newp != ']')) {
while (*newp == ' ')
newp++;
-   if (*newp != '\0')
+   if (*newp == '\0') {
newp = newval[++stridx];
+   continue;
+   }
+   if (!isxdigit(*newp))
+   break;
+   tmp = simple_strtoul(newp, newp, 16);
+   *data++ = tmp  0xFF;
+   *len= *len + 1;
}
if (*newp != ']') {
printf(Unexpected character '%c'\n, *newp);
@@ -589,12 +593,15 @@ static int fdt_parse_prop(char **newval, int count, char 
*data, int *len)
}
} else {
/*
-* Assume it is a string.  Copy it into our data area for
-* convenience (including the terminating '\0').
+* Assume it is one or more strings.  Copy it into our
+* data area for convenience (including the
+* terminating '\0's).
 */
while (stridx  count) {
-   *len = strlen(newp) + 1;
+   size_t length = strlen(newp) + 1;
strcpy(data, newp);
+   data += length;
+   *len += length;
newp = newval[++stridx];
}
}
-- 
1.5.4.7

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


Re: [U-Boot] [PATCH v2] cmd_fdt.c: fix parse of byte streams and strings

2009-09-11 Thread Jerry Van Baren
Ken MacLeod wrote:
 Commit 4abd844d8e extended the fdt command parser to handle property
 strings which are split across multiple arguments but it was broken for
 byte streams and strings.

[snip]

 Signed-off-by: Ken MacLeod k...@bitsko.slc.ut.us
 ---
 
 The previous version of this patch 1) only fixed the first byte stream
 issue above and 2) concatenated the string arguments rather than
 creating a list (pointed out by Scott Wood).

Thanks!  I'll check it out and queue it up.

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


  1   2   >