Support Bootloader for GR-PEACH and GR-LYCHEE

The mainly changes is below:
- Update scatter file, linker file for bootloader support
- Update the file for RZ/A1 serial flash boot loader
- Add "device name" and "bootloader_supported" in targets.json
pull/7375/head
TomoYamanaka 2018-05-29 22:44:40 +09:00 committed by adbridge
parent a08c3ec5db
commit 16f09712ee
11 changed files with 145 additions and 35 deletions

View File

@ -9,25 +9,42 @@
#include "mem_RZ_A1LU.h"
#if !defined(MBED_APP_START)
#define MBED_APP_START 0x18000000
#endif
#if !defined(MBED_APP_SIZE)
#define MBED_APP_SIZE 0x800000
#endif
LOAD_TTB __TTB_BASE __TTB_SIZE ; Page 0 of On-Chip Data Retention RAM
{
TTB +0 EMPTY 0x4000
{ } ; Level-1 Translation Table for MMU
}
SFLASH __ROM_BASE __ROM_SIZE ; load region size_region
SFLASH MBED_APP_START MBED_APP_SIZE ; load region size_region
{
BOOT_LOADER_BEGIN __ROM_BASE FIXED
#if (MBED_APP_START == 0x18000000)
BOOT_LOADER_BEGIN MBED_APP_START FIXED
{
* (BOOT_LOADER)
}
VECTORS __VECTOR_BASE FIXED
VECTORS (MBED_APP_START + 0x4000) FIXED
{
* (RESET, +FIRST) ; Vector table and other startup code
* (InRoot$$Sections) ; All (library) code that must be in a root region
* (+RO-CODE) ; Application RO code (.text)
}
#else
VECTORS MBED_APP_START FIXED
{
* (RESET, +FIRST) ; Vector table and other startup code
* (InRoot$$Sections) ; All (library) code that must be in a root region
* (+RO-CODE) ; Application RO code (.text)
}
#endif
RO_DATA +0
{ * (+RO-DATA) } ; Application RO data (.constdata)

View File

@ -42,10 +42,6 @@
// <o1> ROM Size (in Bytes) <0x0-0xFFFFFFFF:8>
// </h>
*----------------------------------------------------------------------------*/
#define __ROM_BASE 0x18000000
#define __ROM_SIZE 0x08000000
#define __VECTOR_BASE 0x18004000
/*--------------------- RAM Configuration -----------------------------------
*----------------------------------------------------------------------------*/

View File

@ -1,14 +1,33 @@
/* Linker script for mbed RZ_A1LU */
/* Linker script to configure memory regions. */
#if !defined(MBED_APP_START)
#define MBED_APP_START 0x18000000
#endif
#if !defined(MBED_APP_SIZE)
#define MBED_APP_SIZE 0x800000
#endif
#define BOOT_LOADER_ADDR (MBED_APP_START)
#if (MBED_APP_START == 0x18000000)
#define BOOT_LOADER_SIZE (0x00004000)
#else
#define BOOT_LOADER_SIZE (0x00000000)
#endif
#define SFLASH_ADDR (MBED_APP_START + BOOT_LOADER_SIZE)
#define SFLASH_SIZE (MBED_APP_SIZE - BOOT_LOADER_SIZE)
MEMORY
{
ROM (rx) : ORIGIN = 0x00000000, LENGTH = 0x02000000
BOOT_LOADER (rx) : ORIGIN = 0x18000000, LENGTH = 0x00004000
SFLASH (rx) : ORIGIN = 0x18004000, LENGTH = 0x07FFC000
L_TTB (rw) : ORIGIN = 0x20000000, LENGTH = 0x00004000
RAM (rwx) : ORIGIN = 0x20020000, LENGTH = 0x001E0000
RAM_NC (rwx) : ORIGIN = 0x20200000, LENGTH = 0x00100000
ROM (rx) : ORIGIN = 0x00000000, LENGTH = 0x02000000
BOOT_LOADER (rx) : ORIGIN = BOOT_LOADER_ADDR, LENGTH = BOOT_LOADER_SIZE
SFLASH (rx) : ORIGIN = SFLASH_ADDR, LENGTH = SFLASH_SIZE
L_TTB (rw) : ORIGIN = 0x20000000, LENGTH = 0x00004000
RAM (rwx) : ORIGIN = 0x20020000, LENGTH = 0x001E0000
RAM_NC (rwx) : ORIGIN = 0x20200000, LENGTH = 0x00100000
}
/* Linker script to place sections and symbol values. Should be used together
@ -41,17 +60,18 @@ ENTRY(Reset_Handler)
SECTIONS
{
#if (MBED_APP_START == 0x18000000)
.boot :
{
KEEP(*(.boot_loader))
} > BOOT_LOADER
#endif
.text :
{
Image$$VECTORS$$Base = .;
* (RESET)
. += 0x00000400;
KEEP(*(.isr_vector))
*(SVC_TABLE)

View File

@ -2,10 +2,20 @@
/*-Editor annotation file-*/
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\a_v1_0.xml" */
/*-Specials-*/
define symbol __ICFEDIT_intvec_start__ = 0x18004000;
if (!isdefinedsymbol(MBED_APP_START)) {
define symbol MBED_APP_START = 0x18000000;
}
if (MBED_APP_START == 0x18000000) {
define symbol __ICFEDIT_intvec_start__ = MBED_APP_START + 0x4000;
} else {
define symbol __ICFEDIT_intvec_start__ = MBED_APP_START;
}
if (!isdefinedsymbol(MBED_APP_SIZE)) {
define symbol MBED_APP_SIZE = 0x800000;
}
/*-Memory Regions-*/
define symbol __ICFEDIT_region_ROM_start__ = 0x18000000;
define symbol __ICFEDIT_region_ROM_end__ = 0x187FFFFF;
define symbol __ICFEDIT_region_ROM_start__ = MBED_APP_START;
define symbol __ICFEDIT_region_ROM_end__ = MBED_APP_START + MBED_APP_SIZE - 1;
define symbol __ICFEDIT_region_TTB_start__ = 0x20000000;
define symbol __ICFEDIT_region_TTB_end__ = 0x2001FFFF;
define symbol __ICFEDIT_region_RAM_start__ = 0x20020000;

View File

@ -26,6 +26,15 @@
* $Date:: $
* @brief RZ_A1 serial flash boot loader
******************************************************************************/
#if !defined(APPLICATION_ADDR)
#define APPLICATION_ADDR 0x18000000
#endif
#if (APPLICATION_ADDR != 0x18000000)
const char * boot_loader = (char *)0x18000000;
#else /* (APPLICATION_ADDR == 0x18000000) */
#if defined (__CC_ARM)
#pragma arm section rodata = "BOOT_LOADER"
const char boot_loader[] __attribute__((used)) =
@ -825,3 +834,4 @@ const char boot_loader[] __attribute__ ((section(".boot_loader"), used)) =
#pragma arm section
#endif
#endif /* APPLICATION_ADDR */

View File

@ -9,25 +9,42 @@
#include "mem_RZ_A1H.h"
#if !defined(MBED_APP_START)
#define MBED_APP_START 0x18000000
#endif
#if !defined(MBED_APP_SIZE)
#define MBED_APP_SIZE 0x800000
#endif
LOAD_TTB __TTB_BASE __TTB_SIZE ; Page 0 of On-Chip Data Retention RAM
{
TTB +0 EMPTY 0x4000
{ } ; Level-1 Translation Table for MMU
}
SFLASH __ROM_BASE __ROM_SIZE ; load region size_region
SFLASH MBED_APP_START MBED_APP_SIZE ; load region size_region
{
BOOT_LOADER_BEGIN __ROM_BASE FIXED
#if (MBED_APP_START == 0x18000000)
BOOT_LOADER_BEGIN MBED_APP_START FIXED
{
* (BOOT_LOADER)
}
VECTORS __VECTOR_BASE FIXED
VECTORS (MBED_APP_START + 0x4000) FIXED
{
* (RESET, +FIRST) ; Vector table and other startup code
* (InRoot$$Sections) ; All (library) code that must be in a root region
* (+RO-CODE) ; Application RO code (.text)
}
#else
VECTORS MBED_APP_START FIXED
{
* (RESET, +FIRST) ; Vector table and other startup code
* (InRoot$$Sections) ; All (library) code that must be in a root region
* (+RO-CODE) ; Application RO code (.text)
}
#endif
RO_DATA +0
{ * (+RO-DATA) } ; Application RO data (.constdata)

View File

@ -42,10 +42,6 @@
// <o1> ROM Size (in Bytes) <0x0-0xFFFFFFFF:8>
// </h>
*----------------------------------------------------------------------------*/
#define __ROM_BASE 0x18000000
#define __ROM_SIZE 0x08000000
#define __VECTOR_BASE 0x18004000
/*--------------------- RAM Configuration -----------------------------------
*----------------------------------------------------------------------------*/

View File

@ -1,14 +1,33 @@
/* Linker script for mbed RZ_A1H */
/* Linker script to configure memory regions. */
#if !defined(MBED_APP_START)
#define MBED_APP_START 0x18000000
#endif
#if !defined(MBED_APP_SIZE)
#define MBED_APP_SIZE 0x800000
#endif
#define BOOT_LOADER_ADDR (MBED_APP_START)
#if (MBED_APP_START == 0x18000000)
#define BOOT_LOADER_SIZE (0x00004000)
#else
#define BOOT_LOADER_SIZE (0x00000000)
#endif
#define SFLASH_ADDR (MBED_APP_START + BOOT_LOADER_SIZE)
#define SFLASH_SIZE (MBED_APP_SIZE - BOOT_LOADER_SIZE)
MEMORY
{
ROM (rx) : ORIGIN = 0x00000000, LENGTH = 0x02000000
BOOT_LOADER (rx) : ORIGIN = 0x18000000, LENGTH = 0x00004000
SFLASH (rx) : ORIGIN = 0x18004000, LENGTH = 0x07FFC000
L_TTB (rw) : ORIGIN = 0x20000000, LENGTH = 0x00004000
RAM (rwx) : ORIGIN = 0x20020000, LENGTH = 0x008E0000
RAM_NC (rwx) : ORIGIN = 0x20900000, LENGTH = 0x00100000
ROM (rx) : ORIGIN = 0x00000000, LENGTH = 0x02000000
BOOT_LOADER (rx) : ORIGIN = BOOT_LOADER_ADDR, LENGTH = BOOT_LOADER_SIZE
SFLASH (rx) : ORIGIN = SFLASH_ADDR, LENGTH = SFLASH_SIZE
L_TTB (rw) : ORIGIN = 0x20000000, LENGTH = 0x00004000
RAM (rwx) : ORIGIN = 0x20020000, LENGTH = 0x008E0000
RAM_NC (rwx) : ORIGIN = 0x20900000, LENGTH = 0x00100000
}
/* Linker script to place sections and symbol values. Should be used together
@ -41,17 +60,18 @@ ENTRY(Reset_Handler)
SECTIONS
{
#if (MBED_APP_START == 0x18000000)
.boot :
{
KEEP(*(.boot_loader))
} > BOOT_LOADER
#endif
.text :
{
Image$$VECTORS$$Base = .;
* (RESET)
. += 0x00000400;
KEEP(*(.isr_vector))
*(SVC_TABLE)

View File

@ -2,10 +2,20 @@
/*-Editor annotation file-*/
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\a_v1_0.xml" */
/*-Specials-*/
define symbol __ICFEDIT_intvec_start__ = 0x18004000;
if (!isdefinedsymbol(MBED_APP_START)) {
define symbol MBED_APP_START = 0x18000000;
}
if (MBED_APP_START == 0x18000000) {
define symbol __ICFEDIT_intvec_start__ = MBED_APP_START + 0x4000;
} else {
define symbol __ICFEDIT_intvec_start__ = MBED_APP_START;
}
if (!isdefinedsymbol(MBED_APP_SIZE)) {
define symbol MBED_APP_SIZE = 0x800000;
}
/*-Memory Regions-*/
define symbol __ICFEDIT_region_ROM_start__ = 0x18000000;
define symbol __ICFEDIT_region_ROM_end__ = 0x187FFFFF;
define symbol __ICFEDIT_region_ROM_start__ = MBED_APP_START;
define symbol __ICFEDIT_region_ROM_end__ = MBED_APP_START + MBED_APP_SIZE - 1;
define symbol __ICFEDIT_region_TTB_start__ = 0x20000000;
define symbol __ICFEDIT_region_TTB_end__ = 0x2001FFFF;
define symbol __ICFEDIT_region_RAM_start__ = 0x20020000;

View File

@ -26,6 +26,15 @@
* $Date:: $
* @brief RZ_A1 serial flash boot loader
******************************************************************************/
#if !defined(APPLICATION_ADDR)
#define APPLICATION_ADDR 0x18000000
#endif
#if (APPLICATION_ADDR != 0x18000000)
const char * boot_loader = (char *)0x18000000;
#else /* (APPLICATION_ADDR == 0x18000000) */
#if defined (__CC_ARM)
#pragma arm section rodata = "BOOT_LOADER"
const char boot_loader[] __attribute__((used)) =
@ -826,3 +835,4 @@ const char boot_loader[] __attribute__ ((section(".boot_loader"), used)) =
#pragma arm section
#endif
#endif /* APPLICATION_ADDR */

View File

@ -2847,7 +2847,9 @@
"supported_form_factors": ["ARDUINO"],
"extra_labels_add": ["RZA1H", "MBRZA1H", "RZ_A1_EMAC"],
"device_has_add": ["EMAC", "FLASH"],
"release_versions": ["2", "5"]
"release_versions": ["2", "5"],
"device_name": "R7S72100",
"bootloader_supported": true
},
"VK_RZ_A1H": {
"inherits": ["RZ_A1XX"],
@ -2863,6 +2865,8 @@
"device_has_remove": ["ETHERNET"],
"features_remove": ["LWIP"],
"release_versions": ["2", "5"],
"device_name": "R7S72103",
"bootloader_supported": true,
"overrides": {
"network-default-interface-type": null
}