ARM: dts: dt-overlays: add support for am57xx-evm
authorTero Kristo <t-kristo@ti.com>
Mon, 27 Nov 2017 09:24:15 +0000 (11:24 +0200)
committerTero Kristo <t-kristo@ti.com>
Fri, 23 Nov 2018 08:14:54 +0000 (10:14 +0200)
Add support for building FIT image for am57xx-evm. This FIT image
includes support for base am57xx-beagle boards (rev A2 and C) and
AM57xx-evm overlay.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
arch/arm/boot/dts/Makefile
arch/arm/boot/dts/ti/Makefile [new file with mode: 0644]
arch/arm/boot/dts/ti/am57xx-evm.dtso [new file with mode: 0644]
arch/arm/boot/dts/ti/am57xx-evm.its [new file with mode: 0644]

index b934d186f95b48d8a865ea88cd15eedd88edd5c8..a9b0421d75f38c364dce55a67414701774169847 100644 (file)
@@ -755,6 +755,12 @@ dtb-$(CONFIG_SOC_DRA7XX) += \
        dra72-evm-revc.dtb \
        dra71-evm.dtb \
        dra76-evm.dtb
+dtb-merge-$(CONFIG_SOC_DRA7XX) += \
+       am57xx-evm.dtb \
+       am57xx-evm-reva3.dtb
+ifeq ($(CONFIG_SOC_DRA7XX),y)
+dts-dirs += ti
+endif
 dtb-$(CONFIG_ARCH_ORION5X) += \
        orion5x-kuroboxpro.dtb \
        orion5x-lacie-d2-network.dtb \
@@ -1210,4 +1216,20 @@ dtb-$(CONFIG_ARCH_ASPEED) += \
 
 ifeq ($(BUILD_ITBS),y)
 dtb-y=
+dtb-merge-y=
+else
+dts-dirs=
 endif
