Skip to content

Commit

Permalink
Merge pull request #52 from babbleberry/revert-51-master
Browse files Browse the repository at this point in the history
Revert "Solve Issue #50 pull up pull down register mapping wrong way around"
  • Loading branch information
babbleberry authored Apr 22, 2024
2 parents 16f2a00 + 1d022a6 commit 4cd63a2
Show file tree
Hide file tree
Showing 107 changed files with 201 additions and 11,853 deletions.
4 changes: 0 additions & 4 deletions .gitignore

This file was deleted.

53 changes: 0 additions & 53 deletions config.txt

This file was deleted.

14 changes: 7 additions & 7 deletions part10-multicore/Makefile
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
CFILES = $(wildcard *.c)
OFILES = $(CFILES:.c=.o)
GCCFLAGS = -Wall -O2 -ffreestanding -nostdinc -nostdlib -nostartfiles
GCCPATH = ../../gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf/bin
LLVMPATH = /opt/homebrew/opt/llvm/bin
CLANGFLAGS = -Wall -O2 -ffreestanding -nostdinc -nostdlib -mcpu=cortex-a72+nosimd

all: clean kernel8.img

boot.o: boot.S
$(GCCPATH)/aarch64-none-elf-gcc $(GCCFLAGS) -c boot.S -o boot.o
$(LLVMPATH)/clang --target=aarch64-elf $(CLANGFLAGS) -c boot.S -o boot.o

audio.o : audio.bin
$(GCCPATH)/aarch64-none-elf-objcopy -I binary -O elf64-littleaarch64 -B aarch64 $< $@
$(LLVMPATH)/llvm-objcopy -I binary -O elf64-littleaarch64 -B aarch64 $< $@

%.o: %.c
$(GCCPATH)/aarch64-none-elf-gcc $(GCCFLAGS) -c $< -o $@
$(LLVMPATH)/clang --target=aarch64-elf $(CLANGFLAGS) -c $< -o $@

kernel8.img: boot.o $(OFILES) audio.o
$(GCCPATH)/aarch64-none-elf-ld -nostdlib boot.o $(OFILES) audio.o -T link.ld -o kernel8.elf
$(GCCPATH)/aarch64-none-elf-objcopy -O binary kernel8.elf kernel8.img
$(LLVMPATH)/ld.lld -m aarch64elf -nostdlib boot.o $(OFILES) audio.o -T link.ld -o kernel8.elf
$(LLVMPATH)/llvm-objcopy -O binary kernel8.elf kernel8.img

clean:
/bin/rm kernel8.elf *.o *.img > /dev/null 2> /dev/null || true
22 changes: 22 additions & 0 deletions part10-multicore/Makefile.gcc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
CFILES = $(wildcard *.c)
OFILES = $(CFILES:.c=.o)
GCCFLAGS = -Wall -O2 -ffreestanding -nostdinc -nostdlib -nostartfiles
GCCPATH = ../../gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf/bin

all: clean kernel8.img

boot.o: boot.S
$(GCCPATH)/aarch64-none-elf-gcc $(GCCFLAGS) -c boot.S -o boot.o

audio.o : audio.bin
$(GCCPATH)/aarch64-none-elf-objcopy -I binary -O elf64-littleaarch64 -B aarch64 $< $@

%.o: %.c
$(GCCPATH)/aarch64-none-elf-gcc $(GCCFLAGS) -c $< -o $@

kernel8.img: boot.o $(OFILES) audio.o
$(GCCPATH)/aarch64-none-elf-ld -nostdlib boot.o $(OFILES) audio.o -T link.ld -o kernel8.elf
$(GCCPATH)/aarch64-none-elf-objcopy -O binary kernel8.elf kernel8.img

