From 1559013f2beea92a6acde924c290db4256b2d84b Mon Sep 17 00:00:00 2001 From: songyanguang <345810377@qq.com> Date: Wed, 22 Jan 2025 17:01:19 +0800 Subject: [PATCH] boot.S start main --- .../riscv/rv64gc/preboot_for_jh7110/boot.S | 2 +- .../hardkernel/intr/riscv/rv64gc/trampoline.S | 2 - .../hardkernel/mmu/riscv/rv64gc/Makefile | 2 +- .../hardkernel/mmu/riscv/rv64gc/bootmmu.c | 86 ------------------- 4 files changed, 2 insertions(+), 90 deletions(-) delete mode 100644 Ubiquitous/XiZi_AIoT/hardkernel/mmu/riscv/rv64gc/bootmmu.c diff --git a/Ubiquitous/XiZi_AIoT/hardkernel/arch/riscv/rv64gc/preboot_for_jh7110/boot.S b/Ubiquitous/XiZi_AIoT/hardkernel/arch/riscv/rv64gc/preboot_for_jh7110/boot.S index d445c8883..21159e7ea 100644 --- a/Ubiquitous/XiZi_AIoT/hardkernel/arch/riscv/rv64gc/preboot_for_jh7110/boot.S +++ b/Ubiquitous/XiZi_AIoT/hardkernel/arch/riscv/rv64gc/preboot_for_jh7110/boot.S @@ -63,7 +63,7 @@ clear_bss_done: sw zero, 32(tp) /* Start the kernel */ - tail bootmain + tail main relocate_enable_mmu: /* Relocate return address */ diff --git a/Ubiquitous/XiZi_AIoT/hardkernel/intr/riscv/rv64gc/trampoline.S b/Ubiquitous/XiZi_AIoT/hardkernel/intr/riscv/rv64gc/trampoline.S index eef6e6fed..8f32731f9 100644 --- a/Ubiquitous/XiZi_AIoT/hardkernel/intr/riscv/rv64gc/trampoline.S +++ b/Ubiquitous/XiZi_AIoT/hardkernel/intr/riscv/rv64gc/trampoline.S @@ -28,8 +28,6 @@ Modification: 1. first version *************************************************/ -#include "memlayout.h" -#include "core.h" #include "asm/csr.h" #include "asm/asm-offsets.h" diff --git a/Ubiquitous/XiZi_AIoT/hardkernel/mmu/riscv/rv64gc/Makefile b/Ubiquitous/XiZi_AIoT/hardkernel/mmu/riscv/rv64gc/Makefile index 016051139..8d25fd00f 100644 --- a/Ubiquitous/XiZi_AIoT/hardkernel/mmu/riscv/rv64gc/Makefile +++ b/Ubiquitous/XiZi_AIoT/hardkernel/mmu/riscv/rv64gc/Makefile @@ -1,4 +1,4 @@ -SRC_FILES := bootmmu.c mmu.c pagetable_attr.c mmu_init.c +SRC_FILES := mmu_init.c mmu.c pagetable_attr.c include $(KERNEL_ROOT)/compiler.mk diff --git a/Ubiquitous/XiZi_AIoT/hardkernel/mmu/riscv/rv64gc/bootmmu.c b/Ubiquitous/XiZi_AIoT/hardkernel/mmu/riscv/rv64gc/bootmmu.c deleted file mode 100644 index 0f62871c7..000000000 --- a/Ubiquitous/XiZi_AIoT/hardkernel/mmu/riscv/rv64gc/bootmmu.c +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) 2020 AIIT XUOS Lab - * XiUOS is licensed under Mulan PSL v2. - * You can use this software according to the terms and conditions of the Mulan PSL v2. - * You may obtain a copy of Mulan PSL v2 at: - * http://license.coscl.org.cn/MulanPSL2 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v2 for more details. - */ -/** - * @file bootmmu.c - * @brief build pagetable and enable mmu in boot time - * @version 1.0 - * @author AIIT XUOS Lab - * @date 2024.04.26 - */ - -/************************************************* -File name: bootmmu.c -Description: build pagetable and enable mmu in boot time -Others: -History: -Author: AIIT XUOS Lab -Modification: -1. first version -*************************************************/ -#include "core.h" -#include "memlayout.h" -#include "mmio_access.h" -#include "mmu.h" -#include "pagetable.h" -#include "registers.h" -#include "ns16550.h" -#include "printf.h" -#include -#include - -#include -#include - -// -#if 0 -static int test_access_map_address(void) -{ - unsigned long address = KERN_MEM_BASE + (PHY_USER_FREEMEM_BASE - PHY_MEM_BASE) - 4096; - printf_early("to access 0x%lx\n", address); - *(unsigned long *)address = 0x55; - if(*(unsigned long *)address == 0x55) { - printf_early("access 0x%lx done\n", address); - } - return 0; -} - -static int test_access_unmap_address(void) -{ - unsigned long address = KERN_MEM_BASE + (PHY_USER_FREEMEM_BASE - PHY_MEM_BASE) + 4096; - *(unsigned long *)address = 0x55; - printf_early("access 0x%lx done\n", address); - return 0; -} - -static void test_mmu(void) -{ - test_access_map_address(); - test_access_unmap_address(); -} -#endif - -// -extern void main(void); - -void bootmain(void) -{ - _debug_uart_printascii("bootmain start\n"); -#if 0 - test_mmu(); -#endif - - main(); - - _debug_uart_printascii("bootmain end\n"); - while(1); -} -