From bc18798dbcd50828272aed01ee4ce275a99f34f3 Mon Sep 17 00:00:00 2001 From: imi415 Date: Wed, 7 Sep 2022 23:48:27 +0800 Subject: [PATCH] Updated startup compatible with SPL. Signed-off-by: imi415 --- startup_stx7105.S | 1 + stx7105.ld | 8 ++++++-- tools/pad_image.sh | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/startup_stx7105.S b/startup_stx7105.S index ae1ab94..8c6b0ff 100644 --- a/startup_stx7105.S +++ b/startup_stx7105.S @@ -7,6 +7,7 @@ .section .text.vtors, "ax" _vtors: + .long _stext .long _eidata .long _start diff --git a/stx7105.ld b/stx7105.ld index e9617f8..0e059ea 100644 --- a/stx7105.ld +++ b/stx7105.ld @@ -7,13 +7,17 @@ ENTRY(_start) /* We don't use 29-bit mode since PMB and LMI initialization has to be done anyway. */ MEMORY { - EMI (rx) : ORIGIN = 0x80000000, LENGTH = 0x01000000 /* LMI virtual address: 0x8000_0000 */ - LMI (rwx) : ORIGIN = 0x81000000, LENGTH = 0x0F000000 /* LMI virtual address: 0x8100_0000 */ + EMI (rx) : ORIGIN = 0x80000000, LENGTH = 0x01000000 /* EMI copied to Non-cached LMI virtual address: 0x8000_0000 */ + LMI (rwx) : ORIGIN = 0x81000000, LENGTH = 0x0F000000 /* Non-cached LMI virtual address: 0x8100_0000 */ + EMI_CACHED (rx) : ORIGIN = 0x90000000, LENGTH = 0x01000000 /* EMI copied to cached LMI virtual address: 0x9000_0000 */ + LMI_CACHED (rwx) : ORIGIN = 0x91000000, LENGTH = 0x0F000000 /* Cached LMI virtual address: 0x9100_0000 */ + } SECTIONS { .text : { . = ALIGN(4); + _stext = .; KEEP(*(.text.vtors)) *(.text.init) *(.text.exc) diff --git a/tools/pad_image.sh b/tools/pad_image.sh index b5f0984..d64cb25 100755 --- a/tools/pad_image.sh +++ b/tools/pad_image.sh @@ -1,6 +1,6 @@ #!/bin/sh -FLASH_SIZE=1048576 +FLASH_SIZE=1015808 # 1048576 - 32768 INPUT_IMAGE="$1" BINARY_NAME="$2" @@ -30,4 +30,4 @@ PAD_SIZE=$((${FLASH_SIZE} - ${BINARY_SIZE})) echo "Output binary size: ${BINARY_SIZE}, additional padding: ${PAD_SIZE}." # Pad output file using `dd` -tr '\0' '\377' < /dev/zero | dd bs=1 count=${PAD_SIZE} of=${BINARY_NAME} conv=notrunc seek=${BINARY_SIZE} \ No newline at end of file +tr '\0' '\377' < /dev/zero | dd bs=1 count=${PAD_SIZE} of=${BINARY_NAME} conv=notrunc seek=${BINARY_SIZE}