Skip to content
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

plat-hikey: make DRAM0_SIZE and DRAM0_SIZE_NSEC configurable #6718

Closed
wants to merge 1 commit into from

Conversation

zwb-233
Copy link
Contributor

@zwb-233 zwb-233 commented Feb 28, 2024

This commit aims to enable the dynamic adjustment of DRAM0_SIZE and DRAM0_SIZE_NSEC for Hikey960 based on the changes in CFG_TZDRAM_START.

DRAM0_SIZE is now defined as CFG_TZDRAM_START, allowing
for dynamic configuration.

DRAM0_SIZE_NSEC is modified to calculate the size relative
to DRAM0_BASE.

Signed-off-by: Wen Bin <[email protected]>
@@ -105,7 +105,7 @@
*/

#define DRAM0_BASE 0x00000000
#define DRAM0_SIZE 0x3F000000
#define DRAM0_SIZE CFG_TZDRAM_START
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

size = start? This doesn't seem to make much sense does it?

Copy link
Contributor Author

@zwb-233 zwb-233 Feb 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the size of DRAM0_SIZE should match that of CFG_TZDRAM_START, as it appears that only DRAM0 exists before TZDRAM. However, if you think this change is unnecessary, please let me know, and I will close this pull request later.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, sorry I did not see that. Would you mind adding a comment /* DRAM0 exists below TZDRAM */?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency and for future new readers, prefer: #define DRAM0_SIZE (CFG_TZDRAM_START - DRAM0_BASE) even if the result is the same in the generated image.

@@ -130,7 +130,7 @@
#if (CFG_DRAM_SIZE_GB == 3)
#define DRAM1_SIZE_NSEC 0x80000000
#elif (CFG_DRAM_SIZE_GB == 4)
#define DRAM1_SIZE_NSEC 0xA0000000
#define DRAM1_SIZE_NSEC 0xE0000000 - DRAM1_BASE
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parentheses needed

Copy link

This pull request has been marked as a stale pull request because it has been open (more than) 30 days with no activity. Remove the stale label or add a comment, otherwise this pull request will automatically be closed in 5 days. Note, that you can always re-open a closed issue at any time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants