-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update cache helpers #1606
Update cache helpers #1606
Conversation
Travis error is due to checkpatch warnings, fixing those warning would make future syncs with the ARM-TF cache helpers a bit more difficult. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My R-b for the 3 first commits (few minor comments).
For the 4th "core: update cache helpers": 2 comments but my R-b would already apply to the sequences and core registers/instruction set. Cross-checked with arm docs and a-tf sources. very nice integration, thanks.
@@ -120,11 +115,6 @@ | |||
mcr p15, 0, r0, c7, c1, 0 | |||
.endm | |||
|
|||
.macro write_bpiall |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor about sorting, write_bpiall
should remain here (with instr. fix:).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sorry, I don't understand. Please explain.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my mistake :( discard my comment, I just understood the register sorting.
@@ -260,7 +260,7 @@ END_FUNC reset | |||
assert_flat_mapped_range (\vbase), (\line) | |||
ldr r0, =(\vbase) | |||
ldr r1, =(\vend) | |||
bl arm_cl1_d_cleanbyva | |||
bl dcache_clean_range |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add sub r1, r1, r0
@@ -506,7 +506,8 @@ UNWIND( .cantunwind) | |||
|
|||
#if defined (CFG_BOOT_SECONDARY_REQUEST) | |||
/* if L1 is not invalidated before, do it here */ | |||
bl arm_cl1_d_invbysetway | |||
mov r0, #DCACHE_OP_INV | |||
bl dcache_op_all |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should invalidate only the inner (louis), no ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question, I don't know. On the other hand this is done once during boot so it's not that much time that can be saved by doing it only to louis.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalidating all data cache could be harmful to other running cores, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, I'll change to dcache_op_louis()
. @yanyan-wrs, do you agree?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes. maybe we should ask some imx maintainers to test this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
%grep -l CFG_BOOT_SECONDARY_REQUEST **/*.mk
core/arch/arm/plat-imx/conf.mk
core/arch/arm/plat-ls/conf.mk
core/arch/arm/plat-zynq7k/conf.mk
mk/config.mk
So any of plat-imx
, plat-ls
or plat-zynq7k
should be useful.
Any volunteers/comments, @yanyan-wrs , @sorenb-xlnx , @b49020 ?
core/arch/arm/include/arm32_macros.S
Outdated
.endm | ||
|
||
.macro write_dcimvac reg | ||
/* Data cache clean by MVA */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: s/clean/invalidate/
Addressing review comments (except the one about not moving |
update |
|
I'll assume that everyone is happy with this and squash and rebase in 2 days. |
@@ -504,7 +508,8 @@ UNWIND( .cantunwind) | |||
|
|||
#if defined (CFG_BOOT_SECONDARY_REQUEST) | |||
/* if L1 is not invalidated before, do it here */ | |||
bl arm_cl1_d_invbysetway | |||
mov r0, #DCACHE_OP_INV | |||
bl dcache_op_louis |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, late comment after reading back this.
Actually, i even think this should invalidate only the L1 (dcache_op_level1
), not the L2 (in case it is in the inner) that might be used by other running cores.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it makes more sense.
Just a minor comment about sorting in core/arch/arm/include/arm32_macros.S. |
I'm not proposing any sorting order in the 2nd commit, I'm just correcting some deviations from the comment about the sorting. The main reason for a sorting order is to avoid the problem with conflicts when adding functions at the end. Other than that I don't care, but I'm not too happy about changing the sorting order as it doubtless will cause conflicts when rebasing these patches. When you write "cN, M, cO, P" what is what? I'm asking since the instructions are written as p15, A, rX, cB, cC, D. |
I meant registers targeted by instructions based on "p15, A, rX, cB, cC, D" are sorted by (B, A, C, D) in the literature. (up to my experience at least) |
@etienne-lms are you OK with the current state or do we need more changes? |
@jenswi-linaro: yes, current state of the PR is fine to me ( |
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Sorts macros and fixes the macro write_bpial Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Updates AArch64 and ARMv7 cache helpers from lib/aarch32/cache_helpers.S and lib/aarch64/cache_helpers.S in ARM-TF, https://github.com/ARM-software/arm-trusted-firmware/tree/2bd26faf62411c75111fea4b23c542865383b068 The imported routines only covers the inner cache. Already present ARMv7 cache routines are replaced by the new equivalent routines. The AArch64 routines are updated with the resent changes in ARM-TF. The imported files are modified to better fit into OP-TEE, some functions and defines are renamed. Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (Hikey AArch{32,64} pager) Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (Juno AArch{32,64} pager) Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
dbdc78f
to
b3177a3
Compare
Tags applied. |
No description provided.