Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
messigogogo committed Aug 1, 2023
1 parent 1216301 commit 1c83ea3
Show file tree
Hide file tree
Showing 8 changed files with 157 additions and 155 deletions.
12 changes: 6 additions & 6 deletions bsp/phytium/aarch64/applications/mnt.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#define SD_DEIVCE_NAME "sd"
static int filesystem_mount(void)
{
while(rt_device_find(SD_DEIVCE_NAME) == RT_NULL)
while (rt_device_find(SD_DEIVCE_NAME) == RT_NULL)
{
rt_thread_mdelay(1);
}
Expand All @@ -50,8 +50,8 @@ static int filesystem_mount(void)
}

mkdir("/ram", 0x777);
#ifdef RT_USING_DFS_RAMFS

#ifdef RT_USING_DFS_RAMFS
extern struct dfs_ramfs *dfs_ramfs_create(rt_uint8_t *pool, rt_size_t size);

rt_uint8_t *pool = RT_NULL;
Expand All @@ -65,14 +65,14 @@ static int filesystem_mount(void)
LOG_I("RAM file system initializated!");
else
LOG_E("RAM file system initializate failed!");
#endif
#endif
return RT_EOK;
}
INIT_ENV_EXPORT(filesystem_mount);
#else
static int filesystem_mount(void)
{
#ifdef RT_USING_DFS_RAMFS
#ifdef RT_USING_DFS_RAMFS
extern struct dfs_ramfs *dfs_ramfs_create(rt_uint8_t *pool, rt_size_t size);

rt_uint8_t *pool = RT_NULL;
Expand All @@ -86,7 +86,7 @@ static int filesystem_mount(void)
LOG_I("RAM file system initializated!");
else
LOG_E("RAM file system initializate failed!");
#endif
#endif

return RT_EOK;
}
Expand Down
55 changes: 28 additions & 27 deletions bsp/phytium/board/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
#include <mm_page.h>

#ifdef RT_USING_SMART
#include <page.h>
#include <lwp_arch.h>
#include <page.h>
#include <lwp_arch.h>
#endif

#include <gicv3.h>
Expand All @@ -45,7 +45,7 @@
#include "fiopad.h"

#ifdef RT_USING_SMP
#include "fpsci.h"
#include "fpsci.h"
#endif

#define LOG_DEBUG_TAG "BOARD"
Expand All @@ -69,7 +69,8 @@ void idle_wfi(void)
*/
extern size_t MMUTable[];

