powerpc/Makefile: Drop CONFIG_WORD_SIZE for BITS
authorMichael Ellerman <mpe@ellerman.id.au>
Thu, 11 Aug 2016 06:03:14 +0000 (16:03 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 13 Sep 2016 07:37:06 +0000 (17:37 +1000)
Commit 2578bfae84a7 ("[POWERPC] Create and use CONFIG_WORD_SIZE") added
CONFIG_WORD_SIZE, and suggests that other arches were going to do
likewise.

But that never happened, powerpc is the only architecture which uses it.

So switch to using a simple make variable, BITS, like x86, sh, sparc and
tile. It is also easier to spell and simpler, avoiding any confusion
about whether it's defined due to ordering of make vs kconfig.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/Kconfig
arch/powerpc/Makefile
arch/powerpc/kernel/Makefile
arch/powerpc/lib/Makefile
arch/powerpc/mm/Makefile

index 927d2ab2ce08a68c2574c41e6d1b732ecf597d9b..9416e35f15b2741d1329ea202dbaf739f901cc48 100644 (file)
@@ -12,11 +12,6 @@ config 64BIT
        bool
        default y if PPC64
 
-config WORD_SIZE
-       int
-       default 64 if PPC64
-       default 32 if !PPC64
-
 config ARCH_PHYS_ADDR_T_64BIT
        def_bool PPC64 || PHYS_64BIT
 
index ff3369b01666986cefc0e9c17dd71c4139090f0d..c941d5360366e1219c75415d8617026b5cfb6885 100644 (file)
@@ -57,10 +57,15 @@ OLDARCH     := ppc
 endif
 endif
 
-# It seems there are times we use this Makefile without
-# including the config file, but this replicates the old behaviour
-ifeq ($(CONFIG_WORD_SIZE),)
-CONFIG_WORD_SIZE := 32
+# BITS is used as extension for files which are available in a 32 bit
+# and a 64 bit version to simplify shared Makefiles.
+# e.g.: obj-y += foo_$(BITS).o
+export BITS
+
+ifdef CONFIG_PPC64
+        BITS := 64
+else
+        BITS := 32
 endif
 
 UTS_MACHINE := $(OLDARCH)
@@ -88,10 +93,10 @@ aflags-$(CONFIG_CPU_BIG_ENDIAN)             += $(call cc-option,-mbig-endian)
 aflags-$(CONFIG_CPU_LITTLE_ENDIAN)     += -mlittle-endian
 
 ifeq ($(HAS_BIARCH),y)
-override AS    += -a$(CONFIG_WORD_SIZE)
-override LD    += -m elf$(CONFIG_WORD_SIZE)$(LDEMULATION)
-override CC    += -m$(CONFIG_WORD_SIZE)
-override AR    := GNUTARGET=elf$(CONFIG_WORD_SIZE)-$(GNUTARGET) $(AR)
+override AS    += -a$(BITS)
+override LD    += -m elf$(BITS)$(LDEMULATION)
+override CC    += -m$(BITS)
+override AR    := GNUTARGET=elf$(BITS)-$(GNUTARGET) $(AR)
 endif
 
 LDFLAGS_vmlinux-y := -Bstatic
@@ -178,7 +183,7 @@ KBUILD_CFLAGS       += $(call cc-option,-msoft-float)
 KBUILD_CFLAGS  += -pipe -Iarch/$(ARCH) $(CFLAGS-y)
 CPP            = $(CC) -E $(KBUILD_CFLAGS)
 
-CHECKFLAGS     += -m$(CONFIG_WORD_SIZE) -D__powerpc__ -D__powerpc$(CONFIG_WORD_SIZE)__
+CHECKFLAGS     += -m$(BITS) -D__powerpc__ -D__powerpc$(BITS)__
 ifdef CONFIG_CPU_BIG_ENDIAN
 CHECKFLAGS     += -D__BIG_ENDIAN__
 else
@@ -233,7 +238,7 @@ KBUILD_CFLAGS += $(cpu-as-y)
 KBUILD_AFLAGS += $(aflags-y)
 KBUILD_CFLAGS += $(cflags-y)
 
-head-y                         := arch/powerpc/kernel/head_$(CONFIG_WORD_SIZE).o
+head-y                         := arch/powerpc/kernel/head_$(BITS).o
 head-$(CONFIG_8xx)             := arch/powerpc/kernel/head_8xx.o
 head-$(CONFIG_40x)             := arch/powerpc/kernel/head_40x.o
 head-$(CONFIG_44x)             := arch/powerpc/kernel/head_44x.o
index fe4c075bcf50eda75905e7c53b4830914cef5b00..aded29ad2e8f4873e06a01c1e580e47bbc181fcf 100644 (file)
@@ -31,8 +31,7 @@ obj-y                         := cputable.o ptrace.o syscalls.o \
                                   process.o systbl.o idle.o \
                                   signal.o sysfs.o cacheinfo.o time.o \
                                   prom.o traps.o setup-common.o \
-                                  udbg.o misc.o io.o dma.o \
-                                  misc_$(CONFIG_WORD_SIZE).o \
+                                  udbg.o misc.o io.o dma.o misc_$(BITS).o \
                                   of_platform.o prom_parse.o
 obj-$(CONFIG_PPC64)            += setup_64.o sys_ppc32.o \
                                   signal_64.o ptrace32.o \
@@ -70,23 +69,23 @@ obj-$(CONFIG_HIBERNATION)   += swsusp.o suspend.o
 ifeq ($(CONFIG_FSL_BOOKE),y)
 obj-$(CONFIG_HIBERNATION)      += swsusp_booke.o
 else
-obj-$(CONFIG_HIBERNATION)      += swsusp_$(CONFIG_WORD_SIZE).o
+obj-$(CONFIG_HIBERNATION)      += swsusp_$(BITS).o
 endif
 obj64-$(CONFIG_HIBERNATION)    += swsusp_asm64.o
-obj-$(CONFIG_MODULES)          += module.o module_$(CONFIG_WORD_SIZE).o
+obj-$(CONFIG_MODULES)          += module.o module_$(BITS).o
 obj-$(CONFIG_44x)              += cpu_setup_44x.o
 obj-$(CONFIG_PPC_FSL_BOOK3E)   += cpu_setup_fsl_booke.o
 obj-$(CONFIG_PPC_DOORBELL)     += dbell.o
 obj-$(CONFIG_JUMP_LABEL)       += jump_label.o
 
-extra-y                                := head_$(CONFIG_WORD_SIZE).o
+extra-y                                := head_$(BITS).o
 extra-$(CONFIG_40x)            := head_40x.o
 extra-$(CONFIG_44x)            := head_44x.o
 extra-$(CONFIG_FSL_BOOKE)      := head_fsl_booke.o
 extra-$(CONFIG_8xx)            := head_8xx.o
 extra-y                                += vmlinux.lds
 
-obj-$(CONFIG_RELOCATABLE)      += reloc_$(CONFIG_WORD_SIZE).o
+obj-$(CONFIG_RELOCATABLE)      += reloc_$(BITS).o
 
 obj-$(CONFIG_PPC32)            += entry_32.o setup_32.o
 obj-$(CONFIG_PPC64)            += dma-iommu.o iommu.o
@@ -104,11 +103,11 @@ obj-$(CONFIG_STACKTRACE)  += stacktrace.o
 obj-$(CONFIG_SWIOTLB)          += dma-swiotlb.o
 
 pci64-$(CONFIG_PPC64)          += pci_dn.o pci-hotplug.o isa-bridge.o
-obj-$(CONFIG_PCI)              += pci_$(CONFIG_WORD_SIZE).o $(pci64-y) \
+obj-$(CONFIG_PCI)              += pci_$(BITS).o $(pci64-y) \
                                   pci-common.o pci_of_scan.o
 obj-$(CONFIG_PCI_MSI)          += msi.o
 obj-$(CONFIG_KEXEC)            += machine_kexec.o crash.o \
-                                  machine_kexec_$(CONFIG_WORD_SIZE).o
+                                  machine_kexec_$(BITS).o
 obj-$(CONFIG_AUDIT)            += audit.o
 obj64-$(CONFIG_AUDIT)          += compat_audit.o
 
index ba21be15310f3ebd877ad5bf15e8858323932f96..ad5290005ca432549e8b12f268845bb90834ca76 100644 (file)
@@ -22,7 +22,7 @@ obj64-$(CONFIG_SMP)   += locks.o
 obj64-$(CONFIG_ALTIVEC)        += vmx-helper.o
 
 ifeq ($(CONFIG_GENERIC_CSUM),)
-obj-y                  += checksum_$(CONFIG_WORD_SIZE).o checksum_wrappers.o
+obj-y                  += checksum_$(BITS).o checksum_wrappers.o
 endif
 
 obj-$(CONFIG_PPC_EMULATE_SSTEP)        += sstep.o ldstfp.o
index f2cea6d5e764b845731cdd168a7194815b7624cf..1a4e570f789470dc1fa8108a7470bded5f648558 100644 (file)
@@ -7,17 +7,16 @@ subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror
 ccflags-$(CONFIG_PPC64)        := $(NO_MINIMAL_TOC)
 
 obj-y                          := fault.o mem.o pgtable.o mmap.o \
-                                  init_$(CONFIG_WORD_SIZE).o \
-                                  pgtable_$(CONFIG_WORD_SIZE).o
+                                  init_$(BITS).o pgtable_$(BITS).o
 obj-$(CONFIG_PPC_MMU_NOHASH)   += mmu_context_nohash.o tlb_nohash.o \
                                   tlb_nohash_low.o
-obj-$(CONFIG_PPC_BOOK3E)       += tlb_low_$(CONFIG_WORD_SIZE)e.o
+obj-$(CONFIG_PPC_BOOK3E)       += tlb_low_$(BITS)e.o
 hash64-$(CONFIG_PPC_NATIVE)    := hash_native_64.o
 obj-$(CONFIG_PPC_BOOK3E_64)   += pgtable-book3e.o
 obj-$(CONFIG_PPC_STD_MMU_64)   += pgtable-hash64.o hash_utils_64.o slb_low.o slb.o $(hash64-y) mmu_context_book3s64.o pgtable-book3s64.o
 obj-$(CONFIG_PPC_RADIX_MMU)    += pgtable-radix.o tlb-radix.o
 obj-$(CONFIG_PPC_STD_MMU_32)   += ppc_mmu_32.o hash_low_32.o mmu_context_hash32.o
-obj-$(CONFIG_PPC_STD_MMU)      += tlb_hash$(CONFIG_WORD_SIZE).o
+obj-$(CONFIG_PPC_STD_MMU)      += tlb_hash$(BITS).o
 ifeq ($(CONFIG_PPC_STD_MMU_64),y)
 obj-$(CONFIG_PPC_4K_PAGES)     += hash64_4k.o
 obj-$(CONFIG_PPC_64K_PAGES)    += hash64_64k.o