From 563edba8841a139132cefa486cf9601c9aa3ffcb Mon Sep 17 00:00:00 2001 From: Alex Lanzano Date: Tue, 1 Sep 2026 15:09:03 -0400 Subject: [PATCH] Rename board.h to wolfHAL_board.h --- src/port/stm32h563/Makefile | 4 ++-- .../{board.c => wolfHAL_board.c} | 7 ++++--- .../{board.h => wolfHAL_board.h} | 10 +++++----- src/port/stm32h563/dot1x_client.c | 2 +- src/port/stm32h563/main.c | 2 +- src/port/stm32h563/syscalls.c | 2 +- src/port/wolfHAL/README.md | 15 ++++++++------- src/port/wolfHAL/wolfhal_eth.c | 2 +- src/port/wolfHAL/wolfhal_eth.h | 2 +- 9 files changed, 24 insertions(+), 22 deletions(-) rename src/port/stm32h563/boards/stm32h563zi_nucleo/{board.c => wolfHAL_board.c} (98%) rename src/port/stm32h563/boards/stm32h563zi_nucleo/{board.h => wolfHAL_board.h} (97%) diff --git a/src/port/stm32h563/Makefile b/src/port/stm32h563/Makefile index 33a9f194..2e4e38c5 100644 --- a/src/port/stm32h563/Makefile +++ b/src/port/stm32h563/Makefile @@ -160,10 +160,10 @@ CFLAGS += -I$(WOLFHAL_ROOT) -I$(BOARD_DIR) -I$(ROOT)/src/port/wolfHAL LDSCRIPT := $(BOARD_DIR)/linker.ld # The board dir carries its own wolfHAL-specific startup/ivt/syscalls; the -# bare-metal stm32_eth.c driver is replaced by board.c (BSP bringup) plus the +# bare-metal stm32_eth.c driver is replaced by wolfHAL_board.c (BSP bringup) plus the # generic wolfhal_eth.c bridge. SRCS := $(BOARD_DIR)/startup.c $(BOARD_DIR)/ivt.c syscalls.c -SRCS += main.c $(BOARD_DIR)/board.c $(ROOT)/src/port/wolfHAL/wolfhal_eth.c +SRCS += main.c $(BOARD_DIR)/wolfHAL_board.c $(ROOT)/src/port/wolfHAL/wolfhal_eth.c SRCS += $(ROOT)/src/wolfip.c # wolfHAL driver selection (WHAL_CFG_* defines) + wolfHAL driver TUs. diff --git a/src/port/stm32h563/boards/stm32h563zi_nucleo/board.c b/src/port/stm32h563/boards/stm32h563zi_nucleo/wolfHAL_board.c similarity index 98% rename from src/port/stm32h563/boards/stm32h563zi_nucleo/board.c rename to src/port/stm32h563/boards/stm32h563zi_nucleo/wolfHAL_board.c index 4b6a8876..320aa2f8 100644 --- a/src/port/stm32h563/boards/stm32h563zi_nucleo/board.c +++ b/src/port/stm32h563/boards/stm32h563zi_nucleo/wolfHAL_board.c @@ -1,4 +1,4 @@ -/* board.c +/* wolfHAL_board.c * * Copyright (C) 2024-2026 wolfSSL Inc. * @@ -24,7 +24,7 @@ #include #include -#include "board.h" +#include "wolfHAL_board.h" #include #include @@ -68,7 +68,8 @@ static const whal_Stm32h5_Rcc_PeriphClk g_ethClocks[] = { #define ETH_CLOCK_COUNT (sizeof(g_ethClocks) / sizeof(g_ethClocks[0])) /* Ethernet descriptor rings + buffer pool. Referenced by the ETH singleton's - * cfg (WHAL_CFG_STM32H5_ETH_DEV in board.h), so these must be global. */ + * cfg (WHAL_CFG_STM32H5_ETH_DEV in wolfHAL_board.h), so these must be + * global. */ whal_Stm32h5_Eth_TxDesc ethTxDescs[BOARD_ETH_TX_DESC_COUNT] __attribute__((aligned(16))); whal_Stm32h5_Eth_RxDesc ethRxDescs[BOARD_ETH_RX_DESC_COUNT] diff --git a/src/port/stm32h563/boards/stm32h563zi_nucleo/board.h b/src/port/stm32h563/boards/stm32h563zi_nucleo/wolfHAL_board.h similarity index 97% rename from src/port/stm32h563/boards/stm32h563zi_nucleo/board.h rename to src/port/stm32h563/boards/stm32h563zi_nucleo/wolfHAL_board.h index 4bcf6e3f..291150a0 100644 --- a/src/port/stm32h563/boards/stm32h563zi_nucleo/board.h +++ b/src/port/stm32h563/boards/stm32h563zi_nucleo/wolfHAL_board.h @@ -1,4 +1,4 @@ -/* board.h +/* wolfHAL_board.h * * Copyright (C) 2024-2026 wolfSSL Inc. * @@ -21,8 +21,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#ifndef BOARD_H -#define BOARD_H +#ifndef WOLFHAL_BOARD_H +#define WOLFHAL_BOARD_H #include #include @@ -139,7 +139,7 @@ enum { }, \ } -/* ETH descriptor rings + buffer pool — defined in board.c, captured by the +/* ETH descriptor rings + buffer pool — defined in wolfHAL_board.c, captured by the * ETH device's cfg below (expanded in the eth driver code). */ #define BOARD_ETH_TX_DESC_COUNT 3 #define BOARD_ETH_RX_DESC_COUNT 4 @@ -196,4 +196,4 @@ whal_Error board_init(void); whal_Error board_deinit(void); uint64_t board_get_tick(void); -#endif /* BOARD_H */ +#endif /* WOLFHAL_BOARD_H */ diff --git a/src/port/stm32h563/dot1x_client.c b/src/port/stm32h563/dot1x_client.c index 9b082b8b..d78a182f 100644 --- a/src/port/stm32h563/dot1x_client.c +++ b/src/port/stm32h563/dot1x_client.c @@ -43,7 +43,7 @@ #include "dot1x_certs.h" #ifdef ENABLE_WOLFHAL -#include "board.h" +#include "wolfHAL_board.h" #endif #define DOT1X_EAPOL_ETHERTYPE 0x888EU diff --git a/src/port/stm32h563/main.c b/src/port/stm32h563/main.c index 0d802d7b..542b46b2 100644 --- a/src/port/stm32h563/main.c +++ b/src/port/stm32h563/main.c @@ -25,7 +25,7 @@ #include "config.h" #include "wolfip.h" #ifdef ENABLE_WOLFHAL -#include "board.h" +#include "wolfHAL_board.h" #include "wolfhal_eth.h" #include #include diff --git a/src/port/stm32h563/syscalls.c b/src/port/stm32h563/syscalls.c index 2a020ae7..9c5bf5a6 100644 --- a/src/port/stm32h563/syscalls.c +++ b/src/port/stm32h563/syscalls.c @@ -26,7 +26,7 @@ #include #ifdef ENABLE_WOLFHAL #include -#include "board.h" /* g_whalUart for _write -> UART */ +#include "wolfHAL_board.h" /* g_whalUart for _write -> UART */ #endif extern uint32_t _ebss; diff --git a/src/port/wolfHAL/README.md b/src/port/wolfHAL/README.md index bf0d50a8..4f4ea37e 100644 --- a/src/port/wolfHAL/README.md +++ b/src/port/wolfHAL/README.md @@ -31,10 +31,11 @@ flow used by `TZEN=1`, and the wolfHAL SysTick driver owns the SysTick handler that FreeRTOS also needs. `ENABLE_WOLFHAL=1` selects `boards/stm32h563zi_nucleo/` (its own -`startup.c`/`ivt.c`/`syscalls.c`/`linker.ld` plus `board.c`/`board.h`/`board.mk`), -pulls the wolfHAL STM32H5 driver TUs from the `lib/wolfHAL` submodule -(`WOLFHAL_ROOT ?= lib/wolfHAL`), and compiles the port's `main.c` against -wolfHAL drivers instead of the hand-rolled bare-metal ones. +`startup.c`/`ivt.c`/`syscalls.c`/`linker.ld` plus +`wolfHAL_board.c`/`wolfHAL_board.h`/`board.mk`), pulls the wolfHAL STM32H5 +driver TUs from the `lib/wolfHAL` submodule (`WOLFHAL_ROOT ?= lib/wolfHAL`), and +compiles the port's `main.c` against wolfHAL drivers instead of the hand-rolled +bare-metal ones. Initialize the submodule once with @@ -67,9 +68,9 @@ int ret = wolfhal_eth_init(wolfIP_getdev(ipstack), &ctx); ## What a board must provide -The bridge needs the hardware already brought up. A board's `board.c` -(see `src/port/stm32h563/boards/stm32h563zi_nucleo/board.c`) must, before -`wolfhal_eth_init` is called: +The bridge needs the hardware already brought up. A board's `wolfHAL_board.c` +(see `src/port/stm32h563/boards/stm32h563zi_nucleo/wolfHAL_board.c`) must, +before `wolfhal_eth_init` is called: - Initialize clocks and GPIO, then call `whal_Eth_Init` / `whal_EthPhy_Init` (typically from `board_init()`). diff --git a/src/port/wolfHAL/wolfhal_eth.c b/src/port/wolfHAL/wolfhal_eth.c index 29d8d26f..fffab4f0 100644 --- a/src/port/wolfHAL/wolfhal_eth.c +++ b/src/port/wolfHAL/wolfhal_eth.c @@ -22,7 +22,7 @@ */ #include "wolfhal_eth.h" -#include "board.h" +#include "wolfHAL_board.h" #include #ifndef WOLFHAL_ETH_LINK_TIMEOUT_MS diff --git a/src/port/wolfHAL/wolfhal_eth.h b/src/port/wolfHAL/wolfhal_eth.h index 9c9be923..4b383582 100644 --- a/src/port/wolfHAL/wolfhal_eth.h +++ b/src/port/wolfHAL/wolfhal_eth.h @@ -34,7 +34,7 @@ * @code * #include "wolfip.h" * #include "wolfhal_eth.h" - * #include "board.h" + * #include "wolfHAL_board.h" * * int main(void) * {