2007-07-05 16:01:13 +00:00
|
|
|
|
2009-11-02 18:51:28 +00:00
|
|
|
CPPFLAGS += -D__ARM__ -fno-strict-aliasing
|
|
|
|
# Explicitly specifiy 32-bit ARM ISA since toolchain default can be -mthumb:
|
|
|
|
CPPFLAGS +=$(call cc-option,-marm,)
|
2007-07-05 16:01:14 +00:00
|
|
|
|
2009-11-02 18:51:29 +00:00
|
|
|
ifeq ($(CONFIG_CPU_BIG_ENDIAN),y)
|
|
|
|
CPPFLAGS += -mbig-endian
|
|
|
|
AS += -EB
|
|
|
|
LD += -EB
|
|
|
|
else
|
|
|
|
CPPFLAGS += -mlittle-endian
|
|
|
|
AS += -EL
|
|
|
|
LD += -EL
|
|
|
|
endif
|
|
|
|
|
2009-11-02 18:51:30 +00:00
|
|
|
comma = ,
|
|
|
|
|
|
|
|
# This selects which instruction set is used.
|
|
|
|
# Note that GCC does not numerically define an architecture version
|
|
|
|
# macro, but instead defines a whole series of macros which makes
|
|
|
|
# testing for a specific architecture or later rather impossible.
|
|
|
|
arch-$(CONFIG_CPU_32v7) :=-D__LINUX_ARM_ARCH__=7 $(call cc-option,-march=armv7-a,-march=armv5t -Wa$(comma)-march=armv7-a)
|
2010-04-28 09:42:02 +00:00
|
|
|
arch-$(CONFIG_CPU_32v6) :=-D__LINUX_ARM_ARCH__=6 $(call cc-option,-march=armv6,-march=armv5t -Wa$(comma)-march=armv6)
|
2009-11-02 18:51:30 +00:00
|
|
|
arch-$(CONFIG_CPU_32v5) :=-D__LINUX_ARM_ARCH__=5 $(call cc-option,-march=armv5te,-march=armv4t)
|
|
|
|
arch-$(CONFIG_CPU_32v4T) :=-D__LINUX_ARM_ARCH__=4 -march=armv4t
|
|
|
|
|
|
|
|
# This selects how we optimise for the processor.
|
|
|
|
tune-$(CONFIG_CPU_ARM920T) :=-mtune=arm9tdmi
|
|
|
|
tune-$(CONFIG_CPU_ARM926T) :=-mtune=arm9tdmi
|
|
|
|
|
2009-10-31 08:07:14 +00:00
|
|
|
ifeq ($(CONFIG_AEABI),y)
|
|
|
|
CFLAGS_ABI :=-mabi=aapcs-linux -mno-thumb-interwork
|
|
|
|
else
|
|
|
|
CFLAGS_ABI :=$(call cc-option,-mapcs-32,-mabi=apcs-gnu) $(call cc-option,-mno-thumb-interwork,)
|
|
|
|
endif
|
|
|
|
|
2011-03-08 10:59:12 +00:00
|
|
|
ifeq ($(CONFIG_ARM_UNWIND),y)
|
|
|
|
CFLAGS_ABI +=-funwind-tables
|
|
|
|
endif
|
|
|
|
|
2009-10-31 08:07:14 +00:00
|
|
|
CPPFLAGS += $(CFLAGS_ABI) $(arch-y) $(tune-y)
|
2011-01-14 15:44:18 +00:00
|
|
|
AFLAGS += -include asm/unified.h
|
2009-11-02 18:51:30 +00:00
|
|
|
|
2009-11-02 18:51:26 +00:00
|
|
|
# Machine directory name. This list is sorted alphanumerically
|
|
|
|
# by CONFIG_* macro name.
|
|
|
|
machine-$(CONFIG_ARCH_AT91) := at91
|
2010-01-12 19:30:36 +00:00
|
|
|
machine-$(CONFIG_ARCH_EP93XX) := ep93xx
|
2009-11-02 18:51:26 +00:00
|
|
|
machine-$(CONFIG_ARCH_IMX) := imx
|
2011-01-20 09:21:01 +00:00
|
|
|
machine-$(CONFIG_ARCH_MXS) := mxs
|
2010-08-04 01:43:57 +00:00
|
|
|
machine-$(CONFIG_ARCH_NOMADIK) := nomadik
|
2009-11-02 18:51:26 +00:00
|
|
|
machine-$(CONFIG_ARCH_NETX) := netx
|
|
|
|
machine-$(CONFIG_ARCH_OMAP) := omap
|
|
|
|
machine-$(CONFIG_ARCH_S3C24xx) := s3c24xx
|
2010-12-11 07:18:49 +00:00
|
|
|
machine-$(CONFIG_ARCH_VERSATILE) := versatile
|
2009-11-02 18:51:26 +00:00
|
|
|
|
|
|
|
# Board directory name. This list is sorted alphanumerically
|
|
|
|
# by CONFIG_* macro name.
|
|
|
|
board-$(CONFIG_MACH_A9M2410) := a9m2410
|
|
|
|
board-$(CONFIG_MACH_A9M2440) := a9m2440
|
|
|
|
board-$(CONFIG_MACH_AT91SAM9260EK) := at91sam9260ek
|
2009-10-25 09:07:11 +00:00
|
|
|
board-$(CONFIG_MACH_AT91SAM9261EK) := at91sam9261ek
|
2009-11-02 18:51:26 +00:00
|
|
|
board-$(CONFIG_MACH_AT91SAM9263EK) := at91sam9263ek
|
2010-09-18 01:12:28 +00:00
|
|
|
board-$(CONFIG_MACH_AT91SAM9G10EK) := at91sam9261ek
|
2010-09-18 02:26:14 +00:00
|
|
|
board-$(CONFIG_MACH_AT91SAM9G20EK) := at91sam9260ek
|
2010-09-21 20:48:21 +00:00
|
|
|
board-$(CONFIG_MACH_AT91SAM9M10G45EK) := at91sam9m10g45ek
|
2010-01-12 19:30:36 +00:00
|
|
|
board-$(CONFIG_MACH_EDB9301) := edb93xx
|
|
|
|
board-$(CONFIG_MACH_EDB9302) := edb93xx
|
|
|
|
board-$(CONFIG_MACH_EDB9302A) := edb93xx
|
|
|
|
board-$(CONFIG_MACH_EDB9307) := edb93xx
|
|
|
|
board-$(CONFIG_MACH_EDB9307A) := edb93xx
|
|
|
|
board-$(CONFIG_MACH_EDB93012) := edb93xx
|
|
|
|
board-$(CONFIG_MACH_EDB9315) := edb93xx
|
|
|
|
board-$(CONFIG_MACH_EDB9315A) := edb93xx
|
2010-05-24 10:37:51 +00:00
|
|
|
board-$(CONFIG_MACH_EUKREA_CPUIMX25) := eukrea_cpuimx25
|
2009-11-02 18:51:26 +00:00
|
|
|
board-$(CONFIG_MACH_EUKREA_CPUIMX27) := eukrea_cpuimx27
|
2010-06-10 07:43:02 +00:00
|
|
|
board-$(CONFIG_MACH_EUKREA_CPUIMX35) := eukrea_cpuimx35
|
2011-02-25 14:57:10 +00:00
|
|
|
board-$(CONFIG_MACH_EUKREA_CPUIMX51SD) := eukrea_cpuimx51
|
2009-11-02 18:51:26 +00:00
|
|
|
board-$(CONFIG_MACH_FREESCALE_MX25_3STACK) := freescale-mx25-3-stack
|
2010-01-27 12:31:05 +00:00
|
|
|
board-$(CONFIG_MACH_FREESCALE_MX35_3STACK) := freescale-mx35-3-stack
|
2009-11-02 18:51:26 +00:00
|
|
|
board-$(CONFIG_MACH_IMX21ADS) := imx21ads
|
|
|
|
board-$(CONFIG_MACH_IMX27ADS) := imx27ads
|
|
|
|
board-$(CONFIG_MACH_MMCCPU) := mmccpu
|
|
|
|
board-$(CONFIG_MACH_MX1ADS) := mx1ads
|
2010-08-04 01:43:59 +00:00
|
|
|
board-$(CONFIG_MACH_NOMADIK_8815NHK) := nhk8815
|
2009-11-02 18:51:26 +00:00
|
|
|
board-$(CONFIG_MACH_NXDB500) := netx
|
2009-12-09 08:36:55 +00:00
|
|
|
board-$(CONFIG_ARCH_OMAP) := omap
|
2009-11-02 18:51:26 +00:00
|
|
|
board-$(CONFIG_MACH_PCA100) := phycard-i.MX27
|
|
|
|
board-$(CONFIG_MACH_PCM037) := pcm037
|
|
|
|
board-$(CONFIG_MACH_PCM038) := pcm038
|
|
|
|
board-$(CONFIG_MACH_PCM043) := pcm043
|
2009-10-25 09:07:16 +00:00
|
|
|
board-$(CONFIG_MACH_PM9261) := pm9261
|
2009-11-02 18:51:26 +00:00
|
|
|
board-$(CONFIG_MACH_PM9263) := pm9263
|
2010-10-02 02:56:02 +00:00
|
|
|
board-$(CONFIG_MACH_PM9G45) := pm9g45
|
2009-11-02 18:51:26 +00:00
|
|
|
board-$(CONFIG_MACH_SCB9328) := scb9328
|
2010-06-16 12:28:27 +00:00
|
|
|
board-$(CONFIG_MACH_NESO) := guf-neso
|
2010-10-11 08:58:47 +00:00
|
|
|
board-$(CONFIG_MACH_MX23EVK) := freescale-mx23-evk
|
2010-10-11 08:58:47 +00:00
|
|
|
board-$(CONFIG_MACH_CHUMBY) := chumby_falconwing
|
2010-12-13 10:53:36 +00:00
|
|
|
board-$(CONFIG_MACH_TX28) := karo-tx28
|
2010-10-11 11:01:44 +00:00
|
|
|
board-$(CONFIG_MACH_FREESCALE_MX51_PDK) := freescale-mx51-pdk
|
2010-10-12 14:39:08 +00:00
|
|
|
board-$(CONFIG_MACH_GUF_CUPID) := guf-cupid
|
2010-10-19 07:48:52 +00:00
|
|
|
board-$(CONFIG_MACH_MINI2440) := mini2440
|
2010-12-11 07:18:49 +00:00
|
|
|
board-$(CONFIG_MACH_VERSATILEPB) := versatile
|
2011-02-11 07:43:05 +00:00
|
|
|
board-$(CONFIG_MACH_TX25) := karo-tx25
|
2008-06-04 07:31:15 +00:00
|
|
|
|
2009-10-22 12:21:25 +00:00
|
|
|
machdirs := $(patsubst %,arch/arm/mach-%/,$(machine-y))
|
|
|
|
|
|
|
|
ifeq ($(KBUILD_SRC),)
|
|
|
|
CPPFLAGS += $(patsubst %,-I%include,$(machdirs))
|
|
|
|
else
|
|
|
|
CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(machdirs))
|
|
|
|
endif
|
|
|
|
|
2007-07-05 16:01:24 +00:00
|
|
|
TEXT_BASE = $(CONFIG_TEXT_BASE)
|
2007-07-05 16:01:14 +00:00
|
|
|
|
2009-12-08 12:40:02 +00:00
|
|
|
CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE) -P
|
2007-07-05 16:01:14 +00:00
|
|
|
|
2008-07-03 08:30:44 +00:00
|
|
|
ifndef CONFIG_MODULES
|
2008-05-12 13:52:23 +00:00
|
|
|
# Add cleanup flags
|
|
|
|
CPPFLAGS += -fdata-sections -ffunction-sections
|
2009-12-15 08:11:09 +00:00
|
|
|
LDFLAGS_barebox += -static --gc-sections
|
2008-07-03 08:30:44 +00:00
|
|
|
endif
|
2008-05-12 13:52:23 +00:00
|
|
|
|
2009-12-15 08:11:09 +00:00
|
|
|
barebox.netx: barebox.bin
|
|
|
|
$(Q)scripts/gen_netx_image -i barebox.bin -o barebox.netx \
|
2007-09-13 13:33:09 +00:00
|
|
|
--sdramctrl=$(CONFIG_NETX_SDRAM_CTRL) \
|
|
|
|
--sdramtimctrl=$(CONFIG_NETX_SDRAM_TIMING_CTRL) \
|
|
|
|
--memctrl=$(CONFIG_NETX_MEM_CTRL) \
|
|
|
|
--entrypoint=$(CONFIG_TEXT_BASE) \
|
|
|
|
--cookie=$(CONFIG_NETX_COOKIE);
|
|
|
|
|
|
|
|
ifeq ($(machine-y),netx)
|
2009-12-15 08:11:09 +00:00
|
|
|
KBUILD_IMAGE := barebox.netx
|
2007-09-13 13:33:09 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
all: $(KBUILD_IMAGE)
|
|
|
|
|
2007-07-05 16:01:14 +00:00
|
|
|
archprepare: maketools
|
2009-10-25 23:51:44 +00:00
|
|
|
maketools:
|
2010-09-16 08:28:38 +00:00
|
|
|
$(Q)$(MAKE) $(build)=arch/arm/tools include/generated/mach-types.h
|
2007-07-05 16:01:14 +00:00
|
|
|
|
|
|
|
PHONY += maketools
|
|
|
|
|
|
|
|
ifneq ($(board-y),)
|
2010-07-22 03:00:13 +00:00
|
|
|
BOARD := arch/arm/boards/$(board-y)/
|
2007-07-05 16:01:14 +00:00
|
|
|
else
|
2009-11-02 18:51:26 +00:00
|
|
|
BOARD :=
|
2007-07-05 16:01:14 +00:00
|
|
|
endif
|
|
|
|
|
2007-10-17 15:57:55 +00:00
|
|
|
ifneq ($(machine-y),)
|
2009-11-02 18:51:26 +00:00
|
|
|
MACH := arch/arm/mach-$(machine-y)/
|
2007-07-05 16:01:14 +00:00
|
|
|
else
|
2009-11-02 18:51:26 +00:00
|
|
|
MACH :=
|
2007-07-05 16:01:14 +00:00
|
|
|
endif
|
|
|
|
|
2007-07-05 16:01:59 +00:00
|
|
|
common-y += $(BOARD) $(MACH)
|
2010-08-30 17:36:52 +00:00
|
|
|
common-y += arch/arm/lib/ arch/arm/cpu/
|
2007-07-05 16:01:17 +00:00
|
|
|
|
2009-12-15 08:11:09 +00:00
|
|
|
lds-$(CONFIG_GENERIC_LINKER_SCRIPT) := arch/arm/lib/barebox.lds
|
|
|
|
lds-$(CONFIG_BOARD_LINKER_SCRIPT) := $(BOARD)/barebox.lds
|
2007-10-17 10:21:53 +00:00
|
|
|
|
2010-09-16 08:28:38 +00:00
|
|
|
CLEAN_FILES += include/generated/mach-types.h arch/arm/lib/barebox.lds
|