Refactored code to not use macro. Created config xip-enable

pull/11006/head
Lin Gao 2019-07-31 15:05:01 -05:00 committed by Lin Gao
parent ea032bebc4
commit 2a78a9ba13
4 changed files with 16 additions and 9 deletions

View File

@ -31,7 +31,7 @@
void mailbox_init(void);
#endif
#if defined(XIP_ENABLE)
#if MBED_CONF_TARGET_XIP_ENABLE
extern void qspi_xip_start();
#endif
@ -103,7 +103,7 @@ void mbed_sdk_init(void)
/* Enable global interrupts (disabled in CM4 startup assembly) */
__enable_irq();
#endif
#if defined(XIP_ENABLE)
#if MBED_CONF_TARGET_XIP_ENABLE
qspi_xip_start();
#endif

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
#ifdef XIP_ENABLE
#if MBED_CONF_TARGET_XIP_ENABLE
#include "cy_smif.h"
#include "cy_smif_memslot.h"
#include "cycfg_qspi_memslot.h"

View File

@ -51,6 +51,10 @@
"init-us-ticker-at-boot": {
"help": "Initialize the microsecond ticker at boot rather than on first use, and leave it initialized. This speeds up wait_us in particular.",
"value": false
},
"xip-enable": {
"help": "Enable Execute In Place (XIP) on this target. Value is only significant if the board has executable external storage such as QSPIF. If this is enabled, customize the linker file to choose what text segments are placed on external storage",
"value": false
}
}
},

View File

@ -953,6 +953,7 @@ class mbedToolchain:
STACK_PARAM = "target.boot-stack-size"
TFM_LVL_PARAM = "tfm.level"
XIP_ENABLE_PARAM = "target.xip-enable"
def add_linker_defines(self):
params, _ = self.config_data
@ -974,6 +975,14 @@ class mbedToolchain:
self.ld.append(define_string)
self.flags["ld"].append(define_string)
if self.XIP_ENABLE_PARAM in params:
define_string = self.make_ld_define(
"XIP_ENABLE",
params[self.XIP_ENABLE_PARAM].value
)
self.ld.append(define_string)
self.flags["ld"].append(define_string)
if self.target.is_PSA_secure_target:
for flag, param in [
("MBED_PUBLIC_RAM_START", "target.public-ram-start"),
@ -990,12 +999,6 @@ class mbedToolchain:
self.ld.append(define_string)
self.flags["ld"].append(define_string)
if "XIP_ENABLE" in self.target.macros :
define_string = self.make_ld_define(
"XIP_ENABLE", 1)
self.ld.append(define_string)
self.flags["ld"].append(define_string)
# Set the configuration data
def set_config_data(self, config_data):
self.config_data = config_data