-
Notifications
You must be signed in to change notification settings - Fork 23
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
Ramdisk #4
Merged
Merged
Ramdisk #4
Changes from 9 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
0e97067
Some works towards ramdisk
d53531c
PMEM ramdisk working
fe261e6
DTS cleanup
bc8d483
Added some docs on ramdisk
07f6589
Cleanup
d16ee4c
Cleanup
d92affd
Cleanup
82c333d
Cleanup
6b0bb9d
Cleanup
5d0cda9
Change back to original memory size, added comment
b283f85
Cleanup
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 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 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 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 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 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 |
---|---|---|
|
@@ -44,6 +44,7 @@ static void rv_soc_init_mem_access_cbs(rv_soc_td *rv_soc) | |
INIT_MEM_ACCESS_STRUCT(rv_soc, count++, uart_bus_access, &rv_soc->uart8250, UART8250_TX_REG_ADDR, UART_NS8250_NR_REGS); | ||
#endif | ||
INIT_MEM_ACCESS_STRUCT(rv_soc, count++, memory_bus_access, rv_soc->mrom, MROM_BASE_ADDR, MROM_SIZE_BYTES); | ||
INIT_MEM_ACCESS_STRUCT(rv_soc, count++, memory_bus_access, rv_soc->from, FROM_BASE_ADDR, FROM_SIZE_BYTES); | ||
} | ||
|
||
static rv_ret rv_soc_bus_access(void *priv, privilege_level priv_level, bus_access_type access_type, rv_uint_xlen address, void *value, uint8_t len) | ||
|
@@ -74,7 +75,7 @@ void rv_soc_dump_mem(rv_soc_td *rv_soc) | |
} | ||
} | ||
|
||
void rv_soc_init(rv_soc_td *rv_soc, char *fw_file_name, char *dtb_file_name) | ||
void rv_soc_init(rv_soc_td *rv_soc, char *fw_file_name, char *dtb_file_name, char *initrd_file_name) | ||
{ | ||
#define RESET_VEC_SIZE 10 | ||
#define MiB 0x100000 | ||
|
@@ -86,11 +87,13 @@ void rv_soc_init(rv_soc_td *rv_soc, char *fw_file_name, char *dtb_file_name) | |
uint64_t fdt_size = 0; | ||
uint64_t tmp = 0; | ||
|
||
static uint8_t __attribute__((aligned (4))) soc_from[FROM_SIZE_BYTES] = { 0 }; | ||
static uint8_t __attribute__((aligned (4))) soc_mrom[MROM_SIZE_BYTES] = { 0 }; | ||
static uint8_t __attribute__((aligned (4))) soc_ram[RAM_SIZE_BYTES] = { 0 }; | ||
|
||
/* Init everything to zero */ | ||
memset(rv_soc, 0, sizeof(rv_soc_td)); | ||
rv_soc->from = soc_from; | ||
rv_soc->mrom = soc_mrom; | ||
rv_soc->ram = soc_ram; | ||
|
||
|
@@ -113,6 +116,11 @@ void rv_soc_init(rv_soc_td *rv_soc, char *fw_file_name, char *dtb_file_name) | |
|
||
write_mem_from_file(fw_file_name, soc_ram, sizeof(soc_ram)); | ||
|
||
if (initrd_file_name != NULL) { | ||
printf("XXXXXXXXXXXXXXXXXXXXXXXXXXX\n"); | ||
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. Please remove this print statement or change it to something meaningful. 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. Oups... again, leftover from experimentation... |
||
write_mem_from_file(initrd_file_name, soc_from, FROM_SIZE_BYTES); | ||
} | ||
|
||
/* this is the reset vector, taken from qemu v5.2 */ | ||
uint32_t reset_vec[RESET_VEC_SIZE] = { | ||
0x00000297, /* 1: auipc t0, %pcrel_hi(fw_dyn) */ | ||
|
This file contains 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
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.
Why the increase of the main memory? Please keep the old setting.