Bläddra i källkod

Neues 4,7 Zoll (langes)Display
clocksource für dm-timer bei Kernel 4.4

Reinhard Russinger 2 år sedan
förälder
incheckning
0fccfcaf38

+ 76 - 24
board/GfA/Display001/DTS_4.4/Display002_784_rs485.dts

@@ -97,10 +97,10 @@
 		};
 
 
-                i2c_gpio_pins: pinmux_i2c_gpio_pins {
+                i2c2_pins: pinmux_i2c2_pins {
                         pinctrl-single,pins = <
-                                0x150 (PIN_INPUT | MUX_MODE7)    /* spi0_sclk.i2c2_sda */
-                                0x154 (PIN_INPUT | MUX_MODE7)    /* spi0_d0.i2c2_scl */
+                                0x150 (PIN_INPUT | MUX_MODE2)    /* spi0_sclk.i2c2_sda */
+                                0x154 (PIN_INPUT | MUX_MODE2)    /* spi0_d0.i2c2_scl */
                         >;
                 };
 
@@ -171,9 +171,10 @@
 				>;
 				};
 
+
 		timer4_pins: pinmux_timer4_pins {
                         pinctrl-single,pins = <
-                               0x090 (PIN_OUTPUT_PULLDOWN | MUX_MODE2)  /* gpmc_advn_ale.timer4 */
+                               0x090 (/*PIN_OUTPUT_PULLDOWN |*/ MUX_MODE2)  /* gpmc_advn_ale.timer4 */
 				>;
 				};
 
@@ -212,19 +213,51 @@
 	};
 };
 
-/ {
-i2c@3 {
+&i2c2 {
+    pinctrl-names = "default";
+    pinctrl-0 = <&i2c2_pins>;
+    status = "okay";
+    clock-frequency = <400000>;
+
+        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>;
+		};
+};
+
+
+/* / {
+ i2c@3 {
         compatible = "i2c-gpio";
         pinctrl-names = "default";
         pinctrl-0 = <&i2c_gpio_pins>;
         status = "okay";
 
-        gpios = <&gpio0 2 0 /* sda */
-                 &gpio0 3 0 /* scl */
+        gpios = <&gpio0 2 0
+                 &gpio0 3 0
                 >;
-        /*i2c-gpio,sda-open-drain;
-        i2c-gpio,scl-open-drain;*/ 
-        i2c-gpio,delay-us = <1>;        /* ~200 kHz */
+        i2c-gpio,delay-us = <1>;  
         #address-cells = <1>;
         #size-cells = <0>;
 
@@ -254,8 +287,8 @@ i2c@3 {
 		reg = <0x6f>;
 		};
         };
-
 };
