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

Subversion Repositories openrisc

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

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
 
33 397 julius
 
34
include $(SW_ROOT)/Makefile.inc
35
 
36 349 julius
OR32_LDFLAGS = -lgcc -Tspiflash-program.ld -e 256
37
 
38
../utils/bin2binsizeword:
39
        $(Q)$(MAKE) -C ../utils bin2binsizeword
40
 
41
$(PROGRAMMINGFILE_SWBIN): $(PROGRAMMINGFILE) ../utils/bin2binsizeword
42
        $(Q)../utils/bin2binsizeword $< $@
43
 
44
$(PROGRAMMINGFILE_DATA): $(PROGRAMMINGFILE_SWBIN)
45
        $(Q)$(OR32_LD) -r -b binary -o $@ $<
46
        $(Q)$(OR32_OBJCOPY) --rename-section .data=.spiprogram $@
47
 
48
%.dis: %.elf
49
        $(Q)$(OR32_OBJDUMP) -d $< > $@
50
 
51
%.bin: %.elf
52
        $(Q)$(OR32_OBJCOPY) -O binary $< $@
53
 
54
clean:
55
        $(Q)rm -f *.elf *.bin *.vmem *.flashin *.dis $(PROGRAMMINGFILE_SWBIN) $(PROGRAMMINGFILE_DATA)
56
 
57
clean-all: clean-support clean

powered by: WebSVN 2.1.0

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