From ae3be8aec00c70b17077ed5e4e50728f7fc7951c Mon Sep 17 00:00:00 2001 From: Takumi Sueda Date: Sun, 7 Nov 2021 22:00:52 +0900 Subject: [PATCH] Revert "Add U-Boot loader over MMU" This reverts commit 3e93562761ecef77606d7dda57be4a014d2d0ea8. --- x1/.gitignore | 1 - x1/Makefile | 9 --------- x1/c/common.h | 1 - x1/c/generate.py | 27 --------------------------- x1/c/main_uboot.c | 34 ---------------------------------- x1/c/uboot_bin.h.tpl | 5 ----- 6 files changed, 77 deletions(-) delete mode 100644 x1/.gitignore delete mode 100755 x1/c/generate.py delete mode 100644 x1/c/main_uboot.c delete mode 100644 x1/c/uboot_bin.h.tpl diff --git a/x1/.gitignore b/x1/.gitignore deleted file mode 100644 index da9a2d8..0000000 --- a/x1/.gitignore +++ /dev/null @@ -1 +0,0 @@ -c/uboot_bin.h diff --git a/x1/Makefile b/x1/Makefile index 6f0b6cd..ce80d86 100644 --- a/x1/Makefile +++ b/x1/Makefile @@ -21,15 +21,6 @@ c/main.elf: c/main.bin: c/main.elf @./extract.py c/main.elf $@ -c/uboot_loader.bin: - @if [ "$(UBOOT)" = "" ]; then \ - echo "Please specify UBOOT."; \ - exit 1; \ - fi - @c/generate.py $(UBOOT) c/uboot_bin.h.tpl c/uboot_bin.h - @$(CC) -nostdlib -static -fPIC -marm -O0 c/start.S c/main_uboot.c -o c/uboot_loader.elf - @./extract.py c/uboot_loader.elf $@ - spray/main.bin: @$(AS) spray/top.S @./extract.py -p a.out spray/top.bin diff --git a/x1/c/common.h b/x1/c/common.h index f5e8b01..5c136c2 100644 --- a/x1/c/common.h +++ b/x1/c/common.h @@ -2,7 +2,6 @@ #define readl(a) (*(volatile unsigned int *)(a)) #define writel(v, a) (*(volatile unsigned int *)(a) = (v)) -#define writeb(v, a) (*(volatile unsigned char *)(a) = (v)) typedef unsigned int u32; typedef unsigned short u16; diff --git a/x1/c/generate.py b/x1/c/generate.py deleted file mode 100755 index 82156ad..0000000 --- a/x1/c/generate.py +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env python3 -import sys -import textwrap - - -def main(): - if len(sys.argv) < 3: - print(f'Usage: {sys.argv[0]} u-boot.bin uboot_bin.h.tpl uboot_bin.h') - - with open(sys.argv[2]) as f: - tpl = f.read() - - with open(sys.argv[1], 'rb') as ui, open(sys.argv[3], 'w') as header: - uboot = ui.read() - - out = '' - for i, b in enumerate(uboot): - out += f'{b:#04x}, ' - if (i+1) % 16 == 0: - out = out.rstrip() - out += '\n' - - formatted = tpl.format(uboot_size=len(uboot), uboot_bin=textwrap.indent(out, ' ')) - header.write(formatted) - - -main() diff --git a/x1/c/main_uboot.c b/x1/c/main_uboot.c deleted file mode 100644 index 4b9a0e2..0000000 --- a/x1/c/main_uboot.c +++ /dev/null @@ -1,34 +0,0 @@ -#include "common.h" -#include "uboot_bin.h" - -#define VIRT_START (unsigned char *)0x8c000000 - -void main() { - int i; - u8* ptr = VIRT_START; - - // Turn off interrupts - asm volatile ( - "cpsid if \n" - ); - - for (i=0; i