-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Add support for STM32F098xx SOC and Google Kukui reference board #20592
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
Merged
Merged
Changes from all commits
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
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 @@ | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| if(CONFIG_PINMUX) | ||
| zephyr_library() | ||
| zephyr_library_sources(pinmux.c) | ||
| zephyr_library_include_directories(${ZEPHYR_BASE}/drivers) | ||
| endif() |
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 @@ | ||
| # Google Kukui EC | ||
|
|
||
| # Copyright 2019 The Chromium OS Authors | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| config BOARD_GOOGLE_KUKUI | ||
| bool "Google Kukui EC" | ||
| depends on SOC_STM32F098XX |
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,18 @@ | ||
| # Google Kukui EC | ||
|
|
||
| # Copyright 2019 The Chromium OS Authors | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| if BOARD_GOOGLE_KUKUI | ||
|
|
||
| config BOARD | ||
| default "google_kukui" | ||
|
|
||
| if UART_CONSOLE | ||
|
|
||
| config UART_1 | ||
| default y | ||
|
|
||
| endif # UART_CONSOLE | ||
|
|
||
| endif # BOARD_GOOGLE_KUKUI |
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 @@ | ||
| # SPDX-License-Identifier: Apache-2.0 |
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,81 @@ | ||
| .. _google_kukui_board: | ||
|
|
||
| Google Kukui EC | ||
| ############### | ||
|
|
||
| Overview | ||
| ******** | ||
|
|
||
| Kukui is a reference board for Chromium OS-based devices Krane and | ||
| Kodama. Zephyr has support for the STM32-based embedded controller | ||
| (EC) on-board. | ||
|
|
||
| Hardware | ||
| ******** | ||
|
|
||
| - STM32F098RCH6 | ||
| - MT6370 battery charger | ||
| - BMM150 compass | ||
| - BMM160 gyroscope | ||
| - Connections to the MediaTek AP | ||
|
|
||
| Supported Features | ||
| ================== | ||
|
|
||
| The following features are supported: | ||
|
|
||
| +-----------+------------+-------------------------------------+ | ||
| | Interface | Controller | Driver/Component | | ||
| +===========+============+=====================================+ | ||
| | NVIC | on-chip | nested vector interrupt controller | | ||
| +-----------+------------+-------------------------------------+ | ||
| | UART | on-chip | serial port-polling; | | ||
| | | | serial port-interrupt | | ||
| +-----------+------------+-------------------------------------+ | ||
| | PINMUX | on-chip | pinmux | | ||
| +-----------+------------+-------------------------------------+ | ||
| | GPIO | on-chip | gpio | | ||
| +-----------+------------+-------------------------------------+ | ||
| | CLOCK | on-chip | reset and clock control | | ||
| +-----------+------------+-------------------------------------+ | ||
| | FLASH | on-chip | flash memory | | ||
| +-----------+------------+-------------------------------------+ | ||
| | WATCHDOG | on-chip | independent watchdog | | ||
| +-----------+------------+-------------------------------------+ | ||
|
|
||
| Other features (such as I2C) are not available in Zephyr. | ||
|
|
||
| The default configuration can be found in the defconfig file: | ||
| ``boards/arm/google_kukui/google_kukui_defconfig`` | ||
|
|
||
| Connections and IOs | ||
| =================== | ||
|
|
||
| Each of the GPIO pins can be configured by software as output | ||
| (push-pull or open-drain), as input (with or without pull-up or | ||
| pull-down), or as peripheral alternate function. | ||
|
|
||
| Default Zephyr Peripheral Mapping: | ||
| ---------------------------------- | ||
|
|
||
| - UART_1 TX/RX : PA10/PA9 | ||
|
|
||
| Programming and Debugging | ||
| ************************* | ||
|
|
||
| Build application as usual for the ``google_kukui`` board, and flash | ||
| using Servo V2, μServo, or Servo V4 (CCD). See the | ||
| `Chromium EC Flashing Documentation`_ for more information. | ||
|
|
||
| Debugging | ||
| ========= | ||
|
|
||
| Use SWD with a J-Link or ST-Link. | ||
|
|
||
| References | ||
| ********** | ||
|
|
||
| .. target-notes:: | ||
|
|
||
| .. _Chromium EC Flashing Documentation: | ||
| https://chromium.googlesource.com/chromiumos/platform/ec#Flashing-via-the-servo-debug-board | ||
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,40 @@ | ||
| /* | ||
| * Copyright (c) 2019 The Chromium OS Authors | ||
| * | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| /dts-v1/; | ||
| #include <st/f0/stm32f098Xc.dtsi> | ||
|
|
||
| / { | ||
| model = "Google Kukui EC"; | ||
| compatible = "st,stm32f098rc", "st,stm32f098"; | ||
|
|
||
| chosen { | ||
| zephyr,console = &usart1; | ||
| zephyr,shell-uart = &usart1; | ||
| zephyr,sram = &sram0; | ||
| zephyr,flash = &flash0; | ||
| }; | ||
| }; | ||
|
|
||
| &usart1 { | ||
| current-speed = <115200>; | ||
| status = "okay"; | ||
| }; | ||
|
|
||
| &flash0 { | ||
| partitions { | ||
| compatible = "fixed-partitions"; | ||
| #address-cells = <1>; | ||
| #size-cells = <1>; | ||
|
|
||
| /* Set 6Kb of storage at the end of the 256Kb of flash */ | ||
| storage_partition: partition@3e800 { | ||
| label = "storage"; | ||
| reg = <0x0003e800 0x00001800>; | ||
| }; | ||
| }; | ||
| }; | ||
|
|
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,14 @@ | ||
| identifier: google_kukui | ||
| name: Google Kukui EC | ||
| type: mcu | ||
| arch: arm | ||
| toolchain: | ||
| - zephyr | ||
| - gnuarmemb | ||
| - xtools | ||
| ram: 32 | ||
| flash: 256 | ||
| testing: | ||
| ignore_tags: | ||
| - net | ||
| - bluetooth |
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,34 @@ | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| # Zephyr Kernel Configuration | ||
| CONFIG_ARM=y | ||
| CONFIG_SOC_SERIES_STM32F0X=y | ||
|
|
||
| # Platform Configuration | ||
| CONFIG_SOC_STM32F098XX=y | ||
| CONFIG_BOARD_GOOGLE_KUKUI=y | ||
|
|
||
| # Serial Drivers | ||
| CONFIG_SERIAL=y | ||
| CONFIG_UART_INTERRUPT_DRIVEN=y | ||
|
|
||
| # Enable console | ||
| CONFIG_CONSOLE=y | ||
| CONFIG_UART_CONSOLE=y | ||
|
|
||
| # Pinmux Driver | ||
| CONFIG_PINMUX=y | ||
|
|
||
| # GPIO Controller | ||
| CONFIG_GPIO=y | ||
|
|
||
| # Clock configuration | ||
| CONFIG_CLOCK_CONTROL=y | ||
|
|
||
| # Ideally, we would use HSI48, but this is not supported in | ||
| # Zephyr. Use "basic" HSI (8 MHz). | ||
| CONFIG_CORTEX_M_SYSTICK=y | ||
| CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=8000000 | ||
|
|
||
| # SYSCLK selection | ||
| CONFIG_CLOCK_STM32_SYSCLK_SRC_HSI=y |
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,32 @@ | ||
| /* | ||
| * Copyright (c) 2019 The Chromium OS Authors | ||
| * | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| #include <kernel.h> | ||
| #include <device.h> | ||
| #include <init.h> | ||
| #include <drivers/pinmux.h> | ||
| #include <sys/sys_io.h> | ||
|
|
||
| #include <pinmux/stm32/pinmux_stm32.h> | ||
|
|
||
| static const struct pin_config pinconf[] = { | ||
| #ifdef CONFIG_UART_1 | ||
| {STM32_PIN_PA9, STM32F0_PINMUX_FUNC_PA9_USART1_TX}, | ||
| {STM32_PIN_PA10, STM32F0_PINMUX_FUNC_PA10_USART1_RX}, | ||
| #endif /* CONFIG_UART_1 */ | ||
| }; | ||
|
|
||
| static int pinmux_stm32_init(struct device *port) | ||
| { | ||
| ARG_UNUSED(port); | ||
|
|
||
| stm32_setup_pins(pinconf, ARRAY_SIZE(pinconf)); | ||
|
|
||
| return 0; | ||
| } | ||
|
|
||
| SYS_INIT(pinmux_stm32_init, PRE_KERNEL_1, | ||
| CONFIG_PINMUX_STM32_DEVICE_INITIALIZATION_PRIORITY); |
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,21 @@ | ||
| /* | ||
| * Copyright (c) 2019 The Chromium OS Authors | ||
| * | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
| #include <mem.h> | ||
| #include <st/f0/stm32f091.dtsi> | ||
|
|
||
| / { | ||
| sram0: memory@20000000 { | ||
| reg = <0x20000000 DT_SIZE_K(32)>; | ||
| }; | ||
|
|
||
| soc { | ||
| flash-controller@40022000 { | ||
| flash0: flash@8000000 { | ||
| reg = <0x08000000 DT_SIZE_K(256)>; | ||
| }; | ||
| }; | ||
| }; | ||
| }; |
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,14 @@ | ||
| # ST Microelectronics STM32F098XX MCU | ||
jackrosenthal marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| # Copyright (c) 2019 The Chromium OS Authors | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| if SOC_STM32F098XX | ||
|
|
||
| config SOC | ||
| default "stm32f098xx" | ||
|
|
||
| config NUM_IRQS | ||
| default 31 | ||
|
|
||
| endif # SOC_STM32F098xx | ||
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
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.
Uh oh!
There was an error while loading. Please reload this page.