Skip to content

Commit 0ce7827

Browse files
committed
board: arm: Add google_kukui board
This adds support for the EC (embedded controller) on a Google reference board with codename "kukui". This board uses the STM32F098RC chip. We built an application for the board and verified UART functionality on the board. Signed-off-by: Jack Rosenthal <[email protected]> Signed-off-by: Simon Glass <[email protected]>
1 parent 2594aa4 commit 0ce7827

File tree

10 files changed

+236
-0
lines changed

10 files changed

+236
-0
lines changed

CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
/boards/arm/disco_l475_iot1/ @erwango
6363
/boards/arm/frdm*/ @MaureenHelm
6464
/boards/arm/frdm*/doc/ @MaureenHelm @MeganHansen
65+
/boards/arm/google_*/ @jackrosenthal
6566
/boards/arm/hexiwear*/ @MaureenHelm
6667
/boards/arm/hexiwear*/doc/ @MaureenHelm @MeganHansen
6768
/boards/arm/lpcxpresso*/ @MaureenHelm
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
if(CONFIG_PINMUX)
4+
zephyr_library()
5+
zephyr_library_sources(pinmux.c)
6+
zephyr_library_include_directories(${ZEPHYR_BASE}/drivers)
7+
endif()
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Google Kukui EC
2+
3+
# Copyright 2019 The Chromium OS Authors
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
config BOARD_GOOGLE_KUKUI
7+
bool "Google Kukui EC"
8+
depends on SOC_STM32F098XX
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Google Kukui EC
2+
3+
# Copyright 2019 The Chromium OS Authors
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
if BOARD_GOOGLE_KUKUI
7+
8+
config BOARD
9+
default "google_kukui"
10+
11+
if UART_CONSOLE
12+
13+
config UART_1
14+
default y
15+
16+
endif # UART_CONSOLE
17+
18+
endif # BOARD_GOOGLE_KUKUI
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# SPDX-License-Identifier: Apache-2.0
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
.. _google_kukui_board:
2+
3+
Google Kukui EC
4+
###############
5+
6+
Overview
7+
********
8+
9+
Kukui is a reference board for Chromium OS-based devices Krane and
10+
Kodama. Zephyr has support for the STM32-based embedded controller
11+
(EC) on-board.
12+
13+
Hardware
14+
********
15+
16+
- STM32F098RCH6
17+
- MT6370 battery charger
18+
- BMM150 compass
19+
- BMM160 gyroscope
20+
- Connections to the MediaTek AP
21+
22+
Supported Features
23+
==================
24+
25+
The following features are supported:
26+
27+
+-----------+------------+-------------------------------------+
28+
| Interface | Controller | Driver/Component |
29+
+===========+============+=====================================+
30+
| NVIC | on-chip | nested vector interrupt controller |
31+
+-----------+------------+-------------------------------------+
32+
| UART | on-chip | serial port-polling; |
33+
| | | serial port-interrupt |
34+
+-----------+------------+-------------------------------------+
35+
| PINMUX | on-chip | pinmux |
36+
+-----------+------------+-------------------------------------+
37+
| GPIO | on-chip | gpio |
38+
+-----------+------------+-------------------------------------+
39+
| CLOCK | on-chip | reset and clock control |
40+
+-----------+------------+-------------------------------------+
41+
| FLASH | on-chip | flash memory |
42+
+-----------+------------+-------------------------------------+
43+
| WATCHDOG | on-chip | independent watchdog |
44+
+-----------+------------+-------------------------------------+
45+
46+
Other features (such as I2C) are not available in Zephyr.
47+
48+
The default configuration can be found in the defconfig file:
49+
``boards/arm/google_kukui/google_kukui_defconfig``
50+
51+
Connections and IOs
52+
===================
53+
54+
Each of the GPIO pins can be configured by software as output
55+
(push-pull or open-drain), as input (with or without pull-up or
56+
pull-down), or as peripheral alternate function.
57+
58+
Default Zephyr Peripheral Mapping:
59+
----------------------------------
60+
61+
- UART_1 TX/RX : PA10/PA9
62+
63+
Programming and Debugging
64+
*************************
65+
66+
Build application as usual for the ``google_kukui`` board, and flash
67+
using Servo V2, μServo, or Servo V4 (CCD). See the
68+
`Chromium EC Flashing Documentation`_ for more information.
69+
70+
Debugging
71+
=========
72+
73+
Use SWD with a J-Link or ST-Link.
74+
75+
References
76+
**********
77+
78+
.. target-notes::
79+
80+
.. _Chromium EC Flashing Documentation:
81+
https://chromium.googlesource.com/chromiumos/platform/ec#Flashing-via-the-servo-debug-board
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
* Copyright (c) 2019 The Chromium OS Authors
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/dts-v1/;
8+
#include <st/f0/stm32f098Xc.dtsi>
9+
10+
/ {
11+
model = "Google Kukui EC";
12+
compatible = "st,stm32f098rc", "st,stm32f098";
13+
14+
chosen {
15+
zephyr,console = &usart1;
16+
zephyr,shell-uart = &usart1;
17+
zephyr,sram = &sram0;
18+
zephyr,flash = &flash0;
19+
};
20+
};
21+
22+
&usart1 {
23+
current-speed = <115200>;
24+
status = "okay";
25+
};
26+
27+
&flash0 {
28+
partitions {
29+
compatible = "fixed-partitions";
30+
#address-cells = <1>;
31+
#size-cells = <1>;
32+
33+
/* Set 6Kb of storage at the end of the 256Kb of flash */
34+
storage_partition: partition@3e800 {
35+
label = "storage";
36+
reg = <0x0003e800 0x00001800>;
37+
};
38+
};
39+
};
40+
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
identifier: google_kukui
2+
name: Google Kukui EC
3+
type: mcu
4+
arch: arm
5+
toolchain:
6+
- zephyr
7+
- gnuarmemb
8+
- xtools
9+
ram: 32
10+
flash: 256
11+
testing:
12+
ignore_tags:
13+
- net
14+
- bluetooth
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
# Zephyr Kernel Configuration
4+
CONFIG_ARM=y
5+
CONFIG_SOC_SERIES_STM32F0X=y
6+
7+
# Platform Configuration
8+
CONFIG_SOC_STM32F098XX=y
9+
CONFIG_BOARD_GOOGLE_KUKUI=y
10+
11+
# Serial Drivers
12+
CONFIG_SERIAL=y
13+
CONFIG_UART_INTERRUPT_DRIVEN=y
14+
15+
# Enable console
16+
CONFIG_CONSOLE=y
17+
CONFIG_UART_CONSOLE=y
18+
19+
# Pinmux Driver
20+
CONFIG_PINMUX=y
21+
22+
# GPIO Controller
23+
CONFIG_GPIO=y
24+
25+
# Clock configuration
26+
CONFIG_CLOCK_CONTROL=y
27+
28+
# Ideally, we would use HSI48, but this is not supported in
29+
# Zephyr. Use "basic" HSI (8 MHz).
30+
CONFIG_CORTEX_M_SYSTICK=y
31+
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=8000000
32+
33+
# SYSCLK selection
34+
CONFIG_CLOCK_STM32_SYSCLK_SRC_HSI=y

boards/arm/google_kukui/pinmux.c

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* Copyright (c) 2019 The Chromium OS Authors
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <kernel.h>
8+
#include <device.h>
9+
#include <init.h>
10+
#include <drivers/pinmux.h>
11+
#include <sys/sys_io.h>
12+
13+
#include <pinmux/stm32/pinmux_stm32.h>
14+
15+
static const struct pin_config pinconf[] = {
16+
#ifdef CONFIG_UART_1
17+
{STM32_PIN_PA9, STM32F0_PINMUX_FUNC_PA9_USART1_TX},
18+
{STM32_PIN_PA10, STM32F0_PINMUX_FUNC_PA10_USART1_RX},
19+
#endif /* CONFIG_UART_1 */
20+
};
21+
22+
static int pinmux_stm32_init(struct device *port)
23+
{
24+
ARG_UNUSED(port);
25+
26+
stm32_setup_pins(pinconf, ARRAY_SIZE(pinconf));
27+
28+
return 0;
29+
}
30+
31+
SYS_INIT(pinmux_stm32_init, PRE_KERNEL_1,
32+
CONFIG_PINMUX_STM32_DEVICE_INITIALIZATION_PRIORITY);

0 commit comments

Comments
 (0)