Skip to content

Commit 3a5bbb1

Browse files
ene-stevenfabiobaltieri
authored andcommitted
board: ENE kb1200_evb board
Add support for ENE kb1200_evb board Signed-off-by: Steven Chang <[email protected]>
1 parent 7613724 commit 3a5bbb1

File tree

9 files changed

+345
-0
lines changed

9 files changed

+345
-0
lines changed

boards/ene/index.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.. _boards-ene:
2+
3+
ENE
4+
###
5+
6+
.. toctree::
7+
:maxdepth: 1
8+
:glob:
9+
10+
**/*
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright (c) 2023 ENE Technology Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config BOARD_KB1200_EVB
5+
select SOC_KB1200

boards/ene/kb1200_evb/board.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
board_runner_args(jlink "--device=KB1200" "--speed=4000")
4+
5+
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
6+
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)

boards/ene/kb1200_evb/board.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
board:
2+
name: kb1200_evb
3+
vendor: ene
4+
socs:
5+
- name: kb1200

boards/ene/kb1200_evb/doc/index.rst

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
.. _ene_kb1200_evb:
2+
3+
ENE KB1200_EVB
4+
##############
5+
6+
Overview
7+
********
8+
9+
The KB1200_EVB kit is a development platform to evaluate the
10+
ENE KB1200 series microcontrollers. This board needs to be mated with
11+
part number KB1200.
12+
13+
14+
Hardware
15+
********
16+
17+
- ARM Cortex-M4F Processor
18+
- 512KB Flash and 320KB RAM
19+
- ADC & GPIO headers
20+
- SER1, SER2 and SER3
21+
- FAN PWM interface
22+
- ENE Debug interface
23+
24+
Supported Features
25+
==================
26+
27+
The following features are supported:
28+
29+
+-----------+------------+-------------------------------------+
30+
| Interface | Controller | Driver/Component |
31+
+===========+============+=====================================+
32+
| NVIC | on-chip | nested vector interrupt controller |
33+
+-----------+------------+-------------------------------------+
34+
| ADC | on-chip | adc controller |
35+
+-----------+------------+-------------------------------------+
36+
| CLOCK | on-chip | reset and clock control |
37+
+-----------+------------+-------------------------------------+
38+
| GPIO | on-chip | gpio |
39+
+-----------+------------+-------------------------------------+
40+
| I2C | on-chip | i2c port/controller |
41+
+-----------+------------+-------------------------------------+
42+
| PINMUX | on-chip | pinmux |
43+
+-----------+------------+-------------------------------------+
44+
| PMU | on-chip | power management |
45+
+-----------+------------+-------------------------------------+
46+
| PSL | on-chip | power switch logic |
47+
+-----------+------------+-------------------------------------+
48+
| PWM | on-chip | pulse width modulator |
49+
+-----------+------------+-------------------------------------+
50+
| TACH | on-chip | tachometer sensor |
51+
+-----------+------------+-------------------------------------+
52+
| SER | on-chip | serial port-polling; |
53+
| | | serial port-interrupt |
54+
+-----------+------------+-------------------------------------+
55+
| WDT | on-chip | watchdog |
56+
+-----------+------------+-------------------------------------+
57+
58+
Other hardware features are not currently supported by Zephyr (at the moment)
59+
60+
System Clock
61+
============
62+
63+
The KB1200 MCU is configured to use the 96Mhz internal oscillator with the
64+
on-chip DPLL to generate a resulting EC clock rate of 96MHz/48MHz/24MHz/12MHz.
65+
See Processor clock control register (refer 5.1 General Configuration)
66+
67+
Programming and Debugging
68+
*************************
69+
70+
Flashing
71+
========
72+
73+
If the correct headers are installed, this board supports SWD Debug Interface.
74+
75+
To flash with SWD, install the drivers for your programmer, for example:
76+
SEGGER J-link's drivers are at https://www.segger.com/downloads/jlink/
77+
78+
Debugging
79+
=========
80+
81+
Use SWD with a J-Link
82+
83+
References
84+
==========
85+
86+
.. target-notes::

boards/ene/kb1200_evb/kb1200_evb.dts

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
/*
2+
* Copyright (c) 2023 ENE Technology Inc.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/dts-v1/;
8+
9+
#include <zephyr/dt-bindings/input/input-event-codes.h>
10+
#include <ene/kb1200.dtsi>
11+
#include <ene/kb1200-pinctrl.dtsi>
12+
#include <dt-bindings/i2c/i2c.h>
13+
14+
/ {
15+
model = "KB1200 board";
16+
compatible = "ene,kb1200";
17+
18+
aliases {
19+
uart0 = &uart0;
20+
led0 = &led0;
21+
led1 = &led1;
22+
sw0 = &user_button;
23+
};
24+
25+
chosen {
26+
zephyr,console = &uart0;
27+
zephyr,shell-uart = &uart0;
28+
};
29+
30+
gpio_keys {
31+
compatible = "gpio-keys";
32+
user_button: button {
33+
label = "User";
34+
gpios = <&gpio0x1x 0x10 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
35+
zephyr,code = <INPUT_KEY_0>;
36+
};
37+
};
38+
39+
leds {
40+
compatible = "gpio-leds";
41+
/* green led */
42+
led0: led_0 {
43+
gpios = <&gpio0x1x 0x0f GPIO_ACTIVE_HIGH>;
44+
label = "LED0";
45+
};
46+
/* blue led */
47+
led1: led_1 {
48+
gpios = <&gpio0x1x 0x11 GPIO_ACTIVE_HIGH>;
49+
label = "LED1";
50+
};
51+
};
52+
};
53+
54+
&uart0 {
55+
pinctrl-0 = <&uart0_tx_gpio03 &uart0_rx_gpio01>;
56+
pinctrl-names = "default";
57+
status = "okay";
58+
current-speed = <115200>;
59+
};
60+
61+
&uart1 {
62+
pinctrl-0 = <&uart1_tx_gpio36 &uart1_rx_gpio28>;
63+
pinctrl-names = "default";
64+
status = "okay";
65+
current-speed = <115200>;
66+
};
67+
68+
&uart2 {
69+
pinctrl-0 = <&uart2_tx_gpio04 &uart2_rx_gpio55>;
70+
pinctrl-names = "default";
71+
status = "okay";
72+
current-speed = <115200>;
73+
};
74+
75+
&gpio0x1x {
76+
status = "okay";
77+
};
78+
79+
&adc0 {
80+
status = "okay";
81+
pinctrl-0 = <&adc0_gpio0a &adc1_gpio0b &adc2_gpio0c &adc3_gpio0d>;
82+
pinctrl-names = "default";
83+
};
84+
85+
&pwm0 {
86+
status = "okay";
87+
pinctrl-0 = <&pwm0_gpio3a>;
88+
pinctrl-names = "default";
89+
};
90+
91+
&pwm4 {
92+
status = "okay";
93+
pinctrl-0 = <&pwm4_gpio31>;
94+
pinctrl-names = "default";
95+
};
96+
97+
&pwm5 {
98+
status = "okay";
99+
pinctrl-0 = <&pwm5_gpio30>;
100+
pinctrl-names = "default";
101+
};
102+
103+
&pwm6 {
104+
status = "okay";
105+
pinctrl-0 = <&pwm6_gpio37>;
106+
pinctrl-names = "default";
107+
};
108+
109+
&tach0 {
110+
status = "okay";
111+
pinctrl-0 = <&tach0_gpio48>;
112+
pinctrl-names = "default";
113+
pulses-per-round = <2>;
114+
sample-time-us = <2>;
115+
};
116+
117+
&tach1 {
118+
status = "okay";
119+
pinctrl-0 = <&tach1_gpio4e>;
120+
pinctrl-names = "default";
121+
pulses-per-round = <1>;
122+
sample-time-us = <8>;
123+
};
124+
125+
&tach2 {
126+
status = "okay";
127+
pinctrl-0 = <&tach2_gpio0e>;
128+
pinctrl-names = "default";
129+
pulses-per-round = <2>;
130+
sample-time-us = <16>;
131+
};
132+
133+
&tach3 {
134+
status = "okay";
135+
pinctrl-0 = <&tach3_gpio43>;
136+
pinctrl-names = "default";
137+
pulses-per-round = <1>;
138+
sample-time-us = <64>;
139+
};
140+
141+
&wdt0 {
142+
status = "okay";
143+
};
144+
145+
&i2c0 {
146+
status = "okay";
147+
clock-frequency = <I2C_BITRATE_STANDARD>;
148+
pinctrl-0 = <&i2c0_clk_gpio2c &i2c0_dat_gpio2d>;
149+
pinctrl-names = "default";
150+
};
151+
152+
&i2c8 {
153+
status = "okay";
154+
clock-frequency = <I2C_BITRATE_STANDARD>;
155+
pinctrl-0 = <&i2c8_clk_gpio70 &i2c8_dat_gpio71>;
156+
pinctrl-names = "default";
157+
};

