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
|
2011-12-03 17:02:00 +00:00
|
|
|
tune-$(CONFIG_CPU_XSCALE) :=$(call cc-option,-mtune=xscale,-mtune=strongarm110) -Wa,-mcpu=xscale
|
2009-11-02 18:51:30 +00:00
|
|
|
|
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
|
|
|
|
|
2011-12-10 15:41:07 +00:00
|
|
|
ifeq ($(CONFIG_THUMB2_BAREBOX),y)
|
|
|
|
AFLAGS_AUTOIT :=$(call as-option,-Wa$(comma)-mimplicit-it=always,-Wa$(comma)-mauto-it)
|
|
|
|
AFLAGS_NOWARN :=$(call as-option,-Wa$(comma)-mno-warn-deprecated,-Wa$(comma)-W)
|
|
|
|
CFLAGS_THUMB2 :=-mthumb $(AFLAGS_AUTOIT) $(AFLAGS_NOWARN)
|
|
|
|
AFLAGS_THUMB2 :=$(CFLAGS_THUMB2) -Wa$(comma)-mthumb
|
|
|
|
endif
|
|
|
|
|
|
|
|
CPPFLAGS += $(CFLAGS_ABI) $(arch-y) $(tune-y) -msoft-float $(CFLAGS_THUMB2)
|
|
|
|
AFLAGS += -include asm/unified.h -msoft-float $(AFLAGS_THUMB2)
|
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
|
2012-10-18 19:42:42 +00:00
|
|
|
machine-$(CONFIG_ARCH_BCM2835) := bcm2835
|
2012-11-02 09:17:14 +00:00
|
|
|
machine-$(CONFIG_ARCH_CLPS711X) := clps711x
|
2010-01-12 19:30:36 +00:00
|
|
|
machine-$(CONFIG_ARCH_EP93XX) := ep93xx
|
2013-02-13 10:06:42 +00:00
|
|
|
machine-$(CONFIG_ARCH_HIGHBANK) := highbank
|
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
|
2013-05-09 09:52:47 +00:00
|
|
|
machine-$(CONFIG_ARCH_MVEBU) := mvebu
|
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
|
2011-12-03 17:02:00 +00:00
|
|
|
machine-$(CONFIG_ARCH_PXA) := pxa
|
2012-01-02 11:43:49 +00:00
|
|
|
machine-$(CONFIG_ARCH_SAMSUNG) := samsung
|
2013-09-11 10:06:39 +00:00
|
|
|
machine-$(CONFIG_ARCH_SOCFPGA) := socfpga
|
2010-12-11 07:18:49 +00:00
|
|
|
machine-$(CONFIG_ARCH_VERSATILE) := versatile
|
2013-02-11 12:03:26 +00:00
|
|
|
machine-$(CONFIG_ARCH_VEXPRESS) := vexpress
|
2012-05-28 08:12:32 +00:00
|
|
|
machine-$(CONFIG_ARCH_TEGRA) := tegra
|
2013-03-26 09:11:23 +00:00
|
|
|
machine-$(CONFIG_ARCH_ZYNQ) := zynq
|
2009-11-02 18:51:26 +00:00
|
|
|
|
2013-06-23 11:59:10 +00:00
|
|
|
|
2009-11-02 18:51:26 +00:00
|
|
|
# Board directory name. This list is sorted alphanumerically
|
|
|
|
# by CONFIG_* macro name.
|
2013-06-23 11:59:10 +00:00
|
|
|
#
|
|
|
|
# DO NOT ADD NEW ENTRIES TO THIS LIST!
|
|
|
|
# Add to arch/arm/boards/Makefile instead.
|
|
|
|
#
|
|
|
|
# These are here only because they have a board specific config.h.
|
|
|
|
# TODO: Get rid of board specific config.h and move these to
|
|
|
|
# arch/arm/boards/Makefile aswell.
|
2013-05-24 04:40:57 +00:00
|
|
|
board-$(CONFIG_MACH_A9M2410) += a9m2410
|
|
|
|
board-$(CONFIG_MACH_A9M2440) += a9m2440
|
|
|
|
board-$(CONFIG_MACH_AT91RM9200EK) += at91rm9200ek
|
2013-08-13 06:29:48 +00:00
|
|
|
board-$(CONFIG_MACH_GLOBALSCALE_GURUPLUG) += globalscale-guruplug
|
|
|
|
board-$(CONFIG_MACH_GLOBALSCALE_MIRABOX) += globalscale-mirabox
|
|
|
|
board-$(CONFIG_MACH_MARVELL_ARMADA_XP_GP) += marvell-armada-xp-gp
|
2013-05-24 04:40:57 +00:00
|
|
|
board-$(CONFIG_MACH_MINI2440) += friendlyarm-mini2440
|
|
|
|
board-$(CONFIG_MACH_MINI6410) += friendlyarm-mini6410
|
|
|
|
board-$(CONFIG_MACH_PCM027) += pcm027
|
2013-08-13 06:29:48 +00:00
|
|
|
board-$(CONFIG_MACH_PLATHOME_OPENBLOCKS_AX3) += plathome-openblocks-ax3/
|
2013-06-02 10:37:01 +00:00
|
|
|
board-$(CONFIG_MACH_SOLIDRUN_CUBOX) += solidrun-cubox
|
2013-05-24 04:40:57 +00:00
|
|
|
board-$(CONFIG_MACH_TINY210) += friendlyarm-tiny210
|
|
|
|
board-$(CONFIG_MACH_TINY6410) += friendlyarm-tiny6410
|
2013-08-13 06:29:48 +00:00
|
|
|
board-$(CONFIG_MACH_USI_TOPKICK) += usi-topkick
|
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
|
|
|
|
2011-10-13 22:06:37 +00:00
|
|
|
CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE)
|
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
|
|
|
|
2012-10-07 17:06:30 +00:00
|
|
|
ifdef CONFIG_RELOCATABLE
|
|
|
|
LDFLAGS_barebox += -pie
|
|
|
|
endif
|
|
|
|
|
2012-08-12 14:11:26 +00:00
|
|
|
ifdef CONFIG_IMAGE_COMPRESSION
|
|
|
|
KBUILD_BINARY := arch/arm/pbl/zbarebox.bin
|
|
|
|
else
|
|
|
|
KBUILD_BINARY := barebox.bin
|
|
|
|
endif
|
|
|
|
|
|
|
|
barebox.netx: $(KBUILD_BINARY)
|
2012-08-06 20:31:22 +00:00
|
|
|
$(Q)scripts/gen_netx_image -i $< -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)
|
2012-09-06 10:20:15 +00:00
|
|
|
KBUILD_IMAGE := barebox.netx
|
2007-09-13 13:33:09 +00:00
|
|
|
endif
|
|
|
|
|
2012-08-12 14:11:26 +00:00
|
|
|
barebox.s5p: $(KBUILD_BINARY)
|
2012-08-06 20:31:22 +00:00
|
|
|
$(Q)scripts/s5p_cksum $< barebox.s5p
|
2012-05-18 09:43:28 +00:00
|
|
|
|
|
|
|
ifeq ($(CONFIG_ARCH_S5PCxx),y)
|
2012-09-06 10:20:15 +00:00
|
|
|
KBUILD_IMAGE := barebox.s5p
|
2012-05-18 09:43:28 +00:00
|
|
|
endif
|
|
|
|
|
2012-08-12 14:11:26 +00:00
|
|
|
quiet_cmd_mlo ?= IFT $@
|
2013-09-26 12:58:18 +00:00
|
|
|
cmd_mlo ?= scripts/omap_signGP -o MLO -l $(TEXT_BASE) -c $<
|
2012-08-12 14:11:26 +00:00
|
|
|
|
|
|
|
MLO: $(KBUILD_BINARY)
|
|
|
|
$(call if_changed,mlo)
|
2011-04-06 07:45:03 +00:00
|
|
|
|
|
|
|
ifeq ($(CONFIG_OMAP_BUILD_IFT),y)
|
2012-09-06 10:20:15 +00:00
|
|
|
KBUILD_IMAGE := MLO
|
2011-04-06 07:45:03 +00:00
|
|
|
endif
|
|
|
|
|
2012-09-06 15:23:49 +00:00
|
|
|
quiet_cmd_davinci_ubl_image = UBL-IMG $@
|
|
|
|
cmd_davinci_ubl_image = set -e; \
|
|
|
|
scripts/mkublheader $< > $@; \
|
|
|
|
cat $< >> $@
|
|
|
|
|
|
|
|
barebox.ubl: $(KBUILD_BINARY) FORCE
|
|
|
|
$(call if_changed,davinci_ubl_image)
|
2012-06-28 14:52:17 +00:00
|
|
|
|
|
|
|
ifeq ($(CONFIG_ARCH_DAVINCI),y)
|
2012-09-06 10:20:15 +00:00
|
|
|
KBUILD_IMAGE := barebox.ubl
|
2012-07-26 22:03:12 +00:00
|
|
|
endif
|
|
|
|
|
2012-09-28 16:29:43 +00:00
|
|
|
quiet_cmd_am35xx_spi_image = SPI-IMG $@
|
2013-08-06 09:53:04 +00:00
|
|
|
cmd_am35xx_spi_image = scripts/mk-am35xx-spi-image -a $(TEXT_BASE) $< > $@
|
2012-09-28 16:29:43 +00:00
|
|
|
|
|
|
|
barebox.spi: $(KBUILD_BINARY) FORCE
|
|
|
|
$(call if_changed,am35xx_spi_image)
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_OMAP_BUILD_SPI),y)
|
|
|
|
KBUILD_IMAGE := barebox.spi
|
|
|
|
endif
|
|
|
|
|
2013-05-25 13:18:00 +00:00
|
|
|
quiet_cmd_zynq_image = ZYNQ-IMG $@
|
|
|
|
cmd_zynq_image = scripts/zynq_mkimage $< $@
|
|
|
|
|
|
|
|
barebox.zynq: $(KBUILD_BINARY) FORCE
|
|
|
|
$(call if_changed,zynq_image)
|
2013-03-26 09:11:25 +00:00
|
|
|
|
|
|
|
ifeq ($(machine-y),zynq)
|
|
|
|
KBUILD_IMAGE := barebox.zynq
|
|
|
|
endif
|
|
|
|
|
arm: integrate kwbimage in the image generation
When a ARCH_MVEBU platform is selected, generate barebox.kwb and
barebox.kwbuart images from barebox.bin, using kwbimage.
barebox.kwb is generated by executing kwbimage on the board
kwbimage.cfg file, and is therefore designed to be booted from the
default boot media of the board, as defined by kwbimage.cfg (typically
a NAND flash or SPI flash).
barebox.kwbuart is generated by executing kwbimage on the board
kwbimage.cfg file, but by overriding the boot media to be UART. This
image is suitable for usage with the kwbtool and is generally useful
for recovery purposes.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tested-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Squashed this fixup:
arm: ensure the build doesn't fail when kwbimage lacks the binary blob
mach-mvebu images for Armada 370 and Armada XP SoC require a DDR3
training code which should be extracted from existing bootable images
for the relevant board. When such binary blob has not been extracted,
the build of the .kwb and .kwbuart images will fail. This is annoying
as it makes the build of all Armada 370/XP defconfig fail, which can
be a problem for automated builds.
This proposal makes the failure of kwbimage not a fatal failure for
the build process, and shows a warning. The user therefore sees:
====================================================================
KWB barebox.kwb
Didn't find the file 'plathome-openblocks-ax3-binary.0' in '/home/thomas/projets/barebox' which is mandatory to generate the image
This file generally contains the DDR3 training code, and should be extracted from an existing bootable
image for your board. See 'kwbimage -x' to extract it from an existing image.
Could not create image
WARNING: Couldn't create KWB image due to previous errors.
KWBUART barebox.kwbuart
Didn't find the file 'plathome-openblocks-ax3-binary.0' in '/home/thomas/projets/barebox' which is mandatory to generate the image
This file generally contains the DDR3 training code, and should be extracted from an existing bootable
image for your board. See 'kwbimage -x' to extract it from an existing image.
Could not create image
WARNING Couldn't create KWB image due to previous errors.
====================================================================
The only drawback is that barebox-flash-image, which normally points
to barebox.kwb, becomes a stale symbolic link.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-05-09 09:52:48 +00:00
|
|
|
KWBIMAGE_OPTS = \
|
|
|
|
-c -i $(srctree)/$(BOARD)/kwbimage.cfg -d $(TEXT_BASE) -e $(TEXT_BASE)
|
|
|
|
|
|
|
|
quiet_cmd_kwbimage = KWB $@
|
|
|
|
cmd_kwbimage = scripts/kwbimage -p $< $(KWBIMAGE_OPTS) -o $@ || \
|
|
|
|
echo "WARNING: Couldn't create KWB image due to previous errors."
|
|
|
|
|
|
|
|
quiet_cmd_kwbimage_uart = KWBUART $@
|
|
|
|
cmd_kwbimage_uart = scripts/kwbimage -m uart -p $< $(KWBIMAGE_OPTS) -o $@ || \
|
|
|
|
echo "WARNING Couldn't create KWB image due to previous errors."
|
|
|
|
|
|
|
|
barebox.kwb: $(KBUILD_BINARY) FORCE
|
|
|
|
$(call if_changed,kwbimage)
|
|
|
|
|
|
|
|
barebox.kwbuart: $(KBUILD_BINARY) FORCE
|
|
|
|
$(call if_changed,kwbimage_uart)
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_ARCH_MVEBU),y)
|
|
|
|
KBUILD_IMAGE := barebox.kwb barebox.kwbuart
|
|
|
|
endif
|
|
|
|
|
2012-07-27 17:25:56 +00:00
|
|
|
pbl := arch/arm/pbl
|
2013-05-28 08:39:43 +00:00
|
|
|
$(pbl)/zbarebox.S $(pbl)/zbarebox.bin $(pbl)/zbarebox: barebox.bin FORCE
|
2013-05-24 20:20:40 +00:00
|
|
|
$(Q)$(MAKE) $(build)=$(pbl) $@
|
2012-07-27 17:25:56 +00:00
|
|
|
|
|
|
|
archclean:
|
|
|
|
$(MAKE) $(clean)=$(pbl)
|
|
|
|
|
2013-03-10 12:49:16 +00:00
|
|
|
dts := arch/arm/dts
|
|
|
|
|
|
|
|
%.dtb: scripts
|
|
|
|
$(Q)$(MAKE) $(build)=$(dts) $(dts)/$@
|
|
|
|
|
2012-09-06 10:20:15 +00:00
|
|
|
KBUILD_IMAGE ?= $(KBUILD_BINARY)
|
2012-08-12 14:11:26 +00:00
|
|
|
|
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
|
|
|
|
|
2013-06-23 11:59:10 +00:00
|
|
|
common-y += $(BOARD) arch/arm/boards/ $(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
|
|
|
|
2013-06-21 21:48:25 +00:00
|
|
|
common-$(CONFIG_OFTREE) += arch/arm/dts/
|
2013-03-10 12:49:16 +00:00
|
|
|
|
2012-07-08 10:23:11 +00:00
|
|
|
lds-y := arch/arm/lib/barebox.lds
|
2007-10-17 10:21:53 +00:00
|
|
|
|
2013-05-24 04:40:57 +00:00
|
|
|
common- += $(patsubst %,arch/arm/boards/%/,$(board-))
|
|
|
|
|
2012-08-12 14:11:26 +00:00
|
|
|
CLEAN_FILES += include/generated/mach-types.h arch/arm/lib/barebox.lds barebox-flash-image
|