armcm_reset: Introduce Kconfig FLASH_BOOT_ADDRESS value
Specify the arm architecture flash bootup address for each chip type in Kconfig using a new FLASH_BOOT_ADDRESS setting. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
11dd273b34
commit
42e9adcfc9
|
@ -74,6 +74,10 @@ config FLASH_SIZE
|
||||||
hex
|
hex
|
||||||
default 0x80000
|
default 0x80000
|
||||||
|
|
||||||
|
config FLASH_BOOT_ADDRESS
|
||||||
|
hex
|
||||||
|
default 0x0
|
||||||
|
|
||||||
config RAM_START
|
config RAM_START
|
||||||
hex
|
hex
|
||||||
default 0x20400000 if MACH_SAME70
|
default 0x20400000 if MACH_SAME70
|
||||||
|
|
|
@ -91,6 +91,10 @@ config FLASH_SIZE
|
||||||
default 0x80000 if MACH_SAMD51G19 || MACH_SAMD51J19 || MACH_SAMD51N19 || MACH_SAME51J19
|
default 0x80000 if MACH_SAMD51G19 || MACH_SAMD51J19 || MACH_SAMD51N19 || MACH_SAME51J19
|
||||||
default 0x100000 if MACH_SAMD51P20 || MACH_SAME54P20
|
default 0x100000 if MACH_SAMD51P20 || MACH_SAME54P20
|
||||||
|
|
||||||
|
config FLASH_BOOT_ADDRESS
|
||||||
|
hex
|
||||||
|
default 0x0
|
||||||
|
|
||||||
config RAM_START
|
config RAM_START
|
||||||
hex
|
hex
|
||||||
default 0x20000000
|
default 0x20000000
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
// This file may be distributed under the terms of the GNU GPLv3 license.
|
// This file may be distributed under the terms of the GNU GPLv3 license.
|
||||||
|
|
||||||
#include <string.h> // memcpy
|
#include <string.h> // memcpy
|
||||||
#include "autoconf.h" // CONFIG_FLASH_START
|
#include "autoconf.h" // CONFIG_MACH_SAMD21
|
||||||
#include "board/armcm_boot.h" // armcm_enable_irq
|
#include "board/armcm_boot.h" // armcm_enable_irq
|
||||||
#include "board/io.h" // writeb
|
#include "board/io.h" // writeb
|
||||||
#include "board/usb_cdc.h" // usb_notify_ep0
|
#include "board/usb_cdc.h" // usb_notify_ep0
|
||||||
|
|
|
@ -17,10 +17,10 @@
|
||||||
static void
|
static void
|
||||||
canboot_reset(uint64_t req_signature)
|
canboot_reset(uint64_t req_signature)
|
||||||
{
|
{
|
||||||
if (!(CONFIG_FLASH_START & 0x00FFFFFF))
|
if (CONFIG_FLASH_START == CONFIG_FLASH_BOOT_ADDRESS)
|
||||||
// No bootloader
|
// No bootloader
|
||||||
return;
|
return;
|
||||||
uint32_t *bl_vectors = (uint32_t *)(CONFIG_FLASH_START & 0xFF000000);
|
uint32_t *bl_vectors = (uint32_t *)CONFIG_FLASH_BOOT_ADDRESS;
|
||||||
uint64_t *boot_sig = (uint64_t *)(bl_vectors[1] - 9);
|
uint64_t *boot_sig = (uint64_t *)(bl_vectors[1] - 9);
|
||||||
uint64_t *req_sig = (uint64_t *)bl_vectors[0];
|
uint64_t *req_sig = (uint64_t *)bl_vectors[0];
|
||||||
if (boot_sig == (void *)ALIGN((size_t)boot_sig, 8) &&
|
if (boot_sig == (void *)ALIGN((size_t)boot_sig, 8) &&
|
||||||
|
|
|
@ -42,6 +42,10 @@ config FLASH_SIZE
|
||||||
hex
|
hex
|
||||||
default 0x80000
|
default 0x80000
|
||||||
|
|
||||||
|
config FLASH_BOOT_ADDRESS
|
||||||
|
hex
|
||||||
|
default 0x0
|
||||||
|
|
||||||
config RAM_START
|
config RAM_START
|
||||||
hex
|
hex
|
||||||
default 0x10000000
|
default 0x10000000
|
||||||
|
|
|
@ -31,6 +31,10 @@ config FLASH_SIZE
|
||||||
hex
|
hex
|
||||||
default 0x200000
|
default 0x200000
|
||||||
|
|
||||||
|
config FLASH_BOOT_ADDRESS
|
||||||
|
hex
|
||||||
|
default 0x10000100 # Stage2 binary starts at 0x10000000
|
||||||
|
|
||||||
config RAM_START
|
config RAM_START
|
||||||
hex
|
hex
|
||||||
default 0x20000000
|
default 0x20000000
|
||||||
|
@ -45,7 +49,7 @@ config STACK_SIZE
|
||||||
|
|
||||||
config FLASH_START
|
config FLASH_START
|
||||||
hex
|
hex
|
||||||
default 0x10000000
|
default 0x10000100
|
||||||
|
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
//
|
//
|
||||||
// This file may be distributed under the terms of the GNU GPLv3 license.
|
// This file may be distributed under the terms of the GNU GPLv3 license.
|
||||||
|
|
||||||
#include "autoconf.h" // CONFIG_FLASH_START
|
#include "autoconf.h" // CONFIG_FLASH_SIZE
|
||||||
|
|
||||||
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
|
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
|
||||||
OUTPUT_ARCH(arm)
|
OUTPUT_ARCH(arm)
|
||||||
|
|
||||||
MEMORY
|
MEMORY
|
||||||
{
|
{
|
||||||
rom (rx) : ORIGIN = CONFIG_FLASH_START , LENGTH = CONFIG_FLASH_SIZE
|
rom (rx) : ORIGIN = 0x10000000 , LENGTH = CONFIG_FLASH_SIZE
|
||||||
ram (rwx) : ORIGIN = CONFIG_RAM_START , LENGTH = CONFIG_RAM_SIZE
|
ram (rwx) : ORIGIN = CONFIG_RAM_START , LENGTH = CONFIG_RAM_SIZE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -164,6 +164,10 @@ config FLASH_SIZE
|
||||||
default 0x20000 if MACH_STM32H750
|
default 0x20000 if MACH_STM32H750
|
||||||
default 0x200000 if MACH_STM32H743
|
default 0x200000 if MACH_STM32H743
|
||||||
|
|
||||||
|
config FLASH_BOOT_ADDRESS
|
||||||
|
hex
|
||||||
|
default 0x8000000
|
||||||
|
|
||||||
config RAM_START
|
config RAM_START
|
||||||
hex
|
hex
|
||||||
default 0x20000000
|
default 0x20000000
|
||||||
|
|
Loading…
Reference in New Issue