mirror of https://github.com/wolfSSL/wolfBoot.git
AURIX tc3 ARCH/TARGET refactor anticipating TC4xx
parent
1c2d5ee2c5
commit
678781db39
2
Makefile
2
Makefile
|
|
@ -274,7 +274,7 @@ ifeq ($(ARCH),C2000)
|
|||
# cl2000 enters link mode via -z (in LDFLAGS); the .cmd is a positional arg.
|
||||
LSCRIPT_FLAGS+=$(LSCRIPT)
|
||||
endif
|
||||
ifeq ($(ARCH),AURIX_TC3)
|
||||
ifeq ($(ARCH),AURIX)
|
||||
ifneq ($(USE_GCC_HEADLESS),1)
|
||||
LSCRIPT_FLAGS+=-T $(LSCRIPT)
|
||||
endif
|
||||
|
|
|
|||
42
arch.mk
42
arch.mk
|
|
@ -2171,10 +2171,30 @@ ifeq ($(ARCH),C2000)
|
|||
$(Q)$(CC) $(CFLAGS) -c $(OUTPUT_FLAG) $@ $^
|
||||
endif
|
||||
|
||||
# Infineon AURIX Tricore
|
||||
ifeq ($(ARCH), AURIX_TC3)
|
||||
# TC3xx specific
|
||||
ifeq ($(TARGET), aurix_tc3xx)
|
||||
# Infineon AURIX platforms
|
||||
#
|
||||
# TC3xx SoCs are a heterogeneous architecture with ARM and Tricore CPUs, but are
|
||||
# grouped together in wolfBoot under ARCH=AURIX, since platform support is
|
||||
# different enough from existing ARCH variants to not share things like compiler
|
||||
# flags or startup code.
|
||||
#
|
||||
# TARGET=aurix_tc3xx: AURIX TC3xx TriCore host
|
||||
# TARGET=aurix_tc3xx_hsm: AURIX TC3xx Cortex-M3 HSM core
|
||||
# TARGET=aurix_tc4xx: AURIX TC4xx Tricore host (coming soon)
|
||||
|
||||
# Backwards compatibility migration error for legacy ARCH=AURIX_TC3
|
||||
ifeq ($(filter clean keysclean,$(MAKECMDGOALS)),)
|
||||
ifeq ($(ARCH),AURIX_TC3)
|
||||
$(error ARCH=AURIX_TC3 was renamed to ARCH=AURIX)
|
||||
endif
|
||||
ifeq ($(AURIX_TC3_HSM),1)
|
||||
$(error AURIX_TC3_HSM=1 was replaced by TARGET=aurix_tc3xx_hsm)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(ARCH), AURIX)
|
||||
# TC3xx HSM and host cores
|
||||
ifneq (,$(filter aurix_tc3xx aurix_tc3xx_hsm,$(TARGET)))
|
||||
USE_GCC?=1
|
||||
|
||||
CFLAGS += -I$(TC3_DIR) -Ihal
|
||||
|
|
@ -2230,7 +2250,8 @@ ifeq ($(ARCH), AURIX_TC3)
|
|||
BOOT_IMG=test-app/image.elf
|
||||
endif
|
||||
|
||||
ifeq ($(AURIX_TC3_HSM),1)
|
||||
ifeq ($(TARGET), aurix_tc3xx_hsm)
|
||||
# HSM core (ARM Cortex-M3)
|
||||
ARCH_FLASH_OFFSET?=0x80028000
|
||||
# HSM compiler flags, build options, source code, etc
|
||||
ifeq ($(USE_GCC),1)
|
||||
|
|
@ -2253,7 +2274,7 @@ ifeq ($(ARCH), AURIX_TC3)
|
|||
endif
|
||||
|
||||
CFLAGS += -march=armv7-m -mcpu=cortex-m3 -mthumb -mlittle-endian \
|
||||
-fno-builtin -DWOLFBOOT_AURIX_TC3XX_HSM
|
||||
-fno-builtin
|
||||
|
||||
# Temporary fix masking wolfCrypt unused function warning with RSA_LOW_MEM
|
||||
CFLAGS += -Wno-unused-function
|
||||
|
|
@ -2265,8 +2286,6 @@ ifeq ($(ARCH), AURIX_TC3)
|
|||
-Wl,-Map="wolfboot.map" \
|
||||
-Wl,-L$(TC3_DIR)/tc3
|
||||
|
||||
LSCRIPT_IN=hal/$(TARGET)_hsm.ld
|
||||
|
||||
# wolfHSM port server-specific files
|
||||
ifeq ($(WOLFHSM_SERVER),1)
|
||||
USE_GCC_HEADLESS=0
|
||||
|
|
@ -2274,7 +2293,6 @@ ifeq ($(ARCH), AURIX_TC3)
|
|||
CFLAGS += -I$(WOLFHSM_INFINEON_TC3XX)/port/server
|
||||
|
||||
OBJS += $(WOLFHSM_INFINEON_TC3XX)/port/server/port_halflash_df1.o \
|
||||
$(WOLFHSM_INFINEON_TC3XX)/port/server/io.o \
|
||||
$(WOLFHSM_INFINEON_TC3XX)/port/server/sysmem.o \
|
||||
$(WOLFHSM_INFINEON_TC3XX)/port/server/tchsm_hh_hsm.o \
|
||||
$(WOLFHSM_INFINEON_TC3XX)/port/server/tchsm_utils.o\
|
||||
|
|
@ -2297,7 +2315,7 @@ ifeq ($(ARCH), AURIX_TC3)
|
|||
$(TC3_DIR)/../tc3arm_bootloader/tc3arm_bootloader.o
|
||||
|
||||
else
|
||||
# Tricore compiler settings
|
||||
# TriCore host core
|
||||
ARCH_FLASH_OFFSET?=0x800A0000
|
||||
ifeq ($(USE_GCC),1)
|
||||
HT_ROOT?=/opt/hightec/gnutri_v4.9.4.1-11fcedf-lin64
|
||||
|
|
@ -2357,8 +2375,8 @@ ifeq ($(ARCH), AURIX_TC3)
|
|||
$(WOLFHSM_INFINEON_TC3XX)/port/client/tchsm_hh_host.o
|
||||
endif
|
||||
|
||||
endif # !AURIX_TC3_HSM
|
||||
endif
|
||||
endif # aurix_tc3xx_hsm
|
||||
endif # TC3xx
|
||||
|
||||
# TC4xx specific
|
||||
ifeq ($(TARGET), aurix_tc4xx)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
ARCH?=AURIX_TC3
|
||||
ARCH?=AURIX
|
||||
TARGET?=aurix_tc3xx
|
||||
SIGN?=ECC256
|
||||
HASH?=SHA256
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
ARCH?=AURIX_TC3
|
||||
ARCH?=AURIX
|
||||
TARGET?=aurix_tc3xx
|
||||
SIGN?=ECC256
|
||||
HASH?=SHA256
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
ARCH?=AURIX_TC3
|
||||
ARCH?=AURIX
|
||||
TARGET?=aurix_tc3xx
|
||||
SIGN?=ECC256
|
||||
HASH?=SHA256
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
ARCH?=AURIX_TC3
|
||||
ARCH?=AURIX
|
||||
TARGET?=aurix_tc3xx
|
||||
SIGN?=RSA4096
|
||||
HASH?=SHA256
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
ARCH?=AURIX_TC3
|
||||
ARCH?=AURIX
|
||||
TARGET?=aurix_tc3xx
|
||||
SIGN?=ECC256
|
||||
HASH?=SHA256
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
ARCH?=AURIX_TC3
|
||||
TARGET?=aurix_tc3xx
|
||||
AURIX_TC3_HSM=1
|
||||
ARCH?=AURIX
|
||||
TARGET?=aurix_tc3xx_hsm
|
||||
SIGN?=ECC256
|
||||
HASH?=SHA256
|
||||
DEBUG?=0
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
ARCH?=AURIX_TC3
|
||||
TARGET?=aurix_tc3xx
|
||||
AURIX_TC3_HSM=1
|
||||
ARCH?=AURIX
|
||||
TARGET?=aurix_tc3xx_hsm
|
||||
SIGN?=RSA4096
|
||||
HASH?=SHA256
|
||||
DEBUG?=0
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
ARCH?=AURIX_TC3
|
||||
TARGET?=aurix_tc3xx
|
||||
AURIX_TC3_HSM=1
|
||||
ARCH?=AURIX
|
||||
TARGET?=aurix_tc3xx_hsm
|
||||
SIGN?=RSA4096
|
||||
HASH?=SHA256
|
||||
DEBUG?=0
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
ARCH?=AURIX_TC3
|
||||
TARGET?=aurix_tc3xx
|
||||
AURIX_TC3_HSM=1
|
||||
ARCH?=AURIX
|
||||
TARGET?=aurix_tc3xx_hsm
|
||||
SIGN?=ECC256
|
||||
HASH?=SHA256
|
||||
DEBUG?=0
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
ARCH?=AURIX_TC3
|
||||
TARGET?=aurix_tc3xx
|
||||
AURIX_TC3_HSM=1
|
||||
ARCH?=AURIX
|
||||
TARGET?=aurix_tc3xx_hsm
|
||||
SIGN?=RSA4096
|
||||
HASH?=SHA256
|
||||
DEBUG?=0
|
||||
|
|
|
|||
|
|
@ -8603,6 +8603,8 @@ At this point, the kernel image in partition "A" is verified and staged and you
|
|||
|
||||
wolfBoot supports the Infineon AURIX TC3xx family and includes a demo application for the TC375 AURIX LiteKit-V2. It can be configured to run on either the TriCore application cores or the HSM core.
|
||||
|
||||
Both cores build with `ARCH=AURIX`. `TARGET` selects the core: `aurix_tc3xx` for the TriCore application cores and `aurix_tc3xx_hsm` for the HSM core. Example configurations are in `config/examples/aurix-tc375-*.config`.
|
||||
|
||||
On AURIX TC3xx devices, wolfBoot can also integrate with [wolfHSM](https://www.wolfssl.com/products/wolfhsm/) to offload cryptographic operations and key management to the HSM core.
|
||||
|
||||
Currently, wolfBoot for TC3xx is distributed as part of the wolfHSM TC3xx platform release bundle, not as a standalone package. This bundle is under NDA and is not publicly available.
|
||||
|
|
|
|||
|
|
@ -37,7 +37,8 @@
|
|||
#ifdef TC3_CFG_HAVE_BOARD
|
||||
#include "tc3/tc3_board.h"
|
||||
#endif
|
||||
#ifdef WOLFBOOT_AURIX_TC3XX_HSM
|
||||
/* TARGET_aurix_tc3xx_hsm: HSM core build, see hal/aurix_tc3xx_hsm.c */
|
||||
#ifdef TARGET_aurix_tc3xx_hsm
|
||||
#include "tc3/tc3arm.h"
|
||||
#else
|
||||
#include "tc3/tc3tc.h"
|
||||
|
|
@ -297,7 +298,7 @@ void uart_write(const char* buf, unsigned int sz)
|
|||
* the firmware images*/
|
||||
void hal_init(void)
|
||||
{
|
||||
#ifndef WOLFBOOT_AURIX_TC3XX_HSM
|
||||
#ifndef TARGET_aurix_tc3xx_hsm
|
||||
/* Update BTV to use RAM Trap Table */
|
||||
tc3tc_traps_InitBTV();
|
||||
|
||||
|
|
@ -322,7 +323,7 @@ void hal_init(void)
|
|||
|
||||
#ifdef DEBUG_UART
|
||||
uart_init();
|
||||
#ifndef WOLFBOOT_AURIX_TC3XX_HSM
|
||||
#ifndef TARGET_aurix_tc3xx_hsm
|
||||
wolfBoot_printf("Hello from TC3xx wolfBoot on Tricore: V%d\n",
|
||||
WOLFBOOT_VERSION);
|
||||
#else
|
||||
|
|
@ -356,7 +357,7 @@ void hal_prepare_boot(void)
|
|||
|
||||
tc3_clock_SetBoot();
|
||||
|
||||
#ifndef WOLFBOOT_AURIX_TC3XX_HSM
|
||||
#ifndef TARGET_aurix_tc3xx_hsm
|
||||
tc3tc_isr_Cleanup();
|
||||
tc3tc_traps_DeinitBTV();
|
||||
|
||||
|
|
@ -368,7 +369,7 @@ void hal_prepare_boot(void)
|
|||
TC3_ENFORCE_BUS_ERRORS();
|
||||
}
|
||||
|
||||
#ifndef WOLFBOOT_AURIX_TC3XX_HSM
|
||||
#ifndef TARGET_aurix_tc3xx_hsm
|
||||
void do_boot(const uint32_t* app_offset)
|
||||
{
|
||||
LED_OFF(LED_WOLFBOOT);
|
||||
|
|
@ -378,7 +379,7 @@ void do_boot(const uint32_t* app_offset)
|
|||
|
||||
RAMFUNCTION void arch_reboot(void)
|
||||
{
|
||||
#ifdef WOLFBOOT_AURIX_TC3XX_HSM
|
||||
#ifdef TARGET_aurix_tc3xx_hsm
|
||||
tc3arm_HsmBridgeSysReset();
|
||||
#else
|
||||
tc3_Scu_TriggerSwReset(1, WOLFBOOT_AURIX_RESET_REASON);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,23 @@
|
|||
/* aurix_tc3xx_hsm.c
|
||||
*
|
||||
* Copyright (C) 2014-2026 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfBoot.
|
||||
*
|
||||
* wolfBoot is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* wolfBoot is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with wolfBoot. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* TC3xx HSM core (ARM Cortex-M3). The build defines TARGET_aurix_tc3xx_hsm,
|
||||
* which selects the HSM paths inside the shared TC3xx HAL. */
|
||||
#include "aurix_tc3xx.c"
|
||||
|
|
@ -20,7 +20,7 @@
|
|||
#ifndef TC3_CFG_H
|
||||
#define TC3_CFG_H
|
||||
|
||||
#if defined(WOLFBOOT_AURIX_TC3XX_HSM)
|
||||
#if defined(TARGET_aurix_tc3xx_hsm)
|
||||
#define TC3_CFG_HAVE_ARM
|
||||
#else
|
||||
#define TC3_CFG_HAVE_TRICORE
|
||||
|
|
|
|||
|
|
@ -970,7 +970,7 @@ ifeq ($(DEBUG_SYMBOLS),1)
|
|||
CFLAGS+=-g -DDEBUG_SYMBOLS
|
||||
ifeq ($(USE_GCC),1)
|
||||
CFLAGS+=-ggdb3
|
||||
else ifneq ($(ARCH),AURIX_TC3)
|
||||
else ifneq ($(ARCH),AURIX)
|
||||
ifneq ($(USE_CLANG),1)
|
||||
# -gstabs was removed in GCC 12; -gdwarf-4 works on old and new GCC
|
||||
CFLAGS+=-gdwarf-4
|
||||
|
|
@ -1480,7 +1480,7 @@ ifeq ($(USE_GCC_HEADLESS),1)
|
|||
ifeq ($(USE_GCC),1)
|
||||
ifneq ($(USE_CLANG),1)
|
||||
ifneq ($(ARCH),RENESAS_RX)
|
||||
ifneq ($(ARCH),AURIX_TC3)
|
||||
ifneq ($(ARCH),AURIX)
|
||||
CFLAGS+="-Wstack-usage=$(STACK_USAGE)"
|
||||
endif
|
||||
endif
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ ifeq ($(TARGET),ti_hercules)
|
|||
else
|
||||
CFLAGS+=-Wall -ffreestanding -Wno-unused -ffunction-sections -fdata-sections
|
||||
# Stack usage computation not supported on TriCore
|
||||
ifneq ($(ARCH),AURIX_TC3)
|
||||
ifneq ($(ARCH),AURIX)
|
||||
ifneq ($(USE_CLANG),1)
|
||||
CFLAGS+=-Wstack-usage=$(STACK_USAGE_LIMIT)
|
||||
endif
|
||||
|
|
@ -97,7 +97,7 @@ else
|
|||
CFLAGS+=-g
|
||||
ifeq ($(USE_GCC),1)
|
||||
CFLAGS+=-ggdb3
|
||||
else ifneq ($(ARCH),AURIX_TC3)
|
||||
else ifneq ($(ARCH),AURIX)
|
||||
ifneq ($(USE_CLANG),1)
|
||||
# -gstabs was removed in GCC 12; -gdwarf-4 works on old and new GCC
|
||||
CFLAGS+=-gdwarf-4
|
||||
|
|
@ -175,7 +175,7 @@ ifeq ($(DEBUG_UART),1)
|
|||
APP_NEEDS_STRING:=1
|
||||
endif
|
||||
|
||||
ifeq ($(ARCH),AURIX_TC3)
|
||||
ifeq ($(ARCH),AURIX)
|
||||
# AURIX RAM_CODE HAL flash drivers need wolfBoot memcpy
|
||||
APP_NEEDS_STRING:=1
|
||||
endif
|
||||
|
|
@ -1251,7 +1251,7 @@ endif
|
|||
|
||||
CFLAGS+=-I"$(WOLFBOOT_LIB_WOLFSSL)"
|
||||
|
||||
ifeq ($(TARGET),aurix_tc3xx)
|
||||
ifneq (,$(filter aurix_tc3xx aurix_tc3xx_hsm,$(TARGET)))
|
||||
# Add BSP objects (same as in arch.mk for wolfBoot)
|
||||
APP_OBJS += $(TC3_DIR)/src/tc3_clock.o \
|
||||
$(TC3_DIR)/src/tc3_flash.o \
|
||||
|
|
@ -1259,7 +1259,7 @@ ifeq ($(TARGET),aurix_tc3xx)
|
|||
$(TC3_DIR)/src/tc3_uart.o \
|
||||
$(TC3_DIR)/src/tc3.o
|
||||
|
||||
ifeq ($(AURIX_TC3_HSM),1)
|
||||
ifeq ($(TARGET),aurix_tc3xx_hsm)
|
||||
APP_OBJS += $(TC3_DIR)/src/tc3arm_crt.o \
|
||||
$(TC3_DIR)/src/tc3arm.o
|
||||
# Use TC3 Arm app linker script
|
||||
|
|
|
|||
|
|
@ -0,0 +1,22 @@
|
|||
/* app_aurix_tc3xx_hsm.c
|
||||
*
|
||||
* Copyright (C) 2014-2026 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfBoot.
|
||||
*
|
||||
* wolfBoot is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* wolfBoot is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with wolfBoot. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* TC3xx HSM core build of the test application; see app_aurix_tc3xx.c. */
|
||||
#include "app_aurix_tc3xx.c"
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
#ifndef TC3_CFG_H
|
||||
#define TC3_CFG_H
|
||||
|
||||
#if defined(WOLFBOOT_AURIX_TC3XX_HSM)
|
||||
#if defined(TARGET_aurix_tc3xx_hsm)
|
||||
#define TC3_CFG_HAVE_ARM
|
||||
#else
|
||||
#define TC3_CFG_HAVE_TRICORE
|
||||
|
|
|
|||
Loading…
Reference in New Issue