Browse Source

WRK cape, DOES NOT COMPILE

Reinhard Russinger 4 năm trước cách đây
mục cha
commit
88e1658139

+ 398 - 0
board/GfA/Display001/DTS_4.4/Display001_cape.dts

@@ -0,0 +1,398 @@
+/*
+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+/dts-v1/;
+
+#include "am33xx_edma-tpcc.dtsi"
+#include "am335x-bone-common.dtsi"
+#include <dt-bindings/interrupt-controller/irq.h>
+
+
+/ {
+        wlan_en_reg: fixedregulator@2 {
+                compatible = "regulator-fixed";
+                regulator-name = "wlan-en-regulator";
+                regulator-min-microvolt = <1800000>;
+                regulator-max-microvolt = <1800000>;
+                startup-delay-us= <70000>;
+		regulator-always-on;
+
+                /* WL_EN */
+                gpio = <&gpio0 26 0>;
+                enable-active-high;
+		status = "okay";
+        };
+
+        leds {
+                pinctrl-names = "default";
+                pinctrl-0 = <&wl18xx_pins>;
+                compatible = "gpio-leds";
+
+                wl18xx_bt_en {
+                        label = "wl18xx_bt_en";
+                        gpios = <&gpio0 23 GPIO_ACTIVE_HIGH>;
+                        default-state = "off";
+                };
+        };
+
+       kim {
+                compatible = "kim";
+                nshutdown_gpio = <23>; /* gpio0.23 */
+                dev_name = "/dev/ttyO1";
+                flow_cntrl = <1>;
+                baud_rate = <3000000>;
+        };
+
+
+        btwilink {
+                compatible = "btwilink";
+        };
+};
+
+&am33xx_pinmux {
+        wl18xx_pins: pinmux_wl18xx_pins {
+                pinctrl-single,pins = <
+                        0x024 (PIN_OUTPUT_PULLUP | MUX_MODE7)   /* gpio0.23  BT_EN */
+                >;
+        };
+
+        wlbtbuf_pin: pinmux_wlbtbuf_pin {
+                pinctrl-single,pins = <
+                        0x07C ( PIN_OUTPUT_PULLUP | MUX_MODE7 ) /* gpio1.29 LS_BUF_EN */
+                >;
+        };
+
+        mmc3_pins: pinmux_mmc3_pins {
+                pinctrl-single,pins = <
+                        0x08C ( PIN_INPUT | MUX_MODE3 ) /* mmc2_clk */
+                        0x088 ( PIN_INPUT | MUX_MODE3 ) /* mmc2_cmd */
+                        0x040 ( PIN_INPUT | MUX_MODE7 ) /* gpio1.16 P9.15 */
+                        0x030 ( PIN_INPUT | MUX_MODE3 ) /* mmc2_dat0 */
+                        0x034 ( PIN_INPUT | MUX_MODE3 ) /* mmc2_dat1 */
+                        0x038 ( PIN_INPUT | MUX_MODE3 ) /* mmc2_dat2 */
+                        0x03C ( PIN_INPUT | MUX_MODE3 ) /* mmc2_dat3 */
+                >;
+        };
+
+        mmc3_pins_sleep: pinmux_mmc3_pins_sleep {
+                pinctrl-single,pins = <
+                        0x08C ( PIN_INPUT | MUX_MODE7 ) /* mmc2_clk */
+                        0x088 ( PIN_INPUT | MUX_MODE7 ) /* mmc2_cmd */
+                        0x040 ( PIN_INPUT | MUX_MODE7 ) /* gpio1.16 P9.15 */
+                        0x030 ( PIN_INPUT | MUX_MODE7 ) /* mmc2_dat0 */
+                        0x034 ( PIN_INPUT | MUX_MODE7 ) /* mmc2_dat1 */
+                        0x038 ( PIN_INPUT | MUX_MODE7 ) /* mmc2_dat2 */
+                        0x03C ( PIN_INPUT | MUX_MODE7 ) /* mmc2_dat3 */
+                >;
+        };
+
+        /* wl18xx card enable/irq GPIOs. */
+        wlan_pins: pinmux_wlan_pins {
+                pinctrl-single,pins = <
+                        0x028 (PIN_OUTPUT | MUX_MODE7 ) /* gpio0.26 WL_EN */
+                        0x02C (PIN_INPUT_PULLDOWN | MUX_MODE7 )  /* gpio0.27 WL_IRQ */
+                >;
+        };
+
+        /* wl18xx card enable/irq GPIOs. */
+        wlan_pins_sleep: pinmux_wlan_pins_sleep {
+                pinctrl-single,pins = <
+                        0x028 (PIN_INPUT | MUX_MODE7 ) /* gpio0.26 WL_EN */
+                        0x02C (PIN_INPUT_PULLDOWN | MUX_MODE7 )  /* gpio0.27 WL_IRQ */
+                >;
+        };
+
+               uart1_pins_default: pinmux_uart1_pins_default {
+                        pinctrl-single,pins = <
+                                0x180 (PIN_INPUT_PULLUP | MUX_MODE0)    /* uart1_rxd.uart1_rxd */
+                                0x184 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* uart1_txd.uart1_txd */ 
+				0x178 (PIN_INPUT_PULLUP | MUX_MODE0)	/* i2c2_sda.uart1_ctsn */
+                                0x17c (PIN_OUTPUT | MUX_MODE0)  	/* i2c2_scl.uart1_rtsn */
+                        >;
+                };
+
+
+                uart1_pins_sleep: pinmux_uart1_pins_sleep {
+                        pinctrl-single,pins = <
+                                0x180 (PIN_INPUT_PULLDOWN | MUX_MODE0)  /* uart1_rxd.uart1_rxd */
+                                0x184 (PIN_INPUT_PULLDOWN | MUX_MODE0)	/* uart1_txd.uart1_txd */ 
+				0x178 (PIN_INPUT_PULLDOWN | MUX_MODE0)	/* i2c2_sda.uart1_ctsn */
+                                0x17c (PIN_INPUT_PULLDOWN | MUX_MODE0)  /* i2c2_scl.uart1_rtsn */
+                        >;
+                };
+
+
+
+};
+
+&uart1 {
+	pinctrl-names = "default", "sleep";
+        pinctrl-0 = <&uart1_pins_default>;
+        pinctrl-1 = <&uart1_pins_sleep>;
+	has-hw-flow-control;
+        status = "okay";
+};
+
+
+&mmc3 {
+        dmas = <&edma_xbar 12 0 1
+                &edma_xbar 13 0 2>;
+        dma-names = "tx", "rx";
+        status = "okay";
+        vmmc-supply = <&wlan_en_reg>;
+        bus-width = <4>;
+        pinctrl-names = "default", "sleep";
+        pinctrl-0 = <&mmc3_pins &wlan_pins &wlbtbuf_pin>;
+        pinctrl-1 = <&mmc3_pins_sleep &wlan_pins_sleep &wlbtbuf_pin>;
+        ti,non-removable;
+        ti,needs-special-hs-handling;
+        cap-power-off-card;
+        keep-power-in-suspend;
+
+        #address-cells = <1>;
+        #size-cells = <0>;
+        wlcore: wlcore@0 {
+                compatible = "ti,wl1835";
+                reg = <2>;
+                interrupt-parent = <&gpio0>;
+                interrupts = <27 IRQ_TYPE_EDGE_RISING>;
+        };
+};
+
+
+&gpio1 {
+        ls_buf_en {
+                gpio-hog;
+                gpios = <29 GPIO_ACTIVE_HIGH>;
+                output-high;
+                line-name = "WL_BUF_EN";
+        };
+};
+
+ 
+/* ===================================== */
+&ldo3_reg {
+	regulator-min-microvolt = <1800000>;
+	regulator-max-microvolt = <1800000>;
+	regulator-always-on;
+};
+
+&mmc1 {
+	vmmc-supply = <&vmmcsd_fixed>;
+};
+
+&mmc2 {
+	vmmc-supply = <&vmmcsd_fixed>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&emmc_pins>;
+	bus-width = <8>;
+	ti,non-removable;
+	status = "okay";
+};
+
+&am33xx_pinmux {
+		gsm_pins: pinmux_gsm_pins {
+                        pinctrl-single,pins = <
+                                0x048 0x7        /* ehrpwm1a.gpio1_18, OUTPUT | MODE7 */
+                                0x04c 0x7        /* ehrpwm1b.gpio1_19, OUTPUT | MODE7 */
+                        >;
+		};
+
+               spi1_pins: pinmux_spi1_pins {
+                        pinctrl-single,pins = <
+                                0x190 (PIN_INPUT_PULLUP | MUX_MODE3) /* mcasp0_aclkx.spi1_sclk */
+                                0x194 (PIN_INPUT_PULLUP | MUX_MODE3)  /* mcasp0_fsx.spi1_d0 */
+                                0x198 (PIN_OUTPUT_PULLUP | MUX_MODE3) /* mcasp0_axr0.spi1_d1 */
+                                0x19c (PIN_OUTPUT_PULLUP | MUX_MODE3) /* mcasp0_ahclrk.spi1_cs0 */
+                                0x164 (PIN_OUTPUT_PULLUP | MUX_MODE2) /* ecap0_in.pwm0_out */
+                        >;
+                };
+
+
+               uart4_pins_default: pinmux_uart4_pins_default {
+                        pinctrl-single,pins = <
+                                0x070 (PIN_INPUT_PULLUP | MUX_MODE6)    /* gpmc_wait0.uart4_rxd */
+                                0x074 (PIN_OUTPUT_PULLDOWN | MUX_MODE6) /* gpmc_wpn.uart4_txd */ 
+				0x0d0 (PIN_INPUT_PULLUP | MUX_MODE6)	/* lcd_data12.uart4_ctsn */
+                                0x0d4 (PIN_OUTPUT | MUX_MODE6)  	/* lcd_data13.uart4_rtsn */
+                        >;
+                };
+
+
+                uart4_pins_sleep: pinmux_uart4_pins_sleep {
+                        pinctrl-single,pins = <
+                                0x070 (PIN_INPUT_PULLDOWN | MUX_MODE7)
+                                0x074 (PIN_INPUT_PULLDOWN | MUX_MODE7)
+                                0x0d0 (PIN_INPUT_PULLDOWN | MUX_MODE7)
+                                0x0d4 (PIN_INPUT_PULLDOWN | MUX_MODE7)
+                        >;
+                };
+
+
+        uart2_pins_default: pinmux_uart1_pins_default {
+                pinctrl-single,pins = <
+                        0x150 (PIN_INPUT_PULLUP | MUX_MODE1)    /* uart2_rxd.uart2_rxd */
+                        0x154 (PIN_OUTPUT_PULLDOWN | MUX_MODE1) /* uart2_txd.uart2_txd */ 
+			0x0c0 (PIN_INPUT_PULLUP | MUX_MODE6)	/* uart5_txt.uart2_ctsn */
+                        0x0c4 (PIN_OUTPUT | MUX_MODE6)          /* uart5_rxd.uart2_rtsn */
+                >;
+         };
+
+
+         uart2_pins_sleep: pinmux_uart1_pins_sleep {
+                 pinctrl-single,pins = <
+                         0x150 (PIN_INPUT_PULLDOWN | MUX_MODE0)  /* uart2_rxd.uart2_rxd */
+                         0x154 (PIN_INPUT_PULLDOWN | MUX_MODE0)	/* uart2_txd.uart2_txd */ 
+	 	  	 0x0C0 (PIN_INPUT_PULLDOWN | MUX_MODE0)	/* uart5_txt.uart2_ctsn */
+                         0x0C4 (PIN_INPUT_PULLDOWN | MUX_MODE0)  /* uart5_rxd.uart2_rtsn */
+                 >;
+         };
+
+		timer7_pins: pinmux_timer7_pins {
+                        pinctrl-single,pins = <
+                               0x094 (PIN_OUTPUT_PULLDOWN | MUX_MODE2)  /* gpmc_oen_ren.timer7 */
+				>;
+				};
+
+		timer4_pins: pinmux_timer4_pins {
+	                 pinctrl-single,pins = <
+	                     0x090 (PIN_INPUT | MUX_MODE7)  /* gpmc_advn_ale.timer4 gpio2_2 */
+                >;
+                };
+
+		profibus_pins_default: pinmux_profibus_pins_default {
+                        pinctrl-single,pins = < 
+                        0x158 (PIN_INPUT_PULLUP | MUX_MODE4)    /* spi0_d1.uart0_rxd */
+                        0x15c (PIN_OUTPUT_PULLDOWN | MUX_MODE4) /* spi0_cs0.uart0_txd */ 
+			0x1a4 (PIN_OUTPUT | MUX_MODE5)		/* mcasp0_fsr.gpio3.19 */
+                	>;
+                };
+
+};
+
+&timer7 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&timer7_pins>; 
+	status = "okay";
+};
+
+&timer4 {
+        pinctrl-names = "default";
+        pinctrl-0 = <&timer4_pins>; 
+        status = "okay";
+};
+
+&i2c0 {
+	hdmi1: hdmi@70 {
+	      compatible = "nxp,tda998x";
+	      reg = <0x70>;
+	};
+};
+
+
+&i2c2 {
+    pinctrl-names = "default";
+    pinctrl-0 = <&i2c2_pins>;
+    status = "okay";
+    clock-frequency = <400000>;
+};
+
+&spi1 {
+	pinctrl-names = "default";
+        pinctrl-0 = <&spi1_pins>;
+
+	clock-frequency = <1000000>;
+        status = "okay";
+	spi1_0{
+		compatible = "spidev";
+                reg = <0>;
+		spi-max-frequency = <10000000>;
+        };
+
+	spi1_1{
+		compatible = "spidev";
+                reg = <1>;
+		spi-max-frequency = <10000000>;
+        };
+};
+
+&lcdc {
+        status = "okay";
+};
+
+&tscadc {
+        status = "okay";
+};
+
+&am335x_adc {
+        ti,adc-channels = <0 1 2 3 4 5 6 7>;
+};
+
+&uart2 {
+	pinctrl-names = "default", "sleep";
+        pinctrl-0 = <&uart2_pins_default>;
+       	pinctrl-1 = <&uart2_pins_sleep>;
+	has-hw-flow-control;
+        status = "okay";
+};
+
+&uart4 {
+	pinctrl-names = "default", "sleep";
+        pinctrl-0 = <&uart4_pins_default>;
+        pinctrl-1 = <&uart4_pins_sleep>;
+	has-hw-flow-control;
+        status = "okay";
+};
+
+
+
+&pruss {
+	pinctrl-names = "default";
+        pinctrl-0 = <&profibus_pins_default>;
+	status = "okay";
+};
+
+
+/ {
+	gpio-leds {
+        	compatible = "gpio-leds";
+                pinctrl-names = "default";
+                pinctrl-0 = <&gsm_pins>;
+
+                led0 {
+                	label = "EMERG";
+                        gpios = <&gpio1 18 0>;
+                        default-state = "off";
+                     };
+
+                led1 {
+                        label = "IGNIT";
+                        gpios = <&gpio1 19 0>;
+                        default-state = "off";
+                     };
+        };
+
+        pwm7: dmtimer-pwm@7 {
+                compatible = "ti,omap-dmtimer-pwm";
+                ti,timers = <&timer7>;
+                #pwm-cells = <3>;
+        };
+
+        pwm-beeper {
+                compatible = "pwm-beeper";
+                pwms = <&pwm7 0 0 0>;
+        };
+};
+
+/ {
+	vendorinfo { 
+		vendor_name = "GfA Display001";
+		display_dtb = "Display001_cape.dtb";
+		display_physical_width = "96"; /* in mm */
+		display_physical_height = "55"; /* in mm */
+	};
+};

