Skip to content

Commit

Permalink
tests: Add MAX78002EVKIT test overlay files
Browse files Browse the repository at this point in the history
Enable following tests for MAX78002EVKIT:
 - tests/drivers/adc/adc_api
 - tests/drivers/counter/counter_basic_api
 - tests/drivers/dma/chan_blen_transfer
 - tests/drivers/dma/loop_transfer
 - tests/drivers/flash/common
 - tests/drivers/gpio/gpio_basic_api
 - tests/drivers/i2c/i2c_target_api
 - tests/drivers/pwm/pwm_api
 - tests/drivers/spi/spi_loopback
 - tests/drivers/w1/w1_api

(cherry picked from commit ee1d4da)

Original-Signed-off-by: Furkan Akkiz <hasanfurkan.akkiz@analog.com>
GitOrigin-RevId: ee1d4da
Cr-Build-Id: 8730937883239782945
Cr-Build-Url: https://cr-buildbucket.appspot.com/build/8730937883239782945
Copybot-Job-Name: zephyr-main-copybot-downstream
Change-Id: Ie09531587af7e98dd3fa4a180636e58267569e53
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/6028795
Tested-by: Tristan Honscheid <honscheid@google.com>
Commit-Queue: Tristan Honscheid <honscheid@google.com>
Reviewed-by: Tristan Honscheid <honscheid@google.com>
Tested-by: ChromeOS Prod (Robot) <chromeos-ci-prod@chromeos-bot.iam.gserviceaccount.com>
  • Loading branch information
Furkan Akkiz authored and Chromeos LUCI committed Nov 18, 2024
1 parent 3e876f0 commit c59cf8e
Show file tree
Hide file tree
Showing 14 changed files with 256 additions and 0 deletions.
36 changes: 36 additions & 0 deletions tests/drivers/adc/adc_api/boards/max78002evkit_max78002_m4.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Copyright (c) 2024 Analog Devices, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

/ {
zephyr,user {
/* adjust channel number according to pinmux in board.dts */
io-channels = <&adc 0>, <&adc 1>;
};
};

&adc {
status = "okay";
pinctrl-0 = <&ain0_p2_0 &ain1_p2_1>;
pinctrl-names = "default";
#address-cells = <1>;
#size-cells = <0>;

channel@0 {
reg = <0>;
zephyr,gain = "ADC_GAIN_1";
zephyr,reference = "ADC_REF_INTERNAL";
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
zephyr,resolution = <12>;
};

channel@1 {
reg = <1>;
zephyr,gain = "ADC_GAIN_1";
zephyr,reference = "ADC_REF_INTERNAL";
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
zephyr,resolution = <12>;
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/*
* Copyright (c) 2024 Analog Devices, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

&timer0 {
status = "okay";
prescaler = <2>;
counter {
status = "okay";
};
};

&timer1 {
status = "okay";
prescaler = <2>;
counter {
status = "okay";
};
};

&timer2 {
status = "okay";
prescaler = <2>;
counter {
status = "okay";
};
};

&timer3 {
status = "okay";
prescaler = <2>;
counter {
status = "okay";
};
};

&lptimer0 {
status = "okay";
clock-source = <ADI_MAX32_PRPH_CLK_SRC_ERTCO>;
counter {
status = "okay";
};
};

&lptimer1 {
status = "okay";
clock-source = <ADI_MAX32_PRPH_CLK_SRC_INRO>;
counter {
status = "okay";
};
};

&clk_ertco {
status = "okay";
};

&clk_inro {
status = "okay";
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright (c) 2024 Analog Devices, Inc.
# SPDX-License-Identifier: Apache-2.0

CONFIG_CODE_DATA_RELOCATION=y
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
* Copyright (c) 2024 Analog Devices, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

tst_dma0: &dma0 { };
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
* Copyright (c) 2024 Analog Devices, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

tst_dma0: &dma0 { };
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Copyright (c) 2024 Analog Devices, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

&flash0 {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;

code_partition: partition@0 {
reg = <0x0 DT_SIZE_M(2)>;
read-only;
};

storage_partition: partition@200000 {
label = "storage";
reg = <0x200000 DT_SIZE_K(512)>;
};
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* Copyright (c) 2024 Analog Devices, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

/ {
resources {
compatible = "test-gpio-basic-api";
out-gpios = <&gpio0 8 0>;
in-gpios = <&gpio0 9 0>;
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#
# Copyright (c) 2024 Analog Devices, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
CONFIG_I2C_VIRTUAL=n
CONFIG_I2C_MAX32_DMA=y
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Copyright (c) 2024 Analog Devices, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

&i2c0 {
dmas = <&dma0 0 MAX78_DMA_SLOT_I2C0_TX>, <&dma0 1 MAX78_DMA_SLOT_I2C0_RX>;
dma-names = "tx", "rx";

eeprom0: eeprom@54 {
compatible = "zephyr,i2c-target-eeprom";
reg = <0x54>;
address-width = <16>;
size = <1024>;
};
};

&i2c1 {
status = "okay";
pinctrl-0 = <&i2c1_scl_p0_16 &i2c1_sda_p0_17>;
pinctrl-names = "default";

dmas = <&dma0 2 MAX78_DMA_SLOT_I2C1_TX>, <&dma0 3 MAX78_DMA_SLOT_I2C1_RX>;
dma-names = "tx", "rx";

eeprom1: eeprom@56 {
compatible = "zephyr,i2c-target-eeprom";
reg = <0x56>;
address-width = <16>;
size = <1024>;
};
};
24 changes: 24 additions & 0 deletions tests/drivers/pwm/pwm_api/boards/max78002evkit_max78002_m4.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright (c) 2024 Analog Devices, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

/ {
aliases {
pwm-0 = &pwm0;
};
};

&tmr0a_ioa_p0_2 {
power-source=<MAX32_VSEL_VDDIOH>;
};

&timer0 {
status = "okay";
pwm0: pwm {
status = "okay";
pinctrl-0 = <&tmr0a_ioa_p0_2>;
pinctrl-names = "default";
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#
# Copyright (c) 2024 Analog Devices, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
CONFIG_SPI_ASYNC=y
CONFIG_SPI_MAX32_INTERRUPT=y
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright (c) 2024 Analog Devices, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

&spi0 {
dmas = <&dma0 1 MAX78_DMA_SLOT_SPI0_TX>, <&dma0 2 MAX78_DMA_SLOT_SPI0_RX>;
dma-names = "tx", "rx";

slow@0 {
compatible = "test-spi-loopback-slow";
reg = <0>;
spi-max-frequency = <128000>;
};
fast@0 {
compatible = "test-spi-loopback-fast";
reg = <0>;
spi-max-frequency = <500000>;
};
};
12 changes: 12 additions & 0 deletions tests/drivers/w1/w1_api/boards/max78002evkit_max78002_m4.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* Copyright (c) 2024 Analog Devices, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

w1_0: &w1 {
status = "okay";
internal-pullup = <1>;
};

#include "../w1_devices.dtsi"
1 change: 1 addition & 0 deletions tests/drivers/w1/w1_api/testcase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,4 @@ tests:
- max32666evkit/max32666/cpu0
- max32680evkit/max32680/m4
- max32690evkit/max32690/m4
- max78002evkit/max78002/m4

0 comments on commit c59cf8e

Please sign in to comment.