Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Arm Trusted Firmware
Commits
5d385355
Commit
5d385355
authored
Apr 14, 2017
by
davidcunado-arm
Committed by
GitHub
Apr 14, 2017
Browse files
Merge pull request #897 from vwadekar/memctrl-v1-xlat-table-v2
Tegra: memctrl_v1: enable 'xlat_table_v2' library
parents
a8a39a50
c05a2197
Changes
3
Hide whitespace changes
Inline
Side-by-side
plat/nvidia/tegra/common/drivers/memctrl/memctrl_v1.c
View file @
5d385355
...
@@ -37,7 +37,7 @@
...
@@ -37,7 +37,7 @@
#include <string.h>
#include <string.h>
#include <tegra_def.h>
#include <tegra_def.h>
#include <utils.h>
#include <utils.h>
#include <xlat_tables.h>
#include <xlat_tables
_v2
.h>
#define TEGRA_GPU_RESET_REG_OFFSET 0x28c
#define TEGRA_GPU_RESET_REG_OFFSET 0x28c
#define GPU_RESET_BIT (1 << 24)
#define GPU_RESET_BIT (1 << 24)
...
@@ -135,17 +135,18 @@ static void tegra_clear_videomem(uintptr_t non_overlap_area_start,
...
@@ -135,17 +135,18 @@ static void tegra_clear_videomem(uintptr_t non_overlap_area_start,
unsigned
long
long
non_overlap_area_size
)
unsigned
long
long
non_overlap_area_size
)
{
{
/*
/*
* Perform cache maintenance to ensure that the non-overlapping area is
* Map the NS memory first, clean it and then unmap it.
* zeroed out. The first invalidation of this range ensures that
* possible evictions of dirty cache lines do not interfere with the
* 'zeromem' operation. Other CPUs could speculatively prefetch the
* main memory contents of this area between the first invalidation and
* the 'zeromem' operation. The second invalidation ensures that any
* such cache lines are removed as well.
*/
*/
inv_dcache_range
(
non_overlap_area_start
,
non_overlap_area_size
);
mmap_add_dynamic_region
(
non_overlap_area_start
,
/* PA */
non_overlap_area_start
,
/* VA */
non_overlap_area_size
,
/* size */
MT_NS
|
MT_RW
|
MT_EXECUTE_NEVER
);
/* attrs */
zeromem
((
void
*
)
non_overlap_area_start
,
non_overlap_area_size
);
zeromem
((
void
*
)
non_overlap_area_start
,
non_overlap_area_size
);
inv_dcache_range
(
non_overlap_area_start
,
non_overlap_area_size
);
flush_dcache_range
(
non_overlap_area_start
,
non_overlap_area_size
);
mmap_remove_dynamic_region
(
non_overlap_area_start
,
non_overlap_area_size
);
}
}
/*
/*
...
@@ -194,7 +195,6 @@ void tegra_memctrl_videomem_setup(uint64_t phys_base, uint32_t size_in_bytes)
...
@@ -194,7 +195,6 @@ void tegra_memctrl_videomem_setup(uint64_t phys_base, uint32_t size_in_bytes)
*/
*/
INFO
(
"Cleaning previous Video Memory Carveout
\n
"
);
INFO
(
"Cleaning previous Video Memory Carveout
\n
"
);
disable_mmu_el3
();
if
(
phys_base
>
vmem_end_old
||
video_mem_base
>
vmem_end_new
)
{
if
(
phys_base
>
vmem_end_old
||
video_mem_base
>
vmem_end_new
)
{
tegra_clear_videomem
(
video_mem_base
,
video_mem_size
<<
20
);
tegra_clear_videomem
(
video_mem_base
,
video_mem_size
<<
20
);
}
else
{
}
else
{
...
@@ -207,7 +207,6 @@ void tegra_memctrl_videomem_setup(uint64_t phys_base, uint32_t size_in_bytes)
...
@@ -207,7 +207,6 @@ void tegra_memctrl_videomem_setup(uint64_t phys_base, uint32_t size_in_bytes)
tegra_clear_videomem
(
vmem_end_new
,
non_overlap_area_size
);
tegra_clear_videomem
(
vmem_end_new
,
non_overlap_area_size
);
}
}
}
}
enable_mmu_el3
(
0
);
done:
done:
tegra_mc_write_32
(
MC_VIDEO_PROTECT_BASE_HI
,
(
uint32_t
)(
phys_base
>>
32
));
tegra_mc_write_32
(
MC_VIDEO_PROTECT_BASE_HI
,
(
uint32_t
)(
phys_base
>>
32
));
...
...
plat/nvidia/tegra/common/tegra_common.mk
View file @
5d385355
...
@@ -38,12 +38,15 @@ USE_COHERENT_MEM := 0
...
@@ -38,12 +38,15 @@ USE_COHERENT_MEM := 0
SEPARATE_CODE_AND_RODATA
:=
1
SEPARATE_CODE_AND_RODATA
:=
1
PLAT_XLAT_TABLES_DYNAMIC
:=
1
$(eval
$(call
add_define,PLAT_XLAT_TABLES_DYNAMIC))
PLAT_INCLUDES
:=
-Iplat
/nvidia/tegra/include/drivers
\
PLAT_INCLUDES
:=
-Iplat
/nvidia/tegra/include/drivers
\
-Iplat
/nvidia/tegra/include
\
-Iplat
/nvidia/tegra/include
\
-Iplat
/nvidia/tegra/include/
${TARGET_SOC}
-Iplat
/nvidia/tegra/include/
${TARGET_SOC}
PLAT_BL_COMMON_SOURCES
:=
lib/xlat_tables/xlat_tables
_common.c
\
include
lib/xlat_tables
_v2
/xlat_tables
.mk
lib/xlat_tables/aarch64/xlat_tables.c
PLAT_BL_COMMON_SOURCES
+=
${XLAT_TABLES_LIB_SRCS}
COMMON_DIR
:=
plat/nvidia/tegra/common
COMMON_DIR
:=
plat/nvidia/tegra/common
...
...
plat/nvidia/tegra/include/platform_def.h
View file @
5d385355
/*
/*
* Copyright (c) 2015, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2015
-2017
, ARM Limited and Contributors. All rights reserved.
*
*
* Redistribution and use in source and binary forms, with or without
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* modification, are permitted provided that the following conditions are met:
...
@@ -77,7 +77,8 @@
...
@@ -77,7 +77,8 @@
/*******************************************************************************
/*******************************************************************************
* Platform specific page table and MMU setup constants
* Platform specific page table and MMU setup constants
******************************************************************************/
******************************************************************************/
#define ADDR_SPACE_SIZE (1ull << 35)
#define PLAT_PHY_ADDR_SPACE_SIZE (1ull << 35)
#define PLAT_VIRT_ADDR_SPACE_SIZE (1ull << 35)
/*******************************************************************************
/*******************************************************************************
* Some data must be aligned on the biggest cache line size in the platform.
* Some data must be aligned on the biggest cache line size in the platform.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment