soc: arm: ambiq: apollo4: Add support for Apollo4 Plus SoC
Add all required parts (new SoC family/series, device tree) for the Ambiq Apollo4 Plus SoC. Signed-off-by: Maciej Sobkowski <msobkowski@antmicro.com>
This commit is contained in:
parent
1733076474
commit
0118886624
13 changed files with 169 additions and 0 deletions
32
dts/arm/ambiq/ambiq_apollo4p.dtsi
Normal file
32
dts/arm/ambiq/ambiq_apollo4p.dtsi
Normal file
|
@ -0,0 +1,32 @@
|
|||
/* SPDX-License-Identifier: Apache-2.0 */
|
||||
|
||||
#include <arm/armv7-m.dtsi>
|
||||
#include <mem.h>
|
||||
|
||||
/ {
|
||||
cpus {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
cpu0: cpu@0 {
|
||||
compatible = "arm,cortex-m4f";
|
||||
reg = <0>;
|
||||
};
|
||||
};
|
||||
|
||||
/* MRAM region */
|
||||
flash0: flash@18000 {
|
||||
compatible = "soc-nv-flash";
|
||||
reg = <0x00018000 0x1e8000>;
|
||||
};
|
||||
|
||||
/* TCM + SRAM region */
|
||||
sram0: memory@10000000 {
|
||||
compatible = "mmio-sram";
|
||||
reg = <0x10000000 0x2C0000>;
|
||||
};
|
||||
};
|
||||
|
||||
&nvic {
|
||||
arm,num-irq-priority-bits = <3>;
|
||||
};
|
7
soc/arm/ambiq/CMakeLists.txt
Normal file
7
soc/arm/ambiq/CMakeLists.txt
Normal file
|
@ -0,0 +1,7 @@
|
|||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# Copyright (c) 2023 Antmicro <www.antmicro.com>
|
||||
|
||||
add_subdirectory(${SOC_SERIES})
|
||||
|
||||
zephyr_include_directories(.)
|
16
soc/arm/ambiq/Kconfig
Normal file
16
soc/arm/ambiq/Kconfig
Normal file
|
@ -0,0 +1,16 @@
|
|||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# Copyright (c) 2023 Antmicro <www.antmicro.com>
|
||||
|
||||
config SOC_FAMILY_AMBIQ
|
||||
bool
|
||||
|
||||
if SOC_FAMILY_AMBIQ
|
||||
|
||||
config SOC_FAMILY
|
||||
string
|
||||
default "ambiq"
|
||||
|
||||
source "soc/arm/ambiq/*/Kconfig.soc"
|
||||
|
||||
endif # SOC_FAMILY_AMBIQ
|
5
soc/arm/ambiq/Kconfig.defconfig
Normal file
5
soc/arm/ambiq/Kconfig.defconfig
Normal file
|
@ -0,0 +1,5 @@
|
|||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# Copyright (c) 2023 Antmicro <www.antmicro.com>
|
||||
|
||||
source "soc/arm/ambiq/*/Kconfig.defconfig.series"
|
5
soc/arm/ambiq/Kconfig.soc
Normal file
5
soc/arm/ambiq/Kconfig.soc
Normal file
|
@ -0,0 +1,5 @@
|
|||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# Copyright (c) 2023 Antmicro <www.antmicro.com>
|
||||
|
||||
source "soc/arm/ambiq/*/Kconfig.series"
|
7
soc/arm/ambiq/apollo4x/CMakeLists.txt
Normal file
7
soc/arm/ambiq/apollo4x/CMakeLists.txt
Normal file
|
@ -0,0 +1,7 @@
|
|||
# Copyright (c) 2023 Antmicro <www.antmicro.com>
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
zephyr_sources(soc.c)
|
||||
zephyr_include_directories(${ZEPHYR_BASE}/soc/arm/common/cortex_m)
|
18
soc/arm/ambiq/apollo4x/Kconfig.defconfig.apollo4p
Normal file
18
soc/arm/ambiq/apollo4x/Kconfig.defconfig.apollo4p
Normal file
|
@ -0,0 +1,18 @@
|
|||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# Copyright (c) 2023 Antmicro <www.antmicro.com>
|
||||
|
||||
if SOC_APOLLO4P
|
||||
|
||||
config NUM_IRQS
|
||||
default 83
|
||||
|
||||
DT_NODE_SRAM := /memory@0
|
||||
|
||||
config SRAM_NC_SIZE
|
||||
default $(dt_node_reg_size_int,$(DT_NODE_SRAM),1,K)
|
||||
|
||||
config SRAM_NC_BASE_ADDRESS
|
||||
default $(dt_node_reg_addr_hex,$(DT_NODE_SRAM),1)
|
||||
|
||||
endif # SOC_APOLLO4P
|
12
soc/arm/ambiq/apollo4x/Kconfig.defconfig.series
Normal file
12
soc/arm/ambiq/apollo4x/Kconfig.defconfig.series
Normal file
|
@ -0,0 +1,12 @@
|
|||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# Copyright (c) 2023 Antmicro <www.antmicro.com>
|
||||
|
||||
if SOC_SERIES_APOLLO4X
|
||||
|
||||
source "soc/arm/ambiq/apollo4x/Kconfig.defconfig.apollo4*"
|
||||
|
||||
config SOC_SERIES
|
||||
default "apollo4x"
|
||||
|
||||
endif # SOC_SERIES_APOLLO4X
|
17
soc/arm/ambiq/apollo4x/Kconfig.series
Normal file
17
soc/arm/ambiq/apollo4x/Kconfig.series
Normal file
|
@ -0,0 +1,17 @@
|
|||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# Copyright (c) 2023 Antmicro <www.antmicro.com>
|
||||
|
||||
# Ambiq Apollo4 MCU Series
|
||||
|
||||
config SOC_SERIES_APOLLO4X
|
||||
bool "Apollo4 Series MCU"
|
||||
select ARM
|
||||
select CPU_CORTEX_M4
|
||||
select CPU_CORTEX_M_HAS_DWT
|
||||
select CPU_HAS_FPU
|
||||
select SOC_FAMILY_AMBIQ
|
||||
select HAS_SWO
|
||||
select AMBIQ_HAL
|
||||
help
|
||||
Enable support for Apollo4 MCU series
|
12
soc/arm/ambiq/apollo4x/Kconfig.soc
Normal file
12
soc/arm/ambiq/apollo4x/Kconfig.soc
Normal file
|
@ -0,0 +1,12 @@
|
|||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# Copyright (c) 2023 Antmicro <www.antmicro.com>
|
||||
|
||||
choice
|
||||
prompt "Ambiq Apollo4X Selection"
|
||||
depends on SOC_SERIES_APOLLO4X
|
||||
|
||||
config SOC_APOLLO4P
|
||||
bool "Apollo4P"
|
||||
|
||||
endchoice
|
7
soc/arm/ambiq/apollo4x/linker.ld
Normal file
7
soc/arm/ambiq/apollo4x/linker.ld
Normal file
|
@ -0,0 +1,7 @@
|
|||
/*
|
||||
* Copyright (c) 2023 Antmicro <www.antmicro.com>
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <zephyr/arch/arm/aarch32/cortex_m/scripts/linker.ld>
|
19
soc/arm/ambiq/apollo4x/soc.c
Normal file
19
soc/arm/ambiq/apollo4x/soc.c
Normal file
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
* Copyright (c) 2023 Antmicro <www.antmicro.com>
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <zephyr/init.h>
|
||||
|
||||
#include <am_mcu_apollo.h>
|
||||
|
||||
static int arm_apollo4_init(void)
|
||||
{
|
||||
am_hal_pwrctrl_low_power_init();
|
||||
am_hal_rtc_osc_disable();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
SYS_INIT(arm_apollo4_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
12
soc/arm/ambiq/apollo4x/soc.h
Normal file
12
soc/arm/ambiq/apollo4x/soc.h
Normal file
|
@ -0,0 +1,12 @@
|
|||
/*
|
||||
* Copyright (c) 2023 Antmicro <www.antmicro.com>
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef __SOC_H__
|
||||
#define __SOC_H__
|
||||
|
||||
#include <apollo4p.h>
|
||||
|
||||
#endif /* __SOC_H__ */
|
Loading…
Add table
Add a link
Reference in a new issue