Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
8908570
hal: realtek: add zephyr/module/hal_realtek to handle blobs
zjian-zhang Jan 20, 2026
4a0d854
hal: realtek: avoid error when soc not get merged in Zephyr
zjian-zhang Feb 2, 2026
84c64d5
hal: realtek: Add the ameba directory under zephyr/blobs
zjian-zhang Feb 2, 2026
c9b61c6
hal: realtek: add amebaflash runner support
zjian-zhang Feb 2, 2026
eb1a4a2
hal: realtek: soc rename
zjian-zhang Feb 5, 2026
f0192aa
hal: realtek: add support for rtl87x2g & rtl8752h
ZhiyuanTang17 Jan 21, 2026
0ab1f18
hal: realtek: add RCC APIs for zephyr
minyuan-xue Feb 2, 2026
2e8ff64
hal: realtek: fix rcc api usage for amebad.
minyuan-xue Mar 3, 2026
6e0d396
hal: realtek: update Kconfig for RTL8752H
zophai-liu Feb 11, 2026
2321639
hal: realtek: add initialization variable in rcc api.
minyuan-xue Mar 4, 2026
5d482b1
hal: realtek: add RTL8752H SOC Kconfig for CI
zophai-liu Mar 6, 2026
22d60ef
hal: realtek: add ameba scripts requirements.txt
minyuan-xue Mar 10, 2026
ba27293
hal: realtek: rtl8752h: add essential init functions
ZhiyuanTang17 Mar 6, 2026
c8f99f7
hal: realtek: drop python-mbedtls
fabiobaltieri Mar 19, 2026
84a7fd5
hal: realtek: export Peripheral_Handler ROM symbol
ZhiyuanTang17 Mar 17, 2026
2103202
hal: realtek: add libs for wifi drivers in blobs
minyuan-xue Mar 18, 2026
7a01d57
hal: realtek: add support for ameba wifi
minyuan-xue Mar 18, 2026
a5915aa
hal: realtek: update ameba drivers implement
minyuan-xue Mar 19, 2026
81da315
hal: realtek: add ameba flash driver uesed files
minyuan-xue Apr 20, 2026
2c5fe73
hal: realtek: bee: restructure rtl8752h/rtl87x2g driver path hierarchy
YuzhuoLiuRTK Apr 15, 2026
85ae055
hal: realtek: bee: update rtl8752h drivers
YuzhuoLiuRTK Apr 16, 2026
428e4dd
hal: realtek: bee: update rtl87x2g drivers
YuzhuoLiuRTK Apr 16, 2026
e555c11
hal: realtek: add flash init symbol for rtl8752h
ZhiyuanTang17 Mar 11, 2026
022c29e
hal: realtek: adapt ameba os_wrapper header file
minyuan-xue Apr 22, 2026
063d854
hal: realtek: adapt update_blobs.py and update module.yml
minyuan-xue Apr 22, 2026
3c297ba
hal: realtek: amebadplus: move DiagPrintfNano to swlib/log.c
minyuan-xue Apr 26, 2026
825297c
hal: realtek: bee: add core WDT driver and rom symbols
ZhiyuanTang17 Mar 13, 2026
beb44b1
hal: realtek: remove redefine MBEDTLS config
minyuan-xue May 4, 2026
9d5def3
hal: realtek: bee: add rtl87x2j driver support files
ZhiyuanTang17 May 27, 2026
890c142
hal: realtek: bee: add rtl87x2j platform files
ZhiyuanTang17 May 27, 2026
3034c66
[DNM] binary blobs
ZhiyuanTang17 May 27, 2026
aff247f
bee: add rtl87x2j eflash hal
ZhiyuanTang17 May 28, 2026
048b0a2
watchdog: reconstruct the directory and add rtl87x2j support
ZhiyuanTang17 May 29, 2026
6b7621b
entropy: reconstruct entropy HAL
ZhiyuanTang17 Jun 1, 2026
9a5a26d
rtl87x2j: update rtl_bt_hci.c for vhci v3 stage 3
janegu593 Jun 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
# SPDX-License-Identifier: Apache-2.0

add_subdirectory_ifdef(CONFIG_SOC_FAMILY_REALTEK_AMEBA ameba)
add_subdirectory_ifdef(CONFIG_SOC_FAMILY_REALTEK_BEE bee)
1 change: 1 addition & 0 deletions Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
# SPDX-License-Identifier: Apache-2.0

rsource "ameba/Kconfig"
rsource "bee/Kconfig"
37 changes: 32 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,35 @@
Important Information About This Repository
*******************************************

HAL Realtek (or `hal_realtek`) is a collection of tools, low-level APIs, and hardware access functions for Realtek Devices.
Realtek HAL Module (hal_realtek)
################################

