xiuos/Ubiquitous/XiUOS/board/gapuino/board.c

60 lines
1.5 KiB
C
Executable File

/*
* 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 board.c
* @brief support gap8 init configure and start-up
* @version 1.0
* @author AIIT XUOS Lab
* @date 2021-09-02
*/
#include <board.h>
#include <arch_interrupt.h>
#include <xiuos.h>
#include <device.h>
extern void entry(void);
extern int InitHwUart(void);
extern void irqinitialize(void);
extern void timer_initialize(void);
extern void gapuino_sysinit(void);
extern unsigned int __bss_end__;
void GapuinoStart(uint32_t mhartid)
{
gapuino_sysinit();
entry();
}
void InitBoardHardware(void)
{
irqinitialize();
InitBoardMemory(MEMORY_START_ADDRESS, MEMORY_END_ADDRESS);
InitHwUart();
InstallConsole("uart0", "uart0_drv", "uart0_dev0");
KPrintf("console init completed.\n");
KPrintf("board initialization......\n");
timer_initialize();
KPrintf("memory address range: [0x%08x - 0x%08x], size: %d\n", (x_ubase) MEMORY_START_ADDRESS, (x_ubase) MEMORY_END_ADDRESS, GAP8_SRAM_SIZE);
/* initialize memory system */
KPrintf("board init done.\n");
KPrintf("start kernel...\n");
return;
}