boards/odroid_go: Update odroid_go board

odroid_go board was not up to date.
Fix compilation issues.
Add timers support and flash partitions.

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
This commit is contained in:
Yannis Damigos 2022-03-19 15:22:44 +02:00 committed by Carles Cufí
commit 2707500731
6 changed files with 103 additions and 38 deletions

View file

@ -1,34 +1,6 @@
# SPDX-License-Identifier: Apache-2.0
if(CONFIG_BOOTLOADER_ESP_IDF)
include(ExternalProject)
## we use hello_world project, but I think any can be used.
set(espidf_src_dir ${ESP_IDF_PATH}/examples/get-started/hello_world/)
set(espidf_prefix ${CMAKE_BINARY_DIR}/esp-idf)
set(espidf_build_dir ${espidf_prefix}/build)
ExternalProject_Add(
EspIdfBootloader
PREFIX ${espidf_prefix}
SOURCE_DIR ${espidf_src_dir}
BINARY_DIR ${espidf_src_dir}
CONFIGURE_COMMAND "" # Skip configuring the project, e.g. with autoconf
BUILD_COMMAND
PATH=$ENV{PATH}:${ESPRESSIF_TOOLCHAIN_PATH}/bin
make
IDF_PATH=${ESP_IDF_PATH}
BUILD_DIR_BASE=${espidf_build_dir}
SDKCONFIG=${espidf_build_dir}/sdkconfig
defconfig bootloader partition_table
INSTALL_COMMAND "" # This particular build system has no install command
)
add_dependencies(app EspIdfBootloader)
board_finalize_runner_args(odroid_go "--esp-flash-bootloader=${espidf_build_dir}/bootloader/bootloader.bin")
board_finalize_runner_args(odroid_go "--esp-flash-partition_table=${espidf_build_dir}/partitions_singleapp.bin")
if(CONFIG_PINMUX_ESP32)
zephyr_library()
zephyr_library_sources(board_init.c)
endif()

View file

@ -4,7 +4,7 @@
# SPDX-License-Identifier: Apache-2.0
config BOARD
default "odroid-go"
default "odroid_go"
depends on BOARD_ODROID_GO
config ENTROPY_ESP32_RNG

View file

@ -0,0 +1,28 @@
/*
* Copyright (c) 2022 Yannis Damigos
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <drivers/gpio.h>
#define LED_B_PIN DT_GPIO_PIN(DT_ALIAS(led0), gpios)
static int board_odroid_go_init(const struct device *dev)
{
ARG_UNUSED(dev);
const struct device *gpio;
gpio = device_get_binding(DT_LABEL(DT_NODELABEL(gpio0)));
if (!gpio) {
return -ENODEV;
}
/* turns blue LED off */
gpio_pin_configure(gpio, LED_B_PIN, GPIO_OUTPUT);
gpio_pin_set(gpio, LED_B_PIN, 0);
return 0;
}
SYS_INIT(board_odroid_go_init, PRE_KERNEL_2, CONFIG_PINMUX_INIT_PRIORITY);

View file

@ -9,12 +9,13 @@
/ {
model = "ODROID-GO Game Kit";
compatible = "hardkernel,odroid-go", "espressif,esp32";
compatible = "hardkernel,odroid_go", "espressif,esp32";
chosen {
zephyr,sram = &sram0;
zephyr,console = &uart0;
zephyr,shell-uart = &uart0;
zephyr,flash = &flash0;
};
leds {
@ -57,11 +58,11 @@
};
&cpu0 {
clock-frequency = <40000000>;
clock-frequency = <ESP32_CLK_CPU_240M>;
};
&cpu1 {
clock-frequency = <40000000>;
clock-frequency = <ESP32_CLK_CPU_240M>;
};
&uart0 {
@ -71,6 +72,14 @@
rx-pin = <3>;
};
&gpio0 {
status = "okay";
};
&gpio1 {
status = "okay";
};
&i2c0 {
status = "okay";
clock-frequency = <I2C_BITRATE_FAST>;
@ -78,6 +87,61 @@
scl-pin = <15>;
};
&timer0 {
status = "okay";
};
&timer1 {
status = "okay";
};
&timer2 {
status = "okay";
};
&timer3 {
status = "okay";
};
&trng0 {
status = "okay";
};
&flash0 {
status = "okay";
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
/* Reserve 60kB for the bootloader */
boot_partition: partition@1000 {
label = "mcuboot";
reg = <0x00001000 0x0000F000>;
read-only;
};
/* Reserve 1024kB for the application in slot 0 */
slot0_partition: partition@10000 {
label = "image-0";
reg = <0x00010000 0x00100000>;
};
/* Reserve 1024kB for the application in slot 1 */
slot1_partition: partition@110000 {
label = "image-1";
reg = <0x00110000 0x00100000>;
};
/* Reserve 256kB for the scratch partition */
scratch_partition: partition@210000 {
label = "image-scratch";
reg = <0x00210000 0x00040000>;
};
storage_partition: partition@250000 {
label = "storage";
reg = <0x00250000 0x00006000>;
};
};
};

View file

@ -1,4 +1,4 @@
identifier: odroid-go
identifier: odroid_go
name: ODROID-GO
type: mcu
arch: xtensa
@ -10,3 +10,4 @@ supported:
- watchdog
- uart
- pinmux
- nvs

View file

@ -7,12 +7,11 @@ CONFIG_SOC_ESP32=y
CONFIG_MAIN_STACK_SIZE=2048
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=40000000
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=240000000
CONFIG_CONSOLE=y
CONFIG_SERIAL=y
CONFIG_UART_CONSOLE=y
CONFIG_UART_ESP32=y
CONFIG_XTENSA_USE_CORE_CRT1=n
@ -26,3 +25,4 @@ CONFIG_GEN_ISR_TABLES=y
CONFIG_GEN_IRQ_VECTOR_TABLE=n
CONFIG_I2C=y
CONFIG_CLOCK_CONTROL=y