rt_region_t init_page_region = {
rt_region_t init_page_region =
{
PAGE_START,
PAGE_END
};
Expand Down Expand Up @@ -113,17 +114,17 @@ INIT_BOARD_EXPORT(rt_hw_timer_init);
void rt_hw_board_aarch64_init(void)
{
/* AARCH64 */
#if defined(RT_USING_SMART)
/* 1. init rt_kernel_space table (aspace.start = KERNEL_VADDR_START , aspace.size = ), 2. init io map range (rt_ioremap_start \ rt_ioremap_size) 3. */
rt_hw_mmu_map_init(&rt_kernel_space, (void*)0xfffffffff0000000, 0x10000000, MMUTable, PV_OFFSET);
#else
rt_hw_mmu_map_init(&rt_kernel_space, (void*)0x80000000, 0x10000000, MMUTable, 0);
#endif
#if defined(RT_USING_SMART)
/* 1. init rt_kernel_space table (aspace.start = KERNEL_VADDR_START , aspace.size = ), 2. init io map range (rt_ioremap_start \ rt_ioremap_size) 3. */
rt_hw_mmu_map_init(&rt_kernel_space, (void *)0xfffffffff0000000, 0x10000000, MMUTable, PV_OFFSET);
#else
rt_hw_mmu_map_init(&rt_kernel_space, (void *)0x80000000, 0x10000000, MMUTable, 0);
#endif
rt_page_init(init_page_region);

rt_hw_mmu_setup(&rt_kernel_space, platform_mem_desc, platform_mem_desc_size);

/* init memory pool */
/* init memory pool */
#ifdef RT_USING_HEAP
rt_system_heap_init((void *)HEAP_BEGIN, (void *)HEAP_END);
#endif
Expand All @@ -135,9 +136,9 @@ void rt_hw_board_aarch64_init(void)
FEarlyUartProbe();

FIOPadCfgInitialize(&iopad_ctrl, FIOPadLookupConfig(FIOPAD0_ID));

#ifdef RT_USING_SMART
iopad_ctrl.config.base_address = (uintptr)rt_ioremap((void*)iopad_ctrl.config.base_address, 0x2000);
iopad_ctrl.config.base_address = (uintptr)rt_ioremap((void *)iopad_ctrl.config.base_address, 0x2000);
#endif

/* compoent init */
Expand All @@ -161,7 +162,7 @@ void rt_hw_board_aarch64_init(void)
rt_hw_interrupt_umask(RT_SCHEDULE_IPI);
#endif



}
#else
Expand All @@ -172,29 +173,29 @@ void rt_hw_board_aarch32_init(void)
#if defined(RT_USING_SMART)

/* set io map range is 0xf0000000 ~ 0x10000000 , Memory Protection start address is 0xf0000000 - rt_mpr_size */
rt_hw_mmu_map_init(&rt_kernel_space, (void*)0xf0000000, 0x10000000, MMUTable, PV_OFFSET);
rt_hw_mmu_map_init(&rt_kernel_space, (void *)0xf0000000, 0x10000000, MMUTable, PV_OFFSET);

rt_page_init(init_page_region);

/* rt_kernel_space 在start_gcc.S 中被初始化,此函数将iomap 空间放置在kernel space 上 */
rt_hw_mmu_ioremap_init(&rt_kernel_space, (void*)0xf0000000, 0x10000000);
rt_hw_mmu_ioremap_init(&rt_kernel_space, (void *)0xf0000000, 0x10000000);
/* */
arch_kuser_init(&rt_kernel_space, (void*)0xffff0000);
arch_kuser_init(&rt_kernel_space, (void *)0xffff0000);
#else
/*
map kernel space memory (totally 1GB = 0x10000000), pv_offset = 0 if not RT_SMART:
0x80000000 ~ 0x80100000: kernel stack
0x80100000 ~ __bss_end: kernel code and data
*/
rt_hw_mmu_map_init(&rt_kernel_space, (void*)0x80000000, 0x10000000, MMUTable, 0);
rt_hw_mmu_ioremap_init(&rt_kernel_space, (void*)0x80000000, 0x10000000);
rt_hw_mmu_map_init(&rt_kernel_space, (void *)0x80000000, 0x10000000, MMUTable, 0);
rt_hw_mmu_ioremap_init(&rt_kernel_space, (void *)0x80000000, 0x10000000);
#endif

/* init memory pool */
/* init memory pool */
#ifdef RT_USING_HEAP
rt_system_heap_init((void *)HEAP_BEGIN, (void *)HEAP_END);
#endif

extern int rt_hw_cpu_id(void);

u32 cpu_id, cpu_offset = 0;
Expand All @@ -208,10 +209,10 @@ void rt_hw_board_aarch32_init(void)
FEarlyUartProbe();

FIOPadCfgInitialize(&iopad_ctrl, FIOPadLookupConfig(FIOPAD0_ID));

#if defined(RT_USING_SMART)
redist_addr = (uint32_t)rt_ioremap(GICV3_RD_BASE_ADDR, 4 * 128*1024);
iopad_ctrl.config.base_address = (uintptr)rt_ioremap((void*)iopad_ctrl.config.base_address, 0x2000);
redist_addr = (uint32_t)rt_ioremap(GICV3_RD_BASE_ADDR, 4 * 128 * 1024);
iopad_ctrl.config.base_address = (uintptr)rt_ioremap((void *)iopad_ctrl.config.base_address, 0x2000);
#else
redist_addr = GICV3_RD_BASE_ADDR;
#endif
Expand Down
Loading

0 comments on commit 1c83ea3

Please sign in to comment.