# Rewritten by Cort Dougan and Paul Mackerras
#
-# This must match PAGE_OFFSET in include/asm-powerpc/page.h.
-KERNELLOAD := $(CONFIG_KERNEL_START)
-
HAS_BIARCH := $(call cc-option-yn, -m32)
ifeq ($(CONFIG_PPC64),y)
SZ := 32
endif
+UTS_MACHINE := $(OLDARCH)
+
ifeq ($(HAS_BIARCH),y)
override AS += -a$(SZ)
override LD += -m elf$(SZ)ppc
override CC += -m$(SZ)
endif
-LDFLAGS_vmlinux := -Ttext $(KERNELLOAD) -Bstatic -e $(KERNELLOAD)
+LDFLAGS_vmlinux := -Bstatic
# The -Iarch/$(ARCH)/include is temporary while we are merging
CPPFLAGS += -Iarch/$(ARCH) -Iarch/$(ARCH)/include
endif
endif
+# No AltiVec instruction when building kernel
+CFLAGS += $(call cc-option,-mno-altivec)
+
# Enable unit-at-a-time mode when possible. It shrinks the
# kernel considerably.
CFLAGS += $(call cc-option,-funit-at-a-time)
# Default to the common case.
KBUILD_DEFCONFIG := common_defconfig
-head-y := arch/powerpc/kernel/head.o
+head-y := arch/powerpc/kernel/head_32.o
head-$(CONFIG_PPC64) := arch/powerpc/kernel/head_64.o
head-$(CONFIG_8xx) := arch/powerpc/kernel/head_8xx.o
head-$(CONFIG_4xx) := arch/powerpc/kernel/head_4xx.o
head-$(CONFIG_44x) := arch/powerpc/kernel/head_44x.o
head-$(CONFIG_FSL_BOOKE) := arch/powerpc/kernel/head_fsl_booke.o
-ifeq ($(CONFIG_PPC32),y)
-head-$(CONFIG_6xx) += arch/powerpc/kernel/idle_6xx.o
+head-$(CONFIG_PPC64) += arch/powerpc/kernel/entry_64.o
head-$(CONFIG_PPC_FPU) += arch/powerpc/kernel/fpu.o
-endif
-core-y += arch/powerpc/kernel/
-core-y += arch/$(OLDARCH)/kernel/
-core-$(CONFIG_PPC32) += arch/powerpc/mm/
-core-$(CONFIG_PPC64) += arch/$(OLDARCH)/mm/
-core-$(CONFIG_PPC32) += arch/powerpc/lib/
-libs-$(CONFIG_PPC64) += arch/$(OLDARCH)/lib/
-core-y += arch/powerpc/sysdev/
-core-y += arch/powerpc/platforms/
-core-$(CONFIG_PPC32) += arch/ppc/syslib/
+core-y += arch/powerpc/kernel/ \
+ arch/$(OLDARCH)/kernel/ \
+ arch/powerpc/mm/ \
+ arch/powerpc/lib/ \
+ arch/powerpc/sysdev/ \
+ arch/powerpc/platforms/
core-$(CONFIG_MATH_EMULATION) += arch/ppc/math-emu/
core-$(CONFIG_XMON) += arch/powerpc/xmon/
core-$(CONFIG_APUS) += arch/ppc/amiga/
defaultimage-$(CONFIG_PPC32) := uImage zImage
defaultimage-$(CONFIG_PPC_ISERIES) := vmlinux
+defaultimage-$(CONFIG_PPC_PSERIES) := zImage
KBUILD_IMAGE := $(defaultimage-y)
all: $(KBUILD_IMAGE)
boot := arch/$(OLDARCH)/boot
+# urk
+ifeq ($(CONFIG_PPC64),y)
+$(BOOT_TARGETS): vmlinux
+ $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
+else
$(BOOT_TARGETS): vmlinux
- $(Q)$(MAKE) ARCH=$(OLDARCH) $(build)=$(boot) $@
+ $(Q)$(MAKE) ARCH=ppc $(build)=$(boot) $@
+endif
uImage: vmlinux
$(Q)$(MAKE) ARCH=$(OLDARCH) $(build)=$(boot)/images $(boot)/images/$@