2005-04-16 22:20:36 +00:00
|
|
|
#
|
2007-11-30 15:11:38 +00:00
|
|
|
# Makefile for rescue (bootstrap) code
|
2005-04-16 22:20:36 +00:00
|
|
|
#
|
2005-07-27 18:44:30 +00:00
|
|
|
|
2009-04-21 09:44:57 +00:00
|
|
|
# CC = gcc-cris -mlinux -march=v32 $(LINUXINCLUDE)
|
|
|
|
# ccflags-$(CONFIG_ETRAX_ARCH_V32) += -I$(srctree)/include/asm/arch/mach/ \
|
|
|
|
# -I$(srctree)/include/asm/arch
|
|
|
|
# asflags-y += -I $(srctree)/include/asm/arch/mach/ -I $(srctree)/include/asm/arch
|
|
|
|
# LD = gcc-cris -mlinux -march=v32 -nostdlib
|
|
|
|
|
2016-10-30 16:09:18 +00:00
|
|
|
ifdef CONFIG_ETRAX_AXISFLASHMAP
|
|
|
|
|
2009-04-21 09:44:57 +00:00
|
|
|
arch-$(CONFIG_ETRAX_ARCH_V10) = v10
|
|
|
|
arch-$(CONFIG_ETRAX_ARCH_V32) = v32
|
|
|
|
|
|
|
|
ldflags-y += -T $(srctree)/$(src)/rescue_$(arch-y).lds
|
2005-04-16 22:20:36 +00:00
|
|
|
OBJCOPYFLAGS = -O binary --remove-section=.bss
|
2009-04-21 09:44:57 +00:00
|
|
|
obj-$(CONFIG_ETRAX_ARCH_V32) = $(obj)/head_v32.o
|
|
|
|
obj-$(CONFIG_ETRAX_ARCH_V10) = $(obj)/head_v10.o
|
|
|
|
OBJECTS := $(obj-y)
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2007-11-30 15:11:38 +00:00
|
|
|
targets := rescue.o rescue.bin
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2009-04-21 09:44:57 +00:00
|
|
|
$(obj)/rescue.o: $(OBJECTS) FORCE
|
2007-11-30 15:11:38 +00:00
|
|
|
$(call if_changed,ld)
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2007-11-30 15:11:38 +00:00
|
|
|
$(obj)/rescue.bin: $(obj)/rescue.o FORCE
|
|
|
|
$(call if_changed,objcopy)
|
|
|
|
cp -p $(obj)/rescue.bin $(objtree)
|
|
|
|
|
2016-10-30 16:09:18 +00:00
|
|
|
else
|
|
|
|
$(obj)/rescue.bin:
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
2007-11-30 15:11:38 +00:00
|
|
|
$(obj)/testrescue.bin: $(obj)/testrescue.o
|
|
|
|
$(OBJCOPY) $(OBJCOPYFLAGS) $(obj)/testrescue.o tr.bin
|
2005-04-16 22:20:36 +00:00
|
|
|
# Pad it to 784 bytes
|
|
|
|
dd if=/dev/zero of=tmp2423 bs=1 count=784
|
|
|
|
cat tr.bin tmp2423 >testrescue_tmp.bin
|
2007-11-30 15:11:38 +00:00
|
|
|
dd if=testrescue_tmp.bin of=$(obj)/testrescue.bin bs=1 count=784
|
2005-04-16 22:20:36 +00:00
|
|
|
rm tr.bin tmp2423 testrescue_tmp.bin
|
|
|
|
|
2009-04-21 09:44:57 +00:00
|
|
|
|
2007-11-30 15:11:38 +00:00
|
|
|
$(obj)/kimagerescue.bin: $(obj)/kimagerescue.o
|
|
|
|
$(OBJCOPY) $(OBJCOPYFLAGS) $(obj)/kimagerescue.o ktr.bin
|
2005-04-16 22:20:36 +00:00
|
|
|
# Pad it to 784 bytes, that's what the rescue loader expects
|
|
|
|
dd if=/dev/zero of=tmp2423 bs=1 count=784
|
|
|
|
cat ktr.bin tmp2423 >kimagerescue_tmp.bin
|
2007-11-30 15:11:38 +00:00
|
|
|
dd if=kimagerescue_tmp.bin of=$(obj)/kimagerescue.bin bs=1 count=784
|
2005-04-16 22:20:36 +00:00
|
|
|
rm ktr.bin tmp2423 kimagerescue_tmp.bin
|
2009-04-21 09:44:57 +00:00
|
|
|
|