-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Add soc em32f967 #97843
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
ElanJohnnyChuang
wants to merge
2
commits into
zephyrproject-rtos:main
Choose a base branch
from
ElanJohnnyChuang:add_soc_em32f967
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Add soc em32f967 #97843
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,184 @@ | ||
/* | ||
* Copyright (c) 2024 ELAN Microelectronics Corp. | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#include <arm/armv7-m.dtsi> | ||
#include <zephyr/dt-bindings/gpio/gpio.h> | ||
#include <zephyr/dt-bindings/i2c/i2c.h> | ||
#include <zephyr/dt-bindings/pwm/pwm.h> | ||
#include <zephyr/dt-bindings/gpio/gpio.h> | ||
#include <zephyr/dt-bindings/clock/em32_clock.h> | ||
#include <zephyr/dt-bindings/pinctrl/em32f967-pinctrl.h> | ||
#include <mem.h> | ||
|
||
/ { | ||
|
||
cpus { | ||
#address-cells = <1>; | ||
#size-cells = <0>; | ||
|
||
cpu0: cpu@0 { | ||
device_type = "cpu"; | ||
compatible = "arm,cortex-m4"; | ||
reg = <0>; | ||
#address-cells = <1>; | ||
#size-cells = <1>; | ||
|
||
mpu: mpu@e000ed90 { | ||
compatible = "arm,armv7m-mpu"; | ||
reg = <0xe000ed90 0x40>; | ||
}; | ||
}; | ||
}; | ||
|
||
sram0: memory@20000000 { | ||
compatible = "mmio-sram"; | ||
reg = <0x20000000 DT_SIZE_K(448)>; | ||
}; | ||
|
||
clocks { | ||
#size-cells = <0>; | ||
|
||
clk_ahb: clk-ahb { | ||
compatible = "elan,em32-ahb"; | ||
#clock-cells = <0>; | ||
clock-source = <EM32_CLK_SRC_IRCHIGH>; | ||
clock-frequency = <EM32_CLK_FREQ_IRCHIGH96>; | ||
clock-divider = <EM32_AHB_CLK_DIV1>; | ||
status = "disabled"; | ||
}; | ||
|
||
clk_apb: clk-apb { | ||
compatible = "elan,em32-apb"; | ||
#clock-cells = <0>; | ||
clocks = <&clk_ahb>; | ||
status = "disabled"; | ||
}; | ||
}; | ||
|
||
soc { | ||
/* Pin Controller */ | ||
pinctrl: pin-controller@40030200 { | ||
compatible = "elan,em32-pinctrl"; | ||
reg = <0x40030200 0x100>; | ||
reg-names = "iomux"; | ||
#address-cells = <1>; | ||
#size-cells = <1>; | ||
#pinctrl-cells = <1>; | ||
status = "okay"; | ||
|
||
|
||
/* GPIO Controllers - EM32F967 hardware */ | ||
gpioa: gpio@40020000 { | ||
compatible = "elan,em32-gpio"; | ||
reg = <0x40020000 0x1000>; | ||
port-id = <0>; | ||
interrupts = <0 0>; | ||
gpio-controller; | ||
#gpio-cells = <2>; | ||
ngpios = <16>; | ||
clocks = <&clk_ahb>; | ||
status = "disabled"; | ||
}; | ||
|
||
gpiob: gpio@40021000 { | ||
compatible = "elan,em32-gpio"; | ||
reg = <0x40021000 0x1000>; | ||
port-id = <1>; | ||
interrupts = <1 0>; | ||
gpio-controller; | ||
#gpio-cells = <2>; | ||
ngpios = <16>; | ||
clocks = <&clk_ahb>; | ||
status = "disabled"; | ||
}; | ||
|
||
uart0: serial@40002000 { | ||
compatible = "elan,elandev-uart"; | ||
reg = <0x40002000 0x4c>; | ||
clocks = <&clk_apb>; | ||
status = "disabled"; | ||
}; | ||
|
||
spi2: spi@40013000 { | ||
compatible = "elan,elandev-spi2"; | ||
reg = <0x40013000 0x1000>; | ||
#address-cells = <1>; | ||
#size-cells = <0>; | ||
interrupts = <25 0>; | ||
clocks = <&clk_apb>; | ||
status = "disabled"; | ||
}; | ||
}; | ||
|
||
em32_flash_controller: flash-controller@40034000 { | ||
compatible = "elan,em32-flash-controller"; | ||
reg = <0x40034000 DT_SIZE_K(4)>; | ||
status = "disabled"; | ||
|
||
#address-cells = <1>; | ||
#size-cells = <1>; | ||
|
||
flash0: flash@10000000 { | ||
compatible = "soc-nv-flash"; | ||
reg = <0x10000000 DT_SIZE_K(536)>; | ||
erase-block-size = <DT_SIZE_K(8)>; | ||
write-block-size = <16>; | ||
}; | ||
|
||
flash1: flash@10094000 { | ||
compatible = "mcuboot"; | ||
reg = <0x10094000 DT_SIZE_K(48)>; | ||
}; | ||
}; | ||
|
||
usbd: usbd@40038000 { | ||
compatible = "elan,elandev-usbd"; | ||
reg = <0x40038000 0x1000>; | ||
num-bidir-endpoints = <5>; | ||
}; | ||
|
||
uid: device_uid@40030f00 { | ||
compatible = "elan,em32-uid"; | ||
reg = <0x40030f00 0x4 /* Chip ID */ | ||
0x100A6020 0x4 /* Device ID */ | ||
0x100A6024 0x4 /* IC Version */>; | ||
reg-names = "chip_id", "device_id", "ic_version"; | ||
status = "disabled"; | ||
}; | ||
bbram0: bbram@40033000 { | ||
compatible = "elan,em32-bbram"; | ||
reg = <0x40033000 0x40>; | ||
backup-regs-count = <16>; | ||
status = "disabled"; | ||
}; | ||
trng0: trng@40018000 { | ||
compatible = "elan,em32-trng"; | ||
reg = <0x40018000 0x100>; | ||
interrupts = <41 0>; | ||
clocks = <&clk_apb>; | ||
status = "disabled"; | ||
}; | ||
wdt0: watchdog@40035000 { | ||
compatible = "elan,em32-wdt"; | ||
reg = <0x40035000 0x1000>; | ||
interrupts = <2 0>; | ||
clocks = <&clk_apb>; | ||
status = "disabled"; | ||
}; | ||
|
||
crypto0: crypto@40016000 { | ||
compatible = "elan,em32-crypto"; | ||
reg = <0x40016000 0x1000>; | ||
interrupts = <40 0>; | ||
clocks = <&clk_apb>; | ||
status = "disabled"; | ||
}; | ||
|
||
}; | ||
}; | ||
|
||
&nvic { | ||
arm,num-irq-priority-bits = <3>; | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Copyright (c) 2025 Elan Microelectronics Corp.. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
zephyr_library() | ||
zephyr_library_sources(soc.c) | ||
|
||
set(SOC_LINKER_SCRIPT ${ZEPHYR_BASE}/include/zephyr/arch/arm/cortex_m/scripts/linker.ld CACHE INTERNAL "") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Copyright (c) 2025 Elan Microelectronics Corps. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
config SOC_EM32F967 | ||
select ARM | ||
select CPU_CORTEX_M4 | ||
select CPU_HAS_ARM_MPU | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
if SOC_EM32F967 | ||
|
||
config NUM_IRQS | ||
default 64 | ||
|
||
config SYS_CLOCK_HW_CYCLES_PER_SEC | ||
default 60000000 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. get from dt function from dts |
||
|
||
config BUILD_OUTPUT_BIN | ||
default y | ||
|
||
config BUILD_OUTPUT_HEX | ||
default y | ||
|
||
endif # SOC_EM32F967 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Copyright (c) 2025 Elan Microelectronics Corp. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
config SOC_EM32F967 | ||
bool | ||
help | ||
ELAN EM32F967 | ||
|
||
config SOC | ||
default "em32f967" if SOC_EM32F967 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this file is not formatted correctly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This draft PR update is mainly for me to get familiar with the workflow. I’m aware that the current code still has many aspects that don’t meet the requirements. I will address those based on your suggestions and the issues reported by the CI pipeline. After the necessary fixes and optimizations, I’ll force‑push the changes to this PR and then convert the draft PR into a regular PR for your review. Thank you.