Re: [U-Boot] [PATCH 4/8 v2] powerpc/85xx: add TPL_BOOT support

2011-01-24 Thread Wolfgang Denk
Dear Haiying Wang,

In message 1295840749.2196.3.camel@haiying-laptop you wrote:

   +#ifdef CONFIG_FSL_CORENET
   + return (gd-bus_clk + 8) / 16;
   +#else
   + return (gd-bus_clk + 4UL)/8UL;
   +#endif
  
  This looks inconsistent. Either this should be ... +8UL) / 16UL or
  ... + 4) / 8;
 This part was copied from arch/powerpc/cpu/mpc85xx/cpu.c, just want too 
 reduce the image size without including that file(cpu.c). Will fix it.

Instead of copying, can we please move it to some common code?


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
It is wrong always, everywhere and for everyone to  believe  anything
upon  insufficient  evidence.  - W. K. Clifford, British philosopher,
circa 1876
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/8 v2] powerpc/85xx: add TPL_BOOT support

2011-01-23 Thread Haiying Wang
On Sat, 2011-01-22 at 23:12 +0100, Wolfgang Denk wrote:
 You should not undo a previous copyright.  I guess you mean:
 
   Copyright 2009-2010 Freescale Semiconductor, Inc.
 
 ?

Yes. Sorry about it.

  +DECLARE_GLOBAL_DATA_PTR;
 
 Please move this up to top of file.
OK.

  +unsigned long get_tbclk(void)
  +{
  +#ifdef CONFIG_FSL_CORENET
  +   return (gd-bus_clk + 8) / 16;
  +#else
  +   return (gd-bus_clk + 4UL)/8UL;
  +#endif
 
 This looks inconsistent. Either this should be ... +8UL) / 16UL or
 ... + 4) / 8;
This part was copied from arch/powerpc/cpu/mpc85xx/cpu.c, just want too reduce 
the image size without including that file(cpu.c). Will fix it.

  -#ifndef CONFIG_NAND_SPL
  +#if !defined(CONFIG_NAND_SPL)  !defined(CONFIG_TPL_BOOT)
  GOT_ENTRY(_start)
  GOT_ENTRY(_start_of_vectors)
  GOT_ENTRY(_end_of_vectors)
  GOT_ENTRY(transfer_to_handler)
  -#endif
  +#endif /* !CONFIG_TPL_BOOT || !CONFIG_NAND_SPL*/
 
 Should that be
 
#endif /* !CONFIG_TPL_BOOT  !CONFIG_NAND_SPL*/
 
 instead?
Yes. Thanks for pointing out.

 And can we please make this consistent, i. e. as you do in the
 following:
 
  +#endif  /* !CONFIG_NAND_SPL  !CONFIG_TPL_BOOT */
 
OK.

Thanks.

Haiying



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


Re: [U-Boot] [PATCH 4/8 v2] powerpc/85xx: add TPL_BOOT support

2011-01-22 Thread Wolfgang Denk
Dear haiying.w...@freescale.com,

In message 1291218463-4211-1-git-send-email-haiying.w...@freescale.com you 
wrote:
 From: Haiying Wang haiying.w...@freescale.com
 
 Signed-off-by: Haiying Wang haiying.w...@freescale.com
 ---
 Splitted from TPL patch to only address 85xx changes
  arch/powerpc/cpu/mpc85xx/cpu_init_nand.c |   34 ++-
  arch/powerpc/cpu/mpc85xx/start.S |   12 ++--
  arch/powerpc/cpu/mpc85xx/u-boot-tpl.lds  |   99 
 ++
  3 files changed, 137 insertions(+), 8 deletions(-)
  create mode 100644 arch/powerpc/cpu/mpc85xx/u-boot-tpl.lds
...
 - * Copyright 2009 Freescale Semiconductor, Inc.
 + * Copyright 2010 Freescale Semiconductor, Inc.

You should not undo a previous copyright.  I guess you mean:

  Copyright 2009-2010 Freescale Semiconductor, Inc.

?

 +DECLARE_GLOBAL_DATA_PTR;

