# this architecture
# Core configuration.
-# (Use CPU=<xtensa_config> to use another default compiler.)
+# (Use VAR=<xtensa_config> to use another default compiler.)
-cpu-$(CONFIG_XTENSA_CPU_LINUX_BE) := linux_be
-cpu-$(CONFIG_XTENSA_CPU_LINUX_CUSTOM) := linux_custom
+variant-$(CONFIG_XTENSA_VARIANT_FSF) := fsf
+variant-$(CONFIG_XTENSA_VARIANT_LINUX_CUSTOM) := custom
-CPU = $(cpu-y)
-export CPU
+VARIANT = $(variant-y)
+export VARIANT
# Platform configuration
-platform-y := common
platform-$(CONFIG_XTENSA_PLATFORM_XT2000) := xt2000
platform-$(CONFIG_XTENSA_PLATFORM_ISS) := iss
PLATFORM = $(platform-y)
export PLATFORM
-#LDFLAGS_vmlinux := -T$(word 1,$(LINKSCRIPT))
-AFLAGS_vmlinux.lds.o := -Uxtensa
-CPPFLAGS += -Iarch/xtensa -Iinclude/asm -mlongcalls -g
-AFLAGS += -Iarch/xtensa -Iinclude/asm
-CPP = $(CC) -E $(CFLAGS)
+# temporarily until string.h is fixed
+KBUILD_CFLAGS += -ffreestanding
-cflags-y += -Iarch/xtensa -pipe -mlongcalls
+KBUILD_CFLAGS += -pipe -mlongcalls
-
-KBUILD_DEFCONFIG := common_defconfig
+KBUILD_DEFCONFIG := iss_defconfig
# ramdisk/initrd support
# You need a compressed ramdisk image, named ramdisk.gz in
# Test for cross compiling
-ifneq ($(CPU),)
+ifneq ($(VARIANT),)
COMPILE_ARCH = $(shell uname -m)
ifneq ($(COMPILE_ARCH), xtensa)
ifndef CROSS_COMPILE
- CROSS_COMPILE = xtensa_$(CPU)-
+ CROSS_COMPILE = xtensa_$(VARIANT)-
endif
endif
endif
#
-LIBGCC := $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
+LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
head-y := arch/xtensa/kernel/head.o
-core-y += arch/xtensa/kernel/ \
- arch/xtensa/mm/ arch/xtensa/platform-$(PLATFORM)/
+core-y += arch/xtensa/kernel/ arch/xtensa/mm/
+ifneq ($(PLATFORM),)
+core-y += arch/xtensa/platform-$(PLATFORM)/
+endif
libs-y += arch/xtensa/lib/ $(LIBGCC)
-boot := arch/xtensa/boot
+boot := arch/xtensa/boot
-arch/xtensa/kernel/asm-offsets.s: \
- arch/xtensa/kernel/asm-offsets.c \
- include/asm-xtensa/.platform
+archinc := include/asm-xtensa
-include/asm-xtensa/offsets.h: arch/xtensa/kernel/asm-offsets.s
- $(call filechk,gen-asm-offsets)
+archprepare: $(archinc)/.platform
-prepare: include/asm-xtensa/.platform include/asm-xtensa/offsets.h
-
-# Update machine cpu and platform symlinks if something which affects
+# Update processor variant and platform symlinks if something which affects
# them changed.
-include/asm-xtensa/.platform: $(wildcard include/config/arch/*.h)
- @echo ' Setting up cpu ($(CPU)) and platform ($(PLATFORM)) symlinks'
- $(Q)rm -f include/asm-xtensa/platform
- $(Q)rm -f include/asm-xtensa/xtensa/config
- $(Q)(cd include/asm-xtensa/; ln -sf platform-$(PLATFORM) platform)
- $(Q)(cd include/asm-xtensa/xtensa; ln -sf config-$(CPU) config)
+$(archinc)/.platform: $(wildcard include/config/arch/*.h) include/config/auto.conf
+ @echo ' SYMLINK $(archinc)/variant -> $(archinc)/variant-$(VARIANT)'
+ $(Q)mkdir -p $(archinc)
+ $(Q)ln -fsn $(srctree)/$(archinc)/variant-$(VARIANT) $(archinc)/variant
+ @echo ' SYMLINK $(archinc)/platform -> $(archinc)/platform-$(PLATFORM)'
+ $(Q)ln -fsn $(srctree)/$(archinc)/platform-$(PLATFORM) $(archinc)/platform
+ @touch $@
+
all: zImage
zImage zImage.initrd: vmlinux
$(Q)$(MAKE) $(build)=$(boot) $@
-CLEAN_FILES += arch/xtensa/vmlinux.lds include/asm-xtensa/offset.h
+CLEAN_FILES += arch/xtensa/vmlinux.lds \
+ $(archinc)/platform $(archinc)/variant \
+ $(archinc)/.platform
define archhelp
@echo '* zImage - Compressed kernel image (arch/xtensa/boot/images/zImage.*)'