# SPDX-License-Identifier: GPL-2.0
dtb-$(CONFIG_ARCH_SOPHGO) += cv1800b-milkv-duo.dtb
dtb-$(CONFIG_ARCH_SOPHGO) += cv1812h-huashan-pi.dtb
dtb-$(CONFIG_ARCH_SOPHGO) += sg2000-milkv-duo-s.dtb
dtb-$(CONFIG_ARCH_SOPHGO) += sg2002-milkv-duo-256m.dtb
dtb-$(CONFIG_ARCH_SOPHGO) += sg2002-licheerv-nano-b.dtb
dtb-$(CONFIG_ARCH_SOPHGO) += sg2042-milkv-pioneer.dtb
dtb-$(CONFIG_ARCH_SOPHGO) += sg2042-evb-v1.dtb
dtb-$(CONFIG_ARCH_SOPHGO) += sg2042-evb-v2.dtb
dtb-$(CONFIG_ARCH_SOPHGO) += sg2044-sophgo-srd3-10.dtb

# The C906L coprocessor overlay, selectable at runtime through armbianEnv.txt.
# The composite target below is never booted: it exists so the build applies the
# overlay to the base with fdtoverlay, which both validates that it still fits
# and is what makes Makefile.dtbs pass -@ to the base DTB. Without those
# symbols, "fdt apply" in U-Boot cannot resolve &remoteproc at boot.
sg2000-milkv-duo-s-c906l-dtbs := sg2000-milkv-duo-s.dtb overlay/sg2000-c906l.dtbo
dtb-$(CONFIG_ARCH_SOPHGO) += sg2000-milkv-duo-s-c906l.dtb
dtb-$(CONFIG_ARCH_SOPHGO) += overlay/sg2000-c906l.dtbo

# The device-mode overlay, selectable at runtime through armbianEnv.txt. Same
# arrangement as the C906L one above: the composite target is never booted, it
# is there so the build applies the overlay with fdtoverlay - which checks that
# it still fits its base - and so that Makefile.dtbs passes -@ to the base DTB.
sg2000-milkv-duo-s-usb-device-dtbs := sg2000-milkv-duo-s.dtb overlay/sg2000-usb-device.dtbo
dtb-$(CONFIG_ARCH_SOPHGO) += sg2000-milkv-duo-s-usb-device.dtb
dtb-$(CONFIG_ARCH_SOPHGO) += overlay/sg2000-usb-device.dtbo

# Pin header overlays: the 26-pin header (J3) has i2c1, i2c4, spi3, uart1,
# uart2 and two PWM chips reachable on it, and the board DTS routes pads to
# none of them. Each of these turns one of those on, selectable through
# armbianEnv.txt.
#
# One composite target covers all of them rather than one apiece. fdtoverlay
# applies them to the base in sequence, so a single build checks that every one
# still resolves against it, and through base-dtb-y in scripts/Makefile.dtbs it
# is what makes the base DTB get -@ - without those symbols U-Boot's "fdt apply"
# cannot resolve &pinctrl at boot. The result is never booted, which is just as
# well: several of these overlays want the same pads, so applying the whole set
# produces a tree that contradicts itself. dtb-y is what gives the base its -@,
# so it is installed too; only the individual .dtbo files are of use at boot.
sg2000-milkv-duo-s-header-dtbs := sg2000-milkv-duo-s.dtb \
	overlay/sg2000-i2c1.dtbo overlay/sg2000-i2c4.dtbo \
	overlay/sg2000-spi3.dtbo overlay/sg2000-spi3-spidev.dtbo \
	overlay/sg2000-uart1.dtbo overlay/sg2000-uart2.dtbo \
	overlay/sg2000-pwm0.dtbo overlay/sg2000-pwm1.dtbo
dtb-$(CONFIG_ARCH_SOPHGO) += sg2000-milkv-duo-s-header.dtb
dtb-$(CONFIG_ARCH_SOPHGO) += overlay/sg2000-i2c1.dtbo
dtb-$(CONFIG_ARCH_SOPHGO) += overlay/sg2000-i2c4.dtbo
dtb-$(CONFIG_ARCH_SOPHGO) += overlay/sg2000-spi3.dtbo
dtb-$(CONFIG_ARCH_SOPHGO) += overlay/sg2000-spi3-spidev.dtbo
dtb-$(CONFIG_ARCH_SOPHGO) += overlay/sg2000-uart1.dtbo
dtb-$(CONFIG_ARCH_SOPHGO) += overlay/sg2000-uart2.dtbo
dtb-$(CONFIG_ARCH_SOPHGO) += overlay/sg2000-pwm0.dtbo
dtb-$(CONFIG_ARCH_SOPHGO) += overlay/sg2000-pwm1.dtbo
