hex-five / multizone-sdk

MultiZone® Security TEE is the quick and safe way to add security and separation to any RISC-V processors. The RISC-V standard ISA doesn't define TrustZone-like primitives to provide hardware separation. To shield critical functionality from untrusted third-party components, MultiZone provides hardware-enforced, software-defined separation of multi
https://hex-five.com/multizone-security-tee-riscv/
Other
82 stars 24 forks source link

multizone to generate linker scripts for zone #7

Closed borancar closed 4 years ago

borancar commented 5 years ago

multizone could generate the linker scripts based on a template to support multiple boards. All the information is already available in the multizone configuration.

For the following multizone.cfg:

Zone = 1 # 
    base = 0x40410000; size =   64K; rwx = rx # FLASH
        base = 0x80001000; size =    4K; rwx = rw # RAM

and the template zone1/flash.lds.template:

/* Copyright(C) 2018 Hex Five Security, Inc. - All Rights Reserved */

OUTPUT_ARCH( "riscv" )

ENTRY( _start )

MEMORY {
  $FLASH
  $RAM
}

...

running the tool would generate the following zone1/flash.lds:

/* Copyright(C) 2018 Hex Five Security, Inc. - All Rights Reserved */
/* This file is generated from zone1/flash.lds.template. Local modifications will be lost. */

OUTPUT_ARCH( "riscv" )

ENTRY( _start )

MEMORY {
  flash (rxai!w) : ORIGIN = 0x40410000, LENGTH = 64K
  ram   (wxa!ri) : ORIGIN = 0x80001000, LENGTH =  4K
}

...
cgarlati commented 5 years ago

The MultiZone configurator utility receives fully linked .hex files in input. The linker scripts must be available before the utility runs. A more elegant solution would be an eclipse pluging that interactively builds simultaneously multizone.cfg AND .lds out of iker templates and device memory map. TBD