+
+always         += $(dtb-merge-y)
+
+$(addprefix $(obj)/,$(dtb-merge-y)): TI_DTBOS
+       @$(srctree)/scripts/dtb-merge $(srctree) $(objtree) $@ $(objtree)/scripts/dtc/fdtoverlay $(src)/ti
+
+TI_DTBOS:
+       $(Q)$(MAKE) $(build)=$(src)/ti
+
+PHONY += TI_DTBOS
+
+subdir-y       += $(dts-dirs)
+subdir-                += ti
diff --git a/arch/arm/boot/dts/ti/Makefile b/arch/arm/boot/dts/ti/Makefile
new file mode 100644 (file)
index 0000000..eb09c8c
--- /dev/null
@@ -0,0 +1,49 @@
+DTC_FLAGS += -@ -Wno-reg_format -Wno-avoid_default_addr_size
+DTC_FLAGS_MKIMAGE = -I dts -O dtb -p 500 -Wno-unit_address_vs_reg \
+       -i arch/arm/boot/dts/ti
+
+-include $(obj)/.itb-deps.d
+
+ifneq ($(DTC),)
+  DTC_PATH=$(dir $(DTC))
+else
+  DTC_PATH=$(objtree)/scripts/dtc
+endif
+
+quiet_cmd_mkfit = MKIMAGE -f $@
+cmd_mkfit = PATH="$(DTC_PATH):$(PATH)" $(MKIMAGE) -D "$(DTC_FLAGS_MKIMAGE)" -f $< $@
+
+define gen_itb_deps
+       @if [ -d $(obj) ] ; then \
+               echo >> $(obj)/.itb-deps.d ; \
+               echo "$(src)/$(patsubst %.its,%.itb,$(notdir $(1))): $(srctree)/$(src)/$(notdir $(1)) \\" >> $(obj)/.itb-deps.d ; \
+               cat $(1) | grep incbin | cut -d "\"" -f 2 | awk '{ printf " $(src)/%s \\\n", $$1 }' | sed '$$s/ \\$$//' >> $(obj)/.itb-deps.d ; \
+       fi
+
+endef
+
+$(obj)/.itb-deps.d:
+       @if [ -d  $(obj) ] ; then \
+               echo "$(src)/.itb-deps.d: $(src)/Makefile $(wildcard $(srctree)/$(src)/*.its)" > $(obj)/.itb-deps.d ; \
+               echo >> $(obj)/.itb-deps.d ; \
+       fi
+       $(foreach f,$(wildcard $(srctree)/$(src)/*.its),$(call gen_itb_deps,$f))
+
+$(obj)/%.dtb: $(src)/../%.dts FORCE
+       $(call if_changed_dep,dtc)
+
+$(obj)/%.dtbo: $(src)/%.dtso FORCE
+       $(call if_changed_dep,dtc)
+
+$(obj)/%.itb: $(src)/%.its FORCE
+       $(call cmd,mkfit)
+
+ifeq ($(BUILD_ITBS),y)
+dtb-$(CONFIG_SOC_DRA7XX) += am57xx-evm.itb
+else
+dtb-$(CONFIG_SOC_DRA7XX) += $(shell grep incbin $(srctree)/$(src)/*.its | grep dtb | cut -d "\"" -f 2)
+endif
+
+clean-files    := *.dtb *.dtbo *.itb
+
+always         := $(dtb-y)
diff --git a/arch/arm/boot/dts/ti/am57xx-evm.dtso b/arch/arm/boot/dts/ti/am57xx-evm.dtso
new file mode 100644 (file)
index 0000000..62ad0df
--- /dev/null
@@ -0,0 +1,138 @@
+/dts-v1/;
+/plugin/;
+#include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+  fragment@101 {
+       target-path = "/";
+
+       __overlay__ {
+               compatible = "ti,am5728-evm", "ti,am572x-beagle-x15", "ti,am5728", "ti,dra742", "ti,dra74", "ti,dra7";
+               model = "TI AM5728 EVM";
+
+               aliases {
+                       display0 = "/display";
+                       display1 = "/connector";
+               };
+
+               gpio_keys {
+                       compatible = "gpio-keys";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       autorepeat;
+
+                       USER1 {
+                               gpios = <&gpio2 23 GPIO_ACTIVE_LOW>;
+                               label = "Up";
+                               linux,code = <KEY_UP>;
+                       };
+
+                       USER2 {
+                               gpios = <&gpio2 25 GPIO_ACTIVE_LOW>;
+                               label = "Down";
+                               linux,code = <KEY_DOWN>;
+                       };
+
+                       USER3 {
+                               gpios = <&gpio2 28 GPIO_ACTIVE_LOW>;
+                               label = "Left";
+                               linux,code = <KEY_LEFT>;
+                       };
+
+                       USER4 {
+                               gpios = <&gpio2 24 GPIO_ACTIVE_LOW>;
+                               label = "Right";
+                               linux,code = <KEY_RIGHT>;
+                       };
+
+                       USER5 {
+                               gpios = <&gpio2 20 GPIO_ACTIVE_LOW>;
+                               label = "Home";
+                               linux,code = <KEY_HOME>;
+                       };
+               };
+
+               lcd0: display {
+                       compatible = "osddisplays,osd070t1718-19ts", "panel-dpi";
+                       backlight = <&lcd_bl>;
+                       enable-gpios = <&gpio2 5 GPIO_ACTIVE_HIGH>;
+                       label = "lcd";
+
+                       panel-timing {
+                               clock-frequency = <33000000>;
+                               de-active = <1>;
+                               hactive = <800>;
+                               hback-porch = <16>;
+                               hfront-porch = <210>;
+                               hsync-active = <0>;
+                               hsync-len = <30>;
+                               pixelclk-active = <1>;
+                               vactive = <480>;
+                               vback-porch = <10>;
+                               vfront-porch = <22>;
+                               vsync-active = <0>;
+                               vsync-len = <13>;
+                       };
+
+                       port {
+                               lcd_in: endpoint {
+                                       remote-endpoint = <&dpi_out>;
+                               };
+                       };
+               };
+
+               lcd_bl: backlight {
+                       compatible = "pwm-backlight";
+                       brightness-levels = <0 243 245 247 249 251 252 253 255>;
+                       default-brightness-level = <8>;
+                       pwms = <&ehrpwm1 0 50000 0>;
+               };
+       };
+  };
+};
+
+&ehrpwm1 {
+       status = "okay";
+};
+
+&epwmss1 {
+       status = "okay";
+};
+
+&i2c5 {
+       clock-frequency = <400000>;
+       status = "okay";
+
+       pixcir_ts@5c {
+               compatible = "pixcir,pixcir_tangoc";
+               attb-gpio = <&gpio2 4 GPIO_ACTIVE_HIGH>;
+               interrupt-parent = <&gpio2>;
+               interrupts = <4 0>;
+               reg = <0x5c>;
+               reset-gpio = <&gpio2 6 GPIO_ACTIVE_HIGH>;
+               touchscreen-size-x = <1024>;
+               touchscreen-size-y = <600>;
+       };
+};
+
+&uart8 {
+       status = "okay";
+};
+
+&dss {
+       ports {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               port {
+                       reg = <0>;
+
+                       dpi_out: endpoint {
+                               data-lines = <24>;
+                               remote-endpoint = <&lcd_in>;
+                       };
+               };
+       };
+};
diff --git a/arch/arm/boot/dts/ti/am57xx-evm.its b/arch/arm/boot/dts/ti/am57xx-evm.its
new file mode 100644 (file)
index 0000000..a60941e
--- /dev/null
@@ -0,0 +1,67 @@
+/dts-v1/;
+
+/ {
+       description = "AM57xx-evm";
+       #address-cells = <1>;
+
+       images {
+               kernel@1 {
+                       description = "LCPD kernel";
+                       data = /incbin/("../../zImage");
+                       type = "kernel";
+                       arch = "arm";
+                       os = "linux";
+                       compression = "none";
+                       load = <0x82000000>;
+                       entry = <0x82000000>;
+               };
+               fdt@1 {
+                       description = "AM57xx-beagle-x15";
+                       data = /incbin/("am57xx-beagle-x15.dtb");
+                       type = "flat_dt";
+                       arch = "arm";
+                       compression = "none";
+                       load = <0x83000000>;
+               };
+               fdt@2 {
+                       description = "AM57xx-beagle-x15-revc";
+                       data = /incbin/("am57xx-beagle-x15-revc.dtb");
+                       type = "flat_dt";
+                       arch = "arm";
+                       compression = "none";
+                       load = <0x83000000>;
+               };
+               fdt@3 {
+                       description = "AM57xx-evm overlay";
+                       data = /incbin/("am57xx-evm.dtbo");
+                       type = "flat_dt";
+                       arch = "arm";
+                       compression = "none";
+                       load = <0x83080000>;
+               };
+       };
+
+       configurations {
+               default = "am57xx-evm.dtb";
+               am57xx-evm.dtb {
+                       description = "AM57xx EVM";
+                       kernel = "kernel@1";
+                       fdt = "fdt@1", "fdt@3";
+               };
+               am57xx-evm-reva3.dtb {
+                       description = "AM57xx EVM rev A3";
+                       kernel = "kernel@1";
+                       fdt = "fdt@2", "fdt@3";
+               };
+               am57xx-beagle-x15.dtb {
+                       description = "AM57xx beagle-x15";
+                       kernel = "kernel@1";
+                       fdt = "fdt@1";
+               };
+               am57xx-beagle-x15-revc.dtb {
+                       description = "AM57xx beagle-x15 C";
+                       kernel = "kernel@1";
+                       fdt = "fdt@2";
+               };
+       };
+};