Skip to content

Commit

Permalink
Kernel - Some tweaks on getting the realview-pb-a8 working again
Browse files Browse the repository at this point in the history
  • Loading branch information
thepowersgang committed Apr 18, 2021
1 parent a61d3aa commit f7ba709
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 5 deletions.
9 changes: 7 additions & 2 deletions Bootloaders/arm/Makefile
Expand Up @@ -18,16 +18,21 @@ OBJ_MAIN := target/target/release/libmain.a
KERNEL := ../../Kernel/bin/kernel-$(ARCH).bin
TARGET := ../../Kernel/Core/arch/$(ARCH)/target.json

FDT_FILE :=
ifneq ($(wildcard fdt-$(PLATFORM).dts),)
FDT_FILE := fdt-$(PLATFORM).dtb
endif

.PHONY: all clean

all: loader-$(PLATFORM).bin

clean:
rm -r loader-$(PLATFORM).bin $(OBJDIR)start-$(PLATFORM).ao $(dir $(OBJ_MAIN))

loader-$(PLATFORM).bin: $(OBJDIR)start.ao $(OBJ_MAIN) $(KERNEL)
loader-$(PLATFORM).bin: $(OBJDIR)start.ao $(OBJ_MAIN) $(KERNEL) $(FDT_FILE)
@echo "[LD] -o $@"
$Varm-elf-eabi-ld -e start -o $@ $(OBJDIR)start.ao $(OBJ_MAIN) --format binary $(KERNEL) -Map $(OBJDIR)map.txt --gc-sections
$Varm-elf-eabi-ld -e start -o $@ $(OBJDIR)start.ao $(OBJ_MAIN) --format binary $(KERNEL) $(FDT_FILE) -Map $(OBJDIR)map.txt --gc-sections

# Assembly source for bootloader
$(OBJDIR)start.ao: start-$(PLATFORM).S platform-$(PLATFORM).h
Expand Down
4 changes: 2 additions & 2 deletions Bootloaders/arm/fdt-realview-pb-a8.dts
Expand Up @@ -81,7 +81,7 @@
device_type = "misc";
compatible = "zero";
};

*/
kmi0 {
manifest_type = "virtual";
address_type = "memory";
Expand All @@ -101,7 +101,7 @@
compatible = "primecell,arm,pl050,mouse";
interrupts = <53>;
};

/*
uart0 {
};

Expand Down
9 changes: 9 additions & 0 deletions Bootloaders/arm/platform-realview-pb-a8.h
@@ -0,0 +1,9 @@

#define RAM_START 0x00000000 // Realview RAM starts at 0
#define RAM_LENGTH 0x10000000 // 128MB (a safe assumption)
#define UART_BASE 0x10009000 // PL011 UART (first of 4)
//#define FDT_BASE RAM_START // No provided FDT?

#define fdt_start _binary_fdt_realview_pb_a8_dtb_start
#define fdt_end _binary_fdt_realview_pb_a8_dtb_end

1 change: 1 addition & 0 deletions Bootloaders/arm/start-realview-pb-a8.S
@@ -0,0 +1 @@
#include "start.S"
2 changes: 1 addition & 1 deletion Bootloaders/arm/start.S
Expand Up @@ -15,7 +15,7 @@
b .
ENTRY(start)
mov sp, #STACK_TOP
mov r0, #UART_BASE
ldr r0, =UART_BASE
push {r0}

ldr r8, =_binary_______Kernel_bin_kernel_armv7_bin_start
Expand Down
2 changes: 2 additions & 0 deletions Kernel/rundir/Makefile
Expand Up @@ -89,8 +89,10 @@ MACHINE_TYPE ?= virt
#MACHINE_TYPE ?= realview-pb-a8

CMDLINE += SYSDISK=virtio0p0
ifeq ($(MACHINE_TYPE),virt)
QEMU_ARGS += -device virtio-net-device
QEMU_ARGS += -device virtio-blk-device,drive=hda
endif
QEMU_ARGS += -drive if=none,id=hda,index=0,file=$(IMGDIR)hda.img,format=raw
#QEMU_ARGS += -device pl110
#QEMU_ARGS += -device virtio-gpu-device
Expand Down

0 comments on commit f7ba709

Please sign in to comment.