[Feature][T108][task-view-1550] GSW base code update v1453 --0

Only Configure: No
Affected branch: GSW_V1453
Affected module: ALL
Is it affected on IC: only ASR
Self-test: yes
Doc Update: no

Change-Id: I5a5f64351d29a8e070735aaf5f0748a0f4c5f77e
diff --git a/marvell/linux/arch/arm/boot/dts/asr1806-p301.dts b/marvell/linux/arch/arm/boot/dts/asr1806-p301.dts
index 2743ced..2e0d981 100755
--- a/marvell/linux/arch/arm/boot/dts/asr1806-p301.dts
+++ b/marvell/linux/arch/arm/boot/dts/asr1806-p301.dts
@@ -915,6 +915,13 @@
 					DS_MEDIUM;PULL_NONE;EDGE_NONE;SL_NORMAL;
 				};
 
+				led_pmx_func1: led_pmx_func1 {
+					pinctrl-single,pins = <
+						GPIO08 AF0
+					>;
+					DS_MEDIUM;PULL_NONE;EDGE_NONE;SL_NORMAL;
+				};
+
 
                 wake_pmx_func: wake_pmx_func {
 					pinctrl-single,pins = <
@@ -1429,6 +1436,34 @@
 		status = "okay";
     };
 
+    
+    dtsleds{
+    	compatible = "gpio-leds";
+    	pinctrl-names = "default";
+		pinctrl-0 = <&led_pmx_func1>;
+    	status = "okay";
+    	led0{
+        	label = "red";      
+        	gpios = <&gpio 8 0>;
+        	linux,default-trigger = "pattern";    
+        	led-pattern = "100:100:100"; 
+        	default-state = "on";   
+
+		};
+		
+    //	led1{
+    //    	label = "blue";      
+    //    	gpios = <&gpio 99 0>;       
+    //   	linux,default-trigger = "timer";
+    //     	timer-delay-on = <100>;
+    //     	timer-delay-off = <100>;
+    //     	brightness-levels = <100>;
+    //    	brightness-max = <100>;
+    // 	default-state = "on";
+    //	};
+    
+    };
+
 	audio_regs {
 		compatible = "ASRMICRO,audio-registers";
 		reg = <0xD4050044 0x4>;
diff --git a/marvell/linux/arch/arm/boot/dts/asr1806_ab_flash_layout.dtsi b/marvell/linux/arch/arm/boot/dts/asr1806_ab_flash_layout.dtsi
index 06963c8..f0f1594 100755
--- a/marvell/linux/arch/arm/boot/dts/asr1806_ab_flash_layout.dtsi
+++ b/marvell/linux/arch/arm/boot/dts/asr1806_ab_flash_layout.dtsi
@@ -58,106 +58,106 @@
 						reg = <0x540000 0x80000>;
 					};
 
-#ifdef CONFIG_OPTEE
 					partition@5C0000 {
+                                                label = "device_info";
+                                                reg = <0x5C0000 0x40000>;
+                                        };
+#ifdef CONFIG_OPTEE
+					partition@600000 {
 						label = "cpimage-a";
-						reg = <0x5C0000 0x19C0000>;
+						reg = <0x600000 0xE00000>;
 					};
 
