From d7048c221be8f56b9bf57f17eade0186f8c42077 Mon Sep 17 00:00:00 2001 From: Robert Nelson Date: Fri, 2 Jun 2023 16:42:00 -0500 Subject: [PATCH] BeagleV: add overlays Signed-off-by: Robert Nelson --- arch/riscv/boot/dts/thead/Makefile | 5 ++ .../dts/thead/overlays/BBORG_LOAD-00A2.dts | 71 +++++++++++++++++++ .../dts/thead/overlays/BBORG_RELAY-00A2.dts | 58 +++++++++++++++ .../dts/thead/overlays/BONE-LED_P8_03.dts | 32 +++++++++ .../dts/thead/overlays/BONE-LED_P9_11.dts | 32 +++++++++ .../dts/thead/overlays/BVA-MIKROBUS-0.dts | 30 ++++++++ arch/riscv/boot/dts/thead/overlays/Makefile | 14 ++++ 7 files changed, 242 insertions(+) create mode 100644 arch/riscv/boot/dts/thead/overlays/BBORG_LOAD-00A2.dts create mode 100644 arch/riscv/boot/dts/thead/overlays/BBORG_RELAY-00A2.dts create mode 100644 arch/riscv/boot/dts/thead/overlays/BONE-LED_P8_03.dts create mode 100644 arch/riscv/boot/dts/thead/overlays/BONE-LED_P9_11.dts create mode 100644 arch/riscv/boot/dts/thead/overlays/BVA-MIKROBUS-0.dts create mode 100644 arch/riscv/boot/dts/thead/overlays/Makefile diff --git a/arch/riscv/boot/dts/thead/Makefile b/arch/riscv/boot/dts/thead/Makefile index 32ceb723c..0b3db193e 100644 --- a/arch/riscv/boot/dts/thead/Makefile +++ b/arch/riscv/boot/dts/thead/Makefile @@ -47,3 +47,8 @@ dtb-$(CONFIG_SOC_THEAD) += fire-emu.dtb fire-emu-crash.dtb dtb-$(CONFIG_SOC_THEAD) += fire-emu-soc-base.dtb fire-emu-soc-c910x4.dtb fire-emu-gpu-dpu-dsi0.dtb fire-emu-vi-dsp-vo.dtb fire-emu-vi-vp-vo.dtb dtb-$(CONFIG_SOC_THEAD) += fire-emu-soc-base-sec.dtb dtb-$(CONFIG_SOC_THEAD) += light-lpi4a-laptop.dtb + +targets += dtbs dtbs_install +targets += $(dtb-y) + +subdir-y := overlays diff --git a/arch/riscv/boot/dts/thead/overlays/BBORG_LOAD-00A2.dts b/arch/riscv/boot/dts/thead/overlays/BBORG_LOAD-00A2.dts new file mode 100644 index 000000000..21ec131ed --- /dev/null +++ b/arch/riscv/boot/dts/thead/overlays/BBORG_LOAD-00A2.dts @@ -0,0 +1,71 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright (C) 2020 - 2022 Deepak Khatri + * See Cape Interface Spec page for more info on Bone Buses + * https://docs.beagleboard.org/0.0/boards/capes/cape-interface-spec.html#beaglebone-cape-interface-spec + * + */ + +/dts-v1/; +/plugin/; + +/* + * Helper to show loaded overlays under: /proc/device-tree/chosen/overlays/ + */ +&{/chosen} { + overlays { + BBORG_LOAD-00A2 = __TIMESTAMP__; + }; +}; + +/* + * Easy load control through sysfs (/sys/class/leds/) using gpio-leds driver + */ + +&bone_led_P9_42 { + status = "okay"; + label = "load-sink1"; + default-state = "keep"; +}; + +&bone_led_P9_41 { + status = "okay"; + label = "load-sink2"; + default-state = "keep"; +}; + +&bone_led_P9_30 { + status = "okay"; + label = "load-sink3"; + default-state = "keep"; +}; + +&bone_led_P9_27 { + status = "okay"; + label = "load-sink4"; + default-state = "keep"; +}; + +&bone_led_P8_12 { + status = "okay"; + label = "load-sink5"; + default-state = "keep"; +}; + +&bone_led_P8_11 { + status = "okay"; + label = "load-sink6"; + default-state = "keep"; +}; + +&bone_led_P8_15 { + status = "okay"; + label = "load-sink7"; + default-state = "keep"; +}; + +&bone_led_P8_17 { + status = "okay"; + label = "load-sink8"; + default-state = "keep"; +}; diff --git a/arch/riscv/boot/dts/thead/overlays/BBORG_RELAY-00A2.dts b/arch/riscv/boot/dts/thead/overlays/BBORG_RELAY-00A2.dts new file mode 100644 index 000000000..defeafac5 --- /dev/null +++ b/arch/riscv/boot/dts/thead/overlays/BBORG_RELAY-00A2.dts @@ -0,0 +1,58 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright (C) 2015 Robert Nelson + * Copyright (C) 2019 Amilcar Lucas + * Copyright (C) 2020 - 2023 Deepak Khatri + * + * See Cape Interface Spec page for more info on Bone Buses + * https://docs.beagleboard.org/0.0/boards/capes/cape-interface-spec.html#beaglebone-cape-interface-spec + * + */ + +/dts-v1/; +/plugin/; + +/* + * Helper to show loaded overlays under: /proc/device-tree/chosen/overlays/ + */ +&{/chosen} { + overlays { + BBORG_RELAY-00A2.kernel = __TIMESTAMP__; + }; +}; + +/* + * Easy load control through sysfs (/sys/class/leds/) using gpio-leds driver + */ + +// relay1 +&bone_led_P9_41 { + status = "okay"; + // access: sys/class/leds/relay1 + label = "relay1"; + default-state = "keep"; +}; + +// relay2 +&bone_led_P9_42 { + status = "okay"; + // access: sys/class/leds/relay2 + label = "relay2"; + default-state = "keep"; +}; + +// realy3 +&bone_led_P9_30 { + status = "okay"; + // access: sys/class/leds/relay3 + label = "relay3"; + default-state = "keep"; +}; + +// realy4 +&bone_led_P9_27 { + status = "okay"; + // access: sys/class/leds/relay4 + label = "relay4"; + default-state = "keep"; +}; diff --git a/arch/riscv/boot/dts/thead/overlays/BONE-LED_P8_03.dts b/arch/riscv/boot/dts/thead/overlays/BONE-LED_P8_03.dts new file mode 100644 index 000000000..7af6bfc3e --- /dev/null +++ b/arch/riscv/boot/dts/thead/overlays/BONE-LED_P8_03.dts @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright (C) 2020 - 2022 Deepak Khatri + * + * See Cape Interface Spec page for more info on Bone Buses + * https://docs.beagleboard.org/0.0/boards/capes/cape-interface-spec.html#beaglebone-cape-interface-spec + * + * Virtual cape for LED on P8_03 + * Supports BBB, BBBWL, BBAI, and BBAI-64 + * + */ + +/dts-v1/; +/plugin/; + +&{/chosen} { + overlays { + BONE-LED_P8_03 = __TIMESTAMP__; + }; +}; + +/* + * Easy LED control through sysfs (/sys/class/leds/) using gpio-leds driver + */ + +&bone_led_P8_03 { + status = "okay"; + // access: sys/class/leds/led_P8_03 + label = "led_P8_03"; + linux,default-trigger = "heartbeat"; + default-state = "on"; +}; \ No newline at end of file diff --git a/arch/riscv/boot/dts/thead/overlays/BONE-LED_P9_11.dts b/arch/riscv/boot/dts/thead/overlays/BONE-LED_P9_11.dts new file mode 100644 index 000000000..76080b7e4 --- /dev/null +++ b/arch/riscv/boot/dts/thead/overlays/BONE-LED_P9_11.dts @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright (C) 2020 - 2022 Deepak Khatri + * + * See Cape Interface Spec page for more info on Bone Buses + * https://docs.beagleboard.org/0.0/boards/capes/cape-interface-spec.html#beaglebone-cape-interface-spec + * + * Virtual cape for LED on P9_11 + * Supports BBB, BBBWL, BBAI, and BBAI-64 + * + */ + +/dts-v1/; +/plugin/; + +&{/chosen} { + overlays { + BONE-LED_P9_11 = __TIMESTAMP__; + }; +}; + +/* + * Easy LED control through sysfs (/sys/class/leds/) using gpio-leds driver + */ + +&bone_led_P9_11 { + status = "okay"; + // access: sys/class/leds/led_P9_11 + label = "led_P9_11"; + linux,default-trigger = "heartbeat"; + default-state = "on"; +}; \ No newline at end of file diff --git a/arch/riscv/boot/dts/thead/overlays/BVA-MIKROBUS-0.dts b/arch/riscv/boot/dts/thead/overlays/BVA-MIKROBUS-0.dts new file mode 100644 index 000000000..ad1cd6df7 --- /dev/null +++ b/arch/riscv/boot/dts/thead/overlays/BVA-MIKROBUS-0.dts @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright (C) 2023 BeagleBoard.org - https://beagleboard.org/ + * Copyright (C) 2023 Deepak Khatri + * + * See Cape Interface Spec page for more info on Bone Buses + * https://docs.beagleboard.org/0.0/boards/capes/cape-interface-spec.html + * + */ + +/dts-v1/; +/plugin/; + + /* + * Helper to show loaded overlays under: /proc/device-tree/chosen/overlays/ + */ + +&{/chosen} { + overlays { + BBORG_LOAD-00A2 = __TIMESTAMP__; + }; +}; + +/* + * Enable mikroBus port + */ + +&bone_mikrobus0 { + status = "okay"; +}; \ No newline at end of file diff --git a/arch/riscv/boot/dts/thead/overlays/Makefile b/arch/riscv/boot/dts/thead/overlays/Makefile new file mode 100644 index 000000000..7056b7862 --- /dev/null +++ b/arch/riscv/boot/dts/thead/overlays/Makefile @@ -0,0 +1,14 @@ +# Overlays for the CONFIG_SOC_THEAD platform + +dtbo-$(CONFIG_SOC_THEAD) += \ + BBORG_LOAD-00A2.dtbo \ + BBORG_RELAY-00A2.dtbo \ + BONE-LED_P8_03.dtbo \ + BONE-LED_P9_11.dtbo \ + BVA-MIKROBUS-0.dtbo + +targets += dtbs dtbs_install +targets += $(dtbo-y) + +always-y := $(dtbo-y) +clean-files := *.dtbo