+ 4 - 4
board/GfA/Display001/busybox.config

@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
 # Busybox version: 1.25.1
-# Mon Feb 20 10:36:29 2017
+# Sun Oct 25 15:27:35 2020
 #
 CONFIG_HAVE_DOT_CONFIG=y
 
@@ -783,7 +783,7 @@ CONFIG_NAMEIF=y
 # CONFIG_NC_EXTRA is not set
 # CONFIG_NC_110_COMPAT is not set
 CONFIG_PING=y
-# CONFIG_PING6 is not set
+CONFIG_PING6=y
 CONFIG_FEATURE_FANCY_PING=y
 CONFIG_WGET=y
 CONFIG_FEATURE_WGET_STATUSBAR=y
@@ -797,7 +797,7 @@ CONFIG_FEATURE_IPV6=y
 # CONFIG_FEATURE_UNIX_LOCAL is not set
 # CONFIG_FEATURE_PREFER_IPV4_ADDRESS is not set
 # CONFIG_VERBOSE_RESOLUTION_ERRORS is not set
-# CONFIG_ARP is not set
+CONFIG_ARP=y
 CONFIG_ARPING=y
 # CONFIG_BRCTL is not set
 # CONFIG_FEATURE_BRCTL_FANCY is not set
@@ -897,7 +897,7 @@ CONFIG_FEATURE_TFTP_BLOCKSIZE=y
 # CONFIG_FEATURE_TFTP_PROGRESS_BAR is not set
 # CONFIG_TFTP_DEBUG is not set
 CONFIG_TRACEROUTE=y
