Эх сурвалжийг харах

Build 702, toch und langes Display

Reinhard Russinger 2 жил өмнө
parent
commit
702f61918d

+ 1 - 1
board/GfA/Display001/DTS_4.4/Display001_4.dts

@@ -224,7 +224,7 @@
                 pinctrl-names = "default";
                 pinctrl-0 = <&edt_ft5x06_pins>;
                 interrupt-parent = <&gpio2>;
-                interrupts = <1 0>;
+                interrupts = <1 8>;
                 reset-gpios = <&gpio3 21 1>;
         };
 

+ 1 - 1
board/GfA/Display001/DTS_4.4/Display001_4_2020.dts

@@ -224,7 +224,7 @@
                 pinctrl-names = "default";
                 pinctrl-0 = <&edt_ft5x06_pins>;
                 interrupt-parent = <&gpio2>;
-                interrupts = <1 0>;
+                interrupts = <1 8>;
                 reset-gpios = <&gpio3 21 1>;
         };
 

+ 1 - 1
board/GfA/Display001/DTS_4.4/Display001_4_nopruss.dts

@@ -224,7 +224,7 @@
                 pinctrl-names = "default";
                 pinctrl-0 = <&edt_ft5x06_pins>;
                 interrupt-parent = <&gpio2>;
-                interrupts = <1 0>;
+                interrupts = <1 8>;
                 reset-gpios = <&gpio3 21 1>;
         };
 

+ 19 - 26
board/GfA/Display001/DTS_4.4/Display001_7_i2c2.dts

@@ -97,17 +97,10 @@
 		};
 
 
-             /* 	i2c1_pins: pinmux_i2c1_pins { 
+                i2c2_pins: pinmux_i2c2_pins {
                         pinctrl-single,pins = <
-                                0x158 (PIN_INPUT | MUX_MODE2) */   /* spi0_d1.i2c1_sda */
-                              /*  0x15c (PIN_INPUT | MUX_MODE2) */    /* spi0_cs0.i2c1_scl */
-/*                        >;
-                };
-*/
-              	i2c2_pins: pinmux_i2c2_pins { 
-                        pinctrl-single,pins = <
-                                0x150 (PIN_INPUT_PULLUP | MUX_MODE2)    /* spi0_sclk.i2c2_sda */
-                                0x154 (PIN_INPUT_PULLUP | MUX_MODE2)    /* spi0_d0.i2c2_scl */
+                                0x150 (PIN_INPUT | MUX_MODE2)    /* spi0_sclk.i2c2_sda */
+                                0x154 (PIN_INPUT | MUX_MODE2)    /* spi0_d0.i2c2_scl */
                         >;
                 };
 
@@ -211,25 +204,24 @@
     pinctrl-names = "default";
     pinctrl-0 = <&i2c2_pins>;
     status = "okay";
-    clock-frequency = <400000>;
+    clock-frequency = <100000>;
 };
 
-
 &i2c2 {
-        polytouch: edt-ft5x06@38 {
-                compatible = "edt,edt-ft5406", "edt,edt-ft5x06";
-                reg = <0x38>;
-                pinctrl-names = "default";
-                pinctrl-0 = <&edt_ft5x06_pins>;
-                interrupt-parent = <&gpio2>;
-                interrupts = <1 0>;
-                reset-gpios = <&gpio3 21 1>;
+    polytouch: edt-ft5x06@38 {
+	compatible = "edt,edt-ft5406", "edt,edt-ft5x06";
+        reg = <0x38>;
+        pinctrl-names = "default";
+        pinctrl-0 = <&edt_ft5x06_pins>;
+        interrupt-parent = <&gpio2>;
+        interrupts = <1 8>;
+        reset-gpios = <&gpio3 21 1>;
         };
 
-        mcp7940x: rtc@6f {
-                compatible = "microchip,mcp7940x";
-                reg = <0x6f>;
-                };
+    mcp7940x: rtc@6f {
+        compatible = "microchip,mcp7940x";
+        reg = <0x6f>;
+        };
 };
 
 &spi1 {
@@ -273,7 +265,7 @@
                 sync-ctrl         = <1>;   
                 raster-order      = <0>;   
                 fifo-th           = <0>;   
-                };
+               };
 
         display-timings {
 			800x480 {
@@ -356,8 +348,9 @@
         };
 };
 