+*/
 
 &spi1 {
 	pinctrl-names = "default";
@@ -316,17 +349,17 @@ i2c@3 {
                };
 
         display-timings {
-			400x1280 {
-				hactive         = <400>;
+			416x1280 {
+				hactive         = <416>;
 				vactive         = <1280>;
-				hback-porch     = <30>;
+				hback-porch     = <14>;
 				hfront-porch    = <24>;
 				hsync-len       = <2>;
 				vback-porch     = <8>;
 				vfront-porch    = <8>;
 				vsync-len       = <2>;
-				clock-frequency = <33000000>;
-				hsync-active    = <0>;
+				clock-frequency = <40000000>;
+				hsync-active    = <1>;
 				vsync-active    = <0>;
 				de-active	= <1>;
 				pixelclk-active = <0>;
@@ -394,33 +427,47 @@ i2c@3 {
                 pwms = <&pwm7 0 0 0>;
         };
 
+
         pwm4: dmtimer-pwm@4 {
                 compatible = "ti,omap-dmtimer-pwm";
                 ti,timers = <&timer4>;
+		ti,clock-source = <0>;
                 #pwm-cells = <3>;
         };
 
+
         pwm5: dmtimer-pwm@5 {
                 compatible = "ti,omap-dmtimer-pwm";
                 ti,timers = <&timer5>;
+		ti,clock-source = <0>;
                 #pwm-cells = <3>;
         };
 
 	pwmleds {
 		compatible = "pwm-leds";
+
 		gfa-backlight { 
-			pwms = <&pwm4 0 1000000 0>;
+			pwms = <&pwm4 0 50000 0>;
 			label = "backlight";
 			max-brightness = <255>;
 		};
 
 		gfa-leds { 
-			pwms = <&pwm5 0 1000000 0>;
+			pwms = <&pwm5 0 50000 0>;
 			label = "led_brightness";
 			max-brightness = <255>;
 		};
 	};
 
+/*
+      backlight {
+                compatible = "pwm-backlight";
+                pwms = <&pwm4 0 50000 0>;
+                brightness-levels = <0 58 61 66 75 90 125 170 255>;
+                default-brightness-level = <8>;
+        };
+*/
+
 
 	gfa_panel_leds {
 		compatible = "gpio-leds";
@@ -436,13 +483,13 @@ i2c@3 {
 		lcdnres {
 			label = "LCDNRES";
 			gpios = <&gpio1 17 0>;
-			default-state = "off";
+			default-state = "on";
 		};
 
-		ignit {
-			label = "IGNIT";
+		nres_ad {
+			label = "NRES_AD";
 			gpios = <&gpio1 19 0>;
-			default-state = "off";
+			default-state = "on";
 		};
 
 		led0 {
@@ -472,7 +519,12 @@ i2c@3 {
 	vendorinfo { 
 		vendor_name = "GfA Display002";
 		display_dtb = "Display002_784_rs485.dtb";
-		display_physical_width = "59.40"; /* in mm */
+		/*display_physical_width = "59.40";*/ /* in mm */
+		display_physical_width = "61.78"; /* in mm */
 		display_physical_height = "190.08"; /* in mm */
 	};
+
+
+
+
 };

+ 3 - 3
board/GfA/Display001/linux_4.4.94_rt19/linux-001-Bootlogo-GfA.patch

@@ -6,7 +6,7 @@ index 6e92917..1302223 100644
  	if (fb_get_color_depth(&info->var, &info->fix) == 1)
  		erase &= ~0x400;
  	logo_height = fb_prepare_logo(info, ops->rotate);
-+	logo_height += 5;
++	logo_height += 21;
  	logo_lines = DIV_ROUND_UP(logo_height, vc->vc_font.height);
  	q = (unsigned short *) (vc->vc_origin +
  				vc->vc_size_row * rows);
@@ -20,8 +20,8 @@ index 0705d88..6a60d1ef 100644
  
 -	image.dx = 0;
 -	image.dy = y;
-+	image.dx = 0 + 5;
-+	image.dy = y + 5;
++	image.dx = 0 + 21;
++	image.dy = y + 21;
  	image.width = logo->width;
  	image.height = logo->height;
  

+ 34 - 0
board/GfA/Display001/linux_4.4.94_rt19/linux-039_ti_pwm_dm_timer_clk_source.patch

@@ -0,0 +1,34 @@
+diff --git a/drivers/pwm/pwm-omap-dmtimer.c b/drivers/pwm/pwm-omap-dmtimer.c
+index b7e6ecb..21ab848 100644
+--- a/drivers/pwm/pwm-omap-dmtimer.c
++++ b/drivers/pwm/pwm-omap-dmtimer.c
+@@ -240,13 +240,16 @@ static const struct pwm_ops pwm_omap_dmtimer_ops = {
+ 
+ static int pwm_omap_dmtimer_probe(struct platform_device *pdev)
+ {
++	extern int omap_dm_timer_set_source(struct omap_dm_timer *timer, int source);
+ 	struct device_node *np = pdev->dev.of_node;
+ 	struct device_node *timer;
+ 	struct pwm_omap_dmtimer_chip *omap;
+ 	struct pwm_omap_dmtimer_pdata *pdata;
+ 	pwm_omap_dmtimer *dm_timer;
+ 	u32 prescaler;
++	u32 v;
+ 	int status;
++	int ret;
+ 
+ 	pdata = dev_get_platdata(&pdev->dev);
+ 	if (!pdata) {
+@@ -310,6 +313,12 @@ static int pwm_omap_dmtimer_probe(struct platform_device *pdev)
+ 	if (!of_property_read_u32(pdev->dev.of_node, "ti,prescaler",
+ 				&prescaler))
+ 		omap->pdata->set_prescaler(omap->dm_timer, prescaler);
++	/* setup dmtimer clock source */
++	if (!of_property_read_u32(pdev->dev.of_node, "ti,clock-source", &v)) {
++		ret = omap_dm_timer_set_source(omap->dm_timer, v);
++		dev_dbg(&pdev->dev, "of ti,clock-source = %d (ret = %d)\n", v, ret);
++		}
++
+ 
+ 	omap->chip.dev = &pdev->dev;
+ 	omap->chip.ops = &pwm_omap_dmtimer_ops;

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

@@ -37,7 +37,7 @@ modprobe industrialio
 if [ "$BASEBOARD" == "DISPLAY002" ]; then
 	ANIN6=`cat /sys/bus/iio/devices/iio\\:device0/in_voltage6_raw`
 
-	if [ "$ANIN6" -gt "1300" -a "$ANIN6" -lt "1450" ]; then
+	if [ "$ANIN6" -gt "3650" -a "$ANIN6" -lt "3810" ]; then
 		echo "DISPLAY002_784" > /tmp/BASEBOARD
 	else
 	if [ "$ANIN6" -gt "2000" -a "$ANIN6" -lt "2100" ]; then

+ 7 - 0
board/GfA/Display001/rootfs/root/rot0.sh

@@ -0,0 +1,7 @@
+echo 0 > /sys/block/mmcblk1boot0/force_ro
+echo 0 > /sys/block/mmcblk1boot1/force_ro
+
+fw_setenv emmcboot "fatload mmc 1 0x80200000 uImage; fatload mmc 1 0x80F00000 Display001.dtb; fdt addr 0x80F00000; setenv bootargs console=ttyO0,115200 root=/dev/mmcblk1p2 rw rootwait vram=50M cma=50M fbcon=rotate:0; bootm 0x80200000 - 0x80F00000"
+
+echo 1 > /sys/block/mmcblk1boot0/force_ro
+echo 1 > /sys/block/mmcblk1boot1/force_ro

+ 7 - 0
board/GfA/Display001/rootfs/root/rot180.sh

@@ -0,0 +1,7 @@
+echo 0 > /sys/block/mmcblk1boot0/force_ro
+echo 0 > /sys/block/mmcblk1boot1/force_ro
+
+fw_setenv emmcboot "fatload mmc 1 0x80200000 uImage; fatload mmc 1 0x80F00000 Display001.dtb; fdt addr 0x80F00000; setenv bootargs console=ttyO0,115200 root=/dev/mmcblk1p2 rw rootwait vram=50M cma=50M consoleblank=0 fbcon=rotate:2; bootm 0x80200000 - 0x80F00000"
+
+echo 1 > /sys/block/mmcblk1boot0/force_ro
+echo 1 > /sys/block/mmcblk1boot1/force_ro

+ 7 - 0
board/GfA/Display001/rootfs/root/rot270.sh

@@ -0,0 +1,7 @@
+echo 0 > /sys/block/mmcblk1boot0/force_ro
+echo 0 > /sys/block/mmcblk1boot1/force_ro
+
+fw_setenv emmcboot "fatload mmc 1 0x80200000 uImage; fatload mmc 1 0x80F00000 Display001.dtb; fdt addr 0x80F00000; setenv bootargs console=ttyO0,115200 root=/dev/mmcblk1p2 rw rootwait vram=50M cma=50M fbcon=rotate:3; bootm 0x80200000 - 0x80F00000"
+
+echo 1 > /sys/block/mmcblk1boot0/force_ro
+echo 1 > /sys/block/mmcblk1boot1/force_ro

+ 7 - 0
board/GfA/Display001/rootfs/root/rot90.sh

@@ -0,0 +1,7 @@
+echo 0 > /sys/block/mmcblk1boot0/force_ro
+echo 0 > /sys/block/mmcblk1boot1/force_ro
+
+fw_setenv emmcboot "fatload mmc 1 0x80200000 uImage; fatload mmc 1 0x80F00000 Display001.dtb; fdt addr 0x80F00000; setenv bootargs console=ttyO0,115200 root=/dev/mmcblk1p2 rw rootwait vram=50M cma=50M fbcon=rotate:1; bootm 0x80200000 - 0x80F00000"
+
+echo 1 > /sys/block/mmcblk1boot0/force_ro
+echo 1 > /sys/block/mmcblk1boot1/force_ro

+ 42 - 0
patches/0118-UpdateRootfs_sh_in_add_784.patch

@@ -0,0 +1,42 @@
+diff --git a/UpdateRootfs.sh.in b/UpdateRootfs.sh.in
+index da6b7ea..19bece2 100644
+--- a/UpdateRootfs.sh.in
++++ b/UpdateRootfs.sh.in
+@@ -405,6 +405,14 @@ else
+ fi
+ fi
+ 
++if [ "$XRES" == "416" -a "$YRES" == "1280" ]; then
++if [ "$BASEBOARD" == "DISPLAY002_784" ]; then
++  echo "4.7 x 7.5 Inch long Display 2"
++  sh /root/Display2To_784inch_rs485.sh
++  DONE=1
++fi
++fi
++
+ if [ "$DONE" == "0" ]; then
+   echo "Unknown Display Resolution"
+ fi
+@@ -419,6 +427,7 @@ echo "restart system !!!"
+ sleep 2
+ #-----------------
+ reboot
++exit 0
+ fi
+ fi
+ #======================  DoRealUpdate ==== Ende =====
+@@ -975,6 +984,14 @@ else
+ fi
+ fi
+   
++if [ "\$XRES" == "416" -a "\$YRES" == "1280" ]; then
++if [ "\$BASEBOARD" == "DISPLAY002_784" ]; then
++  echo "15 Inch Display 2"
++  cp \$EMMC_BOOTPATH/Display002_784_rs485.dtb \$EMMC_BOOTPATH/Display001.dtb
++  DONE=1
++fi
++fi
++
+ if [ "\$DONE" == "0" ]; then
+   echo "Unknown Display Resolution"
+ fi