Please move this up to top of file.

 +unsigned long get_tbclk(void)
 +{
 +#ifdef CONFIG_FSL_CORENET
 + return (gd-bus_clk + 8) / 16;
 +#else
 + return (gd-bus_clk + 4UL)/8UL;
 +#endif

This looks inconsistent. Either this should be ... +8UL) / 16UL or
... + 4) / 8;

 -#ifndef CONFIG_NAND_SPL
 +#if !defined(CONFIG_NAND_SPL)  !defined(CONFIG_TPL_BOOT)
   GOT_ENTRY(_start)
   GOT_ENTRY(_start_of_vectors)
   GOT_ENTRY(_end_of_vectors)
   GOT_ENTRY(transfer_to_handler)
 -#endif
 +#endif /* !CONFIG_TPL_BOOT || !CONFIG_NAND_SPL*/

Should that be

   #endif /* !CONFIG_TPL_BOOT  !CONFIG_NAND_SPL*/

instead?

And can we please make this consistent, i. e. as you do in the
following:

 +#endif  /* !CONFIG_NAND_SPL  !CONFIG_TPL_BOOT */

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 price of curiosity is a terminal experience.
 - Terry Pratchett, _The Dark Side of the Sun_
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/8 v2] powerpc/85xx: add TPL_BOOT support

2011-01-21 Thread Kumar Gala

On Dec 1, 2010, at 9:47 AM, haiying.w...@freescale.com 
haiying.w...@freescale.com wrote:

 From: Haiying Wang haiying.w...@freescale.com
 
 Signed-off-by: Haiying Wang haiying.w...@freescale.com
 ---
 Splitted from TPL patch to only address 85xx changes
 arch/powerpc/cpu/mpc85xx/cpu_init_nand.c |   34 ++-
 arch/powerpc/cpu/mpc85xx/start.S |   12 ++--
 arch/powerpc/cpu/mpc85xx/u-boot-tpl.lds  |   99 ++
 3 files changed, 137 insertions(+), 8 deletions(-)
 create mode 100644 arch/powerpc/cpu/mpc85xx/u-boot-tpl.lds

Did you plan on review this patch?

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


[U-Boot] [PATCH 4/8 v2] powerpc/85xx: add TPL_BOOT support

2010-12-01 Thread Haiying.Wang
From: Haiying Wang haiying.w...@freescale.com

Signed-off-by: Haiying Wang haiying.w...@freescale.com
---
Splitted from TPL patch to only address 85xx changes
 arch/powerpc/cpu/mpc85xx/cpu_init_nand.c |   34 ++-
 arch/powerpc/cpu/mpc85xx/start.S |   12 ++--
 arch/powerpc/cpu/mpc85xx/u-boot-tpl.lds  |   99 ++
 3 files changed, 137 insertions(+), 8 deletions(-)
 create mode 100644 arch/powerpc/cpu/mpc85xx/u-boot-tpl.lds

diff --git a/arch/powerpc/cpu/mpc85xx/cpu_init_nand.c 
b/arch/powerpc/cpu/mpc85xx/cpu_init_nand.c
index 8fb27ab..decedca 100644
--- a/arch/powerpc/cpu/mpc85xx/cpu_init_nand.c
+++ b/arch/powerpc/cpu/mpc85xx/cpu_init_nand.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2009 Freescale Semiconductor, Inc.
+ * Copyright 2010 Freescale Semiconductor, Inc.
  *
  * See file CREDITS for list of people who contributed to this
  * project.
@@ -40,7 +40,8 @@ void cpu_init_f(void)
 #error  CONFIG_NAND_BR_PRELIM, CONFIG_NAND_OR_PRELIM must be defined
 #endif
 
-#if defined(CONFIG_SYS_RAMBOOT)  defined(CONFIG_SYS_INIT_L2_ADDR)
+#if defined(CONFIG_SYS_RAMBOOT)  defined(CONFIG_SYS_INIT_L2_ADDR) \
+!defined(CONFIG_TPL_BOOT)
ccsr_l2cache_t *l2cache = (void *)CONFIG_SYS_MPC85xx_L2_ADDR;
char *l2srbar;
int i;
@@ -60,4 +61,33 @@ void cpu_init_f(void)
for (i = 0; i  CONFIG_SYS_L2_SIZE; i++)
l2srbar[i] = 0;
 #endif