-# CONFIG_TRACEROUTE6 is not set
+CONFIG_TRACEROUTE6=y
 # CONFIG_FEATURE_TRACEROUTE_VERBOSE is not set
 # CONFIG_FEATURE_TRACEROUTE_SOURCE_ROUTE is not set
 # CONFIG_FEATURE_TRACEROUTE_USE_ICMP is not set

+ 20 - 0
board/GfA/Display001/linux_4.4.94_rt19/linux-037-i2c_slve_eeprom_add_delay_after_first_receive.patch

@@ -0,0 +1,20 @@
+diff --git a/drivers/i2c/i2c-slave-eeprom.c b/drivers/i2c/i2c-slave-eeprom.c
+index b2039f9..5f209dd 100644
+--- a/drivers/i2c/i2c-slave-eeprom.c
++++ b/drivers/i2c/i2c-slave-eeprom.c
+@@ -21,6 +21,7 @@
+ #include <linux/slab.h>
+ #include <linux/spinlock.h>
+ #include <linux/sysfs.h>
++#include <linux/delay.h>
+ 
+ struct eeprom_data {
+ 	struct bin_attribute bin;
+@@ -38,6 +39,7 @@ static int i2c_slave_eeprom_slave_cb(struct i2c_client *client,
+ 	switch (event) {
+ 	case I2C_SLAVE_WRITE_RECEIVED:
+ 		if (eeprom->first_write) {
++			usleep_range(135,135);
+ 			eeprom->buffer_idx = *val;
+ 			eeprom->first_write = false;
+ 		} else {

+ 4 - 2
board/GfA/Display001/rootfs/etc/dnsmasq.conf

@@ -4,8 +4,10 @@ interface=usb0
 
 dhcp-range=usb0,192.168.7.1,192.168.7.1,1h
 dhcp-option=usb0,1,255.255.255.252
-dhcp-option=usb0,3,192.168.7.2
-dhcp-option=usb0,6,192.168.7.2
+dhcp-option=usb0,3
+dhcp-option=usb0,6
+#dhcp-option=usb0,3,192.168.7.2
+#dhcp-option=usb0,6,192.168.7.2
 
 listen-address=127.0.0.1
 listen-address=192.168.7.2

+ 135 - 22
board/GfA/Display001/rootfs/etc/init.d/M98usb_g_ether

@@ -1,26 +1,139 @@
 #!/bin/sh
+set -e
+
+# USB Gadget for FT-TXT
 #
-# Start the usb gadget network....
-#
+if [ ! -d "/sys/kernel/config" ]; then
+    echo "load configfs"
+    modprobe configfs
+fi
 
-case "$1" in
-  start)
- 	echo "Starting usb g_ether network..."
-	modprobe g_ether
-	/sbin/ifdown usb0
-	/sbin/ifup usb0
-	;;
-  stop)
-	echo -n "Stopping usb g_ether network..."
-	rmmod g_ether
-	;;
-  restart|reload)
-	"$0" stop
-	"$0" start
-	;;
-  *)
-	echo "Usage: $0 {start|stop|restart}"
-	exit 1
-esac
+if [ -z "$(ls -A /sys/kernel/config)" ]; then
+   echo "mount configfs"
+   mount -t configfs none /sys/kernel/config 2>/dev/null
+fi
+
+if [ ! -d "/sys/kernel/config/usb_gadget" ]; then
+    echo "load libcomposite"
+    modprobe libcomposite
+fi
+
+# command line parameters
+command="$1" # "up|start" or "down"
+
+g="/sys/kernel/config/usb_gadget/rndisdev"
+
+rndis_usb_up() {
+    usb_ver="0x0200" # USB 2.0
+    dev_class="0xfe" # 
+    dev_subclass="0x04"
+    dev_protocol="0x01"
+    vid="0x1d6b" # Linux Foundation
+    pid="0x0104" # Linux-USB Multifunction Composit Gadget
+    device="0x0100" # v1.0.0
+    mfg="GfA" # 
+    prod="GfA Display" # 
+    serial="fedcba9875643210"
+    attr="0xC0" # Self powered
+    pwr="1" # 2mA
+    cfg2="RNDIS"
+    dev_mac2="00:54:58:54:FF:03"
+    host_mac2="00:54:58:54:FF:04"
+    ms_vendor_code="0xcd" # Microsoft
+    ms_qw_sign="MSFT100" # also Microsoft (if you couldn't tell)
+    ms_compat_id="RNDIS" # matches Windows RNDIS Drivers
+    ms_subcompat_id="5162001" # matches Windows RNDIS 6.0 Driver
+
+    if [ -d ${g} ]; then
+        if [ "$(cat ${g}/UDC)" != "" ]; then
+            echo "Gadget is already up."
+            exit 1
+        fi
+        echo "Cleaning up old directory..."
+        rndis_usb_down
+    fi
+    echo "Setting up gadget..."
+
+    # Create a new gadget
+    mkdir ${g}
+    echo "${usb_ver}" > ${g}/bcdUSB
+    echo "${dev_class}" > ${g}/bDeviceClass
+    echo "${dev_subclass}" > ${g}/bDeviceSubClass
+    echo "${dev_protocol}" > ${g}/bDeviceProtocol
+    echo "${vid}" > ${g}/idVendor
+    echo "${pid}" > ${g}/idProduct
+    echo "${device}" > ${g}/bcdDevice
+    mkdir ${g}/strings/0x409
+    echo "${mfg}" > ${g}/strings/0x409/manufacturer
+    echo "${prod}" > ${g}/strings/0x409/product
+    echo "${serial}" > ${g}/strings/0x409/serialnumber
 
-exit $?
+    # config RNDIS
+    mkdir ${g}/configs/c.1
+    echo "${attr}" > ${g}/configs/c.1/bmAttributes
+    echo "${pwr}" > ${g}/configs/c.1/MaxPower
+    mkdir ${g}/configs/c.1/strings/0x409
+    echo "${cfg2}" > ${g}/configs/c.1/strings/0x409/configuration
+
+    # On Windows 7 and later, the RNDIS 5.1 driver would be used by default,
+    # but it does not work very well. The RNDIS 6.0 driver works better. In
+    # order to get this driver to load automatically, we have to use a
+    # Microsoft-specific extension of USB.
+    echo "1" > ${g}/os_desc/use
+    echo "${ms_vendor_code}" > ${g}/os_desc/b_vendor_code
+    echo "${ms_qw_sign}" > ${g}/os_desc/qw_sign
+
+    # Create the RNDIS function, including the Microsoft-specific bits
+    mkdir ${g}/functions/rndis.usb0
+    echo "${dev_mac2}" > ${g}/functions/rndis.usb0/dev_addr
+    echo "${host_mac2}" > ${g}/functions/rndis.usb0/host_addr
+    echo "${ms_compat_id}" > ${g}/functions/rndis.usb0/os_desc/interface.rndis/compatible_id
+    echo "${ms_subcompat_id}" > ${g}/functions/rndis.usb0/os_desc/interface.rndis/sub_compatible_id
+
+    # Link everything up and bind the USB device
+    ln -s ${g}/functions/rndis.usb0 ${g}/configs/c.1
+    ln -s ${g}/configs/c.1 ${g}/os_desc
+    echo `ls /sys/class/udc/` > ${g}/UDC
+
+    echo "Done."
+}
+
+rndis_usb_down() {
+    if [ ! -d ${g} ]; then
+        echo "Gadget is already down."
+        exit 1
+    fi
+    echo "Taking down gadget..."
+
+    # Have to unlink and remove directories in reverse order.
+    # Checks allow to finish takedown after error.
+    if [ "$(cat ${g}/UDC)" != "" ]; then
+        echo "" > ${g}/UDC
+    fi
+    rm -f ${g}/os_desc/c.1
+    rm -f ${g}/configs/c.1/rndis.usb0
+    [ -d ${g}/functions/rndis.usb0 ] && rmdir ${g}/functions/rndis.usb0
+    [ -d ${g}/configs/c.1/strings/0x409 ] && rmdir ${g}/configs/c.1/strings/0x409
+    [ -d ${g}/configs/c.1 ] && rmdir ${g}/configs/c.1
+    [ -d ${g}/strings/0x409 ] && rmdir ${g}/strings/0x409
+    rmdir ${g}
+
+    echo "Done."
+}
+case ${command} in
+
+start | up)
+    rndis_usb_up
+    sleep 1
+    ifdown usb0
+    ifup usb0
+    ;;
+stop | down)
+#    ifdown usb0
+    rndis_usb_down
+    ;;
+*)
+    echo "Usage: $0 up|down"
+    exit 1
+    ;;
+esac