boards/ene/kb1200_evb/kb1200_evb.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
identifier: kb1200_evb
2+
name: KB1200 EVB
3+
type: mcu
4+
arch: arm
5+
toolchain:
6+
- zephyr
7+
- gnuarmemb
8+
- xtools
9+
supported:
10+
- gpio
11+
- uart
12+
ram: 64
13+
flash: 256
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Copyright (c) 2023 ENE Technology Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
# Enable console & UART driver
5+
CONFIG_SERIAL=y
6+
CONFIG_CONSOLE=y
7+
CONFIG_UART_CONSOLE=y
8+
CONFIG_UART_INTERRUPT_DRIVEN=y
9+
10+
# Enable GPIO
11+
CONFIG_GPIO=y
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# SPDX-License-Identifier: GPL-2.0-or-later
2+
3+
source [find interface/jlink.cfg]
4+
5+
transport select swd
6+
7+
source [find target/swj-dp.tcl]
8+
9+
10+
# Set Chipname
11+
if { [info exists CHIPNAME] } {
12+
set _CHIPNAME $CHIPNAME
13+
} else {
14+
set _CHIPNAME kb1200
15+
}
16+
17+
# SWD DAP ID of ENE KB1200 Cortex-M4.
18+
if { [info exists CPUDAPID ] } {
19+
set _CPUDAPID $CPUDAPID
20+
} else {
21+
set _CPUDAPID 0x2ba01477
22+
}
23+
24+
# Work-area is a space in RAM used for flash programming
25+
# By default use 32kB
26+
if { [info exists WORKAREASIZE] } {
27+
set _WORKAREASIZE $WORKAREASIZE
28+
} else {
29+
set _WORKAREASIZE 0x8000
30+
}
31+
32+
# Debug Adapter Target Settings
33+
swj_newdap $_CHIPNAME cpu -irlen 4 -expected-id $_CPUDAPID
34+
dap create $_CHIPNAME.dap -chain-position $_CHIPNAME.cpu
35+
set _TARGETNAME $_CHIPNAME.cpu
36+
target create $_TARGETNAME cortex_m -endian little -dap $_CHIPNAME.dap
37+
38+
$_TARGETNAME configure -work-area-phys 0x200c0000 -work-area-size $_WORKAREASIZE -work-area-backup 0
39+
40+
# Initial JTAG/SWD speed
41+
# For safety purposes, set for the lowest cpu clock configuration
42+
# 4MHz / 6 = 666KHz, so use 600KHz for it
43+
adapter speed 600
44+
45+
# For safety purposes, set for the lowest cpu clock configuration
46+
$_TARGETNAME configure -event reset-start {adapter speed 600}
47+
48+
# use sysresetreq to perform a system reset
49+
cortex_m reset_config sysresetreq
50+
51+
# ENE internal spi flash
52+
flash bank ispif eneispif 0x60000000 0 0 0 $_TARGETNAME 0x50101000

0 commit comments

Comments
 (0)