rockchip: memblk: update memblk attr

Add M_ATTR_IGNORE_INVISIBLE for kernel memblk on RK3308-AArch32 to
alloc kernel region within 0~1M address.

Add "ramoops" alias for share memblk to avoid sysmem check warning.

Add M_ATTR_KMEM_CAN_OVERLAP for some images.

Change-Id: I1d7ed93a19ea22e5c69f23d75a1c1faf4e9f0104
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
This commit is contained in:
Joseph Chen 2019-07-15 14:20:40 +08:00
parent 50226c8f95
commit 996752e678
1 changed files with 18 additions and 10 deletions

View File

@ -7,10 +7,6 @@
#include <memblk.h> #include <memblk.h>
const static struct memblk_attr plat_mem_attr[MEMBLK_ID_MAX] = { const static struct memblk_attr plat_mem_attr[MEMBLK_ID_MAX] = {
[MEMBLK_ID_DEMO] = {
.name = "DEMO",
.flags = M_ATTR_NONE,
},
[MEMBLK_ID_ATF] = { [MEMBLK_ID_ATF] = {
.name = "ATF", .name = "ATF",
.flags = M_ATTR_NONE, .flags = M_ATTR_NONE,
@ -22,18 +18,19 @@ const static struct memblk_attr plat_mem_attr[MEMBLK_ID_MAX] = {
[MEMBLK_ID_SHM] = { [MEMBLK_ID_SHM] = {
.name = "SHM", .name = "SHM",
.flags = M_ATTR_NONE, .flags = M_ATTR_NONE,
.alias[0] = "ramoops",
}, },
[MEMBLK_ID_UBOOT] = { [MEMBLK_ID_UBOOT] = {
.name = "U-Boot", .name = "U-Boot",
.flags = M_ATTR_OVERLAP, .flags = M_ATTR_KMEM_CAN_OVERLAP,
}, },
[MEMBLK_ID_FASTBOOT] = { [MEMBLK_ID_FASTBOOT] = {
.name = "FASTBOOT", .name = "FASTBOOT",
.flags = M_ATTR_OVERLAP, .flags = M_ATTR_KMEM_CAN_OVERLAP,
}, },
[MEMBLK_ID_STACK] = { [MEMBLK_ID_STACK] = {
.name = "STACK", .name = "STACK",
.flags = M_ATTR_HOFC | M_ATTR_OVERLAP, .flags = M_ATTR_HOFC | M_ATTR_KMEM_CAN_OVERLAP,
}, },
[MEMBLK_ID_FDT] = { [MEMBLK_ID_FDT] = {
.name = "FDT", .name = "FDT",
@ -55,19 +52,30 @@ const static struct memblk_attr plat_mem_attr[MEMBLK_ID_MAX] = {
}, },
[MEMBLK_ID_KERNEL] = { [MEMBLK_ID_KERNEL] = {
.name = "KERNEL", .name = "KERNEL",
/*
* Here is a workarund:
* ATF reserves 0~1MB when kernel is aarch32 mode(follow the ATF for
* aarch64 kernel, but it actually occupies 0~192KB, so we allow kernel
* to alloc the region within 0~1MB address.
*/
#if defined(CONFIG_ROCKCHIP_RK3308) && defined(CONFIG_ARM64_BOOT_AARCH32)
.flags = M_ATTR_OFC | M_ATTR_IGNORE_INVISIBLE,
#else
.flags = M_ATTR_OFC, .flags = M_ATTR_OFC,
#endif
}, },
[MEMBLK_ID_UNCOMP_KERNEL] = { [MEMBLK_ID_UNCOMP_KERNEL] = {
.name = "UNCOMPRESS-KERNEL", .name = "UNCOMPRESS-KERNEL",
.flags = M_ATTR_PEEK, .flags = M_ATTR_IGNORE_INVISIBLE,
}, },
[MEMBLK_ID_ANDROID] = { [MEMBLK_ID_ANDROID] = {
.name = "ANDROID", .name = "ANDROID",
.flags = M_ATTR_OFC, .flags = M_ATTR_OFC | M_ATTR_KMEM_CAN_OVERLAP,
}, },
[MEMBLK_ID_AVB_ANDROID] = { [MEMBLK_ID_AVB_ANDROID] = {
.name = "AVB_ANDROID", .name = "AVB_ANDROID",
.flags = M_ATTR_OFC | M_ATTR_CACHELINE_ALIGN, .flags = M_ATTR_OFC | M_ATTR_CACHELINE_ALIGN |
M_ATTR_KMEM_CAN_OVERLAP,
}, },
}; };