mirror of
https://github.com/Fishwaldo/OBLFR.git
synced 2025-03-15 11:21:23 +00:00
Add fw_header to D0 low_load and fix the image offset with the new addresses.
This commit is contained in:
parent
634a27ffb4
commit
23f3dd52ad
3 changed files with 19 additions and 2 deletions
|
@ -20,6 +20,8 @@ target_sources(app PRIVATE
|
|||
|
||||
target_compile_options(app PRIVATE -ggdb -Os)
|
||||
|
||||
sdk_add_link_options(-ufw_header)
|
||||
|
||||
sdk_set_main_file(src/main.c)
|
||||
sdk_set_linker_script(bl808_flash_d0.ld)
|
||||
project(d0_lowload)
|
||||
|
|
|
@ -24,6 +24,7 @@ HeapMinSize = 0x1000; /* 4KB */
|
|||
|
||||
MEMORY
|
||||
{
|
||||
fw_header_memory (rx) : ORIGIN = 0x58000000 - 0x1000, LENGTH = 4K
|
||||
xip_memory (rx) : ORIGIN = 0x58000000, LENGTH = 1M
|
||||
itcm_memory (rx) : ORIGIN = 0x3F000000, LENGTH = 12K
|
||||
dtcm_memory (rx) : ORIGIN = 0x3F003000, LENGTH = 4K
|
||||
|
@ -34,7 +35,11 @@ MEMORY
|
|||
|
||||
SECTIONS
|
||||
{
|
||||
|
||||
.fw_header :
|
||||
{
|
||||
KEEP(*(.fw_header))
|
||||
} > fw_header_memory
|
||||
|
||||
.text :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
|
|
|
@ -38,7 +38,7 @@ extern void unlz4(const void *aSource, void *aDestination, uint32_t FileLen);
|
|||
#define VM_LINUX_DST_ADDR 0x50000000
|
||||
#define OPENSBI_DST_ADDR 0x3EF80000
|
||||
#define DTB_DST_ADDR 0x51ff8000
|
||||
#define BOOT_HDR_SRC_ADDR 0x58080000
|
||||
#define BOOT_HDR_SRC_ADDR 0x5d5ff000
|
||||
|
||||
static struct bflb_device_s *uart0;
|
||||
|
||||
|
@ -138,7 +138,17 @@ void linux_load()
|
|||
{
|
||||
LOG_I("low_load start... \r\n");
|
||||
|
||||
// for (int32_t i = 0; i < 10000000; i += 4) {
|
||||
// vm_boot_header_t *header = (vm_boot_header_t *)BOOT_HDR_SRC_ADDR + i;
|
||||
// if (header->magic == 0x4c4d5642) {
|
||||
// LOG_I("Header at %d %p\r\n", i, header);
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
vm_boot_header_t *header = (vm_boot_header_t *)BOOT_HDR_SRC_ADDR;
|
||||
LOG_I("Header at 0x%08x\r\n", BOOT_HDR_SRC_ADDR);
|
||||
if (header->magic != 0x4c4d5642) {
|
||||
LOG_E("invalid boot header magic: 0x%08x\r\n", header->magic);
|
||||
return;
|
||||
|
|
Loading…
Add table
Reference in a new issue