+ 34 - 0
board/GfA/Display001/rootfs/root/DisplayTo_cape.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_cape.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
+

BIN
board/GfA/Display001/rootfs/var/GfA/Display_GSM


+ 1 - 1
build-gnupru.sh

@@ -7,6 +7,6 @@ git clone https://github.com/dinuxbg/gnupru.git
 #---------------------------------------------------
 cd  ./gnupru
 export PREFIX=/opt/GfA/PRU-ICSS/bin/pru-gcc
-./download-and-patch.sh
+./download-and-prepare.sh
 ./build.sh
 

+ 2 - 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"
+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"
 BR2_PACKAGE_BUSYBOX_CONFIG="../GfA/board/GfA/Display001/busybox.config"
 BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
 BR2_PACKAGE_FFMPEG_GPL=y
@@ -438,6 +438,7 @@ BR2_PACKAGE_WPA_SUPPLICANT_PASSPHRASE=y
 BR2_PACKAGE_WPA_SUPPLICANT_DBUS_OLD=y
 BR2_PACKAGE_WPA_SUPPLICANT_DBUS_NEW=y
 BR2_PACKAGE_WPA_SUPPLICANT_DBUS_INTROSPECTION=y
+BR2_PACKAGE_WPAN_TOOLS=y
 BR2_PACKAGE_BASH=y
 BR2_PACKAGE_SCREEN=y
 BR2_PACKAGE_SUDO=y

