From f2ea1da036f7c54199c3bcb79fcbda9753f91028 Mon Sep 17 00:00:00 2001
From: ReFil <31960031+ReFil@users.noreply.github.com>
Date: Sun, 30 Jun 2024 17:59:46 +0100
Subject: [PATCH] fix(boards): Suppress devicetree warning

nRF5x boards throw a spurious warning for duplicate unit-address when the devicetree gets processed

Upstream issue:  https://github.com/zephyrproject-rtos/zephyr/issues/29713

Warning suppressed as per: https://docs.zephyrproject.org/latest/build/dts/intro-input-output.html
---
 app/boards/arm/adv360pro/pre_dt_board.cmake    | 9 +++++++++
 app/boards/arm/bluemicro840/pre_dt_board.cmake | 9 +++++++++
 app/boards/arm/bt60/pre_dt_board.cmake         | 9 +++++++++
 app/boards/arm/ckp/pre_dt_board.cmake          | 9 +++++++++
 app/boards/arm/corneish_zen/pre_dt_board.cmake | 9 +++++++++
 app/boards/arm/glove80/pre_dt_board.cmake      | 9 +++++++++
 app/boards/arm/mikoto/pre_dt_board.cmake       | 9 +++++++++
 app/boards/arm/nice60/pre_dt_board.cmake       | 9 +++++++++
 app/boards/arm/nice_nano/pre_dt_board.cmake    | 9 +++++++++
 app/boards/arm/nrf52840_m2/pre_dt_board.cmake  | 9 +++++++++
 app/boards/arm/nrfmicro/pre_dt_board.cmake     | 9 +++++++++
 app/boards/arm/pillbug/pre_dt_board.cmake      | 9 +++++++++
 app/boards/arm/puchi_ble/pre_dt_board.cmake    | 9 +++++++++
 app/boards/arm/s40nc/pre_dt_board.cmake        | 9 +++++++++
 14 files changed, 126 insertions(+)
 create mode 100644 app/boards/arm/adv360pro/pre_dt_board.cmake
 create mode 100644 app/boards/arm/bluemicro840/pre_dt_board.cmake
 create mode 100644 app/boards/arm/bt60/pre_dt_board.cmake
 create mode 100644 app/boards/arm/ckp/pre_dt_board.cmake
 create mode 100644 app/boards/arm/corneish_zen/pre_dt_board.cmake
 create mode 100644 app/boards/arm/glove80/pre_dt_board.cmake
 create mode 100644 app/boards/arm/mikoto/pre_dt_board.cmake
 create mode 100644 app/boards/arm/nice60/pre_dt_board.cmake
 create mode 100644 app/boards/arm/nice_nano/pre_dt_board.cmake
 create mode 100644 app/boards/arm/nrf52840_m2/pre_dt_board.cmake
 create mode 100644 app/boards/arm/nrfmicro/pre_dt_board.cmake
 create mode 100644 app/boards/arm/pillbug/pre_dt_board.cmake
 create mode 100644 app/boards/arm/puchi_ble/pre_dt_board.cmake
 create mode 100644 app/boards/arm/s40nc/pre_dt_board.cmake

