2 # Makefile for Broadcom BCM947XX boards
4 # Copyright 2001-2003, Broadcom Corporation
7 # THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
8 # KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
9 # SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
10 # FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
14 # Copyright 2004 Manuel Novoa III <mjn3@codepoet.org>
15 # Modified to support bzip'd kernels.
16 # Of course, it would be better to integrate bunzip capability into CFE.
19 # Link at 3 MB offset in RAM
20 #TEXT_START ?= 0x80300000
21 TEXT_START ?
= 0x80001000
22 BZ_MEM_TOP
:= 0x81000000
23 BZ_TEXT_START
:= BZ_MEM_TOP-0x4000
24 BZ_STACK_TOP
:= BZ_TEXT_START-4
26 OBJCOPY
:= $(CROSS_COMPILE
)objcopy
-O binary
-R .reginfo
-R .note
-R .comment
-R .mdebug
-S
28 SRCBASE
:= $(TOPDIR
)/..
/..
29 VPATH
:= $(SRCBASE
)/shared
30 ASFLAGS
+= -D__ASSEMBLY__
-I
$(SRCBASE
)/include -DLOADADDR
=$(LOADADDR
)
31 ASFLAGS
+= -DBZ_MEM_TOP
=$(BZ_MEM_TOP
)
32 ASFLAGS
+= -DBZ_TEXT_START
=$(BZ_TEXT_START
)
33 ASFLAGS
+= -DBZ_STACK_TOP
=$(BZ_STACK_TOP
)
34 CFLAGS
+= -I
$(SRCBASE
)/include -DLOADADDR
=$(LOADADDR
)
35 CFLAGS
+= -DBZ_MEM_TOP
=$(BZ_MEM_TOP
)
36 CFLAGS
+= -DBZ_TEXT_START
=$(BZ_TEXT_START
)
37 CFLAGS
+= -DBZ_STACK_TOP
=$(BZ_STACK_TOP
)
39 CFLAGS
:= $(subst -pg
,,$(CFLAGS
))
41 CFLAGS
+= -ffunction-sections
$(call check_gcc
, -fvtable-gc
, )
42 SEDFLAGS
:= s
/BZ_TEXT_START
/$(BZ_TEXT_START
)/;s
/BZ_MEM_TOP
/$(BZ_MEM_TOP
)/;s
/TEXT_START
/$(TEXT_START
)/
44 SYSTEM ?
= $(TOPDIR
)/vmlinux
45 OBJECTS
:= head.o data.o
49 # Don't build dependencies, this may die if $(CC) isn't gcc
52 # Create a gzipped version named vmlinuz for compatibility
56 # Our bzImage is a gzip'd binary that decompresses and runs
57 # the appended bzip'd kernel.
58 bzImage
: bzLoaderImage.gz piggz
59 cat bzLoaderImage.gz piggz
> $@
61 bzLoaderImage.gz
: bzLoaderImage
64 bzLoaderImage
: bzLoader
67 bzLoader
: vmlinux.lds
$(OBJECTS
)
68 $(LD
) -static
--gc-sections
-no-warn-mismatch
-T vmlinux.lds
-o
$@
$(OBJECTS
)
70 vmlinux.lds
: vmlinux.lds.in Makefile
71 @sed
"$(SEDFLAGS)" < $< > $@
79 data.o
: data.lds data.image
80 $(LD
) -no-warn-mismatch
-T data.lds
-r
-o
$@
-b binary data.image
-b elf32-tradlittlemips
83 @echo
"SECTIONS { .data : { code_start = .; *(.data) code_stop = .; }}" > $@
85 data.image
: decompress_bunzip2.image
88 decompress_bunzip2.image
: decompress_bunzip2.lds decompress_bunzip2.o
89 $(LD
) -static
--gc-sections
-no-warn-mismatch
-T decompress_bunzip2.lds
-o
$@ decompress_bunzip2.o
91 decompress_bunzip2.lds
: decompress_bunzip2.lds.in Makefile
92 @sed
"$(SEDFLAGS)" < $< > $@
97 rm -f vmlinux vmlinuz piggz piggy
*.lds
*.o \
98 bzLoader bzLoaderImage bzLoaderImage.gz bzImage \
100 decompress_bunzip2.lds decompress_bunzip2.image