mirror of
https://github.com/sipeed/LicheeRV-Nano-Build.git
synced 2026-11-09 18:04:55 -06:00
Update the vendored FSBL from Sophgo sg200x-dev commit 426d1e7eccce84b34169e5f21de7d6e7da1804a1 to 5a80c127cf614dea7f534d5b5352886a1c720d37, incorporating 24 upstream commits. Keep the local plat/sg200x symlink to cv181x. Import the upstream DDR, clock, storage and boot-image changes together with their platform support, prebuilt firmware and licensing files. All 935 upstream files match the target revision. Validation on LicheeRV Nano (SG2002/C906, SD, DDR3-1866 x16): - Cross-build BL2 with the existing Xuantie GCC 10.2.0 toolchain. - Repack FIP while preserving the installed OpenSBI and U-Boot byte for byte; verify headers, payload checksums, entry addresses and LZMA. - Software reboot and power-cycle boot succeed; memtester 16M 1 passes all 18 checks. Validation covers the FSBL update with existing later boot stages. Full firmware builds, A53 and video/HID acceptance are not covered.
99 lines
2.1 KiB
ArmAsm
99 lines
2.1 KiB
ArmAsm
/*
|
|
* Copyright (c) 2013-2017, ARM Limited and Contributors. All rights reserved.
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
#include <platform.h>
|
|
|
|
#ifdef __riscv
|
|
OUTPUT_FORMAT("elf64-littleriscv")
|
|
OUTPUT_ARCH(riscv)
|
|
#else
|
|
OUTPUT_FORMAT("elf64-littleaarch64")
|
|
OUTPUT_ARCH(aarch64)
|
|
#endif
|
|
ENTRY(bl2_entrypoint)
|
|
|
|
MEMORY {
|
|
RAM (rwx): ORIGIN = BL2_BASE, LENGTH = BL2_SIZE
|
|
|
|
SRAM (rwx): ORIGIN = 0x000000000C030000, LENGTH = 0x10000
|
|
}
|
|
|
|
SECTIONS
|
|
{
|
|
. = BL2_BASE;
|
|
ASSERT(. == ALIGN(4096),
|
|
"BL2_BASE address is not aligned on a page boundary.")
|
|
|
|
ro . : {
|
|
__RO_START__ = .;
|
|
*bl2_entrypoint.o(.text*)
|
|
*(.vectors)
|
|
*(.text*)
|
|
*(.rodata*)
|
|
|
|
__RO_END__ = .;
|
|
} >RAM
|
|
|
|
/*
|
|
* .data must be placed at a lower address than the stacks if the stack
|
|
* protector is enabled. Alternatively, the .data.stack_protector_canary
|
|
* section can be placed independently of the main .data section.
|
|
*/
|
|
.data . : {
|
|
. = ALIGN(16);
|
|
__DATA_START__ = .;
|
|
*(.data*)
|
|
. = ALIGN(16);
|
|
__DATA_END__ = .;
|
|
} >RAM
|
|
|
|
stacks (NOLOAD) : {
|
|
. = ALIGN(64);
|
|
__STACKS_START__ = .;
|
|
. += PLATFORM_STACK_SIZE;
|
|
. = ALIGN(64);
|
|
__STACKS_END__ = .;
|
|
} >RAM
|
|
|
|
/*
|
|
* The .bss section gets initialised to 0 at runtime.
|
|
* Its base address should be 16-byte aligned for better performance of the
|
|
* zero-initialization code.
|
|
*/
|
|
.bss : ALIGN(16) {
|
|
. = ALIGN(16);
|
|
__BSS_START__ = .;
|
|
*(SORT_BY_ALIGNMENT(.bss*))
|
|
*(COMMON)
|
|
. = ALIGN(16);
|
|
__BSS_END__ = .;
|
|
} >RAM
|
|
|
|
/*
|
|
* Define a linker symbol to mark end of the RW memory area for this
|
|
* image.
|
|
*/
|
|
__BL2_END__ = .;
|
|
|
|
__BSS_SIZE__ = SIZEOF(.bss);
|
|
|
|
ASSERT(. <= (BL2_BASE + BL2_SIZE), "BL2 image has exceeded its limit.")
|
|
|
|
.suspend_sect :
|
|
{
|
|
. = ALIGN(8);
|
|
__suspend_sect_start = .;
|
|
KEEP(*(.suspend_entry))
|
|
KEEP(*(.suspend_func))
|
|
. = ALIGN(8);
|
|
__suspend_data_start = .;
|
|
KEEP(*(.suspend_data))
|
|
. = ALIGN(8);
|
|
__suspend_sect_end = .;
|
|
} > SRAM
|
|
#include <rom_api_refer.h>
|
|
}
|