This repository is a copy (not a fork) of the [ameba-rtos repository](https://github.com/Ameba-AIoT/ameba-rtos) that contains Ameba SoCs.
HAL Realtek (or ``hal_realtek``) is a collection of tools, low-level APIs, and hardware access functions for Realtek Devices, enabling support within the Zephyr RTOS ecosystem.

After following the standard Zephyr guide for compilation, both app and bootloader images tailored for Ameba SoCs will be generated. [Refer to this tutorial](https://github.com/Ameba-AIoT/ameba-rtos/) for Flashing these images and running on Ameba SoCs.
Currently, the ``hal_realtek`` repository supports two primary SoC series: **Ameba** and **Bee**.

Supported SoC Series
*******************

Ameba Series (ameba)
====================

The ``ameba`` directory contains the HAL for Ameba series SoCs.

This repository is a copy (not a fork) of the `ameba-rtos repository <https://github.com/Ameba-AIoT/ameba-rtos>`_ that contains Ameba SoCs.

After following the standard Zephyr guide for compilation, both app and bootloader images tailored for Ameba SoCs will be generated. Refer to this `tutorial <https://github.com/Ameba-AIoT/ameba-rtos/>`_ for Flashing these images and running on Ameba SoCs.

Bee Series (bee)
================

The ``bee`` directory hosts the HAL for Bee series SoCs. The sources in this directory are extracted from their respective SDKs:

* **RTL87x2G**: `rtkconnectivity/rtl87x2g_sdk <https://github.com/rtkconnectivity/rtl87x2g_sdk>`_

* **RTL8752H**: `rtkconnectivity/rtl8752h_sdk <https://github.com/rtkconnectivity/rtl8752h_sdk>`_

Maintenance & Synchronization Strategy
**************************************

Since the HALs for the **Ameba** and **Bee** series are maintained by different teams within Realtek, and additional SoC series may be added to ``hal_realtek`` in the future, there is no single upstream Git history for this repository.

Therefore, this module adheres to the **"Updating modules with a diff from upstream"** practice as defined in the `Zephyr Project Documentation <https://docs.zephyrproject.org/latest/develop/modules.html#allowed-practices>`_.
1 change: 1 addition & 0 deletions ameba/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ config REALTEK_AMEBA_HAL_LIB
This option enables the Realtek Ameba HAL library.

rsource "ameba*/Kconfig"
rsource "common/wifi/Kconfig"

endif # SOC_FAMILY_REALTEK_AMEBA
78 changes: 0 additions & 78 deletions ameba/amebaG2/source/fwlib/include/ameba_phy.h

This file was deleted.

114 changes: 0 additions & 114 deletions ameba/amebaG2/source/fwlib/ram_km4tz/ameba_phy.c

This file was deleted.

43 changes: 15 additions & 28 deletions ameba/amebad/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,35 @@
# Copyright (c) 2024 Realtek Semiconductor Corp.
# SPDX-License-Identifier: Apache-2.0

zephyr_link_libraries_ifdef(CONFIG_WIFI_AMEBA
-Wl,--start-group
${LIB_PATH}/lib_wifi_rtk_app.a
${LIB_PATH}/lib_wifi_single_core.a
-Wl,--end-group
${LIB_PATH}/lib_wifi_api.a
${LIB_PATH}/lib_rtw_event.a
${LIB_PATH}/lib_wpa_lite.a
${LIB_PATH}/lib_wifi_com_sec.a
)
zephyr_compile_options(-mcmse)

zephyr_include_directories(
include
source/cmsis
source/misc
source/swlib
source/lib/include
source/fwlib/include
source/usrcfg/include
source/app/monitor/include
)

# used by common
zephyr_library_sources(
source/fwlib/ram_hp/ameba_system.c
source/fwlib/ram_common/ameba_pll.c
source/swlib/log.c
source/fwlib/ram_common/ameba_reset.c
)

# used by driver, need use zephyr_library_sources_ifdef
Expand All @@ -37,31 +52,3 @@ zephyr_link_libraries(
gcc
-T${CMAKE_CURRENT_SOURCE_DIR}/ld/ameba_rom_symbol_acut.ld
)

# west sign
if(CONFIG_SOC_AMEBA_NP_IMAGE)
file(GLOB blob_bin_file "${ZEPHYR_HAL_REALTEK_MODULE_DIR}/zephyr/blobs/${CONFIG_SOC_SERIES}/bin/*.bin")

if(blob_bin_file)
set(python_script_args
--soc ${CONFIG_SOC_SERIES}
--bin-file ${ZEPHYR_BINARY_DIR}/${KERNEL_BIN_NAME}
--out-dir ${CMAKE_BINARY_DIR}
--module-dir ${ZEPHYR_HAL_REALTEK_MODULE_DIR}
)

add_custom_target(zephyr.raw.map ALL
DEPENDS ${ZEPHYR_BINARY_DIR}/${KERNEL_NAME}.raw.map
)

add_custom_command(
OUTPUT ${ZEPHYR_BINARY_DIR}/${KERNEL_NAME}.raw.map
COMMAND ${CMAKE_NM} ${ZEPHYR_BINARY_DIR}/${KERNEL_ELF_NAME} | sort > ${ZEPHYR_BINARY_DIR}/${KERNEL_NAME}.raw.map
COMMAND ${CMAKE_OBJDUMP} -d ${ZEPHYR_BINARY_DIR}/${KERNEL_ELF_NAME} > ${ZEPHYR_BINARY_DIR}/${KERNEL_NAME}.asm
COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_HAL_REALTEK_MODULE_DIR}/ameba/scripts/merge_bin.py ${python_script_args}
DEPENDS ${ZEPHYR_BINARY_DIR}/${KERNEL_ELF_NAME} ${blob_bin_file} ${CMAKE_CURRENT_SOURCE_DIR}/manifest.json5
)
else()
message(WARNING "Missing Realtek blobs. Run: `west blobs fetch hal_realtek`")
endif()
endif()
3 changes: 3 additions & 0 deletions ameba/amebad/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
config ARM_CORE_CM4
bool
default y if SOC_SERIES_AMEBAD

config SOC_SERIES_AMEBAD
select SINGLE_CORE_WIFI if WLAN
2 changes: 2 additions & 0 deletions ameba/amebad/include/platform_autoconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#define CONFIG_IMG2_FLASH 1
#define CONFIG_SUPPORT_ATCMD 1
#define CONFIG_ATCMD_LOGUART 1
#define CONFIG_VFS_LITTLEFS_INCLUDED 1
#define CONFIG_LINK_ROM_SYMB 1
#define CONFIG_CPU_HAS_FPU 1
#define CONFIG_ARM_CORE_CM4 1
Expand All @@ -18,3 +19,4 @@
#define CONFIG_AMEBAD_B_CUT 1
#define CONFIG_SOC_PS_EN 1
#define CONFIG_SOC_PS_MODULE 1
#include <zephyr/autoconf.h>
2 changes: 1 addition & 1 deletion ameba/amebad/source/fwlib/include/ameba.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
#else
#include "ameba_rcc_lp.h"
#endif
// #include "sscanf_minimal.h"
#include "sscanf_minimal.h"

#include "ameba_trustzone.h"
#include "ameba_arch.h"
Expand Down
2 changes: 1 addition & 1 deletion ameba/amebad/source/fwlib/include/ameba_efuse.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ int OTP_LogicalMap_Write(u32 addr, u32 cnts, u8 *data);
int OTPSetCRC(void);
int OTP_Read8(u32 Addr, u8 *Data);
int OTP_Write8(u32 Addr, u8 Data);

void EFUSE_GetUUID(u32 *UUID);
/**
* @}
*/
Expand Down
2 changes: 1 addition & 1 deletion ameba/amebad/source/fwlib/include/ameba_gdma.h
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ _LONG_CALL_ void GDMA_SetChnlPriority(u8 GDMA_Index, u8 GDMA_ChNum, u32 ChnlPrio
_LONG_CALL_ void GDMA_Suspend(u8 GDMA_Index, u8 GDMA_ChNum);
_LONG_CALL_ void GDMA_Resume(u8 GDMA_Index, u8 GDMA_ChNum);
_LONG_CALL_ u8 GDMA_Abort(u8 GDMA_Index, u8 GDMA_ChNum);

_LONG_CALL_ u8 GDMA_ChannelIsActive(u8 GDMA_Index, u8 GDMA_ChNum);

/**
* @}
Expand Down
6 changes: 6 additions & 0 deletions ameba/amebad/source/fwlib/include/ameba_reset.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@

/* AUTO_GEN_END */

#define AON_BIT_RSTF_DSLP BIT_BOOT_DSLP_RESET_HAPPEN
#define AON_BIT_RSTF_BOR BIT_BOOT_BOD_RESET_HAPPEN

#define IS_WDG_RESET(reason) ((reason) & (BIT_BOOT_WDG_RESET_HAPPEN | BIT_BOOT_KM4WDG_RESET_HAPPEN))
#define IS_SYS_RESET(reason) ((reason) & (BIT_BOOT_SYS_RESET_HAPPEN | BIT_BOOT_KM4SYS_RESET_HAPPEN))

extern void System_Reset(void);

#endif
5 changes: 5 additions & 0 deletions ameba/amebad/source/fwlib/include/ameba_ssi.h
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,11 @@ extern const SPI_DevTable SPI_DEV_TABLE[2];
#define SPI_BIT_RXFIS BIT_ISR_RXFIS
#define SPI_BIT_TXEIS BIT_ISR_TXEIS

/* SPI_SR */
#define SPI_BIT_DCOL BIT_SR_DCOL
#define SPI_BIT_TFE BIT_SR_TFE
#define SPI_BIT_BUSY BIT_SR_BUSY

/* SPI_IMR */
#define SPI_BIT_RXFIM BIT_IMR_RXFIM
#define SPI_BIT_RXOIM BIT_IMR_RXOIM
Expand Down
Loading