boards: it82xx2: Create the it82xx2_evb board

Create a it82xx2_evb board for IT82XX2 chip.

TEST: west build -p always -b it82xx2_evb

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
This commit is contained in:
Tim Lin 2022-10-04 17:51:28 +08:00 committed by Anas Nashif
commit 96df7bb833
12 changed files with 531 additions and 0 deletions

View file

@ -0,0 +1,6 @@
# Copyright (c) 2023 ITE Corporation. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
config BOARD_IT82XX2_EVB
bool "IT82XX2 EV-board"
depends on SOC_IT8XXX2

View file

@ -0,0 +1,8 @@
# Copyright (c) 2023 ITE Corporation. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
if BOARD_IT82XX2_EVB
config BOARD
default "it82xx2_evb"
endif

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View file

@ -0,0 +1,247 @@
.. _it82xx2_evb:
ITE IT82XX2 series
######################
Overview
********
The IT82XX2 is a 32-bit RISC-V microcontroller.
And a highly integrated embedded controller with system functions.
It is suitable for mobile system applications. The picture below is
the IT82202 development board (also known as it82xx2_evb) and its debug card.
.. figure:: it82xx2_evb_and_debug_card.jpg
:align: center
:alt: IT82202 EVB
To find out more about ITE, visit our World Wide Web at:`ITE's website`_
Hardware
********
The IT82XX2 series contains different chip types(ex, it82202, it82302),
and they support different hardware features.
Listing the IT82202 hardware features as following:
- RISC-V RV32IMAFC instruction set
- 4KB instruction cache size
- 256KB SRAM in total
- Built-in 32.768 kHz clock generator
- Embedded Flash, 512K/1024K-byte e-flash
- eSPI, SSPI, SPI slave, BRAM, KBC, PECI, UART
- GPIO, PWM, ADC, INTC, WUC, Timer, Watchdog, KB scan, JTAG
- Support 6 Voltage Comparator
- Support Cryptographic Engine
- 6 SMBus channels, with 6 DMA controller, compatible with I2C
- USB 2.0 Full-speed Controller
- USB Type-c CC Logic
- USB Power Delivery
Supported Features
==================
currently supports the following hardware features:
.. list-table:: Supported Features
:header-rows: 1
:widths: auto
* - Interface
- Controller
- Driver/Component
* - NVIC
- on-chip
- interrupt controller
* - FLASH
- on-chip
- flash controller
* - PINCTRL
- on-chip
- pin controller
* - ESPI
- on-chip
- espi
* - PECI
- on-chip
- peci
* - UART
- on-chip
- serial
* - GPIO
- on-chip
- gpio
* - PWM
- on-chip
- pwm
* - ADC
- on-chip
- adc
* - TIMER
- on-chip
- timer
* - WATCHDOG
- on-chip
- watchdog
* - KSCAN
- on-chip
- kscan
* - SENSOR
- on-chip
- voltage comparator
* - I2C
- on-chip
- i2c
Other hardware features are not currently supported by Zephyr.
The default configuration can be found in the
:zephyr_file:`boards/riscv/it82xx2_evb/it82xx2_evb_defconfig` Kconfig file.
Programming and debugging on it82202
************************************
In order to upload the application to the device,
you'll need our flash tool and Download board.
You can get them at: `ITE's website`_.
Wiring
=======
#. Connect the Download Board to your host computer using the USB cable.
#. Connect the it82xx2_evb to the evolution motherboard.
#. Connect the Download Board J5 to J41 on the evolution motherboard.
#. Connect the USB to UART wire to J33 on the evolution motherboard.
.. image:: it82xx2_evb_wiring.jpg
:align: center
:alt: it82xx2_evb wiring
.. note:: Be careful during connection!
Use separate wires to connect I2C pins with pins on the it82xx2_evb board.
Wiring connection is described in the table below.
+-------------+---------------+
| J5 | it82xx2_evb |
| Connector | J41 Connector |
+=============+===============+
| 2 | E0 |
+-------------+---------------+
| 3 | E7 |
+-------------+---------------+
| 4 | GND |
+-------------+---------------+
For USB to UART cable, connect the evolution motherboard as below:
+-------------+---------------+
| USB to UART | Evolution |
| cable | motherboard |
| | J33 Connector |
+=============+===============+
| RX | B0 |
+-------------+---------------+
| TX | B1 |
+-------------+---------------+
| GND | GND |
+-------------+---------------+
Building
========
#. Build :ref:`hello_world` application as you would normally do
(see :`Zephyr Getting Started Guide`_):.
.. zephyr-app-commands::
:board: it82xx2_evb
:zephyr-app: samples/hello_world
:goals: build
#. The file :file:`zephyr.bin` will be created by west.
Flashing
========
Windows
--------
Use the winflash tool to program a zephyr application
to the it82xx2 board flash.
#. Open the winflash tool and make sure the order you open the switch is right.
First, turn on the Download board switch.
Second, turn on the it82xx2_evb board switch.
Then, configure your winflash tool like below.
.. figure:: WinFlashTool_P2.jpg
:align: center
.. figure:: WinFlashTool_P4.jpg
#. Using the winflash tool flash ``zephyr.bin`` into your ITE board.
First, click the ``Load`` button and select your ``zephyr.bin`` file.
Second, click ``run`` to flash the image into board.
.. figure:: WinFlashTool_P3.jpg
:align: center
#. At this point, you have flashed your image into ITE board and
it will work if you turn on the ITE board. You can use a terminal program
to verify flashing worked correctly.
For example, open device manager to find the USB Serial Port(COM4) and use your
terminal program to connect it(Speed: 115200).
.. figure:: WinFlashTool_P1.jpg
:align: center
#. Turn on the it82xx2_evb board switch, you should see ``"Hello World! it82xx2_evb"``
sent by the board. If you don't see this message, press the Reset button and the
message should appear.
Ubuntu
--------
#. Run your favorite terminal program to listen for output.
Under Linux the terminal should be :code:`/dev/ttyUSB0`. Do not close it.
For example:
.. code-block:: console
$ minicom -D /dev/ttyUSB0 -b 115200
#. Open a second terminal window and use the Linux flash tool to flash your board.
.. code-block:: console
$ sudo ~/itetool/ite -f build/zephyr/zephyr.bin
.. note:: The source code of ITE tool can be downloaded here:
https://www.ite.com.tw/uploads/product_download/itedlb4-linux-v106.tar.bz2
#. Split first and second terminal windows to view both of them.
You should see ``"Hello World! it82xx2_evb"`` in the first terminal window.
If you don't see this message, press the Reset button and the message should appear.
Debugging
=========
it82xx2_evb board can be debugged by connecting USB to UART. We can write commands and
read messages through minicom in the Ubuntu terminal.
Troubleshooting
===============
#. If the flash tool reports a failure, re-plug the 8390 Download board or
power cycle the it82xx2_evb board and try again.
References
==========
.. target-notes::
.. _ITE's website: https://www.ite.com.tw/zh-tw/product/view?mid=169
.. _Zephyr Getting Started Guide: https://docs.zephyrproject.org/latest/getting_started/index.html

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

