source: umon/ports/beagleboneblack/Makefile @ 220ee4b

Last change on this file since 220ee4b was 220ee4b, checked in by Jarielle Catbagan <jcatbagan93@…>, on Jul 8, 2015 at 9:28:41 PM

BBB: Build a uMon image with a Configuration header and a GP header prepended.

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