-
Notifications
You must be signed in to change notification settings - Fork 13
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
ARCv3: Fix displayed L2$ size #161
Conversation
arch/arc/include/asm/cluster.h
Outdated
data_bank_wid:2, data_sub_banks:2, cache_sets:5, | ||
data_bank_sz:5, data_banks:3, cache_tag_banks:3, | ||
cache_blk_sz:1, cache_assoc:4, scm_cache:1, res:1; | ||
#else | ||
unsigned int res:1, scm_cache:1, cache_assoc:4, cache_blk_sz:1, | ||
cache_tag_banks:3, data_banks:3, data_bank_sz:5, | ||
cache_sets:5, data_sub_banks:2, data_bank_wid:2, | ||
superblocks:3, res1:2; | ||
superblocks:3, data_bank_sz_75:1, res1:1; |
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.
Changes in this file are not linked with the L2$ size fix. Please, add this change by a separate commit.
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.
Done
arch/arc/mm/cache-arcv3.c
Outdated
@@ -51,7 +52,9 @@ static int read_decode_cache_bcr_arcv3(int c, char *buf, int len) | |||
if (cln0.has_scm) { | |||
READ_BCR(ARC_REG_CLNR_SCM_BCR_0, scm0); | |||
|
|||
p_l2->sz_k = (1 << scm0.data_bank_sz) * (1 << scm0.data_banks); | |||
assoc = (scm0.cache_assoc == 0) ? 16 : scm0.cache_assoc; | |||
p_l2->sz_k = (scm0.cache_blk_sz << 6) * assoc * (1 << scm0.cache_sets); |
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 think you need to use the L1_CACHE_SHIFT
definition instead of decimal-literal 6. The definition is formed from the CONFIG_ARC_CACHE_LINE_SHIFT
option.
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.
The documentation states that the cache line size for ARСv3 is fixed and the size is 64 bytes. Let's rely on this and also fix the size = 64 bytes in code.
5e82412
to
3f700f8
Compare
3f700f8
to
f0e7412
Compare
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.
Looks good
No description provided.