View file

@ -0,0 +1,218 @@
/*
* Copyright (c) ITE, All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*/
/dts-v1/;
#include <zephyr/dt-bindings/gpio/gpio.h>
#include <ite/it82xx2.dtsi>
#include <ite/it8xxx2-pinctrl-map.dtsi>
/ {
model = "IT82XX2 EV-Board";
compatible = "riscv,it82xx2-evb";
aliases {
i2c-0 = &i2c0;
peci-0 = &peci0;
led0 = &led0;
kscan0 = &kscan0;
watchdog0 = &twd0;
pwm-0 = &pwm0;
};
chosen {
zephyr,console = &uart1;
zephyr,shell-uart = &uart1;
zephyr,bt-uart = &uart2;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,flash-controller = &flashctrl;
zephyr,code-partition = &slot0_partition;
zephyr,keyboard-scan = &kscan0;
};
leds {
compatible = "gpio-leds";
led0: led_0 {
gpios = <&gpioc 0 GPIO_ACTIVE_HIGH>;
label = "Green LED";
};
};
};
&adc0 {
status = "okay";
pinctrl-0 = <&adc0_ch3_gpi3_default>;
pinctrl-names = "default";
};
/* voltage comparator for test */
&vcmp0 {
status = "okay";
scan-period = <IT8XXX2_VCMP_SCAN_PERIOD_600US>;
comparison = <IT8XXX2_VCMP_GREATER>;
threshold-mv = <2000>;
io-channels = <&adc0 3>;
};
&i2c0 {
status = "okay";
clock-frequency = <I2C_BITRATE_STANDARD>;
pinctrl-0 = <&i2c0_clk_gpb3_default
&i2c0_data_gpb4_default>;
pinctrl-names = "default";
};
&i2c1 {
status = "okay";
clock-frequency = <I2C_BITRATE_STANDARD>;
pinctrl-0 = <&i2c1_clk_gpc1_default
&i2c1_data_gpc2_default>;
pinctrl-names = "default";
};
&i2c2 {
status = "okay";
clock-frequency = <I2C_BITRATE_STANDARD>;
pinctrl-0 = <&i2c2_clk_gpf6_default
&i2c2_data_gpf7_default>;
pinctrl-names = "default";
};
&i2c3 {
status = "okay";
clock-frequency = <I2C_BITRATE_STANDARD>;
pinctrl-0 = <&i2c3_clk_gph1_default
&i2c3_data_gph2_default>;
pinctrl-names = "default";
};
&i2c4 {
status = "okay";
clock-frequency = <I2C_BITRATE_STANDARD>;
pinctrl-0 = <&i2c4_clk_gpe0_default
&i2c4_data_gpe7_default>;
pinctrl-names = "default";
};
&i2c5 {
status = "okay";
clock-frequency = <I2C_BITRATE_STANDARD>;
pinctrl-0 = <&i2c5_clk_gpa4_default
&i2c5_data_gpa5_default>;
pinctrl-names = "default";
};
&uart1 {
status = "okay";
current-speed = <115200>;
clock-frequency = <1804800>;
};
&uart2 {
status = "okay";
current-speed = <460800>;
clock-frequency = <1804800>;
};
&ite_uart1_wrapper {
status = "okay";
pinctrl-0 = <&uart1_rx_gpb0_default
&uart1_tx_gpb1_default>;
pinctrl-names = "default";
};
&ite_uart2_wrapper {
status = "okay";
pinctrl-0 = <&uart2_rx_gph1_default
&uart2_tx_gph2_default>;
pinctrl-names = "default";
};
/* pwm for test */
&pwm0 {
status = "okay";
prescaler-cx = <PWM_PRESCALER_C6>;
/*
* If we need pwm output in ITE chip power saving mode,
* then we should set frequency <=324Hz.
*/
pwm-output-frequency = <324>;
pinctrl-0 = <&pwm0_gpa0_default>;
pinctrl-names = "default";
};
/* pwm for fan */
&pwm7 {
status = "okay";
prescaler-cx = <PWM_PRESCALER_C4>;
pwm-output-frequency = <30000>;
pinctrl-0 = <&pwm7_gpa7_default>;
pinctrl-names = "default";
};
/* fan tachometer sensor */
&tach0 {
status = "okay";
channel = <IT8XXX2_TACH_CHANNEL_A>;
pulses-per-round = <2>;
pinctrl-0 = <&tach0a_gpd6_default>;
pinctrl-names = "default";
};
&kscan0 {
status = "okay";
pinctrl-0 = <&ksi0_default
&ksi1_default
&ksi2_default
&ksi3_default
&ksi4_default
&ksi5_default
&ksi6_default
&ksi7_default
&kso0_default
&kso1_default
&kso2_default
&kso3_default
&kso4_default
&kso5_default
&kso6_default
&kso7_default
&kso8_default
&kso9_default
&kso10_default
&kso11_default
&kso12_default
&kso13_default
&kso14_default
&kso15_default>;
pinctrl-names = "default";
};
&peci0 {
status = "okay";
pinctrl-0 = <&peci_gpf6_default>;
pinctrl-names = "default";
};
&flash0 {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
slot0_partition: partition@0 {
label = "image-0";
reg = <0x00000000 DT_SIZE_K(128)>;
};
slot1_partition: partition@20000 {
label = "image-1";
reg = <0x00020000 DT_SIZE_K(128)>;
};
storage_partition: partition@40000 {
label = "storage";
reg = <0x00040000 DT_SIZE_K(256)>;
};
};
};

View file

@ -0,0 +1,22 @@
identifier: it82xx2_evb
name: ITE IT82XX2 EVB
type: mcu
arch: riscv32
toolchain:
- zephyr
ram: 256
testing:
ignore_tags:
- net
- bluetooth
supported:
- adc
- espi
- gpio
- i2c
- kscan
- pm
- pwm
- tach
- uart
- watchdog

View file

@ -0,0 +1,30 @@
# Copyright (c) 2023 ITE Corporation. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
CONFIG_SOC_SERIES_RISCV32_IT8XXX2=y
CONFIG_SOC_IT8XXX2=y
CONFIG_SOC_IT82202_AX=y
CONFIG_BOARD_IT82XX2_EVB=y
CONFIG_GEN_IRQ_VECTOR_TABLE=n
# General Kernel Options
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=32768
CONFIG_XIP=y
CONFIG_INIT_STACKS=y
# UART Driver
CONFIG_SERIAL=y
CONFIG_UART_INTERRUPT_DRIVEN=y
# Console Driver
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
# GPIO Driver
CONFIG_GPIO=y
# Power Management
CONFIG_PM=y
CONFIG_PM_DEVICE=y
CONFIG_PM_POLICY_CUSTOM=y