Merge "Add interleave support in android boot loader nand driver."
diff --git a/app/aboot/aboot.c b/app/aboot/aboot.c
index 3eac025..95d9180 100644
--- a/app/aboot/aboot.c
+++ b/app/aboot/aboot.c
@@ -327,13 +327,13 @@
kernel_actual = ROUND_TO_PAGE(hdr.kernel_size, page_mask);
ramdisk_actual = ROUND_TO_PAGE(hdr.ramdisk_size, page_mask);
- if (2048 + kernel_actual + ramdisk_actual < sz) {
+ if (page_size + kernel_actual + ramdisk_actual < sz) {
fastboot_fail("incomplete bootimage");
return;
}
- memmove((void*) KERNEL_ADDR, ptr + 2048, hdr.kernel_size);
- memmove((void*) RAMDISK_ADDR, ptr + 2048 + kernel_actual, hdr.ramdisk_size);
+ memmove((void*) KERNEL_ADDR, ptr + page_size, hdr.kernel_size);
+ memmove((void*) RAMDISK_ADDR, ptr + page_size + kernel_actual, hdr.ramdisk_size);
fastboot_okay("");
target_battery_charging_enable(0, 1);
diff --git a/dev/keys/gpio_keypad.c b/dev/keys/gpio_keypad.c
index 281cf64..b3e21c1 100644
--- a/dev/keys/gpio_keypad.c
+++ b/dev/keys/gpio_keypad.c
@@ -457,12 +457,8 @@
void ssbi_keypad_init(struct qwerty_keypad_info *qwerty_kp)
{
- int *modem_stat_check = (MSM_SHARED_BASE + 0x14);
int len;
- /* Wait for modem to be ready before keypad init */
- while (readl(modem_stat_check) != 1);
-
ssbi_gpio_init();
len = sizeof(struct gpio_qwerty_kp);
diff --git a/platform/msm7x30/arch_init.S b/platform/msm7x30/arch_init.S
index fd7bf28..9ddd57f 100644
--- a/platform/msm7x30/arch_init.S
+++ b/platform/msm7x30/arch_init.S
@@ -288,6 +288,8 @@
WRITE_L2_SA_SETTINGS:
//;WCP15_L2VR3F1 r0
MCR p15, 0x3, r0, c15, c15, 0x1 //;write r0 to L2VR3F1
+ DSB
+ ISB
LDR r0, =0 //;make sure the registers we touched
LDR r1, =0 //;are cleared when we return
diff --git a/platform/msm7x30/include/platform/iomap.h b/platform/msm7x30/include/platform/iomap.h
index 9388cf4..d5b63e2 100644
--- a/platform/msm7x30/include/platform/iomap.h
+++ b/platform/msm7x30/include/platform/iomap.h
@@ -44,7 +44,7 @@
#define MSM_GCC_BASE 0xC0182000
#if defined(PLATFORM_MSM7X30)
-#define MSM_SHARED_BASE 0x00000000
+#define MSM_SHARED_BASE 0x03700000
#define HW_REVISION_NUMBER 0xABC00270
#else
#define MSM_SHARED_BASE 0x01F00000
diff --git a/platform/msm_shared/timer.c b/platform/msm_shared/timer.c
index b249b23..d1c0fe6 100644
--- a/platform/msm_shared/timer.c
+++ b/platform/msm_shared/timer.c
@@ -82,6 +82,18 @@
#define SPSS_TIMER_STATUS GPT_REG(0x0034)
#endif
+#if defined PLATFORM_QSD8K
+#define DGT_HZ 4800000 /* Uses TCXO/4 (19.2 MHz / 4) */
+#elif defined PLATFORM_MSM7X30
+#if _EMMC_BOOT
+#define DGT_HZ 19200000 /* Uses TCXO (19.2 MHz) */
+#else
+#define DGT_HZ 6144000 /* Uses LPXO/4 (24.576 MHz / 4) */
+#endif
+#else
+#define DGT_HZ 19200000 /* Uses TCXO (19.2 MHz) */
+#endif
+
static platform_timer_callback timer_callback;
static void *timer_arg;
@@ -113,7 +125,7 @@
timer_arg = arg;
timer_interval = interval;
- writel(timer_interval * 19200, DGT_MATCH_VAL);
+ writel(timer_interval * (DGT_HZ / 1000), DGT_MATCH_VAL);
writel(0, DGT_CLEAR);
writel(DGT_ENABLE_EN | DGT_ENABLE_CLR_ON_MATCH_EN, DGT_ENABLE);
diff --git a/project/msm7630_fusion.mk b/project/msm7630_fusion.mk
new file mode 100644
index 0000000..5eac133
--- /dev/null
+++ b/project/msm7630_fusion.mk
@@ -0,0 +1,5 @@
+# top level project rules for the msm7630_surf project
+#
+LOCAL_DIR := $(GET_LOCAL_DIR)
+
+include $(LOCAL_DIR)/msm7630_surf.mk
diff --git a/project/msm7630_fusion_nandwrite.mk b/project/msm7630_fusion_nandwrite.mk
new file mode 100644
index 0000000..7da3585
--- /dev/null
+++ b/project/msm7630_fusion_nandwrite.mk
@@ -0,0 +1,5 @@
+# top level project rules for the msm7630_surf_nandwrite project
+#
+LOCAL_DIR := $(GET_LOCAL_DIR)
+
+include $(LOCAL_DIR)/msm7630_surf_nandwrite.mk
diff --git a/target/msm7630_surf/atags.c b/target/msm7630_surf/atags.c
index 28aaab5..bc2520b 100644
--- a/target/msm7630_surf/atags.c
+++ b/target/msm7630_surf/atags.c
@@ -30,14 +30,17 @@
#include <debug.h>
#include <smem.h>
-#define EBI1_SIZE_51M 0x03300000
-#define EBI1_SIZE_128M 0x08000000
-#define EBI1_ADDR_2M 0x00200000
-#define EBI1_ADDR_128M 0x08000000
-#define EBI1_ADDR_1G 0x40000000
+#define EBI1_SIZE_51M 0x03300000
+#define EBI1_ADDR_2M 0x00200000
+#define EBI1_SIZE_128M 0x08000000
+#define EBI1_ADDR_128M 0x08000000
+#define EBI1_ADDR_1G 0x40000000
+#define EBI0_SIZE_6M 0x00600000
+#define EBI0_ADDR_EFS_BASE 0x03800000
static int msm7x30_lpddr1 = -1;
static int target_is_msm7x30_lpddr1(void);
+int target_is_emmc_boot(void);
int target_is_msm7x30_lpddr1(void)
{
@@ -87,12 +90,21 @@
unsigned* target_atag_mem(unsigned* ptr)
{
- /* ATAG_MEM for 51MB + 128MB setup */
+ /* ATAG_MEM for 51MB + [6MB if nand boot] + 128MB setup */
*ptr++ = 4;
*ptr++ = 0x54410002;
*ptr++ = EBI1_SIZE_51M;
*ptr++ = EBI1_ADDR_2M;
+ /* Reclaim EFS partition used in EMMC for NAND boot */
+ if (!target_is_emmc_boot())
+ {
+ *ptr++ = 4;
+ *ptr++ = 0x54410002;
+ *ptr++ = EBI0_SIZE_6M;
+ *ptr++ = EBI0_ADDR_EFS_BASE;
+ }
+
/* ATAG_MEM */
*ptr++ = 4;
*ptr++ = 0x54410002;
diff --git a/target/msm7630_surf/init.c b/target/msm7630_surf/init.c
index 165af3e..0bcce88 100644
--- a/target/msm7630_surf/init.c
+++ b/target/msm7630_surf/init.c
@@ -37,9 +37,14 @@
#include <dev/flash.h>
#include <smem.h>
-#define LINUX_MACHTYPE_SURF 1007016
-#define LINUX_MACHTYPE_FFA 1007017
-#define LINUX_MACHTYPE_FLUID 1007018
+#define LINUX_MACHTYPE_7x30_SURF 1007016
+#define LINUX_MACHTYPE_7x30_FFA 1007017
+#define LINUX_MACHTYPE_7x30_FLUID 1007018
+#define LINUX_MACHTYPE_8x55_SURF 2768
+#define LINUX_MACHTYPE_8x55_FFA 2769
+
+#define MSM8255_ID 74
+#define MSM8655_ID 75
//Enum values for 7x30 target platforms.
enum platform
@@ -108,6 +113,7 @@
static int emmc_boot = -1; /* set to uninitialized */
int target_is_emmc_boot(void);
static int platform_version = -1;
+static int target_msm_id = -1;
void target_init(void)
{
@@ -181,6 +187,15 @@
return platform_version;
}
+int target_is_msm8x55(void)
+{
+ if ((target_msm_id == MSM8255_ID) ||
+ (target_msm_id == MSM8655_ID))
+ return 1;
+ else
+ return 0;
+}
+
unsigned board_machtype(void)
{
struct smem_board_info_v4 board_info_v4;
@@ -193,44 +208,43 @@
smem_status = smem_read_alloc_entry_offset(SMEM_BOARD_INFO_LOCATION,
&format, sizeof(format), 0);
- if(smem_status)
+ if(!smem_status)
{
- dprintf(CRITICAL, "ERROR: unable to read shared memory for offset entry\n");
- }
-
- if ((format == 3) || (format == 4))
- {
- if (format == 4)
- board_info_len = sizeof(board_info_v4);
- else
- board_info_len = sizeof(board_info_v4.board_info_v3);
-
- smem_status = smem_read_alloc_entry(SMEM_BOARD_INFO_LOCATION,
- &board_info_v4, board_info_len);
- if(smem_status)
- {
- dprintf(CRITICAL, "ERROR: unable to read shared memory for Hardware Platform\n");
- }
-
- if(format == 4)
- platform_version = board_info_v4.platform_version;
-
- platform_type = board_info_v4.board_info_v3.hw_platform;
- switch (platform_type)
+ if ((format == 3) || (format == 4))
{
- case HW_PLATFORM_SURF:
- hw_platform_type = LINUX_MACHTYPE_SURF; break;
- case HW_PLATFORM_FFA:
- hw_platform_type = LINUX_MACHTYPE_FFA; break;
- case HW_PLATFORM_FLUID:
- hw_platform_type = LINUX_MACHTYPE_FLUID; break;
- default:
- hw_platform_type = LINUX_MACHTYPE_SURF;
- }
- return hw_platform_type;
- }
+ if (format == 4)
+ board_info_len = sizeof(board_info_v4);
+ else
+ board_info_len = sizeof(board_info_v4.board_info_v3);
- hw_platform_type = LINUX_MACHTYPE_SURF;
+ smem_status = smem_read_alloc_entry(SMEM_BOARD_INFO_LOCATION,
+ &board_info_v4, board_info_len);
+ if(!smem_status)
+ {
+ if(format == 4)
+ platform_version = board_info_v4.platform_version;
+
+ platform_type = board_info_v4.board_info_v3.hw_platform;
+ target_msm_id = board_info_v4.board_info_v3.msm_id;
+ switch (platform_type)
+ {
+ case HW_PLATFORM_SURF:
+ hw_platform_type = ((target_is_msm8x55()) ?
+ LINUX_MACHTYPE_8x55_SURF : LINUX_MACHTYPE_7x30_SURF); break;
+ case HW_PLATFORM_FFA:
+ hw_platform_type = ((target_is_msm8x55()) ?
+ LINUX_MACHTYPE_8x55_FFA : LINUX_MACHTYPE_7x30_FFA); break;
+ case HW_PLATFORM_FLUID:
+ hw_platform_type = LINUX_MACHTYPE_7x30_FLUID; break;
+ default:
+ hw_platform_type = ((target_is_msm8x55()) ?
+ LINUX_MACHTYPE_8x55_SURF : LINUX_MACHTYPE_7x30_SURF); break;
+ }
+ return hw_platform_type;
+ }
+ }
+ }
+ hw_platform_type = LINUX_MACHTYPE_7x30_SURF;
return hw_platform_type;
}
diff --git a/target/qsd8250_ffa/atags.c b/target/qsd8250_ffa/atags.c
index ec80183..77a1fb8 100644
--- a/target/qsd8250_ffa/atags.c
+++ b/target/qsd8250_ffa/atags.c
@@ -63,7 +63,7 @@
/* 2nd segment */
#ifdef USE_512M_RAM
- size = EBT1_SIZE2_512M;
+ size = EBI1_SIZE2_512M;
#else
size = 0;
#endif
diff --git a/target/qsd8250_surf/atags.c b/target/qsd8250_surf/atags.c
index ec80183..77a1fb8 100644
--- a/target/qsd8250_surf/atags.c
+++ b/target/qsd8250_surf/atags.c
@@ -63,7 +63,7 @@
/* 2nd segment */
#ifdef USE_512M_RAM
- size = EBT1_SIZE2_512M;
+ size = EBI1_SIZE2_512M;
#else
size = 0;
#endif