diff options
author | Valentine Barshak <vbarshak@ru.mvista.com> | 2007-09-21 10:44:38 -0400 |
---|---|---|
committer | Josh Boyer <jwboyer@linux.vnet.ibm.com> | 2007-10-03 08:20:17 -0400 |
commit | 84e3ad5b91ed51db7513a54ad7ed652ab0ca4ba1 (patch) | |
tree | 575a4a0b3ac8d9268c3db14af1d383dc4465112c /arch | |
parent | 2e71cc0d51d8f0dd4532d88c8fffccc08ba7ecdb (diff) |
[POWERPC] 4xx: Introduce cpu_setup functionality to 44x platform
This adds cpu_setup functionality for ppc44x platform.
Low level cpu-spefic initialization routines should be
placed in cpu_setup_44x.S and a callback should be
added to cputable. The cpu_setup is invoked
by identify_cpu() function at early init.
Signed-off-by: Valentine Barshak <vbarshak@ru.mvista.com>
Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/kernel/Makefile | 1 | ||||
-rw-r--r-- | arch/powerpc/kernel/cpu_setup_44x.S | 19 | ||||
-rw-r--r-- | arch/powerpc/kernel/cputable.c | 13 |
3 files changed, 27 insertions, 6 deletions
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile index fb33a7e71941..f1dd90439efc 100644 --- a/arch/powerpc/kernel/Makefile +++ b/arch/powerpc/kernel/Makefile | |||
@@ -58,6 +58,7 @@ obj-y += time.o prom.o traps.o setup-common.o \ | |||
58 | misc_$(CONFIG_WORD_SIZE).o | 58 | misc_$(CONFIG_WORD_SIZE).o |
59 | obj-$(CONFIG_PPC32) += entry_32.o setup_32.o | 59 | obj-$(CONFIG_PPC32) += entry_32.o setup_32.o |
60 | obj-$(CONFIG_PPC64) += dma_64.o iommu.o | 60 | obj-$(CONFIG_PPC64) += dma_64.o iommu.o |
61 | obj-$(CONFIG_44x) += cpu_setup_44x.o | ||
61 | obj-$(CONFIG_PPC_MULTIPLATFORM) += prom_init.o | 62 | obj-$(CONFIG_PPC_MULTIPLATFORM) += prom_init.o |
62 | obj-$(CONFIG_MODULES) += ppc_ksyms.o | 63 | obj-$(CONFIG_MODULES) += ppc_ksyms.o |
63 | obj-$(CONFIG_BOOTX_TEXT) += btext.o | 64 | obj-$(CONFIG_BOOTX_TEXT) += btext.o |
diff --git a/arch/powerpc/kernel/cpu_setup_44x.S b/arch/powerpc/kernel/cpu_setup_44x.S new file mode 100644 index 000000000000..6a6e6c71ad6f --- /dev/null +++ b/arch/powerpc/kernel/cpu_setup_44x.S | |||
@@ -0,0 +1,19 @@ | |||
1 | /* | ||
2 | * This file contains low level CPU setup functions. | ||
3 | * Valentine Barshak <vbarshak@ru.mvista.com> | ||
4 | * MontaVista Software, Inc (c) 2007 | ||
5 | * | ||
6 | * Based on cpu_setup_6xx code by | ||
7 | * Benjamin Herrenschmidt <benh@kernel.crashing.org> | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or | ||
10 | * modify it under the terms of the GNU General Public License | ||
11 | * as published by the Free Software Foundation; either version | ||
12 | * 2 of the License, or (at your option) any later version. | ||
13 | * | ||
14 | */ | ||
15 | |||
16 | #include <asm/processor.h> | ||
17 | #include <asm/cputable.h> | ||
18 | #include <asm/ppc_asm.h> | ||
19 | |||
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c index 8eb8087383eb..8711499f5a02 100644 --- a/arch/powerpc/kernel/cputable.c +++ b/arch/powerpc/kernel/cputable.c | |||
@@ -1319,17 +1319,18 @@ struct cpu_spec *identify_cpu(unsigned long offset, unsigned int pvr) | |||
1319 | for (i = 0; i < ARRAY_SIZE(cpu_specs); i++,s++) | 1319 | for (i = 0; i < ARRAY_SIZE(cpu_specs); i++,s++) |
1320 | if ((pvr & s->pvr_mask) == s->pvr_value) { | 1320 | if ((pvr & s->pvr_mask) == s->pvr_value) { |
1321 | *cur = cpu_specs + i; | 1321 | *cur = cpu_specs + i; |
1322 | #ifdef CONFIG_PPC64 | 1322 | #if defined(CONFIG_PPC64) || defined(CONFIG_BOOKE) |
1323 | /* ppc64 expects identify_cpu to also call setup_cpu | 1323 | /* ppc64 and booke expect identify_cpu to also call |
1324 | * for that processor. I will consolidate that at a | 1324 | * setup_cpu for that processor. I will consolidate |
1325 | * later time, for now, just use our friend #ifdef. | 1325 | * that at a later time, for now, just use #ifdef. |
1326 | * we also don't need to PTRRELOC the function pointer | 1326 | * we also don't need to PTRRELOC the function pointer |
1327 | * on ppc64 as we are running at 0 in real mode. | 1327 | * on ppc64 and booke as we are running at 0 in real |
1328 | * mode on ppc64 and reloc_offset is always 0 on booke. | ||
1328 | */ | 1329 | */ |
1329 | if (s->cpu_setup) { | 1330 | if (s->cpu_setup) { |
1330 | s->cpu_setup(offset, s); | 1331 | s->cpu_setup(offset, s); |
1331 | } | 1332 | } |
1332 | #endif /* CONFIG_PPC64 */ | 1333 | #endif /* CONFIG_PPC64 || CONFIG_BOOKE */ |
1333 | return s; | 1334 | return s; |
1334 | } | 1335 | } |
1335 | BUG(); | 1336 | BUG(); |