-
Notifications
You must be signed in to change notification settings - Fork 8.1k
riscv: Source flash geometry from Kconfig #97144
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
Open
fsammoura1980
wants to merge
1
commit into
zephyrproject-rtos:main
Choose a base branch
from
fsammoura1980:fix_base_address
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+18
−26
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -47,35 +47,10 @@ | |||||
#define ROM_SIZE (CONFIG_FLASH_LOAD_SIZE - ROM_END_OFFSET) | ||||||
#endif | ||||||
|
||||||
#if DT_NODE_HAS_COMPAT_STATUS(DT_CHOSEN(zephyr_flash), soc_nv_flash, okay) | ||||||
#define ROM_BASE (DT_REG_ADDR(DT_CHOSEN(zephyr_flash)) + FLASH_LOAD_OFFSET) | ||||||
#ifndef ROM_SIZE | ||||||
#define ROM_SIZE (DT_REG_SIZE(DT_CHOSEN(zephyr_flash)) - ROM_END_OFFSET) | ||||||
#endif | ||||||
|
||||||
#elif DT_NODE_HAS_COMPAT(DT_CHOSEN(zephyr_flash), jedec_spi_nor) | ||||||
/* For jedec,spi-nor we expect the spi controller to memory map the flash | ||||||
* and for that mapping to be on the register with the name flash_mmap and if a register with that | ||||||
* name doesn't exists, we expect it to be in the second register property of the spi controller. | ||||||
*/ | ||||||
#define SPI_CTRL DT_PARENT(DT_CHOSEN(zephyr_flash)) | ||||||
#define FLASH_MMAP_NAME flash_mmap | ||||||
#define ROM_BASE \ | ||||||
(DT_REG_ADDR_BY_NAME_OR(SPI_CTRL, FLASH_MMAP_NAME, DT_REG_ADDR_BY_IDX(SPI_CTRL, 1)) + \ | ||||||
FLASH_LOAD_OFFSET) | ||||||
#ifndef ROM_SIZE | ||||||
#define ROM_SIZE \ | ||||||
(DT_REG_SIZE_BY_NAME_OR(SPI_CTRL, FLASH_MMAP_NAME, DT_REG_SIZE_BY_IDX(SPI_CTRL, 1)) - \ | ||||||
ROM_END_OFFSET) | ||||||
#endif | ||||||
|
||||||
#else /* Use Kconfig to cover the remaining cases */ | ||||||
#define ROM_BASE (CONFIG_FLASH_BASE_ADDRESS + FLASH_LOAD_OFFSET) | ||||||
#ifndef ROM_SIZE | ||||||
#define ROM_SIZE (CONFIG_FLASH_SIZE * 1024 - FLASH_LOAD_OFFSET - ROM_END_OFFSET) | ||||||
#endif | ||||||
|
||||||
#endif /* DT_NODE_HAS_COMPAT_STATUS */ | ||||||
#endif /* ROM_SIZE*/ | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like this comment is wrong?
Suggested change
|
||||||
|
||||||
#else /* CONFIG_XIP */ | ||||||
#define ROM_BASE CONFIG_SRAM_BASE_ADDRESS | ||||||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 reg-name ("flash_mmap") has to be checked. The position is completely irrelevant.
in Litex this changed already a few times and it also depends on the configuration.
Also that prop might not be used drom the litex litespi driver in tree, but out of tree users could have also used it for others.
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.
was added here: #73482 for more context