ppc4xx: Add GDsys CompactCenter board support.
PATCH v2 1/1 ppc4xx: Add GDsys CompactCenter board support.
Board support for the Guntermann & Drunck CompactCenter and DevCon-Center.
Based on the AMCC Canyonlands board support by Stefan Roese.
---
Changes since v1:
- removed dead code
- whitespace cleanup
- simplified code for nand/nor distinction in board/gdsys/compactcenter/bootstrap.c
MAINTAINERS | 2 + MAKEALL | 2 + Makefile | 8 + board/gdsys/compactcenter/Makefile | 52 +++ board/gdsys/compactcenter/bootstrap.c | 164 ++++++++++ board/gdsys/compactcenter/compactcenter.c | 326 +++++++++++++++++++ board/gdsys/compactcenter/config.mk | 41 +++ board/gdsys/compactcenter/init.S | 97 ++++++ board/gdsys/compactcenter/u-boot.lds | 144 +++++++++ include/configs/compactcenter.h | 495 +++++++++++++++++++++++++++++ 10 files changed, 1331 insertions(+), 0 deletions(-) create mode 100644 board/gdsys/compactcenter/Makefile create mode 100644 board/gdsys/compactcenter/bootstrap.c create mode 100644 board/gdsys/compactcenter/compactcenter.c create mode 100644 board/gdsys/compactcenter/config.mk create mode 100644 board/gdsys/compactcenter/init.S create mode 100644 board/gdsys/compactcenter/u-boot.lds create mode 100644 include/configs/compactcenter.h
MAINTAINERS +2 -0
@@ -135,6 +135,8 @@ Jon Diekema <[email protected]> Dirk Eibach <[email protected]> + compactcenter PPC460EX + devconcenter PPC460EX gdppc440etx PPC440EP/GR neo PPC405EP
MAKEALL +2 -0
@@ -183,6 +183,7 @@ LIST_4xx=" \ canyonlands \ canyonlands_nand \ CMS700 \ + compactcenter \ CPCI2DP \ CPCI405 \ CPCI4052 \
@@ -193,6 +194,7 @@ LIST_4xx=" \ csb272 \ csb472 \ DASA_SIM \ + devconcenter \ DP405 \ DU405 \ DU440 \
Makefile +8 -0
@@ -1299,6 +1299,14 @@ CATcenter_33_config: unconfig CMS700_config: unconfig @$(MKCONFIG) $(@:_config=) ppc ppc4xx cms700 esd +# Compact-Center & DevCon-Center use different U-Boot images +compactcenter_config \ +devconcenter_config: unconfig + @mkdir -p $(obj)include + @echo "#define CONFIG_$$(echo $(subst ,,$(@:_config=)) | \ + tr '[:lower:]' '[:upper:]')" >$(obj)include/config.h + @$(MKCONFIG) -n $@ -a compactcenter ppc ppc4xx compactcenter gdsys + CPCI2DP_config: unconfig @$(MKCONFIG) $(@:_config=) ppc ppc4xx cpci2dp esd
board/gdsys/compactcenter/Makefile new file +52 -0
52 lines not on this page · raw message
board/gdsys/compactcenter/bootstrap.c new file +164 -0
164 lines not on this page · raw message
board/gdsys/compactcenter/compactcenter.c new file +326 -0
326 lines not on this page · raw message
board/gdsys/compactcenter/config.mk new file +41 -0
41 lines not on this page · raw message
board/gdsys/compactcenter/init.S new file +97 -0
97 lines not on this page · raw message
board/gdsys/compactcenter/u-boot.lds new file +144 -0
144 lines not on this page · raw message
include/configs/compactcenter.h new file +495 -0
495 lines not on this page · raw message
Signature · 1 line
1.5.6.5
PATCH v2 1/1 ppc4xx: Add GDsys CompactCenter board support.
Hi Dirk,
Quoted 5 lines · On Monday 13 July 2009 10:35:58 Dirk Eibach wrote:
(quoted diff) +0
-0
b/board/gdsys/compactcenter/compactcenter.cnew file mode 100644 index 0000000..9f1e49dboard/gdsys/compactcenter/compactcenter.c new file +0
-0
<snip>
board/gdsys/compactcenter/compactcenter.c line 127
Quoted 6 lines
board/gdsys/compactcenter/compactcenter.c new file +6
-0+int get_cpu_num (void ) +{ +int cpu =NA_OR_UNKNOWN_CPU ; + +return cpu; +}
Do you really need this function?
<snip>
board/gdsys/compactcenter/compactcenter.c line 286
Quoted 3 lines
board/gdsys/compactcenter/compactcenter.c new file +3
-0+#if defined(CONFIG_OF_LIBFDT ) && defined(CONFIG_OF_BOARD_SETUP ) +void ft_board_setup (void *blob,bd_t *bd) +{
Please check the latest version of this code in canyonlands.c. It's now using the 4xx common __ft_board_setup() function. Please move to this version as well.
<snip>
Quoted 27 lines
+++
b/include/configs/compactcenter.hboard/gdsys/compactcenter/compactcenter.c new file +25
-0@@ -0,0 +1,495 @@ +/* +* (C) Copyright 2009 +* Dirk Eibach, Guntermann & Drunck GmbH, eibach at gdsys.de +* +* Based on include/configs/canyonlands.h +* (C) Copyright 2008 +* Stefan Roese, DENX Software Engineering, sr at denx.de. +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, +* MA 02111-1307 USA +*/ + +/*
board/gdsys/compactcenter/compactcenter.c line 35
Quoted 10 lines
board/gdsys/compactcenter/compactcenter.c new file +10
-0+* compactcenter.h - configuration for CompactCenter (460EX) +*/ +#ifndef __CONFIG_H +#define __CONFIG_H + +/* +* High Level Configuration Options +*/ +/* +* This config file is used for Canyonlands and DevCon-Center
Canyonlands?
<snip>
board/gdsys/compactcenter/compactcenter.c line 45
Quoted 10 lines
board/gdsys/compactcenter/compactcenter.c new file +10
-0+/* +* PPC4xx GPIO Configuration +*/ +/* 460EX: Use USB configuration */ +#define CONFIG_SYS_4xx_GPIO_TABLE { \ +/* Out Alternate1 Alternate2 Alternate3 */ \ +{ \ +/* GPIO Core 0 */ \ +/* GPIO0 GMC1TxD(0) USB2HostD(0) */ \ +{GPIO0_BASE, GPIO_BI , GPIO_ALT1, GPIO_OUT_0}, \
I prefer to not split the too long lines in this CONFIG_SYS_4xx_GPIO_TABLE macro. I know that the resulting lines are > 80 chars, but it really is *much* better readable and maintainable this way.
Best regards,
Stefan
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================
Eibach
PATCH v2 1/1 ppc4xx: Add GDsys CompactCenter board support.
Quoted 11 lines
Quoted 4 lines
(quoted diff) +0
-0
b/board/gdsys/compactcenter/compactcenter.cnew file mode100644 index
Quoted 3 lines
0000000..9f1e49d
board/gdsys/compactcenter/compactcenter.c new file +0
-0<snip>
Quoted 7 lines
Quoted 1 line
+#if
defined(CONFIG_OF_LIBFDT)&&
defined(CONFIG_OF_BOARD_SETUP)voidQuoted 1 line
+ft_board_setup(void *blob,
bd_t*bd) {Please check the latest version of this code in
canyonlands.c. It's now using the 4xx common__ft_board_setup()function. Please move to this version as well.
This code in canyonlands.c does not work for me:
void ft_board_setup(void *blob, bd_t *bd)
{
u32 val[4];
int rc;
__ft_board_setup(blob, bd);
/* Fixup NOR mapping */
val[0] = CONFIG_SYS_NOR_CS; /* chip select number */
val[1] = 0; /* always 0 */
val[2] = CONFIG_SYS_FLASH_BASE_PHYS_L; /* we fixed up
this address */
val[3] = gd->bd->bi_flashsize;
rc = fdt_find_and_setprop(blob, "/plb/opb/ebc", "ranges",
val, sizeof(val), 1);__ft_board_setup() sets the property "ranges", with an entry for every member of EBC_NUM_BANKS.
Then the so called "fixup" happens and the property "ranges" is set again, this time with only one entry (for the nor flash). All other entries are lost.
Cheers
Dirk
PATCH v2 1/1 ppc4xx: Add GDsys CompactCenter board support.
Quoted 22 lines · Dirk
Quoted 3 lines
Please check the latest version of this code in
canyonlands.c. It's now using the 4xx common__ft_board_setup()function. Please move to this version as well.This code in
canyonlands.cdoes not work for me:void
ft_board_setup(void *blob, bd_t *bd){ u32 val[4]; int rc; __ft_board_setup(blob, bd); /* Fixup NOR mapping */ val[0] = CONFIG_SYS_NOR_CS; /* chip select number */ val[1] = 0; /* always 0 */ val[2] = CONFIG_SYS_FLASH_BASE_PHYS_L; /* we fixed up this address */ val[3] = gd->bd->bi_flashsize; rc = fdt_find_and_setprop(blob, "/plb/opb/ebc", "ranges", val, sizeof(val), 1);
Quoted 5 lines
__ft_board_setup()sets the property "ranges", with an entry for every member ofEBC_NUM_BANKS.
Then the so called "fixup" happens and the property "ranges" is set again, this time with only one entry (for the nor flash). All other entries are lost.
I see. I didn't spot this problem in the original patch. Thanks for catching.
It shouldn't be too hard to fix this problem by reading the complete ranges array back and patching only the first entry and re-writing ranges again.
Thanks.
Best regards,
Stefan
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================
PATCH v2 1/1 ppc4xx: Add GDsys CompactCenter board support.
Hi,
Quoted 31 lines · Stefan Roese
Quoted 22 lines · Dirk
Quoted 4 lines
Please check the latest version of this code in
canyonlands.c. It's now using the 4xx common__ft_board_setup()function. Please move to this version as well.This code in
canyonlands.cdoes not work for me:void
ft_board_setup(void *blob, bd_t *bd){ u32 val[4]; int rc; __ft_board_setup(blob, bd); /* Fixup NOR mapping */ val[0] = CONFIG_SYS_NOR_CS; /* chip select number */ val[1] = 0; /* always 0 */ val[2] = CONFIG_SYS_FLASH_BASE_PHYS_L; /* we fixed up this address */ val[3] = gd->bd->bi_flashsize; rc = fdt_find_and_setprop(blob, "/plb/opb/ebc", "ranges", val, sizeof(val), 1);Quoted 6 lines
__ft_board_setup()sets the property "ranges", with an entry for every member ofEBC_NUM_BANKS.
Then the so called "fixup" happens and the property "ranges" is set again, this time with only one entry (for the nor flash). All other entries are lost.
Quoted 6 lines
I see. I didn't spot this problem in the original patch. Thanks for catching.
It shouldn't be too hard to fix this problem by reading the complete ranges array back and patching only the first entry and re-writing ranges again.
I think my first patch that open-coded part of ft_board_setup() related to EBC ranges
was correct and tested on real hardware. I admit that I didn't test the second version
of the patch, as I didn't have the hardware at hand.
I'll submit a fix soon, but I still don't have hardware for testing, so I'd appreciate your
help with that.
Felix.
Eibach
PATCH v2 1/1 ppc4xx: Add GDsys CompactCenter board support.
Quoted 20 lines
Quoted 5 lines
Quoted 5 lines
__ft_board_setup()sets the property "ranges", with an entry for every member ofEBC_NUM_BANKS.
Then the so called "fixup" happens and the property"ranges" is set
Quoted 1 line
Quoted 1 line
again, this time with only one entry (for the nor flash).
All other
Quoted 4 lines
Quoted 2 lines
entries are lost.
I see. I didn't spot this problem in the original patch.
Thanks for catching.
Quoted 2 lines
It shouldn't be too hard to fix this problem by reading the
complete
Quoted 1 line
ranges array back and patching only the first entry and
re-writing ranges again.
Quoted 2 lines
Quoted 7 lines
I think my first patch that open-coded part of
ft_board_setup()related to EBC ranges was correct and tested on real hardware. I admit that I didn't test the second version of the patch, as I didn't have the hardware at hand.I'll submit a fix soon, but I still don't have hardware for testing, so I'd appreciate your help with that.
Hmm, maybe something generic in fdt_support.c would be nice, like
fdt_find_and_modify_prop(void *fdt, const char *node, const char *prop,
const void *val, int len, int pos, int create)
Cheers
Dirk
PATCH v2 1/1 ppc4xx: Add GDsys CompactCenter board support.
In reply to Felix RadenskyFelix,
Quoted 9 lines · On Wednesday 15 July 2009 11:24:07 Felix Radensky wrote:
I think my first patch that open-coded part of
ft_board_setup()related to EBC ranges
was correct and tested on real hardware. I admit that I didn't test the second version
of the patch, as I didn't have the hardware at hand.I'll submit a fix soon, but I still don't have hardware for testing, so I'd appreciate your
help with that.
Any news on this issue? Would be great if you could find the time to submit a patch for this. Dirk (?) and I will do the testing.
Thanks.
Best regards,
Stefan
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================
PATCH v2 1/1 ppc4xx: Add GDsys CompactCenter board support.
Hi, Stefan
Quoted 10 lines · Stefan Roese
Felix,
Quoted 6 lines · On Wednesday 15 July 2009 11:24:07 Felix Radensky wrote:
I think my first patch that open-coded part of
ft_board_setup()related to EBC ranges
was correct and tested on real hardware. I admit that I didn't test the second version
of the patch, as I didn't have the hardware at hand.
Quoted 9 lines
Quoted 4 lines
I'll submit a fix soon, but I still don't have hardware for testing, so I'd appreciate your
help with that.Any news on this issue? Would be great if you could find the time to submit a patch for this. Dirk (?) and I will do the testing.
The problem with approach you suggest (copy ranges array, modify first entry, rewrite
ranges array), is that ranges property doesn't cover all chip selects, only populated ones,
and NOR is not always on CS0 (in case of boot from NAND). So you don't really know
which entry should be modified.
Do you have any other ideas how to do this elegantly, without copying code from generic ft_board_setup() ?
Felix.
Felix.