+#ifdef CONFIG_TPL_BOOT
+   init_used_tlb_cams();
+#endif
+}
+
+#ifdef CONFIG_TPL_BOOT
+/*
+ * Because the primary cpu's info is enough for the 2nd stage,  we define the
+ * cpu number to 1 so as to keep code size for 2nd stage binary as small as
+ * possible.
+ */
+int cpu_numcores()
+{
+   return 1;
+}
+
+DECLARE_GLOBAL_DATA_PTR;
+
+/*
+ * Get timebase clock frequency
+ */
+unsigned long get_tbclk(void)
+{
+#ifdef CONFIG_FSL_CORENET
+   return (gd-bus_clk + 8) / 16;
+#else
+   return (gd-bus_clk + 4UL)/8UL;
+#endif
 }
+#endif /* CONFIG_TPL_BOOT */
diff --git a/arch/powerpc/cpu/mpc85xx/start.S b/arch/powerpc/cpu/mpc85xx/start.S
index 945c1b8..12b0ebb 100644
--- a/arch/powerpc/cpu/mpc85xx/start.S
+++ b/arch/powerpc/cpu/mpc85xx/start.S
@@ -58,12 +58,12 @@
GOT_ENTRY(_GOT2_TABLE_)
GOT_ENTRY(_FIXUP_TABLE_)
 
-#ifndef CONFIG_NAND_SPL
+#if !defined(CONFIG_NAND_SPL)  !defined(CONFIG_TPL_BOOT)
GOT_ENTRY(_start)
GOT_ENTRY(_start_of_vectors)
GOT_ENTRY(_end_of_vectors)
GOT_ENTRY(transfer_to_handler)
-#endif
+#endif /* !CONFIG_TPL_BOOT || !CONFIG_NAND_SPL*/
 
GOT_ENTRY(__init_end)
GOT_ENTRY(_end)
@@ -435,7 +435,7 @@ _start_cont:
 
/* NOTREACHED - board_init_f() does not return */
 
-#ifndef CONFIG_NAND_SPL
+#if !defined(CONFIG_NAND_SPL)  !defined(CONFIG_TPL_BOOT)
. = EXC_OFF_SYS_RESET
.globl  _start_of_vectors
 _start_of_vectors:
@@ -877,7 +877,7 @@ in32:
 in32r:
lwbrx   r3,r0,r3
blr
-#endif  /* !CONFIG_NAND_SPL */
+#endif  /* !CONFIG_NAND_SPL  !CONFIG_TPL_BOOT */
 
 
/*--*/
 
@@ -1067,7 +1067,7 @@ clear_bss:
mr  r4,r10  /* Destination Address  */
bl  board_init_r
 
-#ifndef CONFIG_NAND_SPL
+#if !defined(CONFIG_NAND_SPL)  !defined(CONFIG_TPL_BOOT)
/*
 * Copy exception vector code to low memory
 *
@@ -1207,4 +1207,4 @@ setup_ivors:
 
 #include fixed_ivor.S
blr
-#endif /* !CONFIG_NAND_SPL */
+#endif /* !CONFIG_NAND_SPL  !CONFIG_TPL_BOOT */
diff --git a/arch/powerpc/cpu/mpc85xx/u-boot-tpl.lds 
b/arch/powerpc/cpu/mpc85xx/u-boot-tpl.lds
new file mode 100644
index 000..1c17acf
--- /dev/null
+++ b/arch/powerpc/cpu/mpc85xx/u-boot-tpl.lds
@@ -0,0 +1,99 @@
+/*
+ * Copyright 2010 Freescale Semiconductor, Inc.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+OUTPUT_ARCH(powerpc)
+PHDRS
+{
+  text PT_LOAD;
+  bss PT_LOAD;
+}
+
+SECTIONS
+{
+  /* Read-only sections, merged into text segment: */
+  . = + SIZEOF_HEADERS;
+  .interp : { *(.interp) }
+  .text  :
+  {
+*(.text*)
+   } :text
+_etext = .;
+PROVIDE (etext = .);
+.rodata:
+   {
+*(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
+  } :text