Removed CONFIG_NUM_CPUS for 85xx and 86xx Freescale processors.
PATCH 1/2 Removed CONFIG_NUM_CPUS for 85xx and 86xx Freescale processors.
The number of CPUs are getting detected dynamically by checking the processor SVR value. Also removed CONFIG_NUM_CPUS references from all the platforms with 85xx/86xx processors.
This can help to use the same u-boot image across the platforms.
Also revamped and corrected few Freescale Copyright messages.
--- common/cmd_mp.c | 6 +- cpu/mpc85xx/cpu.c | 111 ++++++++++++++++++++++++++--------------- cpu/mpc85xx/mp.c | 6 +- cpu/mpc85xx/release.S | 25 +++++++++- cpu/mpc85xx/speed.c | 4 +- cpu/mpc86xx/cpu.c | 44 ++++++++++++++-- cpu/mpc86xx/cpu_init.c | 2 +- include/asm-ppc/config.h | 41 +++++++++++++++ include/asm-ppc/global_data.h | 4 ++ include/asm-ppc/processor.h | 5 +- include/common.h | 2 + include/configs/MPC8572DS.h | 1 - include/configs/MPC8610HPCD.h | 1 - include/configs/MPC8641HPCN.h | 1 - include/configs/P2020DS.h | 1 - include/configs/XPEDITE5170.h | 1 - include/configs/XPEDITE5370.h | 1 - include/configs/sbc8641d.h | 1 - include/e500.h | 6 +-- lib_ppc/board.c | 4 ++ lib_ppc/bootm.c | 2 +- 21 files changed, 197 insertions(+), 72 deletions(-)
common/cmd_mp.c +3 -3
@@ -1,5 +1,5 @@/* -* Copyright 2008 Freescale Semiconductor, Inc. +* Copyright (C) 2008-2009 Freescale Semiconductor, Inc. All rights reserved. * * See file CREDITS for list of people who contributed to this * project.
@@ -34,9 +34,9 @@ cpu_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) } cpuid =simple_strtoul (argv[1 ],NULL ,10 ); -if (cpuid >=CONFIG_NUM_CPUS ) { +if (cpuid >=cpu_numcores ()) {printf ("Core num: %lu is out of range[0..%d]\n" , - cpuid,CONFIG_NUM_CPUS -1 ); + cpuid,cpu_numcores () -1 );return 1 ; }
cpu/mpc85xx/cpu.c +70 -41
147 lines not on this page · raw message
cpu/mpc85xx/mp.c +3 -3
@@ -1,5 +1,5 @@/* -* Copyright 2008 Freescale Semiconductor. +* Copyright (C) 2008-2009 Freescale Semiconductor, Inc. All rights reserved. * * See file CREDITS for list of people who contributed to this * project.
@@ -157,7 +157,7 @@ static void pq3_mp_up(unsigned long bootpg)out_be32 (&gur->devdisr, devdisr);/* release the hounds */ - up = ((1 <<CONFIG_NUM_CPUS ) -1 ); + up = ((1 <<cpu_numcores ()) -1 ); bpcr =in_be32 (&ecm->eebpcr); bpcr |= (up <<24 );out_be32 (&ecm->eebpcr, bpcr);
@@ -167,7 +167,7 @@ static void pq3_mp_up(unsigned long bootpg)/* wait for everyone */ while (timeout) {int i; -for (i =0 ; i <CONFIG_NUM_CPUS ; i++) { +for (i =0 ; i <cpu_numcores (); i++) {if (table[i *NUM_BOOT_ENTRY +BOOT_ENTRY_ADDR_LOWER ]) cpu_up_mask |= (1 << i); };
cpu/mpc85xx/release.S +24 -1
@@ -1,3 +1,26 @@ +/* + * Copyright (C) 2008-2009 Freescale Semiconductor, Inc. All rights reserved. + * Kumar Gala <[email protected]> + * + * 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 <config.h> #include <mpc85xx.h> #include <version.h>
@@ -203,7 +226,7 @@ __secondary_start_page: .align L1_CACHE_SHIFT .globl __spin_table __spin_table: - .space CONFIG_NUM_CPUS*ENTRY_SIZE + .space CONFIG_MAX_CPUS*ENTRY_SIZE /* Fill in the empty space. The actual reset vector is * the last word of the page */
cpu/mpc85xx/speed.c +2 -2
@@ -1,5 +1,5 @@/* -* Copyright 2004, 2007-2009 Freescale Semiconductor Inc. +* Copyright (C) 2004, 2007-2009 Freescale Semiconductor, Inc. All rights reserved. * (C) Copyright 2003 Motorola Inc. * Xianghua Xiao, (X.Xiao at motorola.com) *
@@ -51,7 +51,7 @@ void get_sys_info (sys_info_t * sysInfo)/* Divide before multiply to avoid integer * overflow for processor speeds above 2GHz */ half_freqSystemBus = sysInfo->freqSystemBus/2 ; -for (i =0 ; i <CONFIG_NUM_CPUS ; i++) { +for (i =0 ; i <cpu_numcores (); i++) { e500_ratio = ((gur->porpllsr) >> (i *8 +16 )) &0x3f ; sysInfo->freqProcessor[i] = e500_ratio * half_freqSystemBus; }
cpu/mpc86xx/cpu.c +38 -6
77 lines not on this page · raw message
cpu/mpc86xx/cpu_init.c +1 -1
@@ -129,7 +129,7 @@ void cpu_init_f(void)*/ int cpu_init_r (void ) { -#if (CONFIG_NUM_CPUS >1 ) +#if defined(CONFIG_MP )setup_mp ();#endif return 0 ;
include/asm-ppc/config.h +41 -0
45 lines not on this page · raw message
include/asm-ppc/global_data.h +4 -0
@@ -1,4 +1,5 @@/* +* Copyright (C) 2009 Freescale Semiconductor, Inc. All rights reserved. * (C) Copyright 2002 * Wolfgang Denk, DENX Software Engineering, wd at denx.de. *
@@ -92,6 +93,9 @@ typedef struct global_data {#if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx)u32 lbc_clk;#endif /* CONFIG_MPC85xx || CONFIG_MPC86xx */ +#if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx) +void *cpu; +#endif #if defined(CONFIG_MPC83xx) || defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx)u32 i2c1_clk;u32 i2c2_clk;
include/asm-ppc/processor.h +3 -2
@@ -1017,13 +1017,14 @@ n:struct cpu_type {char name[15 ];u32 soc_ver; +u32 num_cores; };struct cpu_type *identify_cpu (u32 ver);#if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx) -#define CPU_TYPE_ENTRY (n, v) \ - { .name = #n, .soc_ver = SVR_##v, } +#define CPU_TYPE_ENTRY (n, v, nc) \ + { .name = #n, .soc_ver = SVR_##v, .num_cores = (nc), }#else #if defined(CONFIG_MPC83xx)#define CPU_TYPE_ENTRY (x) {#x, SPR_##x}
include/common.h +2 -0
@@ -439,6 +439,8 @@ void ppcDWstore(unsigned int *addr, unsigned int *value);#endif /* $(CPU)/cpu.c */ +int cpu_numcores (void ); +int probecpu (void );int checkcpu (void );int checkicache (void );int checkdcache (void );
include/configs/MPC8572DS.h +0 -1
@@ -34,7 +34,6 @@#define CONFIG_MPC8572 1#define CONFIG_MPC8572DS 1#define CONFIG_MP 1/* support multiple processors */ -#define CONFIG_NUM_CPUS 2/* Number of CPUs in the system */ #define CONFIG_FSL_ELBC 1/* Has Enhanced localbus controller */ #define CONFIG_PCI 1/* Enable PCI/PCIE */
include/configs/MPC8610HPCD.h +0 -1
@@ -17,7 +17,6 @@#define CONFIG_MPC86xx 1/* MPC86xx */ #define CONFIG_MPC8610 1/* MPC8610 specific */ #define CONFIG_MPC8610HPCD 1/* MPC8610HPCD board specific */ -#define CONFIG_NUM_CPUS 1/* Number of CPUs in the system */ #define CONFIG_LINUX_RESET_VEC 0x100/* Reset vector used by Linux */ #define CONFIG_FSL_DIU_FB 1/* FSL DIU */
include/configs/MPC8641HPCN.h +0 -1
@@ -37,7 +37,6 @@#define CONFIG_MPC8641 1/* MPC8641 specific */ #define CONFIG_MPC8641HPCN 1/* MPC8641HPCN board specific */ #define CONFIG_MP 1/* support multiple processors */ -#define CONFIG_NUM_CPUS 2/* Number of CPUs in the system */ #define CONFIG_LINUX_RESET_VEC 0x100/* Reset vector used by Linux */ /*#define CONFIG_PHYS_64BIT 1*/ /* Place devices in 36-bit space */ #define CONFIG_ADDR_MAP 1/* Use addr map */
include/configs/P2020DS.h +0 -1
@@ -34,7 +34,6 @@#define CONFIG_P2020 1#define CONFIG_P2020DS 1#define CONFIG_MP 1/* support multiple processors */ -#define CONFIG_NUM_CPUS 2/* Number of CPUs in the system */ #define CONFIG_FSL_ELBC 1/* Has Enhanced localbus controller */ #define CONFIG_PCI 1/* Enable PCI/PCIE */
include/configs/XPEDITE5170.h +0 -1
@@ -34,7 +34,6 @@#define CONFIG_MPC8641 1/* MPC8641 specific */ #define CONFIG_XPEDITE5140 1/* MPC8641HPCN board specific */ #define CONFIG_SYS_BOARD_NAME "XPedite5170" -#define CONFIG_NUM_CPUS 1/* Number of CPUs in the system */ #define CONFIG_LINUX_RESET_VEC 0x100/* Reset vector used by Linux */ #define CONFIG_BOARD_EARLY_INIT_R /* Call board_pre_init */ #define CONFIG_RELOC_FIXUP_WORKS /* Fully relocate to SDRAM */
include/configs/XPEDITE5370.h +0 -1
@@ -36,7 +36,6 @@#define CONFIG_MPC8572 1#define CONFIG_XPEDITE5370 1#define CONFIG_SYS_BOARD_NAME "XPedite5370" -#define CONFIG_NUM_CPUS 2/* 2 Cores */ #define CONFIG_BOARD_EARLY_INIT_R /* Call board_pre_init */ #define CONFIG_RELOC_FIXUP_WORKS /* Fully relocate to SDRAM */
include/configs/sbc8641d.h +0 -1
@@ -41,7 +41,6 @@#define CONFIG_MPC8641 1/* MPC8641 specific */ #define CONFIG_SBC8641D 1/* SBC8641D board specific */ #define CONFIG_MP 1/* support multiple processors */ -#define CONFIG_NUM_CPUS 2/* Number of CPUs in the system */ #define CONFIG_LINUX_RESET_VEC 0x100/* Reset vector used by Linux */ #ifdef RUN_DIAG
include/e500.h +1 -5
@@ -8,13 +8,9 @@ #ifndef __ASSEMBLY__ -#ifndef CONFIG_NUM_CPUS -#define CONFIG_NUM_CPUS 1 -#endif - typedef struct { - unsigned long freqProcessor[CONFIG_NUM_CPUS]; + unsigned long freqProcessor[CONFIG_MAX_CPUS]; unsigned long freqSystemBus; unsigned long freqDDRBus; unsigned long freqLocalBus;
lib_ppc/board.c +4 -0
@@ -291,6 +291,10 @@ init_fnc_t *init_sequence[] = { board_early_init_f,#endif +#if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx) + probecpu, +#endif +#if !defined(CONFIG_8xx_CPUCLK_DEFAULT) get_clocks, /* get CPU and bus clocks (etc.) */#if defined(CONFIG_TQM8xxL) && !defined(CONFIG_TQM866M ) \
lib_ppc/bootm.c +1 -1
@@ -170,7 +170,7 @@ void arch_lmb_reserve(struct lmb *lmb)static void boot_prep_linux (void ) { -#if (CONFIG_NUM_CPUS >1 ) +#ifdef CONFIG_MP /* if we are MP make sure to flush the dcache() to any changes are made * visibile to all other cores */ flush_dcache ();
Signature · 1 line
1.5.6.5
PATCH 1/2 Removed CONFIG_NUM_CPUS for 85xx and 86xx Freescale processors.
Dear Poonam Aggrwal,
Quoted 2 lines · In message <[email protected]>…
The number of CPUs are getting detected dynamically by checking the processor SVR value. Also removed
CONFIG_NUM_CPUSreferences from all the platforms with 85xx/86xx processors.
Please restrict your line length to 70 characters or less.
...
cpu/mpc85xx/cpu.c int checkcpu (void) · line 136
Quoted 8 lines
cpu/mpc85xx/cpu.c +7
-0+#ifndef CONFIG_MP +if (cpu_numcores () >1 ) +puts ("#############################################\n" +"The system is detected to be MULTICORE,\n" +"but u-boot is built with UNI-CORE\n" +"To enable mutlticore Build set CONFIG_MP\n" +"#############################################\n\n" );#endif
Please use terse error messages. We don't print prose here.
cpu/mpc85xx/cpu.c int checkcpu (void) · line 142
Quoted 7 lines
cpu/mpc85xx/cpu.c +5
-2- cpu =identify_cpu (ver); -if (cpu) { +if (cpu_numcores () >1 ) { +volatile ccsr_pic_t *pic = (void *)(CONFIG_SYS_MPC85xx_PIC_ADDR); +printf ("CPU%d: " , pic->whoami); + } +else
Incorrect brace style.
Quoted 2 lines
cpu/mpc85xx/speed.c +0
-0
...
cpu/mpc85xx/speed.c void get_sys_info (sys_info_t * sysInfo) · line 54
Quoted 6 lines
cpu/mpc85xx/speed.c +1
-1@@ -51,7 +51,7 @@ void get_sys_info (sys_info_t * sysInfo)/* Divide before multiply to avoid integer * overflow for processor speeds above 2GHz */ half_freqSystemBus = sysInfo->freqSystemBus/2 ; -for (i =0 ; i <CONFIG_NUM_CPUS ; i++) { +for (i =0 ; i <cpu_numcores (); i++) {
Only one space before the '<', please.
...
Quoted 2 lines
cpu/mpc86xx/cpu.c +0
-0
...
Quoted 9 lines
cpu/mpc86xx/cpu.c +9
-0+int probecpu (void ) +{ +uint svr; +uint ver; + + svr =get_svr (); + ver =SVR_SOC_VER (svr); + + gd->cpu =identify_cpu (ver);
cpu/mpc86xx/cpu.c struct cpu_type *identify_cpu(u32 ver) · line 71
Quoted 10 lines
cpu/mpc86xx/cpu.c +10
-0+ +return 0 ; +} + +int cpu_numcores () { +struct cpu_type *cpu; + cpu = gd->cpu; +return cpu->num_cores; +} +
This seems to be identically repeated code. Please factor out into common code.
Quoted 15 lines
* Default board reset function
*/cpu/mpc86xx/cpu.c +1
-1@@ -66,9 +88,9 @@ checkcpu(void)uint ver;uint major, minor;char buf1[32 ], buf2[32 ]; +struct cpu_type *cpu;volatile immap_t *immap = (immap_t *)CONFIG_SYS_IMMR ;volatile ccsr_gur_t *gur = &immap->im_gur; -struct cpu_type *cpu;uint msscr0 =mfspr (MSSCR0 ); svr =get_svr ();@@ -76,10 +98,20 @@ checkcpu(void) major =SVR_MAJ (svr);
cpu/mpc86xx/cpu.c checkcpu(void) · line 108
Quoted 10 lines
cpu/mpc86xx/cpu.c +8
-0minor =SVR_MIN (svr); +#ifndef CONFIG_MP +if (cpu_numcores () >1 ) +puts ("#############################################\n" +"The system is detected to be MULTICORE,\n" +"but u-boot is built with UNI-CORE\n" +"To enable mutlticore Build set CONFIG_MP\n" +"#############################################\n\n" ); +#endif
Ditto.
cpu/mpc86xx/cpu.c checkcpu(void) · line 116
Quoted 9 lines
cpu/mpc86xx/cpu.c +3
-2puts ("CPU: " ); - cpu =identify_cpu (ver); -if (cpu) { + cpu = gd->cpu; + +if (cpu->name) {puts (cpu->name); }else {
No braces for one-line statements, please.
Quoted 38 lines
include/asm-ppc/config.h +30
-0@@ -37,4 +37,45 @@#endif #endif +#if defined(CONFIG_MPC8533 ) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8535 ) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8536 ) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8540 ) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8541 ) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8543 ) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8544 ) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8545 ) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8547 ) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8548 ) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8555 ) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8560 ) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8567 ) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8568 ) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8569 ) +#define CONFIG_MAX_CPUS 1
include/asm-ppc/config.h line 79
Quoted 10 lines
include/asm-ppc/config.h +10
-0+#elif defined(CONFIG_MPC8572 ) +#define CONFIG_MAX_CPUS 2 +#elif defined(CONFIG_P2020 ) +#define CONFIG_MAX_CPUS 2 + +#elif defined(CONFIG_MPC8610 ) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8641 ) +#define CONFIG_MAX_CPUS 2 +#endif
Sorry, but this does not scale. Please find a better solution.
include/asm-ppc/global_data.h line 2
Quoted 7 lines
include/asm-ppc/global_data.h +1
-0@@ -1,4 +1,5 @@/* +* Copyright (C) 2009 Freescale Semiconductor, Inc. All rights reserved.
On which base to you make such a claim?
include/asm-ppc/global_data.h typedef struct global_data { · line 98
Quoted 10 lines
include/asm-ppc/global_data.h +3
-0* (C) Copyright 2002 * Wolfgang Denk, DENX Software Engineering, wd at denx.de. * @@ -92,6 +93,9 @@ typedef struct global_data {#if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx)u32 lbc_clk;#endif /* CONFIG_MPC85xx || CONFIG_MPC86xx */ +#if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx) +void *cpu; +#endif
Because you added a sinle variable declaration? Come on, be reasonable...
Quoted 142 lines
include/asm-ppc/processor.h +3
-2@@ -1017,13 +1017,14 @@ n:struct cpu_type {char name[15 ];u32 soc_ver; +u32 num_cores; };struct cpu_type *identify_cpu (u32 ver);#if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx) -#define CPU_TYPE_ENTRY (n, v) \ - { .name = #n, .soc_ver = SVR_##v, } +#define CPU_TYPE_ENTRY (n, v, nc) \ + { .name = #n, .soc_ver = SVR_##v, .num_cores = (nc), }#else #if defined(CONFIG_MPC83xx)#define CPU_TYPE_ENTRY (x) {#x, SPR_##x}include/common.h +2
-0@@ -439,6 +439,8 @@ void ppcDWstore(unsigned int *addr, unsigned int *value);#endif /* $(CPU)/cpu.c */ +int cpu_numcores (void ); +int probecpu (void );int checkcpu (void );int checkicache (void );int checkdcache (void );include/configs/MPC8572DS.h +0
-1@@ -34,7 +34,6 @@#define CONFIG_MPC8572 1#define CONFIG_MPC8572DS 1#define CONFIG_MP 1/* support multiple processors */ -#define CONFIG_NUM_CPUS 2/* Number of CPUs in the system */ #define CONFIG_FSL_ELBC 1/* Has Enhanced localbus controller */ #define CONFIG_PCI 1/* Enable PCI/PCIE */ include/configs/MPC8610HPCD.h +0
-1@@ -17,7 +17,6 @@#define CONFIG_MPC86xx 1/* MPC86xx */ #define CONFIG_MPC8610 1/* MPC8610 specific */ #define CONFIG_MPC8610HPCD 1/* MPC8610HPCD board specific */ -#define CONFIG_NUM_CPUS 1/* Number of CPUs in the system */ #define CONFIG_LINUX_RESET_VEC 0x100/* Reset vector used by Linux */ #define CONFIG_FSL_DIU_FB 1/* FSL DIU */ include/configs/MPC8641HPCN.h +0
-1@@ -37,7 +37,6 @@#define CONFIG_MPC8641 1/* MPC8641 specific */ #define CONFIG_MPC8641HPCN 1/* MPC8641HPCN board specific */ #define CONFIG_MP 1/* support multiple processors */ -#define CONFIG_NUM_CPUS 2/* Number of CPUs in the system */ #define CONFIG_LINUX_RESET_VEC 0x100/* Reset vector used by Linux */ /*#define CONFIG_PHYS_64BIT 1*/ /* Place devices in 36-bit space */ #define CONFIG_ADDR_MAP 1/* Use addr map */ include/configs/P2020DS.h +0
-1@@ -34,7 +34,6 @@#define CONFIG_P2020 1#define CONFIG_P2020DS 1#define CONFIG_MP 1/* support multiple processors */ -#define CONFIG_NUM_CPUS 2/* Number of CPUs in the system */ #define CONFIG_FSL_ELBC 1/* Has Enhanced localbus controller */ #define CONFIG_PCI 1/* Enable PCI/PCIE */ include/configs/XPEDITE5170.h +0
-1@@ -34,7 +34,6 @@#define CONFIG_MPC8641 1/* MPC8641 specific */ #define CONFIG_XPEDITE5140 1/* MPC8641HPCN board specific */ #define CONFIG_SYS_BOARD_NAME "XPedite5170" -#define CONFIG_NUM_CPUS 1/* Number of CPUs in the system */ #define CONFIG_LINUX_RESET_VEC 0x100/* Reset vector used by Linux */ #define CONFIG_BOARD_EARLY_INIT_R /* Call board_pre_init */ #define CONFIG_RELOC_FIXUP_WORKS /* Fully relocate to SDRAM */ include/configs/XPEDITE5370.h +0
-1@@ -36,7 +36,6 @@#define CONFIG_MPC8572 1#define CONFIG_XPEDITE5370 1#define CONFIG_SYS_BOARD_NAME "XPedite5370" -#define CONFIG_NUM_CPUS 2/* 2 Cores */ #define CONFIG_BOARD_EARLY_INIT_R /* Call board_pre_init */ #define CONFIG_RELOC_FIXUP_WORKS /* Fully relocate to SDRAM */ include/configs/sbc8641d.h +0
-1@@ -41,7 +41,6 @@#define CONFIG_MPC8641 1/* MPC8641 specific */ #define CONFIG_SBC8641D 1/* SBC8641D board specific */ #define CONFIG_MP 1/* support multiple processors */ -#define CONFIG_NUM_CPUS 2/* Number of CPUs in the system */ #define CONFIG_LINUX_RESET_VEC 0x100/* Reset vector used by Linux */ #ifdef RUN_DIAG include/e500.h +1
-5@@ -8,13 +8,9 @@ #ifndef __ASSEMBLY__ -#ifndef CONFIG_NUM_CPUS -#define CONFIG_NUM_CPUS 1 -#endif - typedef struct { - unsigned long freqProcessor[CONFIG_NUM_CPUS]; + unsigned long freqProcessor[CONFIG_MAX_CPUS]; unsigned long freqSystemBus; unsigned long freqDDRBus; unsigned long freqLocalBus;lib_ppc/board.c +0
-0
lib_ppc/board.c init_fnc_t *init_sequence[] = { · line 297
Quoted 7 lines
lib_ppc/board.c +4
-0@@ -291,6 +291,10 @@ init_fnc_t *init_sequence[] = { board_early_init_f,#endif +#if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx) + probecpu, +#endif +
No empty line here, please.
Best regards,
Wolfgang Denk
Signature · 4 lines
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: wd at denx.de You can only live once, but if you do it right, once is enough.
PATCH 1/2 Removed CONFIG_NUM_CPUS for 85xx and 86xx Freescale processors.
Quoted 42 lines · Wolfgang Denk
Quoted 42 lines
include/asm-ppc/config.h +34
-0@@ -37,4 +37,45 @@#endif #endif +#if defined(CONFIG_MPC8533 ) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8535 ) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8536 ) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8540 ) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8541 ) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8543 ) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8544 ) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8545 ) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8547 ) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8548 ) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8555 ) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8560 ) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8567 ) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8568 ) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8569 ) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8572 ) +#define CONFIG_MAX_CPUS 2 +#elif defined(CONFIG_P2020 ) +#define CONFIG_MAX_CPUS 2
Quoted 8 lines
include/asm-ppc/config.h line 79
Quoted 6 lines
include/asm-ppc/config.h +6
-0+ +#elif defined(CONFIG_MPC8610 ) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8641 ) +#define CONFIG_MAX_CPUS 2 +#endif Sorry, but this does not scale. Please find a better solution.
is there a better solution? We effectively do things like this in the board CONFIG.h and its just duplicated for every board. Here its just isolated. Just wondering if you had any suggestions (I agree its ugly and if/when we get Kconfig its something that could be put there).
- k
PATCH 1/2 Removed CONFIG_NUM_CPUS for 85xx and 86xx Freescale processors.
Dear Kumar Gala,
Quoted 7 lines · In message <[email protected]> you wrote:
Quoted 2 lines
Sorry, but this does not scale. Please find a better solution.
is there a better solution? We effectively do things like this in the board
CONFIG.hand its just duplicated for every board. Here its just isolated. Just wondering if you had any suggestions (I agree its ugly and if/when we getKconfigits something that could be put there).
Well, no, sorry, I don't have any clever suggestion.
It would at least be a bit shorter if you used
#if defined(..) || defined(..) || defined(..) ...
#define CONFIG_MAX_CPUS 1
#elif defined(..) || defined(..) || defined(..) ... #define CONFIG_MAX_CPUS 2
#else
#error
#endif
Best regards,
Wolfgang Denk
Signature · 6 lines
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: wd at denx.de "Today's robots are very primitive, capable of understanding only a few simple instructions such as 'go left', 'go right', and 'build car'." - John Sladek
PATCH 1/2 Removed CONFIG_NUM_CPUS for 85xx and 86xxFreescale processors.
In reply to Wolfgang DenkQuoted 58 lines
...
cpu/mpc85xx/cpu.c int checkcpu (void) · line 144
Quoted 7 lines
cpu/mpc85xx/cpu.c +7
-0+#ifndef CONFIG_MP +if (cpu_numcores () >1 ) +puts ("#############################################\n" +"The system is detected to be MULTICORE,\n" +"but u-boot is built with UNI-CORE\n" + "To enable mutlticore Build set CONFIG_MP\n" +"#############################################\n\n");
Quoted 1 line
#endif
Please use terse error messages. We don't print prose here.
cpu/mpc85xx/cpu.c int checkcpu (void)
Quoted 4 lines
cpu/mpc85xx/cpu.c +2
-2- cpu =identify_cpu (ver); -if (cpu) { +if (cpu_numcores () >1 ) { + volatile ccsr_pic_t *pic = (void*)(CONFIG_SYS_MPC85xx_PIC_ADDR);
cpu/mpc85xx/cpu.c int checkcpu (void) · line 142
Quoted 3 lines
cpu/mpc85xx/cpu.c +3
-0+printf ("CPU%d: " , pic->whoami); + } +else Incorrect brace style.
Quoted 2 lines
cpu/mpc85xx/speed.c +0
-0...
cpu/mpc85xx/speed.c void get_sys_info (sys_info_t * sysInfo) · line 54
Quoted 6 lines
cpu/mpc85xx/speed.c +1
-1@@ -51,7 +51,7 @@ void get_sys_info (sys_info_t * sysInfo)/* Divide before multiply to avoid integer * overflow for processor speeds above 2GHz */ half_freqSystemBus = sysInfo->freqSystemBus/2 ; -for (i =0 ; i <CONFIG_NUM_CPUS ; i++) { +for (i =0 ; i <cpu_numcores (); i++) {Only one space before the '<', please.
...
Quoted 2 lines
cpu/mpc86xx/cpu.c +0
-0...
Quoted 14 lines
cpu/mpc86xx/cpu.c +14
-0+int probecpu (void ) +{ +uint svr; +uint ver; + + svr =get_svr (); + ver =SVR_SOC_VER (svr); + + gd->cpu =identify_cpu (ver); + +return 0 ; +} + +int cpu_numcores () {
Quoted 8 lines
cpu/mpc86xx/cpu.c
Quoted 5 lines
cpu/mpc86xx/cpu.c +5
-0+struct cpu_type *cpu; + cpu = gd->cpu; +return cpu->num_cores; +} +This seems to be identically repeated code. Please factor out into common code.
Actually the files cpu/mpc86xx/cpu.c cpu/mpc85xx/cpu.c are quite identical.
Kumar, Please suggest how should this be taken care. Probably a single file to take care of 85xx and 86xx don't know?
Quoted 120 lines
Quoted 15 lines
* Default board reset function
*/cpu/mpc86xx/cpu.c +1
-1@@ -66,9 +88,9 @@ checkcpu(void)uint ver;uint major, minor;char buf1[32 ], buf2[32 ]; +struct cpu_type *cpu;volatile immap_t *immap = (immap_t *)CONFIG_SYS_IMMR ;volatile ccsr_gur_t *gur = &immap->im_gur; -struct cpu_type *cpu;uint msscr0 =mfspr (MSSCR0 ); svr =get_svr ();cpu/mpc86xx/cpu.c checkcpu(void) · line 107
Quoted 10 lines
cpu/mpc86xx/cpu.c +7
-0@@ -76,10 +98,20 @@ checkcpu(void) major =SVR_MAJ (svr); minor =SVR_MIN (svr); +#ifndef CONFIG_MP +if (cpu_numcores () >1 ) +puts ("#############################################\n" +"The system is detected to be MULTICORE,\n" +"but u-boot is built with UNI-CORE\n" + "To enable mutlticore Build set CONFIG_MP\n" +"#############################################\n\n");
cpu/mpc86xx/cpu.c checkcpu(void) · line 108
Quoted 1 line
cpu/mpc86xx/cpu.c +1
-0+#endif Ditto.
cpu/mpc86xx/cpu.c checkcpu(void) · line 116
Quoted 9 lines
cpu/mpc86xx/cpu.c +3
-2puts ("CPU: " ); - cpu =identify_cpu (ver); -if (cpu) { + cpu = gd->cpu; + +if (cpu->name) {puts (cpu->name); }else {No braces for one-line statements, please.
Review
Quoted 1 line
(quoted diff) +0
-0
b/include/asm-ppc/config.hindexQuoted 37 lines
ca143c7..b799a22 100644
include/asm-ppc/config.h +30
-0@@ -37,4 +37,45 @@#endif #endif +#if defined(CONFIG_MPC8533 ) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8535 ) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8536 ) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8540 ) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8541 ) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8543 ) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8544 ) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8545 ) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8547 ) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8548 ) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8555 ) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8560 ) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8567 ) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8568 ) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8569 ) +#define CONFIG_MAX_CPUS 1include/asm-ppc/config.h line 79
Quoted 10 lines
include/asm-ppc/config.h +10
-0+#elif defined(CONFIG_MPC8572 ) +#define CONFIG_MAX_CPUS 2 +#elif defined(CONFIG_P2020 ) +#define CONFIG_MAX_CPUS 2 + +#elif defined(CONFIG_MPC8610 ) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8641 ) +#define CONFIG_MAX_CPUS 2 +#endif Sorry, but this does not scale. Please find a better solution.
include/asm-ppc/global_data.h line 2
Quoted 7 lines
(quoted diff) +0
-0
b/include/asm-ppc/global_data.hindex 244c161..aa531b9 100644include/asm-ppc/global_data.h +1
-0@@ -1,4 +1,5 @@/* +* Copyright (C) 2009 Freescale Semiconductor, Inc. All rights reserved.
Best regards,
Wolfgang Denk
Signature · 9 lines
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: wd at denx.de You can only live once, but if you do it right, once is enough. _______________________________________________ U-Boot mailing list U-Boot at lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
PATCH 1/2 Removed CONFIG_NUM_CPUS for 85xx and86xxFreescale processors.
Quoted 79 lines
-----Original Message-----
From: u-boot-bounces at lists.denx.de [mailto:u-boot-bounces at lists.denx.de] On Behalf Of Aggrwal Poonam-B10812
Sent: Wednesday, July 22, 2009 3:45 PM
To: Wolfgang Denk; Gala Kumar-B11780
Cc: u-boot at lists.denx.de
Subject: Re: [U-Boot] [PATCH 1/2] RemovedCONFIG_NUM_CPUSfor 85xx and86xxFreescale processors.Quoted 55 lines
...
cpu/mpc85xx/cpu.c int checkcpu (void) · line 144
Quoted 7 lines
cpu/mpc85xx/cpu.c +7
-0+#ifndef CONFIG_MP +if (cpu_numcores () >1 ) +puts ("#############################################\n" +"The system is detected to be MULTICORE,\n" +"but u-boot is built with UNI-CORE\n" + "To enable mutlticore Build set CONFIG_MP\n" +"#############################################\n\n");
Quoted 1 line
#endif
Please use terse error messages. We don't print prose here.
cpu/mpc85xx/cpu.c int checkcpu (void)
Quoted 4 lines
cpu/mpc85xx/cpu.c +2
-2- cpu =identify_cpu (ver); -if (cpu) { +if (cpu_numcores () >1 ) { + volatile ccsr_pic_t *pic = (void*)(CONFIG_SYS_MPC85xx_PIC_ADDR);
cpu/mpc85xx/cpu.c int checkcpu (void) · line 142
Quoted 3 lines
cpu/mpc85xx/cpu.c +3
-0+printf ("CPU%d: " , pic->whoami); + } +else Incorrect brace style.
Quoted 2 lines
cpu/mpc85xx/speed.c +0
-0...
cpu/mpc85xx/speed.c void get_sys_info (sys_info_t * sysInfo) · line 54
Quoted 6 lines
cpu/mpc85xx/speed.c +1
-1@@ -51,7 +51,7 @@ void get_sys_info (sys_info_t * sysInfo)/* Divide before multiply to avoid integer * overflow for processor speeds above 2GHz */ half_freqSystemBus = sysInfo->freqSystemBus/2 ; -for (i =0 ; i <CONFIG_NUM_CPUS ; i++) { +for (i =0 ; i <cpu_numcores (); i++) {Only one space before the '<', please.
...
Quoted 2 lines
cpu/mpc86xx/cpu.c +0
-0...
Quoted 14 lines
cpu/mpc86xx/cpu.c +14
-0+int probecpu (void ) +{ +uint svr; +uint ver; + + svr =get_svr (); + ver =SVR_SOC_VER (svr); + + gd->cpu =identify_cpu (ver); + +return 0 ; +} + +int cpu_numcores () {Quoted 8 lines
cpu/mpc86xx/cpu.c
Quoted 5 lines
cpu/mpc86xx/cpu.c +5
-0+struct cpu_type *cpu; + cpu = gd->cpu; +return cpu->num_cores; +} +This seems to be identically repeated code. Please factor out into common code.
Quoted 4 lines
Actually the files
cpu/mpc86xx/cpu.ccpu/mpc85xx/cpu.care quite identical.
Kumar, Please suggest how should this be taken care. Probably a single file to take care of 85xx and 86xx don't know?
Just a request , I would like to close this as we need to push P2020RDB support quickly.
Otherwise should I just go ahead with 85xx for now? Please suggest. Regards
Poonam
Quoted 22 lines
Quoted 6 lines
Best regards,
Wolfgang Denk
Signature · 1 line
DENX Software Engineering GmbH, MD: Wolfgang Denk &Detlev Zundel
Quoted 1 line
HRB 165235 Munich, Office: Kirchenstr.5, D-82194
Groebenzell, Germany
Quoted 8 lines
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email:
wd at denx.de You can only live once, but if you do it right, once is enough.
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
PATCH 1/2 Removed CONFIG_NUM_CPUS for 85xx and 86xxFreescale processors.
In reply to Aggrwal Poonam-B10812Quoted 27 lines · On Jul 22, 2009, at 5:14 AM, Aggrwal Poonam-B10812 wrote:
Quoted 19 lines
...
Quoted 2 lines
cpu/mpc86xx/cpu.c +0
-0...
Quoted 14 lines
cpu/mpc86xx/cpu.c +14
-0+int probecpu (void ) +{ +uint svr; +uint ver; + + svr =get_svr (); + ver =SVR_SOC_VER (svr); + + gd->cpu =identify_cpu (ver); + +return 0 ; +} + +int cpu_numcores () {Quoted 8 lines
cpu/mpc86xx/cpu.c
Quoted 5 lines
cpu/mpc86xx/cpu.c +5
-0+struct cpu_type *cpu; + cpu = gd->cpu; +return cpu->num_cores; +} +This seems to be identically repeated code. Please factor out into common code.
Quoted 4 lines
Actually the files
cpu/mpc86xx/cpu.ccpu/mpc85xx/cpu.care quite identical.
Kumar, Please suggest how should this be taken care. Probably a single file to take care of 85xx and 86xx don't know?
We can move the code into cpu/mpc8xxx/cpu.c
- k
PATCH 1/2 Removed CONFIG_NUM_CPUS for 85xx and 86xx Freescale processors.
In reply to Poonam Aggrwalcpu/mpc85xx/cpu.c struct cpu_type *identify_cpu(u32 ver) · line 88
Quoted 5 lines · Poonam Aggrwal
cpu/mpc85xx/cpu.c +5
-0+int cpu_numcores () { +struct cpu_type *cpu; + cpu = gd->cpu; +return cpu->num_cores; +}
Shouldn't this check CONFIG_MP and return 1 if not set? Otherwise you get a weird mix of MP and UP.
The checks to warn the user of a UP u-boot on an MP chip would have to reference cpu->num_cores directly, or we could add a hard_cpu_numcores(), or similar.
-Scott
PATCH 1/2 Removed CONFIG_NUM_CPUS for 85xx and 86xx Freescale processors.
Quoted 20 lines
-----Original Message-----
From: Wood Scott-B07421
Sent: Wednesday, July 29, 2009 2:39 AM
To: Aggrwal Poonam-B10812
Cc: u-boot at lists.denx.de
Subject: Re: [U-Boot] [PATCH 1/2] RemovedCONFIG_NUM_CPUSfor 85xx and 86xx Freescale processors.cpu/mpc85xx/cpu.c struct cpu_type *identify_cpu(u32 ver) · line 88
Quoted 5 lines · Poonam Aggrwal
cpu/mpc85xx/cpu.c +5
-0+int cpu_numcores () { +struct cpu_type *cpu; + cpu = gd->cpu; +return cpu->num_cores; +}Shouldn't this check
CONFIG_MPand return 1 if not set? Otherwise you get a weird mix of MP and UP.
Quoted 3 lines
The checks to warn the user of a UP u-boot on an MP chip would have to reference
cpu->num_coresdirectly, or we could add ahard_cpu_numcores(), or similar.
This function's intent is to just return the number of cores that the system has.
This is more of kind of probong the actual hardware.
The CONFIG_MP flag will take care of all the multicore stuff in u-boot.
Quoted 3 lines
-Scott
PATCH 1/2 Removed CONFIG_NUM_CPUS for 85xx and 86xx Freescale processors.
Quoted 19 lines · Aggrwal Poonam-B10812 wrote:
Quoted 19 lines
-----Original Message-----
From: Wood Scott-B07421
Sent: Wednesday, July 29, 2009 2:39 AM
To: Aggrwal Poonam-B10812
Cc: u-boot at lists.denx.de
Subject: Re: [U-Boot] [PATCH 1/2] RemovedCONFIG_NUM_CPUSfor 85xx and 86xx Freescale processors.cpu/mpc85xx/cpu.c struct cpu_type *identify_cpu(u32 ver) · line 88
Quoted 5 lines · Poonam Aggrwal
cpu/mpc85xx/cpu.c +5
-0+int cpu_numcores () { +struct cpu_type *cpu; + cpu = gd->cpu; +return cpu->num_cores; +}Shouldn't this check
CONFIG_MPand return 1 if not set? Otherwise you get a weird mix of MP and UP.
Quoted 8 lines
Quoted 3 lines
The checks to warn the user of a UP u-boot on an MP chip would have to reference
cpu->num_coresdirectly, or we could add ahard_cpu_numcores(), or similar.This function's intent is to just return the number of cores that the system has.
This is more of kind of probong the actual hardware.
TheCONFIG_MPflag will take care of all the multicore stuff in u-boot.Quoted 1 line
-Scott
But you have places that call cpu_numcores() and do per-core stuff that don't check CONFIG_MP, as far as I can tell.
-Scott