diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2007-09-20 20:16:20 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-10-02 19:12:02 -0400 |
commit | 2578bfae84a78bd46fdbc0d2f9d39e9fbc9c8a3f (patch) | |
tree | 9dad1abf1dd5fa31cc1d507d559baa7e52d6a836 /arch | |
parent | 75918a4b5998c93ee1ab131fbe64b97b5d0d2315 (diff) |
[POWERPC] Create and use CONFIG_WORD_SIZE
Linus made this suggestion for the x86 merge and this starts the process
for powerpc. We assume that CONFIG_PPC64 implies CONFIG_PPC_MERGE and
CONFIG_PPC_STD_MMU_32 implies CONFIG_PPC_STD_MMU.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/Kconfig | 5 | ||||
-rw-r--r-- | arch/powerpc/Makefile | 21 | ||||
-rw-r--r-- | arch/powerpc/kernel/Makefile | 30 | ||||
-rw-r--r-- | arch/powerpc/lib/Makefile | 7 | ||||
-rw-r--r-- | arch/powerpc/mm/Makefile | 13 | ||||
-rw-r--r-- | arch/ppc/Kconfig | 4 |
6 files changed, 46 insertions, 34 deletions
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 26126d27d756..45e86c751f11 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig | |||
@@ -14,6 +14,11 @@ config 64BIT | |||
14 | bool | 14 | bool |
15 | default y if PPC64 | 15 | default y if PPC64 |
16 | 16 | ||
17 | config WORD_SIZE | ||
18 | int | ||
19 | default 64 if PPC64 | ||
20 | default 32 if !PPC64 | ||
21 | |||
17 | config PPC_MERGE | 22 | config PPC_MERGE |
18 | def_bool y | 23 | def_bool y |
19 | 24 | ||
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index 87aff5372d6e..71632b20b81d 100644 --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile | |||
@@ -39,7 +39,6 @@ KBUILD_DEFCONFIG := $(shell uname -m)_defconfig | |||
39 | 39 | ||
40 | ifeq ($(CONFIG_PPC64),y) | 40 | ifeq ($(CONFIG_PPC64),y) |
41 | OLDARCH := ppc64 | 41 | OLDARCH := ppc64 |
42 | SZ := 64 | ||
43 | 42 | ||
44 | new_nm := $(shell if $(NM) --help 2>&1 | grep -- '--synthetic' > /dev/null; then echo y; else echo n; fi) | 43 | new_nm := $(shell if $(NM) --help 2>&1 | grep -- '--synthetic' > /dev/null; then echo y; else echo n; fi) |
45 | 44 | ||
@@ -49,16 +48,21 @@ endif | |||
49 | 48 | ||
50 | else | 49 | else |
51 | OLDARCH := ppc | 50 | OLDARCH := ppc |
52 | SZ := 32 | 51 | endif |
52 | |||
53 | # It seems there are times we use this Makefile without | ||
54 | # including the config file, but this replicates the old behaviour | ||
55 | ifeq ($(CONFIG_WORD_SIZE),) | ||
56 | CONFIG_WORD_SIZE := 32 | ||
53 | endif | 57 | endif |
54 | 58 | ||
55 | UTS_MACHINE := $(OLDARCH) | 59 | UTS_MACHINE := $(OLDARCH) |
56 | 60 | ||
57 | ifeq ($(HAS_BIARCH),y) | 61 | ifeq ($(HAS_BIARCH),y) |
58 | override AS += -a$(SZ) | 62 | override AS += -a$(CONFIG_WORD_SIZE) |
59 | override LD += -m elf$(SZ)ppc | 63 | override LD += -m elf$(CONFIG_WORD_SIZE)ppc |
60 | override CC += -m$(SZ) | 64 | override CC += -m$(CONFIG_WORD_SIZE) |
61 | override AR := GNUTARGET=elf$(SZ)-powerpc $(AR) | 65 | override AR := GNUTARGET=elf$(CONFIG_WORD_SIZE)-powerpc $(AR) |
62 | endif | 66 | endif |
63 | 67 | ||
64 | LDFLAGS_vmlinux := -Bstatic | 68 | LDFLAGS_vmlinux := -Bstatic |
@@ -72,7 +76,7 @@ AFLAGS += $(AFLAGS-y) | |||
72 | CFLAGS += -msoft-float -pipe $(CFLAGS-y) | 76 | CFLAGS += -msoft-float -pipe $(CFLAGS-y) |
73 | CPP = $(CC) -E $(CFLAGS) | 77 | CPP = $(CC) -E $(CFLAGS) |
74 | 78 | ||
75 | CHECKFLAGS += -m$(SZ) -D__powerpc__ -D__powerpc$(SZ)__ | 79 | CHECKFLAGS += -m$(CONFIG_WORD_SIZE) -D__powerpc__ -D__powerpc$(CONFIG_WORD_SIZE)__ |
76 | 80 | ||
77 | ifeq ($(CONFIG_PPC64),y) | 81 | ifeq ($(CONFIG_PPC64),y) |
78 | GCC_BROKEN_VEC := $(shell if [ $(call cc-version) -lt 0400 ] ; then echo "y"; fi) | 82 | GCC_BROKEN_VEC := $(shell if [ $(call cc-version) -lt 0400 ] ; then echo "y"; fi) |
@@ -120,8 +124,7 @@ cpu-as-$(CONFIG_E200) += -Wa,-me200 | |||
120 | AFLAGS += $(cpu-as-y) | 124 | AFLAGS += $(cpu-as-y) |
121 | CFLAGS += $(cpu-as-y) | 125 | CFLAGS += $(cpu-as-y) |
122 | 126 | ||
123 | head-y := arch/powerpc/kernel/head_32.o | 127 | head-y := arch/powerpc/kernel/head_$(CONFIG_WORD_SIZE).o |
124 | head-$(CONFIG_PPC64) := arch/powerpc/kernel/head_64.o | ||
125 | head-$(CONFIG_8xx) := arch/powerpc/kernel/head_8xx.o | 128 | head-$(CONFIG_8xx) := arch/powerpc/kernel/head_8xx.o |
126 | head-$(CONFIG_40x) := arch/powerpc/kernel/head_40x.o | 129 | head-$(CONFIG_40x) := arch/powerpc/kernel/head_40x.o |
127 | head-$(CONFIG_44x) := arch/powerpc/kernel/head_44x.o | 130 | head-$(CONFIG_44x) := arch/powerpc/kernel/head_44x.o |
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile index b37165effb65..fb33a7e71941 100644 --- a/arch/powerpc/kernel/Makefile +++ b/arch/powerpc/kernel/Makefile | |||
@@ -38,10 +38,10 @@ obj-$(CONFIG_GENERIC_TBSYNC) += smp-tbsync.o | |||
38 | obj-$(CONFIG_CRASH_DUMP) += crash_dump.o | 38 | obj-$(CONFIG_CRASH_DUMP) += crash_dump.o |
39 | obj-$(CONFIG_6xx) += idle_6xx.o l2cr_6xx.o cpu_setup_6xx.o | 39 | obj-$(CONFIG_6xx) += idle_6xx.o l2cr_6xx.o cpu_setup_6xx.o |
40 | obj-$(CONFIG_TAU) += tau_6xx.o | 40 | obj-$(CONFIG_TAU) += tau_6xx.o |
41 | obj-$(CONFIG_HIBERNATION) += swsusp.o suspend.o | 41 | obj-$(CONFIG_HIBERNATION) += swsusp.o suspend.o \ |
42 | obj32-$(CONFIG_HIBERNATION) += swsusp_32.o | 42 | swsusp_$(CONFIG_WORD_SIZE).o |
43 | obj64-$(CONFIG_HIBERNATION) += swsusp_64.o swsusp_asm64.o | 43 | obj64-$(CONFIG_HIBERNATION) += swsusp_asm64.o |
44 | obj32-$(CONFIG_MODULES) += module_32.o | 44 | obj-$(CONFIG_MODULES) += module_$(CONFIG_WORD_SIZE).o |
45 | 45 | ||
46 | ifeq ($(CONFIG_PPC_MERGE),y) | 46 | ifeq ($(CONFIG_PPC_MERGE),y) |
47 | 47 | ||
@@ -54,9 +54,10 @@ extra-$(CONFIG_8xx) := head_8xx.o | |||
54 | extra-y += vmlinux.lds | 54 | extra-y += vmlinux.lds |
55 | 55 | ||
56 | obj-y += time.o prom.o traps.o setup-common.o \ | 56 | obj-y += time.o prom.o traps.o setup-common.o \ |
57 | udbg.o misc.o io.o | 57 | udbg.o misc.o io.o \ |
58 | obj-$(CONFIG_PPC32) += entry_32.o setup_32.o misc_32.o | 58 | misc_$(CONFIG_WORD_SIZE).o |
59 | obj-$(CONFIG_PPC64) += misc_64.o dma_64.o iommu.o | 59 | obj-$(CONFIG_PPC32) += entry_32.o setup_32.o |
60 | obj-$(CONFIG_PPC64) += dma_64.o iommu.o | ||
60 | obj-$(CONFIG_PPC_MULTIPLATFORM) += prom_init.o | 61 | obj-$(CONFIG_PPC_MULTIPLATFORM) += prom_init.o |
61 | obj-$(CONFIG_MODULES) += ppc_ksyms.o | 62 | obj-$(CONFIG_MODULES) += ppc_ksyms.o |
62 | obj-$(CONFIG_BOOTX_TEXT) += btext.o | 63 | obj-$(CONFIG_BOOTX_TEXT) += btext.o |
@@ -64,16 +65,12 @@ obj-$(CONFIG_SMP) += smp.o | |||
64 | obj-$(CONFIG_KPROBES) += kprobes.o | 65 | obj-$(CONFIG_KPROBES) += kprobes.o |
65 | obj-$(CONFIG_PPC_UDBG_16550) += legacy_serial.o udbg_16550.o | 66 | obj-$(CONFIG_PPC_UDBG_16550) += legacy_serial.o udbg_16550.o |
66 | 67 | ||
67 | module-$(CONFIG_PPC64) += module_64.o | 68 | pci64-$(CONFIG_PPC64) += pci_dn.o isa-bridge.o |
68 | obj-$(CONFIG_MODULES) += $(module-y) | 69 | obj-$(CONFIG_PCI) += pci_$(CONFIG_WORD_SIZE).o $(pci64-y) \ |
69 | 70 | pci-common.o | |
70 | pci64-$(CONFIG_PPC64) += pci_64.o pci_dn.o isa-bridge.o | ||
71 | pci32-$(CONFIG_PPC32) := pci_32.o | ||
72 | obj-$(CONFIG_PCI) += $(pci64-y) $(pci32-y) pci-common.o | ||
73 | obj-$(CONFIG_PCI_MSI) += msi.o | 71 | obj-$(CONFIG_PCI_MSI) += msi.o |
74 | kexec-$(CONFIG_PPC64) := machine_kexec_64.o | 72 | obj-$(CONFIG_KEXEC) += machine_kexec.o crash.o \ |
75 | kexec-$(CONFIG_PPC32) := machine_kexec_32.o | 73 | machine_kexec_$(CONFIG_WORD_SIZE).o |
76 | obj-$(CONFIG_KEXEC) += machine_kexec.o crash.o $(kexec-y) | ||
77 | obj-$(CONFIG_AUDIT) += audit.o | 74 | obj-$(CONFIG_AUDIT) += audit.o |
78 | obj64-$(CONFIG_AUDIT) += compat_audit.o | 75 | obj64-$(CONFIG_AUDIT) += compat_audit.o |
79 | 76 | ||
@@ -87,7 +84,6 @@ smpobj-$(CONFIG_SMP) += smp.o | |||
87 | 84 | ||
88 | endif | 85 | endif |
89 | 86 | ||
90 | obj-$(CONFIG_PPC32) += $(obj32-y) | ||
91 | obj-$(CONFIG_PPC64) += $(obj64-y) | 87 | obj-$(CONFIG_PPC64) += $(obj64-y) |
92 | 88 | ||
93 | extra-$(CONFIG_PPC_FPU) += fpu.o | 89 | extra-$(CONFIG_PPC_FPU) += fpu.o |
diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefile index 23bbb1ea7f9f..65d492e316a6 100644 --- a/arch/powerpc/lib/Makefile +++ b/arch/powerpc/lib/Makefile | |||
@@ -7,11 +7,12 @@ EXTRA_CFLAGS += -mno-minimal-toc | |||
7 | endif | 7 | endif |
8 | 8 | ||
9 | ifeq ($(CONFIG_PPC_MERGE),y) | 9 | ifeq ($(CONFIG_PPC_MERGE),y) |
10 | obj-y := string.o alloc.o | 10 | obj-y := string.o alloc.o \ |
11 | obj-$(CONFIG_PPC32) += div64.o copy_32.o checksum_32.o | 11 | checksum_$(CONFIG_WORD_SIZE).o |
12 | obj-$(CONFIG_PPC32) += div64.o copy_32.o | ||
12 | endif | 13 | endif |
13 | 14 | ||
14 | obj-$(CONFIG_PPC64) += checksum_64.o copypage_64.o copyuser_64.o \ | 15 | obj-$(CONFIG_PPC64) += copypage_64.o copyuser_64.o \ |
15 | memcpy_64.o usercopy_64.o mem_64.o string.o | 16 | memcpy_64.o usercopy_64.o mem_64.o string.o |
16 | obj-$(CONFIG_QUICC_ENGINE) += rheap.o | 17 | obj-$(CONFIG_QUICC_ENGINE) += rheap.o |
17 | obj-$(CONFIG_XMON) += sstep.o | 18 | obj-$(CONFIG_XMON) += sstep.o |
diff --git a/arch/powerpc/mm/Makefile b/arch/powerpc/mm/Makefile index bf20fa688809..20629ae95c50 100644 --- a/arch/powerpc/mm/Makefile +++ b/arch/powerpc/mm/Makefile | |||
@@ -6,13 +6,16 @@ ifeq ($(CONFIG_PPC64),y) | |||
6 | EXTRA_CFLAGS += -mno-minimal-toc | 6 | EXTRA_CFLAGS += -mno-minimal-toc |
7 | endif | 7 | endif |
8 | 8 | ||
9 | obj-y := fault.o mem.o lmb.o | 9 | obj-y := fault.o mem.o lmb.o \ |
10 | obj-$(CONFIG_PPC32) += init_32.o pgtable_32.o mmu_context_32.o | 10 | init_$(CONFIG_WORD_SIZE).o \ |
11 | pgtable_$(CONFIG_WORD_SIZE).o \ | ||
12 | mmu_context_$(CONFIG_WORD_SIZE).o | ||
11 | hash-$(CONFIG_PPC_NATIVE) := hash_native_64.o | 13 | hash-$(CONFIG_PPC_NATIVE) := hash_native_64.o |
12 | obj-$(CONFIG_PPC64) += init_64.o pgtable_64.o mmu_context_64.o \ | 14 | obj-$(CONFIG_PPC64) += hash_utils_64.o \ |
13 | hash_utils_64.o hash_low_64.o tlb_64.o \ | ||
14 | slb_low.o slb.o stab.o mmap.o $(hash-y) | 15 | slb_low.o slb.o stab.o mmap.o $(hash-y) |
15 | obj-$(CONFIG_PPC_STD_MMU_32) += ppc_mmu_32.o hash_low_32.o tlb_32.o | 16 | obj-$(CONFIG_PPC_STD_MMU_32) += ppc_mmu_32.o |
17 | obj-$(CONFIG_PPC_STD_MMU) += hash_low_$(CONFIG_WORD_SIZE).o \ | ||
18 | tlb_$(CONFIG_WORD_SIZE).o | ||
16 | obj-$(CONFIG_40x) += 40x_mmu.o | 19 | obj-$(CONFIG_40x) += 40x_mmu.o |
17 | obj-$(CONFIG_44x) += 44x_mmu.o | 20 | obj-$(CONFIG_44x) += 44x_mmu.o |
18 | obj-$(CONFIG_FSL_BOOKE) += fsl_booke_mmu.o | 21 | obj-$(CONFIG_FSL_BOOKE) += fsl_booke_mmu.o |
diff --git a/arch/ppc/Kconfig b/arch/ppc/Kconfig index c1b34eb383cf..c2087f645ad3 100644 --- a/arch/ppc/Kconfig +++ b/arch/ppc/Kconfig | |||
@@ -4,6 +4,10 @@ | |||
4 | 4 | ||
5 | mainmenu "Linux/PowerPC Kernel Configuration" | 5 | mainmenu "Linux/PowerPC Kernel Configuration" |
6 | 6 | ||
7 | config WORD_SIZE | ||
8 | int | ||
9 | default 32 | ||
10 | |||
7 | config MMU | 11 | config MMU |
8 | bool | 12 | bool |
9 | default y | 13 | default y |