clean:
/bin/rm kernel8.elf *.o *.img > /dev/null 2> /dev/null || true
4 changes: 2 additions & 2 deletions part10-multicore/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ enum {

enum {
Pull_None = 0,
Pull_Down = 2,
Pull_Up = 1
Pull_Down = 1, // Are down and up the right way around?
Pull_Up = 2
};

void mmio_write(long reg, unsigned int val) { *(volatile unsigned int *)reg = val; }
Expand Down
22 changes: 11 additions & 11 deletions part11-breakout-smp/Makefile
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
CFILES = $(wildcard *.c lib/*.c)
OFILES = $(CFILES:.c=.o)
GCCFLAGS = -Wall -O2 -ffreestanding -nostdinc -nostdlib
GCCPATH = ../../gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf/bin

LLVMPATH = /opt/homebrew/opt/llvm/bin
CLANGFLAGS = -Wall -O2 -ffreestanding -nostdinc -nostdlib -mcpu=cortex-a72+nosimd

all: clean kernel8.img

boot/boot.o: boot/boot.S
$(GCCPATH)/aarch64-none-elf-gcc $(GCCFLAGS) -c boot/boot.S -o boot/boot.o
$(LLVMPATH)/clang --target=aarch64-elf $(CLANGFLAGS) -c $< -o $@

bin/BCM4345C0.o : bin/BCM4345C0.hcd
$(GCCPATH)/aarch64-none-elf-objcopy -I binary -O elf64-littleaarch64 -B aarch64 $< $@
$(LLVMPATH)/llvm-objcopy -I binary -O elf64-littleaarch64 -B aarch64 $< $@

bin/audio.o : bin/audio.bin
$(GCCPATH)/aarch64-none-elf-objcopy -I binary -O elf64-littleaarch64 -B aarch64 $< $@
$(LLVMPATH)/llvm-objcopy -I binary -O elf64-littleaarch64 -B aarch64 $< $@

%.o: %.c
$(GCCPATH)/aarch64-none-elf-gcc $(GCCFLAGS) -c $< -o $@
$(LLVMPATH)/clang --target=aarch64-elf $(CLANGFLAGS) -c $< -o $@

kernel8.img: boot/boot.o $(OFILES) bin/BCM4345C0.o bin/audio.o
$(GCCPATH)/aarch64-none-elf-ld -nostdlib boot/boot.o $(OFILES) bin/BCM4345C0.o bin/audio.o -T boot/link.ld -o kernel8.elf
$(GCCPATH)/aarch64-none-elf-objcopy -O binary kernel8.elf kernel8.img
$(LLVMPATH)/ld.lld -m aarch64elf -nostdlib boot/boot.o $(OFILES) bin/BCM4345C0.o bin/audio.o -T boot/link.ld -o kernel8.elf
$(LLVMPATH)/llvm-objcopy -O binary kernel8.elf kernel8.img

clean:
/bin/rm kernel8.elf *.o bin/*.o boot/*.o *.img > /dev/null 2> /dev/null || true
/bin/rm kernel8.elf *.o bin/*.o boot/*.o lib/*.o *.img > /dev/null 2> /dev/null || true
4 changes: 2 additions & 2 deletions part11-breakout-smp/lib/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ enum {

enum {
Pull_None = 0,
Pull_Down = 2,
Pull_Up = 1
Pull_Down = 1, // Are down and up the right way around?
Pull_Up = 2
};

void mmio_write(long reg, unsigned int val) { *(volatile unsigned int *)reg = val; }
Expand Down
4 changes: 2 additions & 2 deletions part12-wgt/lib/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ enum {

enum {
Pull_None = 0,
Pull_Down = 2,
Pull_Up = 1
Pull_Down = 1, // Are down and up the right way around?
Pull_Up = 2
};

void mmio_write(long reg, unsigned int val) { *(volatile unsigned int *)reg = val; }
Expand Down
12 changes: 6 additions & 6 deletions part13-interrupts/Makefile
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
CFILES = $(wildcard *.c lib/*.c kernel/*.c)
SFILES = $(wildcard boot/*.S lib/*.S kernel/*.S)
OFILES = $(CFILES:.c=.o) $(SFILES:.S=.o)
GCCFLAGS = -Wall -O2 -ffreestanding -nostdinc -nostdlib -nostartfiles
GCCPATH = ../../gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf/bin
LLVMPATH = /opt/homebrew/opt/llvm/bin
CLANGFLAGS = -Wall -O2 -ffreestanding -nostdlib -mcpu=cortex-a72+nosimd

all: clean kernel8.img

%.o: %.c
$(GCCPATH)/aarch64-none-elf-gcc $(GCCFLAGS) -c $< -o $@
$(LLVMPATH)/clang --target=aarch64-elf $(CLANGFLAGS) -c $< -o $@

%.o: %.S
$(GCCPATH)/aarch64-none-elf-gcc $(GCCFLAGS) -c $< -o $@
$(LLVMPATH)/clang --target=aarch64-elf $(CLANGFLAGS) -c $< -o $@

kernel8.img: $(OFILES)
$(GCCPATH)/aarch64-none-elf-ld -nostdlib $(OFILES) -T boot/link.ld -o kernel8.elf
$(GCCPATH)/aarch64-none-elf-objcopy -O binary kernel8.elf kernel8.img
$(LLVMPATH)/ld.lld -m aarch64elf -nostdlib $(OFILES) -T boot/link.ld -o kernel8.elf
$(LLVMPATH)/llvm-objcopy -O binary kernel8.elf kernel8.img

clean:
/bin/rm kernel8.elf */*.o *.img > /dev/null 2> /dev/null || true
File renamed without changes.
4 changes: 2 additions & 2 deletions part13-interrupts/lib/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ enum {

enum {
Pull_None = 0,
Pull_Down = 2,
Pull_Up = 1
Pull_Down = 1, // Are down and up the right way around?
Pull_Up = 2
};

void mmio_write(long reg, unsigned int val) { *(volatile unsigned int *)reg = val; }
Expand Down
164 changes: 0 additions & 164 deletions part13a-gpio-interrupts/README.md

This file was deleted.

Loading

0 comments on commit 4cd63a2

Please sign in to comment.