+
 / {
-	vendorinfo { 
+	vendorinfo {
 		vendor_name = "GfA Display001";
 		display_dtb = "Display001_7_i2c2.dtb";
 		display_physical_width = "153"; /* in mm */

+ 9 - 43
board/GfA/Display001/DTS_4.4/Display002_784_rs485.dts

@@ -218,7 +218,7 @@
     pinctrl-0 = <&i2c2_pins>;
     status = "okay";
     clock-frequency = <400000>;
-
+/*
         polytouch: edt-ft5x06@38 {
                         compatible = "edt,edt-ft5406", "edt,edt-ft5x06";
                         reg = <0x38>;
@@ -239,56 +239,22 @@
                         interrupt-parent = <&gpio2>;
                         interrupts = <1 8>;
                 };
-
+*/
 	mcp7940x: rtc@6f {
 		compatible = "microchip,mcp7940x";
 		reg = <0x6f>;
 		};
-};
 
+	 ads1015@48 {
+            compatible = "ti,ads1015";
+            reg = <0x48>;
+            #address-cells = <1>;
+            #size-cells = <0>;
+	    };
 
-/* / {
- i2c@3 {
-        compatible = "i2c-gpio";
-        pinctrl-names = "default";
-        pinctrl-0 = <&i2c_gpio_pins>;
-        status = "okay";
-
-        gpios = <&gpio0 2 0
-                 &gpio0 3 0
-                >;
-        i2c-gpio,delay-us = <1>;  
-        #address-cells = <1>;
-        #size-cells = <0>;
-
-        polytouch: edt-ft5x06@38 {
-                        compatible = "edt,edt-ft5406", "edt,edt-ft5x06";
-                        reg = <0x38>;
-                        pinctrl-names = "default";
-                        pinctrl-0 = <&edt_ft5x06_pins>;
-                        interrupt-parent = <&gpio2>;
-                        interrupts = <1 8>;
-                        reset-gpios = <&gpio3 21 1>;
-			max_x = <800>;
-			max_y = <480>;
-                };
+};
 
-        maxtouch: atmel_mxt_ts@4a {
-                        compatible = "atmel,maxtouch";
-			reg = <0x4a>;
-                        pinctrl-names = "default";
-                        pinctrl-0 = <&edt_ft5x06_pins>;
-                        interrupt-parent = <&gpio2>;
-                        interrupts = <1 8>;
-                };
 
-	mcp7940x: rtc@6f {
-		compatible = "microchip,mcp7940x";
-		reg = <0x6f>;
-		};
-        };
-};
-*/
 
 &spi1 {
 	pinctrl-names = "default";

+ 3 - 2
board/GfA/Display001/DTS_4.4/Display002_7_rs485.dts

@@ -241,12 +241,13 @@ i2c@3 {
                 };
 
         maxtouch: atmel_mxt_ts@4a {
-                        compatible = "atmel,maxtouch";
+                        compatible = "atmel,atmel_mxt_ts";
 			reg = <0x4a>;
+                        reset-gpios = <&gpio3 21 1>;
                         pinctrl-names = "default";
                         pinctrl-0 = <&edt_ft5x06_pins>;
                         interrupt-parent = <&gpio2>;
-                        interrupts = <1 8>;
+                        interrupts = <1 2>;
                 };
 
 	mcp7940x: rtc@6f {

+ 1 - 2
board/GfA/Display001/Display001_4.4.104_rt_defconfig

@@ -2596,8 +2596,7 @@ CONFIG_I2C_VIPERBOARD=m
 # Other I2C/SMBus bus drivers
 #
 # CONFIG_I2C_STUB is not set
-CONFIG_I2C_SLAVE=y
-CONFIG_I2C_SLAVE_EEPROM=m
+# CONFIG_I2C_SLAVE is not set
 # CONFIG_I2C_DEBUG_CORE is not set
 # CONFIG_I2C_DEBUG_ALGO is not set
 # CONFIG_I2C_DEBUG_BUS is not set

+ 93 - 0
board/GfA/Display001/linux_4.4.94_rt19/linux-041_i2c-omap_bus_busy_handling.patch

@@ -0,0 +1,93 @@
+diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
+index ccfc49f..77819c3 100644
+--- a/drivers/i2c/busses/i2c-omap.c
++++ b/drivers/i2c/busses/i2c-omap.c
+@@ -474,6 +474,73 @@ static int omap_i2c_init(struct omap_i2c_dev *omap)
+ 	return 0;
+ }
+ 
++static void omap_i2c_clock_pulse(struct omap_i2c_dev *dev)
++{
++	u32 reg;
++	int i;
++
++	/* Enable testmode */
++	reg = omap_i2c_read_reg(dev, OMAP_I2C_SYSTEST_REG);
++	reg |= OMAP_I2C_SYSTEST_ST_EN;
++	omap_i2c_write_reg(dev, OMAP_I2C_SYSTEST_REG, reg);
++
++	for (i = 0; i < 9; i++) {
++		reg |= OMAP_I2C_SYSTEST_SCL_O;
++		omap_i2c_write_reg(dev, OMAP_I2C_SYSTEST_REG, reg);
++		mdelay(100);
++		reg &= ~OMAP_I2C_SYSTEST_SCL_O;
++		omap_i2c_write_reg(dev, OMAP_I2C_SYSTEST_REG, reg);
++		mdelay(100);
++	}
++
++	/* Disable testmode */
++	reg &= ~OMAP_I2C_SYSTEST_ST_EN;
++	omap_i2c_write_reg(dev, OMAP_I2C_SYSTEST_REG, reg);
++}
++
++static void omap_i2c_bus_recover(struct omap_i2c_dev *dev)
++{
++	u32 reg1;
++	u32 reg2;
++
++	/*
++	 * First differentiate SCL stuck low from SDA stuck low using our
++	 * SYSTEST register. Depending on which line is stuck low, we will
++	 * either Reset our I2C IP (SCL stuck low) or drive 9 clock pulses on
++	 * SCL (SDA stuck low) to tell the device to release the bus.
++	 *
++	 * If, after 9 clock pulses on SCL device still doesn't release the
++	 * bus, there's nothing more we can do; we will still try to Reset
++	 * our I2C IP anyway.
++	 */
++
++	reg1 = omap_i2c_read_reg(dev, OMAP_I2C_SYSTEST_REG);
++	msleep(1);
++	reg2 = omap_i2c_read_reg(dev, OMAP_I2C_SYSTEST_REG);
++
++	if (!(reg1 & OMAP_I2C_SYSTEST_SCL_I_FUNC) &&
++			!(reg2 & OMAP_I2C_SYSTEST_SCL_I_FUNC)) {
++		dev_err(dev->dev, "SCL is stuck low, resetting\n");
++		omap_i2c_reset(dev);
++	}
++
++	if (!(reg1 & OMAP_I2C_SYSTEST_SDA_I_FUNC) &&
++			!(reg2 & OMAP_I2C_SYSTEST_SDA_I_FUNC)) {
++		dev_err(dev->dev, "SDA is stuck low, driving 9 pulses on SCL\n");
++		omap_i2c_clock_pulse(dev);
++
++		reg1 = omap_i2c_read_reg(dev, OMAP_I2C_SYSTEST_REG);
++		msleep(1);
++		reg2 = omap_i2c_read_reg(dev, OMAP_I2C_SYSTEST_REG);
++
++		if ((reg1 & OMAP_I2C_SYSTEST_SDA_I_FUNC) &&
++				(reg2 & OMAP_I2C_SYSTEST_SDA_I_FUNC)) {
++			dev_err(dev->dev, "SDA still stuck, resetting\n");
++			omap_i2c_reset(dev);
++		}
++	}
++}
++
+ /*
+  * Waiting on Bus Busy
+  */
+@@ -483,8 +550,12 @@ static int omap_i2c_wait_for_bb(struct omap_i2c_dev *omap)
+ 
+ 	timeout = jiffies + OMAP_I2C_TIMEOUT;
+ 	while (omap_i2c_read_reg(omap, OMAP_I2C_STAT_REG) & OMAP_I2C_STAT_BB) {
+-		if (time_after(jiffies, timeout))
+-			return i2c_recover_bus(&omap->adapter);
++		if (time_after(jiffies, timeout)) {
++			//return i2c_recover_bus(&omap->adapter);
++			dev_err(omap->dev, "Timeout on BusBusy -> recover\n");
++			omap_i2c_bus_recover(omap);
++			return 0;
++			}
+ 		msleep(1);
+ 	}
+ 

+ 1 - 0
board/GfA/Display001/rootfs/etc/init.d/rcS

@@ -32,6 +32,7 @@ modprobe leds_gpio
 modprobe gpio-74x164
 
 modprobe ti_am335x_adc
+modprobe ti-ads1015
 modprobe industrialio
 #=== get baseboard version
 if [ "$BASEBOARD" == "DISPLAY002" ]; then

+ 34 - 0
board/GfA/Display001/rootfs/root/DisplayTo_7inch_i2c2.sh

@@ -0,0 +1,34 @@
+#!/bin/sh
+umount /var/tmp/mnt 2> /dev/null
+rm -rf /var/tmp/mnt 2> /dev/null
+
+from=/var/tmp/mnt/Display001_7_i2c2.dtb
+to=/var/tmp/mnt/Display001.dtb
+
+such="root=/dev/mmcblk1"
+grep -q $such /proc/cmdline
+if [ $? == 0 ]
+then
+	bootpart="/dev/mmcblk1p1"
+else
+	bootpart="/dev/mmcblk0p1"
+fi  
+
+echo "Bootpart == $bootpart"
+                
+mkdir /var/tmp/mnt
+mount $bootpart /var/tmp/mnt
+
+if [ -e $from ]
+then
+	echo "copy $from --> $to"
+	cp $from $to
+	sync
+	echo "pls. reboot !!"
+else
+	echo " no such file $from"
+fi
+
+umount /var/tmp/mnt 2> /dev/null
+rm -rf /var/tmp/mnt 2> /dev/null
+

+ 1 - 1
configs/Display001_4.4.145_bone23_Qt5.7_defconfig

@@ -37,7 +37,7 @@ BR2_LINUX_KERNEL_UIMAGE=y
 BR2_LINUX_KERNEL_UIMAGE_LOADADDR="0x80008000"
 BR2_LINUX_KERNEL_DTS_SUPPORT=y
 BR2_LINUX_KERNEL_USE_CUSTOM_DTS=y
-BR2_LINUX_KERNEL_CUSTOM_DTS_PATH="../GfA/board/GfA/Display001/DTS_4.4/Display001.dts ../GfA/board/GfA/Display001/DTS_4.4/Display001_4.dts ../GfA/board/GfA/Display001/DTS_4.4/Display001_7.dts ../GfA/board/GfA/Display001/DTS_4.4/Display001_10.dts ../GfA/board/GfA/Display001/DTS_4.4/Display001_15.dts ../GfA/board/GfA/Display001/DTS_4.4/Display001_rru.dts ../GfA/board/GfA/Display001/DTS_4.4/Display001_4_nopruss.dts ../GfA/board/GfA/Display001/DTS_4.4/Display001_7_gain1.dts ../GfA/board/GfA/Display001/DTS_4.4/Display001_5.dts ../GfA/board/GfA/Display001/DTS_4.4/Display002_7.dts ../GfA/board/GfA/Display001/DTS_4.4/Display002_10.dts ../GfA/board/GfA/Display001/DTS_4.4/Display002_4.dts ../GfA/board/GfA/Display001/DTS_4.4/Display002_7_rs485.dts ../GfA/board/GfA/Display001/DTS_4.4/Display001_10_30Hz.dts ../GfA/board/GfA/Display001/DTS_4.4/Display001_7_30Hz.dts ../GfA/board/GfA/Display001/DTS_4.4/Display001_4_2020.dts ../GfA/board/GfA/Display001/DTS_4.4/Display002_10_30Hz.dts ../GfA/board/GfA/Display001/DTS_4.4/Display001_cape.dts ../GfA/board/GfA/Display001/DTS_4.4/Display001_10_i2chid.dts ../GfA/board/GfA/Display001/DTS_4.4/Display002_784_rs485.dts"
+BR2_LINUX_KERNEL_CUSTOM_DTS_PATH="../GfA/board/GfA/Display001/DTS_4.4/Display001.dts ../GfA/board/GfA/Display001/DTS_4.4/Display001_4.dts ../GfA/board/GfA/Display001/DTS_4.4/Display001_7.dts ../GfA/board/GfA/Display001/DTS_4.4/Display001_10.dts ../GfA/board/GfA/Display001/DTS_4.4/Display001_15.dts ../GfA/board/GfA/Display001/DTS_4.4/Display001_rru.dts ../GfA/board/GfA/Display001/DTS_4.4/Display001_4_nopruss.dts ../GfA/board/GfA/Display001/DTS_4.4/Display001_7_gain1.dts ../GfA/board/GfA/Display001/DTS_4.4/Display001_5.dts ../GfA/board/GfA/Display001/DTS_4.4/Display002_7.dts ../GfA/board/GfA/Display001/DTS_4.4/Display002_10.dts ../GfA/board/GfA/Display001/DTS_4.4/Display002_4.dts ../GfA/board/GfA/Display001/DTS_4.4/Display002_7_rs485.dts ../GfA/board/GfA/Display001/DTS_4.4/Display001_10_30Hz.dts ../GfA/board/GfA/Display001/DTS_4.4/Display001_7_30Hz.dts ../GfA/board/GfA/Display001/DTS_4.4/Display001_4_2020.dts ../GfA/board/GfA/Display001/DTS_4.4/Display002_10_30Hz.dts ../GfA/board/GfA/Display001/DTS_4.4/Display001_cape.dts ../GfA/board/GfA/Display001/DTS_4.4/Display001_10_i2chid.dts ../GfA/board/GfA/Display001/DTS_4.4/Display002_784_rs485.dts ../GfA/board/GfA/Display001/DTS_4.4/Display001_7_i2c2.dts"
 BR2_PACKAGE_BUSYBOX_CONFIG="../GfA/board/GfA/Display001/busybox.config"
 BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
 BR2_PACKAGE_FFMPEG_GPL=y