OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [orpsocv2/] [sw/] [apps/] [spiflash/] [Makefile] - Diff between revs 397 and 408

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 397 Rev 408
# This makefile allows you generate a program which will program an SPI flash
# This makefile allows you generate a program which will program an SPI flash
# part with another program.
# part with another program.
# It requires that the PROGRAMMINGFILE variable to set to a binary copy of a
# It requires that the PROGRAMMINGFILE variable to set to a binary copy of a
# program to program the SPI flash with. The file must already exist, the script
# program to program the SPI flash with. The file must already exist, the script
# will not automagically compile it for you.
# will not automagically compile it for you.
# eg.
# eg.
# $ make spiflash-program.elf PROGRAMMINGFILE=../gpio/gpio-board.bin
# $ make spiflash-program.elf PROGRAMMINGFILE=../gpio/gpio-board.bin
# This binary file is then converted to a version that will be loaded into the
# This binary file is then converted to a version that will be loaded into the
# SPI flash (the size of the image is set in the first word), and then converted
# SPI flash (the size of the image is set in the first word), and then converted
# to an object file with the data in a section called .spiprogram
# to an object file with the data in a section called .spiprogram
# A linker script is then used to put this section into the resulting ELF file
# A linker script is then used to put this section into the resulting ELF file
# that will do the programming of the SPI flash
# that will do the programming of the SPI flash
# Simply running this program on the processor should program the SPI flash
# Simply running this program on the processor should program the SPI flash
# memory.
# memory.
#
#
# author: julius.baxter@orsoc.se
# author: julius.baxter@orsoc.se
#
#
SW_ROOT=../..
SW_ROOT=../..
#PROGRAMMINGFILE=
#PROGRAMMINGFILE=
PROGRAMMINGFILE_SWBIN=progfile.swbin # Binary file with sizeword
PROGRAMMINGFILE_SWBIN=progfile.swbin # Binary file with sizeword
PROGRAMMINGFILE_DATA=progfile.o
PROGRAMMINGFILE_DATA=progfile.o
ELF_DEPENDS +=$(PROGRAMMINGFILE_DATA)
ELF_DEPENDS +=$(PROGRAMMINGFILE_DATA)
 
 
 
 
 
 
include $(SW_ROOT)/Makefile.inc
include $(SW_ROOT)/Makefile.inc
OR32_LDFLAGS = -lgcc -Tspiflash-program.ld -e 256
OR32_LDFLAGS = -lgcc -Tspiflash-program.ld -e 256
 
 
../utils/bin2binsizeword:
$(SW_ROOT)/utils/bin2binsizeword:
        $(Q)$(MAKE) -C ../utils bin2binsizeword
        $(Q)$(MAKE) -C $(SW_ROOT)/utils bin2binsizeword
 
 
$(PROGRAMMINGFILE_SWBIN): $(PROGRAMMINGFILE) ../utils/bin2binsizeword
$(PROGRAMMINGFILE_SWBIN): $(PROGRAMMINGFILE) $(SW_ROOT)/utils/bin2binsizeword
        $(Q)../utils/bin2binsizeword $< $@
        $(Q)$(SW_ROOT)/utils/bin2binsizeword $< $@
 
 
$(PROGRAMMINGFILE_DATA): $(PROGRAMMINGFILE_SWBIN)
$(PROGRAMMINGFILE_DATA): $(PROGRAMMINGFILE_SWBIN)
        $(Q)$(OR32_LD) -r -b binary -o $@ $<
        $(Q)$(OR32_LD) -r -b binary -o $@ $<
        $(Q)$(OR32_OBJCOPY) --rename-section .data=.spiprogram $@
        $(Q)$(OR32_OBJCOPY) --rename-section .data=.spiprogram $@
%.dis: %.elf
%.dis: %.elf
        $(Q)$(OR32_OBJDUMP) -d $< > $@
        $(Q)$(OR32_OBJDUMP) -d $< > $@
%.bin: %.elf
%.bin: %.elf
        $(Q)$(OR32_OBJCOPY) -O binary $< $@
        $(Q)$(OR32_OBJCOPY) -O binary $< $@
clean:
clean:
        $(Q)rm -f *.elf *.bin *.vmem *.flashin *.dis $(PROGRAMMINGFILE_SWBIN) $(PROGRAMMINGFILE_DATA)
        $(Q)rm -f *.elf *.bin *.vmem *.flashin *.dis $(PROGRAMMINGFILE_SWBIN) $(PROGRAMMINGFILE_DATA)
 
 
clean-all: clean-support clean
#clean-all: clean
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.