boards: adi: Add AD-APARD32690-SL

Add board support for the ADI AD-APARD32690-SL. The platform is based on
a MAX32690 microcontroller, it has an Arduino-Mega compatible header and
2 PMOD connectors. Also, a 10 Mbps single-pair Ethernet link is enabled
by using the ADIN1110 10BASE-T1L MAC/PHY.

Signed-off-by: Ciprian Regus <ciprian.regus@analog.com>
diff --git a/boards/adi/apard32690/Kconfig.apard32690 b/boards/adi/apard32690/Kconfig.apard32690
new file mode 100644
index 0000000..44ff6d5
--- /dev/null
+++ b/boards/adi/apard32690/Kconfig.apard32690
@@ -0,0 +1,7 @@
+# MAX32690 board configuration
+
+# Copyright (c) 2024 Analog Devices, Inc.
+# SPDX-License-Identifier: Apache-2.0
+
+config BOARD_APARD32690
+	select SOC_MAX32690_M4 if BOARD_APARD32690_MAX32690_M4
diff --git a/boards/adi/apard32690/Kconfig.defconfig b/boards/adi/apard32690/Kconfig.defconfig
new file mode 100644
index 0000000..d6fb445
--- /dev/null
+++ b/boards/adi/apard32690/Kconfig.defconfig
@@ -0,0 +1,20 @@
+# Copyright (c) 2024 Analog Devices, Inc.
+# SPDX-License-Identifier: Apache-2.0
+if BOARD_APARD32690
+
+config MDIO_INIT_PRIORITY
+	default 81
+	depends on MDIO
+
+config PHY_INIT_PRIORITY
+	default 82
+	depends on NET_L2_ETHERNET && ETH_DRIVER
+
+if NETWORKING
+
+config NET_L2_ETHERNET
+	default y
+
+endif # NETWORKING
+
+endif # BOARD_APARD32690
diff --git a/boards/adi/apard32690/apard32690_max32690_m4.dts b/boards/adi/apard32690/apard32690_max32690_m4.dts
new file mode 100644
index 0000000..0de11f8
--- /dev/null
+++ b/boards/adi/apard32690/apard32690_max32690_m4.dts
@@ -0,0 +1,153 @@
+/*
+ * Copyright (c) 2024 Analog Devices, Inc.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+/dts-v1/;
+
+#include <adi/max32/max32690.dtsi>
+#include <adi/max32/max32690-pinctrl.dtsi>
+#include <zephyr/dt-bindings/gpio/adi-max32-gpio.h>
+#include <zephyr/dt-bindings/input/input-event-codes.h>
+
+/ {
+	model = "Analog Devices AD-APARD32690-SL";
+	compatible = "adi,apard32690";
+
+	chosen {
+		zephyr,console = &uart0;
+		zephyr,shell-uart = &uart0;
+		zephyr,sram = &sram0;
+		zephyr,flash = &flash0;
+	};
+
+	leds {
+		compatible = "gpio-leds";
+		blue_led: blue_led {
+			gpios = <&gpio2 1 GPIO_ACTIVE_HIGH>;
+			label = "LED1";
+		};
+		red_led: red_led {
+			gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>;
+			label = "LED2";
+		};
+		green_led: green_led {
+			gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>;
+			label = "LED3";
+		};
+	};
+
+	buttons {
+		compatible = "gpio-keys";
+		usr_btn: usr_btn {
+			gpios = <&gpio1 27 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>;
+			label = "S2";
+			zephyr,code = <INPUT_KEY_0>;
+		};
+	};
+
+	aliases {
+		led0 = &blue_led;
+		led1 = &red_led;
+		led2 = &green_led;
+		sw0 = &usr_btn;
+	};
+};
+
+&clk_ipo {
+	status = "okay";
+};
+
+&clk_ibro {
+	status = "okay";
+};
+
+&gpio0 {
+	status = "okay";
+};
+
+&gpio1 {
+	status = "okay";
+};
+
+&gpio2 {
+	status = "okay";
+};
+
+&gpio3 {
+	status = "okay";
+};
+
+&gpio4 {
+	status = "okay";
+};
+
+&uart0 {
+	clock-source = <ADI_MAX32_PRPH_CLK_SRC_IBRO>;
+	pinctrl-0 = <&uart0a_tx_p2_12 &uart0a_rx_p2_11>;
+	pinctrl-names = "default";
+	current-speed = <115200>;
+	data-bits = <8>;
+	parity = "none";
+	status = "okay";
+};
+
+arduino_serial: &uart1 {
+	clock-source = <ADI_MAX32_PRPH_CLK_SRC_IBRO>;
+	pinctrl-0 = <&uart1a_tx_p2_16 &uart1a_rx_p2_14>;
+	pinctrl-names = "default";
+	current-speed = <115200>;
+};
+
+arduino_spi: &spi1 {
+	pinctrl-0 = <&spi1a_miso_p1_28 &spi1a_mosi_p1_29 &spi1a_sck_p1_26
+		     &spi1a_ss0_p1_23>;
+	pinctrl-names = "default";
+};
+
+&spi3a_miso_p0_20 {
+	power-source = <MAX32_VSEL_VDDIOH>;
+};
+
+&spi3a_mosi_p0_21 {
+	power-source = <MAX32_VSEL_VDDIOH>;
+};
+
+&spi3a_sck_p0_16 {
+	power-source = <MAX32_VSEL_VDDIOH>;
+};
+
+&spi3a_ss0_p0_19 {
+	power-source = <MAX32_VSEL_VDDIOH>;
+};
+
+&spi3 {
+	pinctrl-0 = <&spi3a_miso_p0_20 &spi3a_mosi_p0_21 &spi3a_sck_p0_16
+		     &spi3a_ss0_p0_19>;
+	pinctrl-names = "default";
+	status = "okay";
+
+	adin1110: adin1110@0 {
+		compatible = "adi,adin1110";
+		reg = <0x0>;
+		spi-max-frequency = <DT_FREQ_M(25)>;
+		int-gpios = <&gpio0 17 (GPIO_ACTIVE_LOW | MAX32_GPIO_VSEL_VDDIOH)>;
+		reset-gpios = <&gpio0 15 (GPIO_ACTIVE_LOW | MAX32_GPIO_VSEL_VDDIOH)>;
+		status = "okay";
+
+		port1 {
+			local-mac-address = [ 00 E0 22 FE DA C9 ];
+		};
+		mdio {
+			compatible = "adi,adin2111-mdio";
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			ethernet-phy@1 {
+				reg = <0x1>;
+				compatible = "adi,adin2111-phy";
+			};
+		};
+	};
+};
diff --git a/boards/adi/apard32690/apard32690_max32690_m4.yaml b/boards/adi/apard32690/apard32690_max32690_m4.yaml
new file mode 100644
index 0000000..f108af9
--- /dev/null
+++ b/boards/adi/apard32690/apard32690_max32690_m4.yaml
@@ -0,0 +1,16 @@
+identifier: apard32690/max32690/m4
+name: apard32690 m4
+type: mcu
+arch: arm
+toolchain:
+  - zephyr
+  - gnuarmemb
+  - xtools
+supported:
+  - arduino_serial
+  - arduino_spi
+  - gpio
+  - serial
+  - spi
+ram: 1024
+flash: 3072
diff --git a/boards/adi/apard32690/apard32690_max32690_m4_defconfig b/boards/adi/apard32690/apard32690_max32690_m4_defconfig
new file mode 100644
index 0000000..a048ab2
--- /dev/null
+++ b/boards/adi/apard32690/apard32690_max32690_m4_defconfig
@@ -0,0 +1,13 @@
+# Copyright (c) 2024 Analog Devices, Inc.
+# SPDX-License-Identifier: Apache-2.0
+
+# Enable GPIO
+CONFIG_GPIO=y
+
+# Console
+CONFIG_CONSOLE=y
+CONFIG_UART_CONSOLE=y
+
+# Enable UART
+CONFIG_SERIAL=y
+CONFIG_UART_INTERRUPT_DRIVEN=y
diff --git a/boards/adi/apard32690/board.cmake b/boards/adi/apard32690/board.cmake
new file mode 100644
index 0000000..409b85f
--- /dev/null
+++ b/boards/adi/apard32690/board.cmake
@@ -0,0 +1,9 @@
+# Copyright (c) 2024 Analog Devices, Inc.
+# SPDX-License-Identifier: Apache-2.0
+
+board_runner_args(openocd --cmd-pre-init "source [find interface/cmsis-dap.cfg]")
+board_runner_args(openocd --cmd-pre-init "source [find target/max32690.cfg]")
+board_runner_args(jlink "--device=MAX32690" "--reset-after-load")
+
+include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
+include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
diff --git a/boards/adi/apard32690/board.yml b/boards/adi/apard32690/board.yml
new file mode 100644
index 0000000..269b578
--- /dev/null
+++ b/boards/adi/apard32690/board.yml
@@ -0,0 +1,8 @@
+# Copyright (c) 2024 Analog Devices, Inc.
+# SPDX-License-Identifier: Apache-2.0
+
+board:
+  name: apard32690
+  vendor: adi
+  socs:
+    - name: max32690
diff --git a/boards/adi/apard32690/doc/img/apard32690_img.webp b/boards/adi/apard32690/doc/img/apard32690_img.webp
new file mode 100644
index 0000000..b5d5372
--- /dev/null
+++ b/boards/adi/apard32690/doc/img/apard32690_img.webp
Binary files differ
diff --git a/boards/adi/apard32690/doc/index.rst b/boards/adi/apard32690/doc/index.rst
new file mode 100644
index 0000000..78e3972
--- /dev/null
+++ b/boards/adi/apard32690/doc/index.rst
@@ -0,0 +1,216 @@
+.. _ad_apard32690_sl:
+
+AD-APARD32690-SL
+################
+
+Overview
+********
+The AD-APARD32690-SL is a platform for prototyping intelligent, secure, and connected field devices.
+It has an Arduino Mega-compatible form factor and two Pmod-compatible connectors.
+The system includes the MAX32690 ARM Cortex-M4 with FPU-Based Microcontroller and Bluetooth LE 5.2.
+The MCU is coupled with external RAM (2 x 512 Mb) and Flash (64 Mb) memories to meet the requirements
+of the most demanding applications. The MAXQ1065 security coprocessor enables state of the art
+security features such as for root-of-trust, mutual authentication, data confidentiality and
+integrity, secure boot, and secure communications.
+A 10 Mbps single-pair Ethernet link using the ADIN1110 10BASE-T1L MAC/PHY, enables remote
+data acquisition and system configuration. The 10BASE-T1L interface also supports Single-pair
+Power over Ethernet (SPoE) and be used for powering the system via an Arduino shield implementing
+the required power circuitry.
+
+The Zephyr port is running on the MAX32690 MCU.
+
+.. image:: img/apard32690_img.webp
+   :align: center
+   :alt: AD-APARD32690-SL Front
+
+Hardware
+********
+
+- MAX32690 MCU:
+
+    - Ultra-Efficient Microcontroller for Battery-Powered Applications
+
+      - 120MHz Arm Cortex-M4 Processor with FPU
+      - 7.3728MHz and 60MHz Low-Power Oscillators
+      - External Crystal Support (32MHz required for BLE)
+      - 32.768kHz RTC Clock (Requires External Crystal)
+      - 8kHz Always-On Ultra-Low Power Oscillator
+      - 3MB Internal Flash, 1MB Internal SRAM (832kB ECC ON)
+      - TBDμW/MHz Executing from Cache at 1.1V
+      - 1.8V and 3.3V I/O with No Level Translators
+      - External Flash & SRAM Expansion Interfaces
+
+    - Bluetooth 5.2 LE Radio
+
+      - Dedicated, Ultra-Low-Power, 32-Bit RISC-V Coprocessor to Offload Timing-Critical Bluetooth Processing
+      - Fully Open-Source Bluetooth 5.2 Stack Available
+      - Supports AoA, AoD, LE Audio, and Mesh
+      - High-Throughput (2Mbps) Mode
+      - Long-Range (125kbps and 500kbps) Modes
+      - Rx Sensitivity: -97.5dBm; Tx Power: +4.5dBm
+      - Single-Ended Antenna Connection (50Ω)
+
+    - Multiple Peripherals for System Control
+
+      - 16-Channel DMA
+      - Up To Five Quad SPI Master (60MHz)/Slave (48MHz)
+      - Up To Four 1Mbaud UARTs with Flow Control
+      - Up To Two 1MHz I2C Master/Slave
+      - I2S Master/Slave
+      - Eight External Channel, 12-bit 1MSPS SAR ADC w/ on-die temperature sensor
+      - USB 2.0 Hi-Speed Device
+      - 16 Pulse Train Engines
+      - Up To Six 32-Bit Timers with 8mA High Drive
+      - Up To Two CAN 2.0 Controllers
+      - Up To Four Micro-Power Comparators
+      - 1-Wire Master
+
+    - Security and Integrity
+
+      - ChipDNA Physically Un-clonable Function (PUF)
+      - Modular Arithmetic Accelerator (MAA), True Random Number Generator (TRNG)
+      - Secure Nonvolatile Key Storage, SHA-256, AES-128/192/256
+      - Secure Boot ROM
+
+- External devices connected to the APARD32690:
+
+  - On-Board HyperRAM
+  - On-Board SPI Flash
+  - USB 2.0 Type-C interface to the MAX32690
+  - SPI PMOD connector
+  - I2C PMOD connector
+  - SWD 10-Pin Header
+  - On-Board Bluetooth 5.2 LE Radio antenna
+  - MAXQ1065 Ultralow Power Cryptographic Controller with ChipDNA
+  - ADIN1110 Robust, Industrial, Low Power 10BASE-T1L Ethernet MAC-PHY
+  - U-Blox NINA-W102 802.11b/g/n module with dual-mode Bluetooth v4.2
+  - On-Board 5V, 3.3V, 1.8V, and 1.1V voltage regulators
+  - 2-Pin external power supply terminal block (5V - 28V DC)
+  - Board Power Provided by either the USB Port or the 2-Pin connector
+  - Arduino Mega compatible header.
+  - Two general-purpose LEDs and one general purpose push button.
+
+
+Supported Features
+==================
+
+Below interfaces are supported by Zephyr on APARD32690.
+
++-----------+------------+------------------------------------+
+| Interface | Controller | Driver/Component                   |
++===========+============+====================================+
+| NVIC      | on-chip    | nested vector interrupt controller |
++-----------+------------+------------------------------------+
+| SYSTICK   | on-chip    | systick                            |
++-----------+------------+------------------------------------+
+| CLOCK     | on-chip    | clock and reset control            |
++-----------+------------+------------------------------------+
+| GPIO      | on-chip    | gpio                               |
++-----------+------------+------------------------------------+
+| UART      | on-chip    | serial                             |
++-----------+------------+------------------------------------+
+| SPI       | on-chip    | spi                                |
++-----------+------------+------------------------------------+
+| ADIN1110  | spi        | ADIN1110 10BASE-T1L mac/phy        |
++-----------+------------+------------------------------------+
+
+
+Connections and IOs
+===================
+
++-----------+---------------+---------------+--------------------------------------------------------------------------------------------------+
+| Name      | Name          | Settings      | Description                                                                                      |
++===========+===============+===============+==================================================================================================+
+| P55       | SWD TX        |               |                                                                                                  |
+|           |               | +-----------+ |  +-------------------------------------------------------------------------------+               |
+|           |               | | 1-2       | |  | Connects the SWD UART TX to the (UART) RX port of the U-Blox Nina W102.       |               |
+|           |               | +-----------+ |  +-------------------------------------------------------------------------------+               |
+|           |               | | 2-3       | |  | Connects the SWD UART TX to the UART0 TX pin of the MAX32690.                 |               |
+|           |               | +-----------+ |  +-------------------------------------------------------------------------------+               |
+|           |               |               |                                                                                                  |
++-----------+---------------+---------------+--------------------------------------------------------------------------------------------------+
+| P50       | SWD RX        | +-----------+ |  +-------------------------------------------------------------------------------+               |
+|           |               | | 1-2       | |  | Connects the SWD UART RX to the (UART) TX port of the U-Blox Nina W102.       |               |
+|           |               | +-----------+ |  +-------------------------------------------------------------------------------+               |
+|           |               | | 2-3       | |  | Connects the SWD UART RX to the UART0 RX pin of the MAX32690.                 |               |
+|           |               | +-----------+ |  +-------------------------------------------------------------------------------+               |
+|           |               |               |                                                                                                  |
++-----------+---------------+---------------+--------------------------------------------------------------------------------------------------+
+| P51       | SWD POW       | +-----------+ |  +-------------------------------------------------------------------------------+               |
+|           |               | | 1-2       | |  | Connects the SWD Vcc pin to 3.3V.                                             |               |
+|           |               | +-----------+ |  +-------------------------------------------------------------------------------+               |
+|           |               | | 2-3       | |  | Connects the SWD Vcc pin to 1.8V.                                             |               |
+|           |               | +-----------+ |  +-------------------------------------------------------------------------------+               |
+|           |               |               |                                                                                                  |
++-----------+---------------+---------------+--------------------------------------------------------------------------------------------------+
+| P38       | UART RX WIFI  | +-----------+ |  +-------------------------------------------------------------------------------+               |
+|           |               | | 1-2       | |  | Connect the U-Blox Nina W102 UART RX to the UART2A TX pin of the MAX32690     |               |
+|           |               | +-----------+ |  +-------------------------------------------------------------------------------+               |
+|           |               | | Open      | |  | Disconnects the U-Blox Nina W102 UART RX from the UART2A TX pin               |               |
+|           |               | +-----------+ |  +-------------------------------------------------------------------------------+               |
+|           |               |               |                                                                                                  |
++-----------+---------------+---------------+--------------------------------------------------------------------------------------------------+
+| P58       | UART TX WIFI  | +-----------+ |  +-------------------------------------------------------------------------------+               |
+|           |               | | 1-2       | |  | Connect the U-Blox Nina W102 UART TX to the UART2A RX pin of the MAX32690.    |               |
+|           |               | +-----------+ |  +-------------------------------------------------------------------------------+               |
+|           |               | | Open      | |  | Disconnects the U-Blox Nina W102 UART TX from the UART2A RX pin.              |               |
+|           |               | +-----------+ |  +-------------------------------------------------------------------------------+               |
+|           |               |               |                                                                                                  |
++-----------+---------------+---------------+--------------------------------------------------------------------------------------------------+
+| S4        | SW1           | +-----------+ |  +-------------------------------------------------------------------------------+               |
+|           |               | | On        | |  | Pulls the ADIN1110's SWPD_EN pin to 3.3V through a resistor.                  |               |
+|           |               | +-----------+ |  +-------------------------------------------------------------------------------+               |
+|           |               | | Off       | |  | Leaves the ADIN1110's SWPD_EN pin floating.                                   |               |
+|           |               | +-----------+ |  +-------------------------------------------------------------------------------+               |
+|           |               |               |                                                                                                  |
++-----------+---------------+---------------+--------------------------------------------------------------------------------------------------+
+| S4        | SW2           | +-----------+ |  +-------------------------------------------------------------------------------+               |
+|           |               | | On        | |  | Pulls the ADIN1110's CFG0 pin to 3.3V through a resistor.                     |               |
+|           |               | +-----------+ |  +-------------------------------------------------------------------------------+               |
+|           |               | | Off       | |  | Leaves the ADIN1110's CFG0 pin floating.                                      |               |
+|           |               | +-----------+ |  +-------------------------------------------------------------------------------+               |
+|           |               |               |                                                                                                  |
++-----------+---------------+---------------+--------------------------------------------------------------------------------------------------+
+| S4        | SW3           | +-----------+ |  +-------------------------------------------------------------------------------+               |
+|           |               | | On        | |  | Pulls the ADIN1110's CFG1 pin to 3.3V through a resistor.                     |               |
+|           |               | +-----------+ |  +-------------------------------------------------------------------------------+               |
+|           |               | | Off       | |  | Leaves the ADIN1110's CFG1 pin floating.                                      |               |
+|           |               | +-----------+ |  +-------------------------------------------------------------------------------+               |
+|           |               |               |                                                                                                  |
++-----------+---------------+---------------+--------------------------------------------------------------------------------------------------+
+
+
+Programming and Debugging
+*************************
+
+Flashing
+========
+
+The MAX32690 MCU can be flashed by connecting an external debug probe to the
+SWD port. SWD debug can be accessed through the Cortex 10-pin connector, P9.
+Logic levels are either 1.8V or 3.3V (based on P51 selection).
+
+Once the debug probe is connected to your host computer, then you can simply run the
+``west flash`` command to write a firmware image into flash.
+
+.. note::
+
+   This board uses OpenOCD as the default debug interface. You can also use
+   a Segger J-Link with Segger's native tooling by overriding the runner,
+   appending ``--runner jlink`` to your ``west`` command(s). The J-Link should
+   be connected to the standard 2*5 pin debug connector (P9) using an
+   appropriate adapter board and cable.
+
+Debugging
+=========
+
+Please refer to the `Flashing`_ section and run the ``west debug`` command
+instead of ``west flash``.
+
+References
+**********
+
+- `AD-APARD32690-SL web page`_
+
+.. _AD-APARD32690-SL web page:
+   https://www.analog.com/en/resources/evaluation-hardware-and-software/evaluation-boards-kits/ad-apard32690-sl.html