forked from Imagelibrary/seL4
Compare commits
10 Commits
lsf37/cyth
...
rk3288
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2d4f3b6db6 | ||
|
|
ef7dbbfacb | ||
|
|
91bd40d388 | ||
|
|
ce873d266c | ||
|
|
0d2331bebb | ||
|
|
400744394b | ||
|
|
a09406adb0 | ||
|
|
a18c6bc5b6 | ||
|
|
ab6e39082d | ||
|
|
7d7ce2cb2b |
@@ -12,7 +12,7 @@
|
||||
#include <object/structures.h>
|
||||
|
||||
/* PD slot reserved for storing the PD's allocated hardware ASID */
|
||||
#define PD_ASID_SLOT (0xff000000 >> (PT_INDEX_BITS + PAGE_BITS))
|
||||
#define PD_ASID_SLOT (0xfe000000 >> (PT_INDEX_BITS + PAGE_BITS))
|
||||
|
||||
enum pde_pte_tag {
|
||||
ME_PDE,
|
||||
|
||||
@@ -385,13 +385,9 @@ static inline void cleanByVA_PoU(vptr_t vaddr, paddr_t paddr)
|
||||
#elif defined(CONFIG_ARCH_ARM_V6)
|
||||
/* V6 doesn't distinguish PoU and PoC, so use the basic flush. */
|
||||
asm volatile("mcr p15, 0, %0, c7, c10, 1" : : "r"(vaddr));
|
||||
#elif defined(CONFIG_PLAT_EXYNOS5)
|
||||
#elif defined(CONFIG_ARCH_ARM_V7VE)
|
||||
/* Flush to coherency for table walks... Why? */
|
||||
asm volatile("mcr p15, 0, %0, c7, c10, 1" : : "r"(vaddr));
|
||||
#elif defined(CONFIG_PLAT_IMX7)
|
||||
asm volatile("mcr p15, 0, %0, c7, c10, 1" : : "r"(vaddr));
|
||||
#elif defined(CONFIG_PLAT_TK1)
|
||||
asm volatile("mcr p15, 0, %0, c7, c10, 1" : : "r"(vaddr));
|
||||
#elif defined(CONFIG_ARM_CORTEX_A53)
|
||||
asm volatile("mcr p15, 0, %0, c7, c10, 1" : : "r"(vaddr));
|
||||
#else
|
||||
|
||||
22
libsel4/sel4_plat_include/rk3288/sel4/plat/api/constants.h
Normal file
22
libsel4/sel4_plat_include/rk3288/sel4/plat/api/constants.h
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright 2020, Data61, CSIRO (ABN 41 687 119 230)
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#ifdef HAVE_AUTOCONF
|
||||
#include <autoconf.h>
|
||||
#endif
|
||||
|
||||
/* Cortex a17 manual, section 9.2.2 */
|
||||
#define seL4_NumHWBreakpoints (10)
|
||||
#define seL4_NumExclusiveBreakpoints (6)
|
||||
#define seL4_NumExclusiveWatchpoints (4)
|
||||
#ifdef CONFIG_HARDWARE_DEBUG_API
|
||||
#define seL4_FirstWatchpoint (6)
|
||||
#define seL4_NumDualFunctionMonitors (0)
|
||||
#endif
|
||||
|
||||
/* First address in the virtual address space that is not accessible to user level */
|
||||
#define seL4_UserTop 0xe0000000
|
||||
@@ -2214,6 +2214,7 @@ static exception_t decodeARMPageTableInvocation(word_t invLabel, word_t length,
|
||||
pd = PDE_PTR(cap_page_directory_cap_get_capPDBasePtr(pdCap));
|
||||
asid = cap_page_directory_cap_get_capPDMappedASID(pdCap);
|
||||
|
||||
#ifndef CONFIG_ARM_HYPERVISOR_SUPPORT
|
||||
if (unlikely(vaddr >= USER_TOP)) {
|
||||
userError("ARMPageTableMap: Virtual address cannot be in kernel window. vaddr: 0x%08lx, USER_TOP: 0x%08x", vaddr,
|
||||
USER_TOP);
|
||||
@@ -2222,6 +2223,7 @@ static exception_t decodeARMPageTableInvocation(word_t invLabel, word_t length,
|
||||
|
||||
return EXCEPTION_SYSCALL_ERROR;
|
||||
}
|
||||
#endif
|
||||
|
||||
{
|
||||
findPDForASID_ret_t find_ret;
|
||||
@@ -2279,7 +2281,7 @@ static exception_t decodeARMFrameInvocation(word_t invLabel, word_t length,
|
||||
{
|
||||
switch (invLabel) {
|
||||
case ARMPageMap: {
|
||||
word_t vaddr, vtop, w_rightsMask;
|
||||
word_t vaddr, w_rightsMask;
|
||||
paddr_t capFBasePtr;
|
||||
cap_t pdCap;
|
||||
pde_t *pd;
|
||||
@@ -2333,6 +2335,8 @@ static exception_t decodeARMFrameInvocation(word_t invLabel, word_t length,
|
||||
return EXCEPTION_SYSCALL_ERROR;
|
||||
}
|
||||
} else {
|
||||
#ifndef CONFIG_ARM_HYPERVISOR_SUPPORT
|
||||
word_t vtop;
|
||||
vtop = vaddr + BIT(pageBitsForSize(frameSize)) - 1;
|
||||
|
||||
if (unlikely(vtop >= USER_TOP)) {
|
||||
@@ -2343,6 +2347,7 @@ static exception_t decodeARMFrameInvocation(word_t invLabel, word_t length,
|
||||
|
||||
return EXCEPTION_SYSCALL_ERROR;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
@@ -33,14 +33,14 @@ BOOT_CODE void initGenericTimer(void)
|
||||
}
|
||||
|
||||
/*
|
||||
* The exynos5 platforms require custom hardware initialisation before the
|
||||
* The exynos5 and rk3288 platforms require custom hardware initialisation before the
|
||||
* generic timer is usable. They need to overwrite initTimer before calling
|
||||
* initGenericTimer because of this. We cannot use a `weak` symbol definition
|
||||
* in this case because the kernel is built as a single file and multiple
|
||||
* symbol definitions with the same name are not allowed. We therefore resort
|
||||
* to ifdef'ing out this initTimer definition for exynos5 platforms.
|
||||
*/
|
||||
#ifndef CONFIG_PLAT_EXYNOS5
|
||||
#if !defined(CONFIG_PLAT_EXYNOS5) && !defined(CONFIG_PLAT_RK3288)
|
||||
BOOT_CODE void initTimer(void)
|
||||
{
|
||||
initGenericTimer();
|
||||
|
||||
47
src/plat/rk3288/config.cmake
Normal file
47
src/plat/rk3288/config.cmake
Normal file
@@ -0,0 +1,47 @@
|
||||
#
|
||||
# Copyright 2020, Data61, CSIRO (ABN 41 687 119 230)
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
#
|
||||
|
||||
cmake_minimum_required(VERSION 3.7.2)
|
||||
|
||||
declare_platform(rk3288 KernelPlatRK3288 PLAT_RK3288 "KernelSel4ArchAarch32 OR KernelSel4ArchArmHyp")
|
||||
|
||||
if(KernelPlatRK3288)
|
||||
if("${KernelSel4Arch}" STREQUAL aarch32)
|
||||
declare_seL4_arch(aarch32)
|
||||
elseif("${KernelSel4Arch}" STREQUAL arm_hyp)
|
||||
declare_seL4_arch(arm_hyp)
|
||||
else()
|
||||
fallback_declare_seL4_arch_default(aarch32)
|
||||
endif()
|
||||
set(KernelArmCortexA15 ON) #almost the same as A17
|
||||
set(KernelArchArmV7ve ON)
|
||||
# v7ve is a superset of v7a, so we enable that as well
|
||||
set(KernelArchArmV7a ON)
|
||||
config_set(KernelARMPlatform ARM_PLAT rk3288)
|
||||
config_set(KernelArmMach "rk3288" CACHE INTERNAL "")
|
||||
|
||||
list(APPEND KernelDTSList "tools/dts/${KernelARMPlatform}-ntablet.dts")
|
||||
list(APPEND KernelDTSList "src/plat/rk3288/overlay-${KernelARMPlatform}-ntablet.dts")
|
||||
|
||||
declare_default_headers(
|
||||
TIMER_FREQUENCY 24000000llu
|
||||
MAX_IRQ 187
|
||||
NUM_PPI 32
|
||||
TIMER drivers/timer/arm_generic.h
|
||||
INTERRUPT_CONTROLLER arch/machine/gic_v2.h
|
||||
CLK_MAGIC 2863311531llu
|
||||
CLK_SHIFT 36u
|
||||
KERNEL_WCET 10u
|
||||
)
|
||||
endif()
|
||||
|
||||
add_sources(
|
||||
DEP "KernelPlatRK3288"
|
||||
CFILES
|
||||
# I consider the next line to be too long,
|
||||
# but the github style checker insists on having it all on one line.
|
||||
src/arch/arm/machine/gic_v2.c src/arch/arm/machine/l2c_nop.c src/plat/rk3288/machine/timer.c
|
||||
)
|
||||
28
src/plat/rk3288/machine/timer.c
Normal file
28
src/plat/rk3288/machine/timer.c
Normal file
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Copyright 2020 Data61, CSIRO (ABN 41 687 119 230)
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-only
|
||||
*/
|
||||
|
||||
/*
|
||||
* This code was taken from the Linux kernel, file arch/arm/mach-rockchip/rockchip.c
|
||||
*/
|
||||
|
||||
#define RK3288_TIMER6_7_PHYS 0xff810000
|
||||
|
||||
#define writel(v, a) (*(uint32_t *)(a) = (v))
|
||||
|
||||
BOOT_CODE void initTimer(void)
|
||||
{
|
||||
/*
|
||||
* Most/all uboot versions for rk3288 don't enable timer7
|
||||
* which is needed for the architected timer to work.
|
||||
* So make sure it is running during early boot.
|
||||
*/
|
||||
writel(0, RK3288_TIMER6_7_PHYS + 0x30);
|
||||
writel(0xffffffff, RK3288_TIMER6_7_PHYS + 0x20);
|
||||
writel(0xffffffff, RK3288_TIMER6_7_PHYS + 0x24);
|
||||
writel(1, RK3288_TIMER6_7_PHYS + 0x30);
|
||||
dsb();
|
||||
initGenericTimer();
|
||||
}
|
||||
24
src/plat/rk3288/overlay-rk3288-ntablet.dts
Normal file
24
src/plat/rk3288/overlay-rk3288-ntablet.dts
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright 2020, Data61, CSIRO (ABN 41 687 119 230)
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-only
|
||||
*/
|
||||
|
||||
/ {
|
||||
chosen {
|
||||
seL4,elfloader-devices =
|
||||
"serial2";
|
||||
seL4,kernel-devices =
|
||||
"serial2",
|
||||
&{/interrupt-controller@ffc01000},
|
||||
&{/timer};
|
||||
};
|
||||
|
||||
// Trustzone carves out some RAM for its secure zone.
|
||||
// Ideally we'd use the memory node passed in from U-Boot,
|
||||
// but for now we need this at compile time.
|
||||
memory {
|
||||
reg = <0x0 0x200000 0x0 0x7fe00000>;
|
||||
};
|
||||
|
||||
};
|
||||
3987
tools/dts/rk3288-ntablet.dts
Normal file
3987
tools/dts/rk3288-ntablet.dts
Normal file
File diff suppressed because it is too large
Load Diff
@@ -49,6 +49,7 @@ imx6q-wandboard-revd1=wandq
|
||||
imx7d-sdb=imx7sabre
|
||||
omap3-beagle=omap3
|
||||
qcom-apq8064-ifc6410=apq8064
|
||||
rk3288-ntablet=rk3288-ntablet-870a-5648
|
||||
sun7i-a20-cubietruck=allwinnera20
|
||||
tegra124-jetson-tk1=tk1
|
||||
zynq-zc706=zynq7000
|
||||
|
||||
Reference in New Issue
Block a user