diff --git a/app/boards/arm/adv360pro/pre_dt_board.cmake b/app/boards/arm/adv360pro/pre_dt_board.cmake
new file mode 100644
index 00000000..05b0efe5
--- /dev/null
+++ b/app/boards/arm/adv360pro/pre_dt_board.cmake
@@ -0,0 +1,9 @@
+#
+# Copyright (c) 2024 The ZMK Contributors
+# SPDX-License-Identifier: MIT
+#
+
+# Suppresses duplicate unit-address warning at build time for power, clock, acl and flash-controller
+# https://docs.zephyrproject.org/latest/build/dts/intro-input-output.html
+
+list(APPEND EXTRA_DTC_FLAGS "-Wno-unique_unit_address_if_enabled")
\ No newline at end of file
diff --git a/app/boards/arm/bluemicro840/pre_dt_board.cmake b/app/boards/arm/bluemicro840/pre_dt_board.cmake
new file mode 100644
index 00000000..05b0efe5
--- /dev/null
+++ b/app/boards/arm/bluemicro840/pre_dt_board.cmake
@@ -0,0 +1,9 @@
+#
+# Copyright (c) 2024 The ZMK Contributors
+# SPDX-License-Identifier: MIT
+#
+
+# Suppresses duplicate unit-address warning at build time for power, clock, acl and flash-controller
+# https://docs.zephyrproject.org/latest/build/dts/intro-input-output.html
+
+list(APPEND EXTRA_DTC_FLAGS "-Wno-unique_unit_address_if_enabled")
\ No newline at end of file
diff --git a/app/boards/arm/bt60/pre_dt_board.cmake b/app/boards/arm/bt60/pre_dt_board.cmake
new file mode 100644
index 00000000..05b0efe5
--- /dev/null
+++ b/app/boards/arm/bt60/pre_dt_board.cmake
@@ -0,0 +1,9 @@
+#
+# Copyright (c) 2024 The ZMK Contributors
+# SPDX-License-Identifier: MIT
+#
+
+# Suppresses duplicate unit-address warning at build time for power, clock, acl and flash-controller
+# https://docs.zephyrproject.org/latest/build/dts/intro-input-output.html
+
+list(APPEND EXTRA_DTC_FLAGS "-Wno-unique_unit_address_if_enabled")
\ No newline at end of file
diff --git a/app/boards/arm/ckp/pre_dt_board.cmake b/app/boards/arm/ckp/pre_dt_board.cmake
new file mode 100644
index 00000000..05b0efe5
--- /dev/null
+++ b/app/boards/arm/ckp/pre_dt_board.cmake
@@ -0,0 +1,9 @@
+#
+# Copyright (c) 2024 The ZMK Contributors
+# SPDX-License-Identifier: MIT
+#
+
+# Suppresses duplicate unit-address warning at build time for power, clock, acl and flash-controller
+# https://docs.zephyrproject.org/latest/build/dts/intro-input-output.html
+
+list(APPEND EXTRA_DTC_FLAGS "-Wno-unique_unit_address_if_enabled")
\ No newline at end of file
diff --git a/app/boards/arm/corneish_zen/pre_dt_board.cmake b/app/boards/arm/corneish_zen/pre_dt_board.cmake
new file mode 100644
index 00000000..05b0efe5
--- /dev/null
+++ b/app/boards/arm/corneish_zen/pre_dt_board.cmake
@@ -0,0 +1,9 @@
+#
+# Copyright (c) 2024 The ZMK Contributors
+# SPDX-License-Identifier: MIT
+#
+
+# Suppresses duplicate unit-address warning at build time for power, clock, acl and flash-controller
+# https://docs.zephyrproject.org/latest/build/dts/intro-input-output.html
+
+list(APPEND EXTRA_DTC_FLAGS "-Wno-unique_unit_address_if_enabled")
\ No newline at end of file
diff --git a/app/boards/arm/glove80/pre_dt_board.cmake b/app/boards/arm/glove80/pre_dt_board.cmake
new file mode 100644
index 00000000..05b0efe5
--- /dev/null
+++ b/app/boards/arm/glove80/pre_dt_board.cmake
@@ -0,0 +1,9 @@
+#
+# Copyright (c) 2024 The ZMK Contributors
+# SPDX-License-Identifier: MIT
+#
+
+# Suppresses duplicate unit-address warning at build time for power, clock, acl and flash-controller
+# https://docs.zephyrproject.org/latest/build/dts/intro-input-output.html
+
+list(APPEND EXTRA_DTC_FLAGS "-Wno-unique_unit_address_if_enabled")
\ No newline at end of file
diff --git a/app/boards/arm/mikoto/pre_dt_board.cmake b/app/boards/arm/mikoto/pre_dt_board.cmake
new file mode 100644
index 00000000..05b0efe5
--- /dev/null
+++ b/app/boards/arm/mikoto/pre_dt_board.cmake
@@ -0,0 +1,9 @@
+#
+# Copyright (c) 2024 The ZMK Contributors
+# SPDX-License-Identifier: MIT
+#
+
+# Suppresses duplicate unit-address warning at build time for power, clock, acl and flash-controller
+# https://docs.zephyrproject.org/latest/build/dts/intro-input-output.html
+
+list(APPEND EXTRA_DTC_FLAGS "-Wno-unique_unit_address_if_enabled")
\ No newline at end of file
diff --git a/app/boards/arm/nice60/pre_dt_board.cmake b/app/boards/arm/nice60/pre_dt_board.cmake
new file mode 100644
index 00000000..05b0efe5
--- /dev/null
+++ b/app/boards/arm/nice60/pre_dt_board.cmake
@@ -0,0 +1,9 @@
+#
+# Copyright (c) 2024 The ZMK Contributors
+# SPDX-License-Identifier: MIT
+#
+
+# Suppresses duplicate unit-address warning at build time for power, clock, acl and flash-controller
+# https://docs.zephyrproject.org/latest/build/dts/intro-input-output.html
+
+list(APPEND EXTRA_DTC_FLAGS "-Wno-unique_unit_address_if_enabled")
\ No newline at end of file
diff --git a/app/boards/arm/nice_nano/pre_dt_board.cmake b/app/boards/arm/nice_nano/pre_dt_board.cmake
new file mode 100644
index 00000000..05b0efe5
--- /dev/null
+++ b/app/boards/arm/nice_nano/pre_dt_board.cmake
@@ -0,0 +1,9 @@
+#
+# Copyright (c) 2024 The ZMK Contributors
+# SPDX-License-Identifier: MIT
+#
+
+# Suppresses duplicate unit-address warning at build time for power, clock, acl and flash-controller
+# https://docs.zephyrproject.org/latest/build/dts/intro-input-output.html
+
+list(APPEND EXTRA_DTC_FLAGS "-Wno-unique_unit_address_if_enabled")
\ No newline at end of file
diff --git a/app/boards/arm/nrf52840_m2/pre_dt_board.cmake b/app/boards/arm/nrf52840_m2/pre_dt_board.cmake
new file mode 100644
index 00000000..05b0efe5
--- /dev/null
+++ b/app/boards/arm/nrf52840_m2/pre_dt_board.cmake
@@ -0,0 +1,9 @@
+#
+# Copyright (c) 2024 The ZMK Contributors
+# SPDX-License-Identifier: MIT
+#
+
+# Suppresses duplicate unit-address warning at build time for power, clock, acl and flash-controller
+# https://docs.zephyrproject.org/latest/build/dts/intro-input-output.html
+
+list(APPEND EXTRA_DTC_FLAGS "-Wno-unique_unit_address_if_enabled")
\ No newline at end of file
diff --git a/app/boards/arm/nrfmicro/pre_dt_board.cmake b/app/boards/arm/nrfmicro/pre_dt_board.cmake
new file mode 100644
index 00000000..05b0efe5
--- /dev/null
+++ b/app/boards/arm/nrfmicro/pre_dt_board.cmake
@@ -0,0 +1,9 @@
+#
+# Copyright (c) 2024 The ZMK Contributors
+# SPDX-License-Identifier: MIT
+#
+
+# Suppresses duplicate unit-address warning at build time for power, clock, acl and flash-controller
+# https://docs.zephyrproject.org/latest/build/dts/intro-input-output.html
+
+list(APPEND EXTRA_DTC_FLAGS "-Wno-unique_unit_address_if_enabled")
\ No newline at end of file
diff --git a/app/boards/arm/pillbug/pre_dt_board.cmake b/app/boards/arm/pillbug/pre_dt_board.cmake
new file mode 100644
index 00000000..05b0efe5
--- /dev/null
+++ b/app/boards/arm/pillbug/pre_dt_board.cmake
@@ -0,0 +1,9 @@
+#
+# Copyright (c) 2024 The ZMK Contributors
+# SPDX-License-Identifier: MIT
+#
+
+# Suppresses duplicate unit-address warning at build time for power, clock, acl and flash-controller
+# https://docs.zephyrproject.org/latest/build/dts/intro-input-output.html
+
+list(APPEND EXTRA_DTC_FLAGS "-Wno-unique_unit_address_if_enabled")
\ No newline at end of file
diff --git a/app/boards/arm/puchi_ble/pre_dt_board.cmake b/app/boards/arm/puchi_ble/pre_dt_board.cmake
new file mode 100644
index 00000000..05b0efe5
--- /dev/null
+++ b/app/boards/arm/puchi_ble/pre_dt_board.cmake
@@ -0,0 +1,9 @@
+#
+# Copyright (c) 2024 The ZMK Contributors
+# SPDX-License-Identifier: MIT
+#
+
+# Suppresses duplicate unit-address warning at build time for power, clock, acl and flash-controller
+# https://docs.zephyrproject.org/latest/build/dts/intro-input-output.html
+
+list(APPEND EXTRA_DTC_FLAGS "-Wno-unique_unit_address_if_enabled")
\ No newline at end of file
diff --git a/app/boards/arm/s40nc/pre_dt_board.cmake b/app/boards/arm/s40nc/pre_dt_board.cmake
new file mode 100644
index 00000000..05b0efe5
--- /dev/null
+++ b/app/boards/arm/s40nc/pre_dt_board.cmake
@@ -0,0 +1,9 @@
+#
+# Copyright (c) 2024 The ZMK Contributors
+# SPDX-License-Identifier: MIT
+#
+
+# Suppresses duplicate unit-address warning at build time for power, clock, acl and flash-controller
+# https://docs.zephyrproject.org/latest/build/dts/intro-input-output.html
+
+list(APPEND EXTRA_DTC_FLAGS "-Wno-unique_unit_address_if_enabled")
\ No newline at end of file