Skip to content

Commit

Permalink
Cleanup for tools/bootloader
Browse files Browse the repository at this point in the history
  • Loading branch information
rsta2 committed Apr 11, 2018
1 parent 9433c83 commit cd52026
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 481 deletions.
70 changes: 4 additions & 66 deletions tools/bootloader/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,13 @@ ARMGNU ?= $(PREFIX)

COPS = -Wall -O2 -nostdlib -nostartfiles -ffreestanding -DDEFAULTBAUD=$(FLASHBAUD)

gcc : kernel.img kernel7.img blinker.hex blinker7.hex

all : gcc clang
all: kernel.img kernel7.img

clean :
rm -f *.o
rm -f *.bin
rm -f *.hex
rm -f *.elf
rm -f *.list
rm -f *.lst
rm -f *.img
rm -f *.bc
rm -f *.clang.s


vectors.o : vectors.s
$(ARMGNU)as vectors.s -o vectors.o
Expand All @@ -36,65 +29,10 @@ periph7.o : periph.c BCM2836.h

kernel.img : loader vectors.o periph.o bootloader07.o
$(ARMGNU)ld vectors.o periph.o bootloader07.o -T loader -o bootloader07_rpi1.elf
$(ARMGNU)objdump -D bootloader07_rpi1.elf > bootloader07_rpi1.list
$(ARMGNU)objcopy bootloader07_rpi1.elf -O ihex bootloader07_rpi1.hex
$(ARMGNU)objdump -D bootloader07_rpi1.elf > bootloader07_rpi1.lst
$(ARMGNU)objcopy bootloader07_rpi1.elf -O binary kernel.img

kernel7.img : loader vectors.o periph7.o bootloader07.o
$(ARMGNU)ld vectors.o periph7.o bootloader07.o -T loader -o bootloader07_rpi2.elf
$(ARMGNU)objdump -D bootloader07_rpi2.elf > bootloader07_rpi2.list
$(ARMGNU)objcopy bootloader07_rpi2.elf -O ihex bootloader07_rpi2.hex
$(ARMGNU)objdump -D bootloader07_rpi2.elf > bootloader07_rpi2.lst
$(ARMGNU)objcopy bootloader07_rpi2.elf -O binary kernel7.img


start.o : start.s
$(ARMGNU)as start.s -o start.o

blinker.o : blinker.c
$(ARMGNU)gcc $(COPS) -c blinker.c -o blinker.o

blinker.hex : memmap start.o blinker.o
$(ARMGNU)ld start.o blinker.o -T memmap -o blinker.elf
$(ARMGNU)objdump -D blinker.elf > blinker.list
$(ARMGNU)objcopy blinker.elf -O ihex blinker.hex
#$(ARMGNU)objcopy blinker.elf -O binary blinker.bin

blinker7.o : blinker7.c
$(ARMGNU)gcc $(COPS) -c blinker7.c -o blinker7.o

blinker7.hex : memmap start.o blinker7.o
$(ARMGNU)ld start.o blinker7.o -T memmap -o blinker7.elf
$(ARMGNU)objdump -D blinker7.elf > blinker7.list
$(ARMGNU)objcopy blinker7.elf -O ihex blinker7.hex
#$(ARMGNU)objcopy blinker7.elf -O binary blinker7.bin



LOPS = -Wall -m32 -emit-llvm
LLCOPS0 = -march=arm
LLCOPS1 = -march=arm -mcpu=arm1176jzf-s
LLCOPS = $(LLCOPS1)
#COPS = -Wall -O2 -nostdlib -nostartfiles -ffreestanding
#OOPS = -std-compile-opts
OOPS = -std-link-opts

clang : bootloader07.clang.bin

bootloader07.bc : bootloader07.c
clang $(LOPS) -c bootloader07.c -o bootloader07.bc

periph.bc : periph.c
clang $(LOPS) -c periph.c -o periph.bc

bootloader07.clang.elf : loader vectors.o bootloader07.bc periph.bc
llvm-link periph.bc bootloader07.bc -o bootloader07.nopt.bc
opt $(OOPS) bootloader07.nopt.bc -o bootloader07.opt.bc
llc $(LLCOPS) bootloader07.opt.bc -o bootloader07.clang.s
$(ARMGNU)as bootloader07.clang.s -o bootloader07.clang.o
$(ARMGNU)ld -o bootloader07.clang.elf -T loader vectors.o bootloader07.clang.o
$(ARMGNU)objdump -D bootloader07.clang.elf > bootloader07.clang.list

bootloader07.clang.bin : bootloader07.clang.elf
$(ARMGNU)objcopy bootloader07.clang.elf bootloader07.clang.bin -O binary


7 changes: 3 additions & 4 deletions tools/bootloader/README
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
All credits goes to dwelch67 from github page: https://github.com/dwelch67/raspberrypi
This is modification of the original bootloader which allow a faster baudrate of 1008065.
Nowadays, most usb-serial ttl devices support this speed.
Be aware of using terminal programs that do not support standard speeds. Putty has been tested and verified to work very well.
All credits for this bootloader go to dwelch67 (see: https://github.com/dwelch67/raspberrypi).
This is a modified version of the original bootloader, which allows a faster and configurable
baudrate.

----------------------ORIGINAL README--------------------------------------------
This is a very simple bootloader. Instead of the sd dance (see
Expand Down
72 changes: 0 additions & 72 deletions tools/bootloader/blinker.c

This file was deleted.

80 changes: 0 additions & 80 deletions tools/bootloader/blinker7.c

This file was deleted.

Loading

0 comments on commit cd52026

Please sign in to comment.