Merge "platform: mdm9640: Initialze board data first"
diff --git a/platform/msm8952/platform.c b/platform/msm8952/platform.c
index 0f1439a..33788b0 100644
--- a/platform/msm8952/platform.c
+++ b/platform/msm8952/platform.c
@@ -39,6 +39,7 @@
 #include <board.h>
 #include <boot_stats.h>
 #include <platform.h>
+#include <target/display.h>
 
 #define MSM_IOMAP_SIZE ((MSM_IOMAP_END - MSM_IOMAP_BASE)/MB)
 #define APPS_SS_SIZE   ((APPS_SS_END - APPS_SS_BASE)/MB)
@@ -65,6 +66,7 @@
 	{    APPS_SS_BASE,          APPS_SS_BASE,            APPS_SS_SIZE,      IOMAP_MEMORY},
 	{    MSM_SHARED_IMEM_BASE,  MSM_SHARED_IMEM_BASE,    1,                COMMON_MEMORY},
 	{    SCRATCH_ADDR,          SCRATCH_ADDR,            512,              SCRATCH_MEMORY},
+	{    MIPI_FB_ADDR,          MIPI_FB_ADDR,            10,              COMMON_MEMORY},
 };
 
 void platform_early_init(void)
diff --git a/platform/msm_shared/hsusb.c b/platform/msm_shared/hsusb.c
index 5c7d61f..766c197 100644
--- a/platform/msm_shared/hsusb.c
+++ b/platform/msm_shared/hsusb.c
@@ -46,6 +46,7 @@
 
 #define MAX_TD_XFER_SIZE  (16 * 1024)
 
+BUF_DMA_ALIGN(transfer_desc_item, ROUNDUP(sizeof(struct ept_queue_item), CACHE_LINE));
 
 /* common code - factor out into a shared file */
 
@@ -280,22 +281,19 @@
 	struct usb_request *req = (struct usb_request *)_req;
 	unsigned phys = (unsigned)req->req.buf;
 	unsigned len = req->req.length;
-	unsigned int count = 0;
 
-	curr_item = NULL;
 	xfer = (len > MAX_TD_XFER_SIZE) ? MAX_TD_XFER_SIZE : len;
 	/*
 	 * First TD allocated during request allocation
 	 */
-	item = req->item;
-	item->info = INFO_BYTES(xfer) | INFO_ACTIVE;
-	item->page0 = phys;
-	item->page1 = (phys & 0xfffff000) + 0x1000;
-	item->page2 = (phys & 0xfffff000) + 0x2000;
-	item->page3 = (phys & 0xfffff000) + 0x3000;
-	item->page4 = (phys & 0xfffff000) + 0x4000;
+	curr_item = req->item;
+	curr_item->info = INFO_BYTES(xfer) | INFO_ACTIVE;
+	curr_item->page0 = phys;
+	curr_item->page1 = (phys & 0xfffff000) + 0x1000;
+	curr_item->page2 = (phys & 0xfffff000) + 0x2000;
+	curr_item->page3 = (phys & 0xfffff000) + 0x3000;
+	curr_item->page4 = (phys & 0xfffff000) + 0x4000;
 	phys += xfer;
-	curr_item = item;
 	len -= xfer;
 
 	/*
@@ -306,23 +304,9 @@
 	while (len > 0) {
 		xfer = (len > MAX_TD_XFER_SIZE) ? MAX_TD_XFER_SIZE : len;
 		if (curr_item->next == TERMINATE) {
-			/*
-			 * Allocate new TD only if chain doesnot
-			 * exist already
-			 */
-			item = memalign(CACHE_LINE,
-					ROUNDUP(sizeof(struct ept_queue_item), CACHE_LINE));
-			if (!item) {
-				dprintf(ALWAYS, "allocate USB item fail ept%d\n %s queue\ntd count = %d\n",
-							ept->num,
-							ept->in ? "in" : "out",
-							count);
-				return -1;
-			} else {
-				count ++;
-				curr_item->next = PA((addr_t)item);
+				curr_item->next = PA((addr_t)transfer_desc_item);
+				item = (struct ept_queue_item *)transfer_desc_item;
 				item->next = TERMINATE;
-			}
 		} else
 			/* Since next TD in chain already exists */
 			item = (struct ept_queue_item *)VA(curr_item->next);
diff --git a/target/msm8952/init.c b/target/msm8952/init.c
index 70da0ad..fb83af9 100644
--- a/target/msm8952/init.c
+++ b/target/msm8952/init.c
@@ -64,6 +64,7 @@
 #define PMIC_ARB_CHANNEL_NUM    0
 #define PMIC_ARB_OWNER_ID       0
 #define TLMM_VOL_UP_BTN_GPIO    85
+#define TLMM_VOL_UP_BTN_GPIO_8956 113
 
 #define FASTBOOT_MODE           0x77665500
 #define RECOVERY_MODE           0x77665502
@@ -167,7 +168,14 @@
 {
 	uint8_t status = 0;
 
-	gpio_tlmm_config(TLMM_VOL_UP_BTN_GPIO, 0, GPIO_INPUT, GPIO_PULL_UP, GPIO_2MA, GPIO_ENABLE);
+	if(platform_is_msm8956())
+	{
+		gpio_tlmm_config(TLMM_VOL_UP_BTN_GPIO_8956, 0, GPIO_INPUT, GPIO_PULL_UP, GPIO_2MA, GPIO_ENABLE);
+	}
+	else
+	{
+		gpio_tlmm_config(TLMM_VOL_UP_BTN_GPIO, 0, GPIO_INPUT, GPIO_PULL_UP, GPIO_2MA, GPIO_ENABLE);
+	}
 
 	/* Wait for the gpio config to take effect - debounce time */
 	thread_sleep(10);