source: umon/ports/beagleboneblack/Makefile @ 696ee75

Last change on this file since 696ee75 was 696ee75, checked in by Ben Gras <beng@…>, on 06/20/16 at 12:36:21

FAT fs changes: FAT code and larger ROM size

. add fatfs umon cli to it. unmodified from the umon 1.19

distribution, apache-licensed.

. also add dosfs from the umon 1.19 distribution, which is

similarly liberally licensed.

. increase available 'ROM' size to 128kB minus

1kB secure + 18kB reserved (numbers from uboot wiki).

. no unaligned access - needed to access fields in

on-disk structs without gcc generating unaligned
access instructions (causes data abort exceptions)

. turn on shellvars for BBB as they are needed to

connect FATFS to the SD i/o functions

  • Property mode set to 100644
File size: 5.4 KB
Line 
1###############################################################################
2#
3# Beaglebone Black makefile
4#
5#
6
7ifeq ($(UMONTOP),)
8$(error UMONTOP not set)
9endif
10
11ifeq ($(RTEMSPREFIX),)
12$(error RTEMSPREFIX not set)
13endif
14
15ifeq ($(RTEMSVERSION),)
16$(error RTEMSVERSION not set)
17endif
18
19PLATFORM                = BEAGLEBONEBLACK
20TOPDIR                  = $(UMONTOP)
21TGTDIR                  = beagleboneblack
22CPUTYPE                 = arm
23FILETYPE                = elf
24TOOLSET                 = RTEMS
25
26ifeq ($(TOOLSET),RTEMS)
27#
28# Using tools built by RTEMS Source Builder:
29#
30ABIDIR          = $(RTEMSPREFIX)/lib/gcc/arm-rtems$(RTEMSVERSION)/4.9.2
31TOOL_PREFIX     = arm-rtems$(RTEMSVERSION)
32else
33#
34# Using tools installed by "sudo apt-get install gcc-arm-none-eabi"...
35#
36ABIDIR          = /usr/lib/gcc/arm-none-eabi/4.8.2
37TOOL_PREFIX     = /usr/bin/arm-none-eabi
38endif
39
40LIBABIDIR       = -L $(ABIDIR)
41COMMON_AFLAGS   = -c -D PLATFORM_$(PLATFORM)=1 -D ASSEMBLY_ONLY
42CUSTOM_CFLAGS   = -mcpu=cortex-a8 -O2 -isystem $(ABIDIR)/include -Wno-char-subscripts -mno-unaligned-access
43
44
45###############################################################################
46#
47# Memory map configuration:
48# The following variables are used to establish the system's memory map.
49#
50BOOTROMBASE=0x402F0400
51BOOTROMLEN=0x01b000
52BOOTRAMBASE=0x80000000
53BOOTRAMLEN=0x010000
54RAMTSTROMBASE=0x80100000
55RAMTSTROMLEN=0x100000
56ATAGSIZE=0x1000
57
58# These next two hard-coded values are used by the ramtst version of
59# uMon to allow it to know where these flash-based structures are located.
60MACADDRBASE=0x08000020
61ALTTFSDEVTBLBASE=0x08000040
62
63include $(TOPDIR)/make/common.make
64
65# Build each variable from a list of individual filenames...
66#
67LOCSSRC         =
68CPUSSRC         = vectors_arm.S
69LOCCSRC         = cpuio.c etherdev.c am335x_sd.c am335x_mmc.c
70COMCSRC         = arp.c cast.c cache.c chario.c cmdtbl.c \
71                          docmd.c dhcp_00.c dhcpboot.c dns.c edit.c env.c ethernet.c \
72                          flash.c gdb.c icmp.c if.c ledit_vt100.c monprof.c \
73                          fbi.c font.c mprintf.c memcmds.c malloc.c moncom.c memtrace.c \
74                          misccmds.c misc.c nand.c password.c redirect.c \
75                          reg_cache.c sbrk.c sd.c \
76                          start.c struct.c symtbl.c syslog.c tcpstuff.c tfs.c tfsapi.c \
77                          tfsclean1.c tfscli.c tfsloader.c tfslog.c tftp.c timestuff.c \
78                          tsi.c xmodem.c dosfs.c fatfs.c
79CPUCSRC         = except_arm.c misc_arm.c strace_arm.c
80IODEVSRC        = uart16550.c
81FLASHSRC        =
82
83
84include $(TOPDIR)/make/objects.make
85
86OBJS    =       $(LOCSOBJ) $(CPUSOBJ) $(LOCCOBJ) $(CPUCOBJ) $(COMCOBJ) \
87                        $(FLASHOBJ) $(IODEVOBJ)
88
89#########################################################################
90#
91# Targets...
92
93# boot:
94# The default target is "boot", a shortcut to $(BUILDDIR)/boot.$(FILETYPE).
95# This builds the bootflash image that can be used by 'newmon' to
96# load a new version onto an already running system.
97#
98boot:   $(BUILDDIR)/boot.$(FILETYPE)
99        $(CC) $(ASMFLAGS) -D \
100                BIN_SIZE=$(shell wc --bytes build_$(PLATFORM)/boot.bin | cut -f 1 -d ' ') \
101                -o gp_header.o gp_header.S
102        ${CC} ${ASMFLAGS} -o config_header.o config_header.S
103        $(OBJCOPY) -O binary gp_header.o build_$(PLATFORM)/gp_header.bin
104        ${OBJCOPY} -O binary config_header.o build_${PLATFORM}/config_header.bin
105        @cat build_$(PLATFORM)/gp_header.bin build_$(PLATFORM)/boot.bin > build_$(PLATFORM)/MLO
106        @cat build_$(PLATFORM)/config_header.bin build_$(PLATFORM)/gp_header.bin \
107                build_$(PLATFORM)/boot.bin > build_$(PLATFORM)/rawboot.bin
108        @echo Boot version of uMon built under $(BUILDDIR) ...
109        @ls $(BUILDDIR)/boot*
110        @echo Boot version of uMon prepended with a GP header built under $(BUILDDIR) ...
111        @ls $(BUILDDIR)/MLO
112        @echo Boot version of uMon prepended with a Configuration header and a GP header built
113        @echo under $(BUILDDIR) ...
114        @ls $(BUILDDIR)/rawboot.bin
115
116# ramtst:
117# A shortcut to $(BUILDDIR)/ramtst.$(FILETYPE).  This is a version of uMon
118# that resides strictly in RAM and is used for two main purposes:
119# 1. To test new monitor features prior to burning the boot flash.
120# 2. To be downloaded into the RAM space of a board that has no programmed
121#    boot flash.  This provides a running monitor that can then accept
122#    an incoming bootflash image using 'newmon'.
123#
124ramtst: $(BUILDDIR)/ramtst.$(FILETYPE)
125        @echo Ram-resident test version of uMon built under $(BUILDDIR) ...
126        @ls $(BUILDDIR)/ramtst*
127
128$(BUILDDIR)/boot.$(FILETYPE): $(BUILDDIR) $(OBJS) libz.a \
129                libg.a Makefile
130        $(CC) $(ASMFLAGS) -o rom_reset.o rom_reset.S
131        $(MAKE_MONBUILT)
132        sed -e s/ROMBASE/$(BOOTROMBASE)/ -e s/ROMLEN/$(BOOTROMLEN)/ \
133                -e s/DRAMBASE/$(BOOTRAMBASE)/ -e s/DRAMLEN/$(BOOTRAMLEN)/ -e s/ATAGSIZE/$(ATAGSIZE)/ \
134                $(PLATFORM)_$(@F:.$(FILETYPE)=.ldt) > $(PLATFORM)_$(@F:.$(FILETYPE)=.ld)
135        $(LINK) -e coldstart $(OBJS) monbuilt.o libz.a \
136                libg.a $(LIBABIDIR) $(LIBGCC)
137        $(MAKE_BINARY)
138        $(MAKE_GNUSYMS)
139
140$(BUILDDIR)/ramtst.$(FILETYPE): $(BUILDDIR) $(OBJS) libz.a \
141                libg.a Makefile
142        $(CC) $(ASMFLAGS) -o ram_reset.o ram_reset.S
143        $(MAKE_MONBUILT)
144        sed -e s/RAMTSTROMBASE/$(RAMTSTROMBASE)/ \
145                -e s/RAMTSTROMLEN/$(RAMTSTROMLEN)/ -e s/ATAGSIZE/$(ATAGSIZE)/ \
146                -e s/MACADDRBASE/$(MACADDRBASE)/ -e s/ALTTFSDEVTBLBASE/$(ALTTFSDEVTBLBASE)/ \
147                $(PLATFORM)_$(@F:.$(FILETYPE)=.ldt) > $(PLATFORM)_$(@F:.$(FILETYPE)=.ld)
148
149        $(LINK) -e coldstart $(OBJS) monbuilt.o libz.a libg.a $(LIBGCC)
150        $(MAKE_BINARY)
151        $(MAKE_GNUSYMS)
152
153include $(TOPDIR)/make/rules.make
154
155
156#########################################################################
157#
158# Miscellaneous...
159cscope_local:
160        ls rom_reset.S ram_reset.S >cscope.files
161        ls $(FLASHDIR)/s29gl512n_16x1.c >>cscope.files
162        ls $(FLASHDIR)/s29gl512n_16x1.h >>cscope.files
163
164help_local:
165
166varcheck:
Note: See TracBrowser for help on using the repository browser.