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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [orpsocv2/] [sw/] [apps/] [spiflash/] [Makefile] - Blame information for rev 624

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 349 julius
# This makefile allows you generate a program which will program an SPI flash
2
# part with another program.
3
 
4
# It requires that the PROGRAMMINGFILE variable to set to a binary copy of a
5
# program to program the SPI flash with. The file must already exist, the script
6
# will not automagically compile it for you.
7
# eg.
8
# $ make spiflash-program.elf PROGRAMMINGFILE=../gpio/gpio-board.bin
9
 
10
# This binary file is then converted to a version that will be loaded into the
11
# SPI flash (the size of the image is set in the first word), and then converted
12
# to an object file with the data in a section called .spiprogram
13
 
14
# A linker script is then used to put this section into the resulting ELF file
15
# that will do the programming of the SPI flash
16
 
17
# Simply running this program on the processor should program the SPI flash
18
# memory.
19
 
20
#
21
# author: julius.baxter@orsoc.se
22
#
23
 
24 397 julius
SW_ROOT=../..
25
 
26 349 julius
#PROGRAMMINGFILE=
27
PROGRAMMINGFILE_SWBIN=progfile.swbin # Binary file with sizeword
28
PROGRAMMINGFILE_DATA=progfile.o
29
 
30
ELF_DEPENDS +=$(PROGRAMMINGFILE_DATA)
31
 
32 397 julius
include $(SW_ROOT)/Makefile.inc
33
 
34 465 julius
OR32_LDFLAGS = -L$(SW_ROOT)/lib -lorpsoc -lgcc -Tspiflash-program.ld -e 256
35 349 julius
 
36 408 julius
$(SW_ROOT)/utils/bin2binsizeword:
37
        $(Q)$(MAKE) -C $(SW_ROOT)/utils bin2binsizeword
38 349 julius
 
39 408 julius
$(PROGRAMMINGFILE_SWBIN): $(PROGRAMMINGFILE) $(SW_ROOT)/utils/bin2binsizeword
40
        $(Q)$(SW_ROOT)/utils/bin2binsizeword $< $@
41 349 julius
 
42
$(PROGRAMMINGFILE_DATA): $(PROGRAMMINGFILE_SWBIN)
43
        $(Q)$(OR32_LD) -r -b binary -o $@ $<
44
        $(Q)$(OR32_OBJCOPY) --rename-section .data=.spiprogram $@
45
 
46
%.dis: %.elf
47
        $(Q)$(OR32_OBJDUMP) -d $< > $@
48
 
49
%.bin: %.elf
50
        $(Q)$(OR32_OBJCOPY) -O binary $< $@
51
 
52
clean:
53
        $(Q)rm -f *.elf *.bin *.vmem *.flashin *.dis $(PROGRAMMINGFILE_SWBIN) $(PROGRAMMINGFILE_DATA)
54
 
55 449 julius
#distclean: clean

powered by: WebSVN 2.1.0

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