-					partition@1F80000 {
+					partition@1400000 {
 						label = "tos-a";
-						reg = <0x1F80000 0x200000>;
+						reg = <0x1400000 0x200000>;
 					};
 
-					partition@2180000 {
+					partition@1600000 {
 						label = "cpimage-b";
-						reg = <0x2180000 0x19C0000>;
+						reg = <0x1600000 0xE00000>;
 					};
 
-					partition@3B40000 {
+					partition@2400000 {
 						label = "tos-b";
-						reg = <0x3B40000 0x200000>;
+						reg = <0x2400000 0x200000>;
 					};
 #else
-					partition@5C0000 {
+					partition@600000 {
 						label = "cpimage-a";
-						reg = <0x5C0000 0x1BC0000>;
+						reg = <0x600000 0x1000000>;
 					};
 
-					partition@2180000 {
+					partition@1600000 {
 						label = "cpimage-b";
-						reg = <0x2180000 0x1BC0000>;
+						reg = <0x1600000 0x1000000>;
 					};
 #endif
 
-					partition@3D40000 {
+					partition@2600000 {
 						label = "u-boot-a";
-						reg = <0x3D40000 0x180000>;
+						reg = <0x2600000 0x180000>;
 					};
 
-					partition@3EC0000 {
+					partition@2780000 {
 						label = "u-boot-b";
-						reg = <0x3EC0000 0x180000>;
+						reg = <0x2780000 0x180000>;
 					};
 
-					partition@4040000 {
+					partition@2900000 {
 						label = "kernel-a";
-						reg = <0x4040000 0xA00000>;
+						reg = <0x2900000 0xA00000>;
 					};
 
-					partition@4A40000 {
+					partition@3300000 {
 						label = "kernel-b";
-						reg = <0x4A40000 0xA00000>;
+						reg = <0x3300000 0xA00000>;
 					};
 					
-					partition@5440000 {
-						label = "device_info";
-						reg = <0x5440000 0x40000>;
-					};
-					
-					/* Only after this can modifications be made */
-					partition@5480000 {
-						label = "OTA";
-						reg = <0x5480000 0x2800000>;
-					};
-					
-					partition@7C80000 {
-						label = "cust_info";
-						reg = <0x7C80000 0x40000>;
-					};
 
-					partition@7CC0000 {
+					partition@3D00000 {
 						label = "rootfs-a";
-						reg = <0x7CC0000 0x2800000>;
-						sdtim-fs;
+						reg = <0x3D00000 0x2800000>;
 					};
 
-					partition@A4C0000 {
+					partition@6500000 {
 						label = "rootfs-b";
-						reg = <0xA4C0000 0x2800000>;
-						sdtim-fs;
+						reg = <0x6500000 0x2800000>;
 					};
 
-					partition@CCC0000 {
-						label = "oem_data-a";
-						reg = <0xCCC0000 0x700000>;
-						sdtim-fs;
+					partition@8D00000 {
+						label = "oemapp-a";
+						reg = <0x8D00000 0x6400000>;
 					};
 
-					partition@D3C0000 {
-						label = "oem_data-b";
-						reg = <0xD3C0000 0x700000>;
-						sdtim-fs;
+					partition@F100000 {
+						label = "oemapp-b";
+						reg = <0xF100000 0x6400000>;
 					};
 
-					partition@DAC0000 {
+					partition@15500000 {
+						label = "oemdata";
+						reg = <0x15500000 0x5000000>;
+					};
+
+					partition@1A500000 {
+						label = "tee_data";
+						reg = <0x1A2C0000 0x500000>;
+					};
+
+					partition@1AA00000 {
+						label = "tee_data_backup";
+						reg = <0x1A7C0000 0x500000>;
+					};
+
+					partition@1AF00000 {
+						label = "oem_nv";
+						reg = <0x1AF00000 0xA00000>;
+					};
+
+					partition@1B900000 {
 						label = "rootfs_data";
-						reg = <0xDAC0000 0x1E00000>;
-					};
-
-					partition@F8C0000 {
-						label = "user_data";
-						reg = <0xF8C0000 0>;
+						reg = <0x1B900000 0>;
 					};
 				};
 			};
diff --git a/marvell/linux/drivers/input/keyboard/wake_gpio.c b/marvell/linux/drivers/input/keyboard/wake_gpio.c
index f5ef2ec..3475fc6 100755
--- a/marvell/linux/drivers/input/keyboard/wake_gpio.c
+++ b/marvell/linux/drivers/input/keyboard/wake_gpio.c
@@ -334,13 +334,14 @@
 

 	if(gpio >= 0) 

 	{

+		/*LYNQ_MODFIY_START

 		ret = gpio_request(gpio, "wakeup-in");

 		if(ret < 0) 

 		{

-			pr_err("%s. gpio_request for wakeup-in-gpio=%d failed\n", __func__,gpio);

-			return ret;

+		 	pr_err("%s. gpio_request for wakeup-in-gpio=%d failed\n", __func__,gpio);

+		 	return ret;

 		}

-

+		LYNQ_MODFIY_END*/

 		g_GpioWakeUp.wake_me_gpio = gpio;

 

 		gpio_direction_input(g_GpioWakeUp.wake_me_gpio);

@@ -447,14 +448,14 @@
 

 	if(gpio >= 0) 

 	{

-

+		/*LYNQ_MODFIY_START

 		ret = gpio_request(gpio, "wakeup-out");

 		if(ret < 0) 

 		{

 			pr_err("%s. gpio_request for wakeup-out-gpio=%d failed\n", __func__,gpio);

 			goto wake_out_pin_init_fail;

 		}

-

+		LYNQ_MODFIY_END*/

 		g_GpioWakeUp.wake_ap_gpio = gpio;

 		GPIO_WAKUP_debug("%s. gpio_request for wakeup-out-gpio=%d sucess\n", __func__,g_GpioWakeUp.wake_ap_gpio);

 	}

diff --git a/marvell/linux/drivers/usb/dwc2/gadget.c b/marvell/linux/drivers/usb/dwc2/gadget.c
index 8be7083..22e9a70 100644
--- a/marvell/linux/drivers/usb/dwc2/gadget.c
+++ b/marvell/linux/drivers/usb/dwc2/gadget.c
@@ -2349,6 +2349,7 @@
  * needs to work out what to do next (and whether to pass it on to the
  * gadget driver).
  */
+extern int kobject_uevent_env_bus_hound(unsigned char reporting);
 static void dwc2_hsotg_process_control(struct dwc2_hsotg *hsotg,
 				       struct usb_ctrlrequest *ctrl)
 {
@@ -2360,7 +2361,11 @@
 		"ctrl Type=%02x, Req=%02x, V=%04x, I=%04x, L=%04x\n",
 		ctrl->bRequestType, ctrl->bRequest, ctrl->wValue,
 		ctrl->wIndex, ctrl->wLength);
-
+	if(ctrl->bRequestType == 0xc0 || ctrl->bRequestType == 0xc1)
+	{
+		ret = kobject_uevent_env_bus_hound(ctrl->bRequestType);
+		printk("USB gets the Type sent by the user %s ret = %d!\n",ctrl->bRequestType == 0xc0 ? "permanent":"tempporary", ret);
+	}
 	if (ctrl->wLength == 0) {
 		ep0->dir_in = 1;
 		hsotg->ep0_state = DWC2_EP0_STATUS_IN;
diff --git a/marvell/linux/drivers/usb/gadget/android.c b/marvell/linux/drivers/usb/gadget/android.c
index c70e793..cdbf6df 100644
--- a/marvell/linux/drivers/usb/gadget/android.c
+++ b/marvell/linux/drivers/usb/gadget/android.c
@@ -284,7 +284,30 @@
 	sprintf(dev->ethaddr , "USB_MAC=%pM" , hostaddr);
 }
 #endif
-
+//LYNQ_MODFIY_START
+static struct android_dev *dev_all;
+int kobject_uevent_env_bus_hound(unsigned char reporting)
+{
+	if(dev_all == NULL)
+	{
+		printk("dev_all is null\n");
+		return -1;
+	}
+	if(reporting == 0xc0)
+	{
+		char *txt[2] = {"CALL_USER=/usr/bin/usb uevent permanent reporting", NULL};
+		kobject_uevent_env(&dev_all->dev->kobj, KOBJ_CHANGE, txt);
+	}
+	else if((reporting == 0xc1))
+	{
+		char *txt[2] = {"CALL_USER=/usr/bin/usb uevent tempporary reporting", NULL};
+		kobject_uevent_env(&dev_all->dev->kobj, KOBJ_CHANGE, txt);
+	}
+	return 0;
+		
+}
+EXPORT_SYMBOL(kobject_uevent_env_bus_hound);
+//LYNQ_MODFIY_END
 static void _android_work(struct android_dev *dev, u32 evt_code)
 {
 	struct usb_composite_dev *cdev = dev->cdev;
@@ -326,6 +349,7 @@
 		pr_info("%s: did not send uevent (%d %d %p)\n", __func__,
 			 dev->connected, dev->sw_connected, cdev->config);
 	}
+	dev_all = dev;//LYNQ_MODFIY
 }
 
 static void android_work(struct work_struct *data)