+ 37 - 0
patches/0029-add-contiki-settings-for-crosscompile.patch

@@ -0,0 +1,37 @@
+diff --git a/CrossCompile.sh b/CrossCompile.sh
+index c068ea1..5982fef 100755
+--- a/CrossCompile.sh
++++ b/CrossCompile.sh
+@@ -73,6 +73,14 @@ export CC_FULLPATH="${SYSROOT}/${CROSS_COMPILE}"
+ export CC=${CROSS_COMPILE}gcc
+ export CXX=${CROSS_COMPILE}g++
+ 
++export AS=arm-buildroot-linux-gnueabihf-as
++export NM=arm-buildroot-linux-gnueabihf-nm
++export OBJCOPY=arm-buildroot-linux-gnueabihf-objcopy
++export STRIP=arm-buildroot-linux-gnueabihf-strip
++#for contiki-ng
++export LD_OVERRIDE=$CC
++
++
+ #--- gnupru
+ export PASM=pasm
+ ##export PSYSROOT=/home/ru/pru/pru-gcc/bin
+diff --git a/MakeTOOLCHAIN.sh b/MakeTOOLCHAIN.sh
+index 134f9f1..0fecf27 100755
+--- a/MakeTOOLCHAIN.sh
++++ b/MakeTOOLCHAIN.sh
+@@ -89,6 +89,13 @@ export CC_FULLPATH="${SYSROOT}/${CROSS_COMPILE}"
+ export CC=${CROSS_COMPILE}gcc
+ export CXX=${CROSS_COMPILE}g++
+ 
++export AS=${CROSS_COMPILE}as
++export NM==${CROSS_COMPILE}nm
++export OBJCOPY==${CROSS_COMPILE}objcopy
++export STRIP==${CROSS_COMPILE}strip
++#for contiki-ng
++export LD_OVERRIDE=${CROSS_COMPILE}gcc
++
+ if [ \$# -eq "0" ] 
+ then
+ PROMPT_COMMAND='PS1="\[\033[0;31m\]CROSS CC:\[\033[0;32m\]\$PS1";unset PROMPT_COMMAND' bash ; reset