boards: silabs: Refactor xg22 explorer kits

Move to explorer_kits directory, share configuration between
bgm220_ek4314a and xg22_ek2710a, as their pinouts are similar.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
diff --git a/boards/silabs/dev_kits/bgm220_ek4314a/board.cmake b/boards/silabs/dev_kits/bgm220_ek4314a/board.cmake
deleted file mode 100644
index a0b07f2..0000000
--- a/boards/silabs/dev_kits/bgm220_ek4314a/board.cmake
+++ /dev/null
@@ -1,8 +0,0 @@
-# Copyright The Zephyr Project Contributors
-# SPDX-License-Identifier: Apache-2.0
-
-board_runner_args(jlink "--device=BGM220PC22HNA" "--reset-after-load")
-include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
-
-board_runner_args(silabs_commander "--device=BGM220PC22HNA")
-include(${ZEPHYR_BASE}/boards/common/silabs_commander.board.cmake)
diff --git a/boards/silabs/dev_kits/bgm220_ek4314a/board.yml b/boards/silabs/dev_kits/bgm220_ek4314a/board.yml
deleted file mode 100644
index f0aa04e..0000000
--- a/boards/silabs/dev_kits/bgm220_ek4314a/board.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-board:
-  name: bgm220_ek4314a
-  full_name: BGM220 Explorer Kit (BGM220-EK4314A)
-  vendor: silabs
-  socs:
-    - name: bgm220pc22hna
diff --git a/boards/silabs/dev_kits/xg22_ek2710a/Kconfig.defconfig b/boards/silabs/dev_kits/xg22_ek2710a/Kconfig.defconfig
deleted file mode 100644
index 40a34f3..0000000
--- a/boards/silabs/dev_kits/xg22_ek2710a/Kconfig.defconfig
+++ /dev/null
@@ -1,28 +0,0 @@
-# Copyright The Zephyr Project Contributors
-# SPDX-License-Identifier: Apache-2.0
-
-if BOARD_XG22_EK2710A
-
-config LOG_BACKEND_SWO_FREQ_HZ
-	default 875000
-	depends on LOG_BACKEND_SWO
-
-if SOC_GECKO_USE_RAIL
-
-config FPU
-	default y
-
-endif # SOC_GECKO_USE_RAIL
-
-if BT
-
-config FPU
-	default y
-
-config MAIN_STACK_SIZE
-	default 3072 if PM
-	default 2304
-
-endif # BT
-
-endif # BOARD_XG22_EK2710A
diff --git a/boards/silabs/dev_kits/xg22_ek2710a/board.yml b/boards/silabs/dev_kits/xg22_ek2710a/board.yml
deleted file mode 100644
index 9d4fb22..0000000
--- a/boards/silabs/dev_kits/xg22_ek2710a/board.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-board:
-  name: xg22_ek2710a
-  full_name: EFR32xG22 Explorer Kit (xG22-EK2710A)
-  vendor: silabs
-  socs:
-    - name: efr32mg22e224f512im40
diff --git a/boards/silabs/dev_kits/xg22_ek2710a/xg22_ek2710a-pinctrl.dtsi b/boards/silabs/dev_kits/xg22_ek2710a/xg22_ek2710a-pinctrl.dtsi
deleted file mode 100644
index ced65cf..0000000
--- a/boards/silabs/dev_kits/xg22_ek2710a/xg22_ek2710a-pinctrl.dtsi
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright The Zephyr Project Contributors
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-#include <dt-bindings/pinctrl/silabs/xg22-pinctrl.h>
-
-&pinctrl {
-	itm_default: itm_default {
-		group0 {
-			pins = <GPIO_SWV_PA3>;
-			drive-push-pull;
-			output-high;
-		};
-	};
-
-	i2c0_default: i2c0_default {
-		group0 {
-			pins = <I2C0_SCL_PD2>, <I2C0_SDA_PD3>;
-			bias-pull-up;
-			drive-open-drain;
-		};
-	};
-
-	pti_default: pti_default {
-		group0 {
-			pins = <PTI_DOUT_PC4>, <PTI_DFRAME_PC5>;
-			drive-push-pull;
-			output-high;
-		};
-	};
-
-	timer0_default: timer0_default {
-		group0 {
-			pins = <TIMER0_CC0_PA4>;
-			drive-push-pull;
-			output-high;
-		};
-	};
-
-	usart1_default: usart1_default {
-		group0 {
-			pins = <USART1_TX_PA5>;
-			drive-push-pull;
-			output-high;
-		};
-
-		group1 {
-			pins = <USART1_RX_PA6>;
-			input-enable;
-			silabs,input-filter;
-		};
-	};
-};
diff --git a/boards/silabs/dev_kits/xg22_ek2710a/xg22_ek2710a.dts b/boards/silabs/dev_kits/xg22_ek2710a/xg22_ek2710a.dts
deleted file mode 100644
index 9c7fe55..0000000
--- a/boards/silabs/dev_kits/xg22_ek2710a/xg22_ek2710a.dts
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
- * Copyright The Zephyr Project Contributors
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-/dts-v1/;
-#include <silabs/xg22/efr32mg22e224f512im40.dtsi>
-#include <zephyr/dt-bindings/input/input-event-codes.h>
-#include <zephyr/dt-bindings/regulator/silabs_dcdc.h>
-#include <zephyr/dt-bindings/pwm/pwm.h>
-#include "xg22_ek2710a-pinctrl.dtsi"
-
-/ {
-	model = "Silicon Labs BRD2710A (xG22 Explorer Kit)";
-	compatible = "silabs,xg22_ek2710a", "silabs,efr32mg22";
-
-	chosen {
-		zephyr,bt-hci = &bt_hci_silabs;
-		zephyr,code-partition = &slot0_partition;
-		zephyr,console = &usart1;
-		zephyr,flash = &flash0;
-		zephyr,shell-uart = &usart1;
-		zephyr,sram = &sram0;
-		zephyr,uart-pipe = &usart1;
-	};
-
-	aliases {
-		led0 = &led0;
-		pwm-led0 = &pwm_led0;
-		sw0 = &button0;
-		watchdog0 = &wdog0;
-
-		/* If enabled, MCUboot uses this for recovery mode entrance */
-		mcuboot-led0 = &led0;
-		mcuboot-button0 = &button0;
-	};
-
-	leds {
-		compatible = "gpio-leds";
-
-		led0: led_0 {
-			gpios = <&gpioa 4 GPIO_ACTIVE_HIGH>;
-		};
-	};
-
-	pwmleds {
-		compatible = "pwm-leds";
-
-		pwm_led0: pwm_led_0 {
-			pwms = <&timer0_pwm 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
-		};
-	};
-
-	buttons {
-		compatible = "gpio-keys";
-
-		button0: button_0 {
-			gpios = <&gpioc 7 GPIO_ACTIVE_LOW>;
-			zephyr,code = <INPUT_KEY_0>;
-		};
-	};
-};
-
-&timer0 {
-	status = "okay";
-
-	timer0_pwm: pwm {
-		pinctrl-0 = <&timer0_default>;
-		pinctrl-names = "default";
-		status = "okay";
-	};
-};
-
-&cpu0 {
-	clock-frequency = <76800000>;
-};
-
-&itm {
-	pinctrl-0 = <&itm_default>;
-	pinctrl-names = "default";
-	swo-ref-frequency = <DT_FREQ_K(76800)>;
-};
-
-&hfxo {
-	ctune = <121>;
-	precision = <50>;
-	status = "okay";
-};
-
-&lfxo {
-	ctune = <42>;
-	precision = <50>;
-	status = "okay";
-};
-
-&hfrcodpll {
-	clock-frequency = <DT_FREQ_K(76800)>;
-	clocks = <&hfxo>;
-	dpll-autorecover;
-	dpll-edge = "fall";
-	dpll-lock = "phase";
-	dpll-m = <1919>;
-	dpll-n = <3839>;
-};
-
-&em23grpaclk {
-	clocks = <&lfxo>;
-};
-
-&em4grpaclk {
-	clocks = <&lfxo>;
-};
-
-&rtccclk {
-	clocks = <&lfxo>;
-};
-
-&wdog0clk {
-	clocks = <&lfxo>;
-};
-
-&usart1 {
-	pinctrl-0 = <&usart1_default>;
-	pinctrl-names = "default";
-	status = "okay";
-};
-
-&i2c0 {
-	pinctrl-0 = <&i2c0_default>;
-	pinctrl-names = "default";
-	status = "okay";
-};
-
-&wdog0 {
-	status = "okay";
-};
-
-&gpio {
-	status = "okay";
-};
-
-&gpioa {
-	status = "okay";
-};
-
-&gpiob {
-	status = "okay";
-};
-
-&gpioc {
-	status = "okay";
-};
-
-&gpiod {
-	status = "okay";
-};
-
-&rtcc0 {
-	status = "okay";
-};
-
-&adc0 {
-	status = "okay";
-};
-
-&trng {
-	status = "okay";
-};
-
-&dcdc {
-	regulator-boot-on;
-	regulator-initial-mode = <SILABS_DCDC_MODE_BUCK>;
-	status = "okay";
-};
-
-&flash0 {
-	partitions {
-		compatible = "fixed-partitions";
-		#address-cells = <1>;
-		#size-cells = <1>;
-
-		/* Reserve 48 KiB for the bootloader */
-		boot_partition: partition@0 {
-			reg = <0x00000000 DT_SIZE_K(48)>;
-			label = "mcuboot";
-			read-only;
-		};
-
-		/* Reserve 224 KiB for the application in slot 0 */
-		slot0_partition: partition@c000 {
-			reg = <0x0000c000 DT_SIZE_K(224)>;
-			label = "image-0";
-		};
-
-		/* Reserve 224 KiB for the application in slot 1 */
-		slot1_partition: partition@44000 {
-			reg = <0x00044000 DT_SIZE_K(224)>;
-			label = "image-1";
-		};
-
-		/* Set 16 KiB of storage at the end of the 512 KiB of flash */
-		storage_partition: partition@7c000 {
-			reg = <0x0007c000 DT_SIZE_K(16)>;
-			label = "storage";
-		};
-	};
-};
-
-&radio {
-	pa-voltage-mv = <1800>;
-};
-
-&bt_hci_silabs {
-	status = "okay";
-};
diff --git a/boards/silabs/explorer_kits/index.rst b/boards/silabs/explorer_kits/index.rst
new file mode 100644
index 0000000..b5333b2
--- /dev/null
+++ b/boards/silabs/explorer_kits/index.rst
@@ -0,0 +1,10 @@
+.. _explorer_kits:
+
+Explorer Kits
+#############
+
+.. toctree::
+   :maxdepth: 1
+   :glob:
+
+   **/*
diff --git a/boards/silabs/dev_kits/bgm220_ek4314a/Kconfig.bgm220_ek4314a b/boards/silabs/explorer_kits/xg22/Kconfig.bgm220_ek4314a
similarity index 100%
rename from boards/silabs/dev_kits/bgm220_ek4314a/Kconfig.bgm220_ek4314a
rename to boards/silabs/explorer_kits/xg22/Kconfig.bgm220_ek4314a
diff --git a/boards/silabs/dev_kits/bgm220_ek4314a/Kconfig.defconfig b/boards/silabs/explorer_kits/xg22/Kconfig.defconfig
similarity index 84%
rename from boards/silabs/dev_kits/bgm220_ek4314a/Kconfig.defconfig
rename to boards/silabs/explorer_kits/xg22/Kconfig.defconfig
index 7f56465..9c47fc3 100644
--- a/boards/silabs/dev_kits/bgm220_ek4314a/Kconfig.defconfig
+++ b/boards/silabs/explorer_kits/xg22/Kconfig.defconfig
@@ -1,7 +1,7 @@
 # Copyright The Zephyr Project Contributors
 # SPDX-License-Identifier: Apache-2.0
 
-if BOARD_BGM220_EK4314A
+if BOARD_BGM220_EK4314A || BOARD_XG22_EK2710A
 
 config LOG_BACKEND_SWO_FREQ_HZ
 	default 875000
@@ -18,4 +18,4 @@
 
 endif # BT
 
-endif # BOARD_BGM220_EK4314A
+endif
diff --git a/boards/silabs/dev_kits/xg22_ek2710a/Kconfig.xg22_ek2710a b/boards/silabs/explorer_kits/xg22/Kconfig.xg22_ek2710a
similarity index 100%
rename from boards/silabs/dev_kits/xg22_ek2710a/Kconfig.xg22_ek2710a
rename to boards/silabs/explorer_kits/xg22/Kconfig.xg22_ek2710a
diff --git a/boards/silabs/explorer_kits/xg22/bgm220_ek4314a.dts b/boards/silabs/explorer_kits/xg22/bgm220_ek4314a.dts
new file mode 100644
index 0000000..645fc65
--- /dev/null
+++ b/boards/silabs/explorer_kits/xg22/bgm220_ek4314a.dts
@@ -0,0 +1,14 @@
+/*
+ * Copyright The Zephyr Project Contributors
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+/dts-v1/;
+#include <silabs/xg22/bgm220pc22hna.dtsi>
+#include "xg22_explorer_kit.dtsi"
+
+/ {
+	model = "Silicon Labs BRD4314A (BGM220 Explorer Kit)";
+	compatible = "silabs,bgm220_ek4314a", "silabs,efr32bg22";
+};
diff --git a/boards/silabs/dev_kits/bgm220_ek4314a/bgm220_ek4314a.yaml b/boards/silabs/explorer_kits/xg22/bgm220_ek4314a.yaml
similarity index 100%
rename from boards/silabs/dev_kits/bgm220_ek4314a/bgm220_ek4314a.yaml
rename to boards/silabs/explorer_kits/xg22/bgm220_ek4314a.yaml
diff --git a/boards/silabs/dev_kits/bgm220_ek4314a/bgm220_ek4314a_defconfig b/boards/silabs/explorer_kits/xg22/bgm220_ek4314a_defconfig
similarity index 100%
rename from boards/silabs/dev_kits/bgm220_ek4314a/bgm220_ek4314a_defconfig
rename to boards/silabs/explorer_kits/xg22/bgm220_ek4314a_defconfig
diff --git a/boards/silabs/dev_kits/xg22_ek2710a/board.cmake b/boards/silabs/explorer_kits/xg22/board.cmake
similarity index 80%
rename from boards/silabs/dev_kits/xg22_ek2710a/board.cmake
rename to boards/silabs/explorer_kits/xg22/board.cmake
index f62e0c1..78ec4da 100644
--- a/boards/silabs/dev_kits/xg22_ek2710a/board.cmake
+++ b/boards/silabs/explorer_kits/xg22/board.cmake
@@ -4,5 +4,5 @@
 board_runner_args(jlink "--device=EFR32MG22C224F512IM40" "--reset-after-load")
 include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
 
-board_runner_args(silabs_commander "--device=EFR32MG22E224F512IM40")
+board_runner_args(silabs_commander "--device=${CONFIG_SOC}")
 include(${ZEPHYR_BASE}/boards/common/silabs_commander.board.cmake)
diff --git a/boards/silabs/explorer_kits/xg22/board.yml b/boards/silabs/explorer_kits/xg22/board.yml
new file mode 100644
index 0000000..161c154
--- /dev/null
+++ b/boards/silabs/explorer_kits/xg22/board.yml
@@ -0,0 +1,11 @@
+boards:
+  - name: bgm220_ek4314a
+    full_name: BGM220 Explorer Kit (BGM220-EK4314A)
+    vendor: silabs
+    socs:
+      - name: bgm220pc22hna
+  - name: xg22_ek2710a
+    full_name: EFR32xG22E Explorer Kit (xG22-EK2710A)
+    vendor: silabs
+    socs:
+      - name: efr32mg22e224f512im40
diff --git a/boards/silabs/dev_kits/bgm220_ek4314a/doc/index.rst b/boards/silabs/explorer_kits/xg22/doc/bgm220_ek4314a.rst
similarity index 100%
rename from boards/silabs/dev_kits/bgm220_ek4314a/doc/index.rst
rename to boards/silabs/explorer_kits/xg22/doc/bgm220_ek4314a.rst
diff --git a/boards/silabs/dev_kits/bgm220_ek4314a/doc/bgm220-ek4314a-explorer-kit.webp b/boards/silabs/explorer_kits/xg22/doc/bgm220_ek4314a.webp
similarity index 100%
rename from boards/silabs/dev_kits/bgm220_ek4314a/doc/bgm220-ek4314a-explorer-kit.webp
rename to boards/silabs/explorer_kits/xg22/doc/bgm220_ek4314a.webp
Binary files differ
diff --git a/boards/silabs/dev_kits/xg22_ek2710a/doc/img/xg22_ek2710a.png b/boards/silabs/explorer_kits/xg22/doc/xg22_ek2710a.png
similarity index 100%
rename from boards/silabs/dev_kits/xg22_ek2710a/doc/img/xg22_ek2710a.png
rename to boards/silabs/explorer_kits/xg22/doc/xg22_ek2710a.png
Binary files differ
diff --git a/boards/silabs/dev_kits/xg22_ek2710a/doc/index.rst b/boards/silabs/explorer_kits/xg22/doc/xg22_ek2710a.rst
similarity index 96%
rename from boards/silabs/dev_kits/xg22_ek2710a/doc/index.rst
rename to boards/silabs/explorer_kits/xg22/doc/xg22_ek2710a.rst
index 53d1533..66b05aa 100644
--- a/boards/silabs/dev_kits/xg22_ek2710a/doc/index.rst
+++ b/boards/silabs/explorer_kits/xg22/doc/xg22_ek2710a.rst
@@ -49,9 +49,6 @@
 | PA6   | USART1_RX   | UART Console VCOM_RX US0_RX         |
 +-------+-------------+-------------------------------------+
 
-The default configuration can be found in
-:zephyr_file:`boards/silabs/dev_kits/xg22_ek2710a/xg22_ek2710a_defconfig`
-
 System Clock
 ============
 
diff --git a/boards/silabs/explorer_kits/xg22/xg22_ek2710a.dts b/boards/silabs/explorer_kits/xg22/xg22_ek2710a.dts
new file mode 100644
index 0000000..530f9b3
--- /dev/null
+++ b/boards/silabs/explorer_kits/xg22/xg22_ek2710a.dts
@@ -0,0 +1,50 @@
+/*
+ * Copyright The Zephyr Project Contributors
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+/dts-v1/;
+#include <silabs/xg22/efr32mg22e224f512im40.dtsi>
+#include "xg22_explorer_kit.dtsi"
+
+/ {
+	model = "Silicon Labs BRD2710A (xG22 Explorer Kit)";
+	compatible = "silabs,xg22_ek2710a", "silabs,efr32mg22";
+};
+
+&radio {
+	pa-voltage-mv = <1800>;
+};
+
+&hfxo {
+	ctune = <140>;
+	precision = <50>;
+	status = "okay";
+};
+
+&lfxo {
+	ctune = <25>;
+	precision = <50>;
+	status = "okay";
+};
+
+&em23grpaclk {
+	clocks = <&lfxo>;
+};
+
+&em4grpaclk {
+	clocks = <&lfxo>;
+};
+
+&prortcclk {
+	clocks = <&lfxo>;
+};
+
+&rtccclk {
+	clocks = <&lfxo>;
+};
+
+&wdog0clk {
+	clocks = <&lfxo>;
+};
diff --git a/boards/silabs/dev_kits/xg22_ek2710a/xg22_ek2710a.yaml b/boards/silabs/explorer_kits/xg22/xg22_ek2710a.yaml
similarity index 82%
rename from boards/silabs/dev_kits/xg22_ek2710a/xg22_ek2710a.yaml
rename to boards/silabs/explorer_kits/xg22/xg22_ek2710a.yaml
index 11a3ad5..ed8b280 100644
--- a/boards/silabs/dev_kits/xg22_ek2710a/xg22_ek2710a.yaml
+++ b/boards/silabs/explorer_kits/xg22/xg22_ek2710a.yaml
@@ -1,5 +1,5 @@
 identifier: xg22_ek2710a
-name: EFR32xG22 Explorer Kit (xG22-EK2710A, BRD2710A)
+name: EFR32xG22E Explorer Kit (xG22-EK2710A, BRD2710A)
 type: mcu
 arch: arm
 ram: 32
diff --git a/boards/silabs/dev_kits/xg22_ek2710a/xg22_ek2710a_defconfig b/boards/silabs/explorer_kits/xg22/xg22_ek2710a_defconfig
similarity index 100%
rename from boards/silabs/dev_kits/xg22_ek2710a/xg22_ek2710a_defconfig
rename to boards/silabs/explorer_kits/xg22/xg22_ek2710a_defconfig
diff --git a/boards/silabs/dev_kits/bgm220_ek4314a/bgm220_ek4314a-pinctrl.dtsi b/boards/silabs/explorer_kits/xg22/xg22_explorer_kit-pinctrl.dtsi
similarity index 100%
rename from boards/silabs/dev_kits/bgm220_ek4314a/bgm220_ek4314a-pinctrl.dtsi
rename to boards/silabs/explorer_kits/xg22/xg22_explorer_kit-pinctrl.dtsi
diff --git a/boards/silabs/dev_kits/bgm220_ek4314a/bgm220_ek4314a.dts b/boards/silabs/explorer_kits/xg22/xg22_explorer_kit.dtsi
similarity index 94%
rename from boards/silabs/dev_kits/bgm220_ek4314a/bgm220_ek4314a.dts
rename to boards/silabs/explorer_kits/xg22/xg22_explorer_kit.dtsi
index eba7608..ff5592d 100644
--- a/boards/silabs/dev_kits/bgm220_ek4314a/bgm220_ek4314a.dts
+++ b/boards/silabs/explorer_kits/xg22/xg22_explorer_kit.dtsi
@@ -4,18 +4,13 @@
  * SPDX-License-Identifier: Apache-2.0
  */
 
-/dts-v1/;
-#include <silabs/xg22/bgm220pc22hna.dtsi>
 #include <dt-bindings/adc/silabs-adc.h>
 #include <zephyr/dt-bindings/input/input-event-codes.h>
 #include <zephyr/dt-bindings/pwm/pwm.h>
 #include <zephyr/dt-bindings/regulator/silabs_dcdc.h>
-#include "bgm220_ek4314a-pinctrl.dtsi"
+#include "xg22_explorer_kit-pinctrl.dtsi"
 
 / {
-	model = "Silicon Labs BRD4314A (BGM220 Explorer Kit)";
-	compatible = "silabs,bgm220_ek4314a", "silabs,efr32bg22";
-
 	chosen {
 		zephyr,bt-hci = &bt_hci_silabs;
 		zephyr,code-partition = &slot0_partition;