soc: ambiq: apollo2: Add support for Apollo2 SoC
Added SoC series for the Ambiq Apollo2 SoC. Signed-off-by: Sri Surya <srisurya@linumiz.com>
This commit is contained in:
@@ -2,10 +2,11 @@
|
||||
#
|
||||
# Copyright (c) 2023 Antmicro <www.antmicro.com>
|
||||
# Copyright (c) 2025, Ambiq Micro Inc. <www.ambiq.com>
|
||||
|
||||
# Copyright (c) 2025, Linumiz GmbH
|
||||
#
|
||||
config AMBIQ_HAL
|
||||
bool "Ambiq HAL drivers support"
|
||||
depends on SOC_SERIES_APOLLO3X || SOC_SERIES_APOLLO4X || SOC_SERIES_APOLLO5X
|
||||
depends on SOC_SERIES_APOLLO2X || SOC_SERIES_APOLLO3X || SOC_SERIES_APOLLO4X || SOC_SERIES_APOLLO5X
|
||||
help
|
||||
Use the Ambiq HAL
|
||||
|
||||
|
||||
9
soc/ambiq/apollo2x/CMakeLists.txt
Normal file
9
soc/ambiq/apollo2x/CMakeLists.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# Copyright (c) 2025 Linumiz GmbH
|
||||
# Author : Sri Surya <srisurya@linumiz.com>
|
||||
|
||||
zephyr_sources(soc.c)
|
||||
zephyr_include_directories(.)
|
||||
|
||||
set(SOC_LINKER_SCRIPT ${ZEPHYR_BASE}/include/zephyr/arch/arm/cortex_m/scripts/linker.ld CACHE INTERNAL "")
|
||||
14
soc/ambiq/apollo2x/Kconfig
Normal file
14
soc/ambiq/apollo2x/Kconfig
Normal file
@@ -0,0 +1,14 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# Copyright (c) 2025 Linumiz GmbH
|
||||
# Author : Sri Surya <srisurya@linumiz.com>
|
||||
|
||||
config SOC_SERIES_APOLLO2X
|
||||
select ARM
|
||||
select CPU_CORTEX_M4
|
||||
select CPU_CORTEX_M_HAS_DWT
|
||||
select CPU_HAS_FPU
|
||||
select CPU_HAS_ARM_MPU
|
||||
select HAS_SWO
|
||||
select AMBIQ_HAL
|
||||
select SOC_EARLY_INIT_HOOK
|
||||
16
soc/ambiq/apollo2x/Kconfig.defconfig
Normal file
16
soc/ambiq/apollo2x/Kconfig.defconfig
Normal file
@@ -0,0 +1,16 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# Copyright (c) 2025 Linumiz GmbH
|
||||
# Author : Sri Surya <srisurya@linumiz.com>
|
||||
|
||||
if SOC_APOLLO2
|
||||
|
||||
config NUM_IRQS
|
||||
default 32
|
||||
|
||||
DT_CLK_SYS_PATH := $(dt_nodelabel_path,sys_clk)
|
||||
|
||||
config SYS_CLOCK_HW_CYCLES_PER_SEC
|
||||
default $(dt_node_int_prop_int,$(DT_CLK_SYS_PATH),clock-frequency)
|
||||
|
||||
endif
|
||||
22
soc/ambiq/apollo2x/Kconfig.soc
Normal file
22
soc/ambiq/apollo2x/Kconfig.soc
Normal file
@@ -0,0 +1,22 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# Copyright (c) 2025 Linumiz GmbH
|
||||
# Author : Sri Surya <srisurya@linumiz.com>
|
||||
|
||||
config SOC_SERIES_APOLLO2X
|
||||
bool
|
||||
select SOC_FAMILY_AMBIQ
|
||||
help
|
||||
Apollo2 Series MCU
|
||||
|
||||
config SOC_APOLLO2
|
||||
bool
|
||||
select SOC_SERIES_APOLLO2X
|
||||
help
|
||||
Apollo2
|
||||
|
||||
config SOC_SERIES
|
||||
default "apollo2x" if SOC_SERIES_APOLLO2X
|
||||
|
||||
config SOC
|
||||
default "apollo2" if SOC_APOLLO2
|
||||
24
soc/ambiq/apollo2x/soc.c
Normal file
24
soc/ambiq/apollo2x/soc.c
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Copyright (c) 2025 Linumiz GmbH
|
||||
* Author: Sri Surya <srisurya@linumiz.com>
|
||||
*/
|
||||
|
||||
#include <zephyr/init.h>
|
||||
#include <soc.h>
|
||||
|
||||
void soc_early_init_hook(void)
|
||||
{
|
||||
/* Set the clock frequency.*/
|
||||
am_hal_clkgen_sysclk_select(AM_HAL_CLKGEN_SYSCLK_MAX);
|
||||
|
||||
/* Enable Flash cache.*/
|
||||
am_hal_cachectrl_enable(&am_hal_cachectrl_defaults);
|
||||
|
||||
/* Initialize for low power in the power control block */
|
||||
am_hal_pwrctrl_low_power_init();
|
||||
|
||||
/* Disable the RTC. */
|
||||
am_hal_rtc_osc_disable();
|
||||
}
|
||||
14
soc/ambiq/apollo2x/soc.h
Normal file
14
soc/ambiq/apollo2x/soc.h
Normal file
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Copyright (c) 2025 Linumiz GmbH
|
||||
* Author: Sri Surya <srisurya@linumiz.com>
|
||||
*/
|
||||
|
||||
#ifndef __SOC_H__
|
||||
#define __SOC_H__
|
||||
|
||||
/*required in soc.c and pinctrl_ambiq.c*/
|
||||
#include <am_mcu_apollo.h>
|
||||
|
||||
#endif /* __SOC_H__ */
|
||||
@@ -1,14 +1,17 @@
|
||||
family:
|
||||
- name: ambiq
|
||||
series:
|
||||
- name: apollo4x
|
||||
- name: apollo2x
|
||||
socs:
|
||||
- name: apollo4p
|
||||
- name: apollo4p_blue
|
||||
- name: apollo2
|
||||
- name: apollo3x
|
||||
socs:
|
||||
- name: apollo3_blue
|
||||
- name: apollo3p_blue
|
||||
- name: apollo4x
|
||||
socs:
|
||||
- name: apollo4p
|
||||
- name: apollo4p_blue
|
||||
- name: apollo5x
|
||||
socs:
|
||||
- name: apollo510
|
||||
|
||||
Reference in New Issue
Block a user