Merge "target: mdm9607: Increase size of scratch memory."
diff --git a/platform/mdm9607/platform.c b/platform/mdm9607/platform.c
index 1be8698..701a3a1 100644
--- a/platform/mdm9607/platform.c
+++ b/platform/mdm9607/platform.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2015,2020 The Linux Foundation. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -53,6 +53,8 @@
 #define SCRATCH_REGION1_VIRT_START_128            0x88000000
 #define SCRATCH_REGION2_VIRT_START_128            (SCRATCH_REGION1_VIRT_START_128 + SCRATCH_REGION1_SIZE_128)
 
+#define SCRATCH_REGION2_VIRT_START_256 (SCRATCH_REGION_256 + SCRATCH_REGION_SIZE_256)
+
 static void ddr_based_mmu_mappings(mmu_section_t *table, uint32_t table_size);
 static uint64_t ddr_size;
 static void board_ddr_detect();
@@ -80,8 +82,9 @@
 };
 
 mmu_section_t mmu_section_table_256[] = {
-	{SCRATCH_REGION_256,         SCRATCH_REGION_256,          SCRATCH_REGION_SIZE_256/ MB,      SCRATCH_MEMORY},
-	{KERNEL_REGION,              KERNEL_REGION,               KERNEL_REGION_SIZE/ MB,           SCRATCH_MEMORY},
+	{SCRATCH_REGION_256,  SCRATCH_REGION_256,             SCRATCH_REGION_SIZE_256/ MB,  SCRATCH_MEMORY},
+	{SCRATCH_REGION2_256, SCRATCH_REGION2_VIRT_START_256, SCRATCH_REGION2_SIZE_256/ MB, SCRATCH_MEMORY},
+	{KERNEL_REGION,       KERNEL_REGION,                  KERNEL_REGION_SIZE/ MB,       SCRATCH_MEMORY},
 };
 
 static void board_ddr_detect()
diff --git a/target/mdm9607/meminfo.c b/target/mdm9607/meminfo.c
index 31eea83..3196cfc 100644
--- a/target/mdm9607/meminfo.c
+++ b/target/mdm9607/meminfo.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2015,2020 The Linux Foundation. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -103,5 +103,5 @@
 		return (SCRATCH_REGION1_SIZE_128 + SCRATCH_REGION2_SIZE_128);
 	else
 		/*256MB DDR scratch size*/
-		return (SCRATCH_REGION_SIZE_256);
+		return (SCRATCH_REGION_SIZE_256 + SCRATCH_REGION2_SIZE_256);
 }
diff --git a/target/mdm9607/rules.mk b/target/mdm9607/rules.mk
index 555cf51..422b906 100644
--- a/target/mdm9607/rules.mk
+++ b/target/mdm9607/rules.mk
@@ -12,14 +12,16 @@
 SCRATCH_REGION1_128                     := 0x86000000
 SCRATCH_REGION1_SIZE_128                := 0x01a00000  # 26MB
 SCRATCH_REGION2_128                     := 0x80000000
-SCRATCH_REGION2_SIZE_128                := 0x02900000   # 41M
+SCRATCH_REGION2_SIZE_128                := 0x02900000  # 41M
 
 KERNEL_REGION                           := 0x80000000
-KERNEL_REGION_SIZE                      := 0x2000000 # 20MB
+KERNEL_REGION_SIZE                      := 0x02000000  # 32MB
 
 SCRATCH_ADDR_256                        := 0x88000000
 SCRATCH_REGION_256                      := 0x88000000
+SCRATCH_REGION2_256                     := 0x82A00000
 SCRATCH_REGION_SIZE_256                 := 0x08000000  # 128MB
+SCRATCH_REGION2_SIZE_256                := 0x05000000  # 80MB
 
 BASE_ADDR                               := 0x80000000
 
@@ -39,11 +41,13 @@
 	SCRATCH_ADDR_128=$(SCRATCH_ADDR_128) \
 	SCRATCH_ADDR_256=$(SCRATCH_ADDR_256) \
 	SCRATCH_REGION_256=$(SCRATCH_REGION_256) \
+	SCRATCH_REGION2_256=$(SCRATCH_REGION2_256) \
 	SCRATCH_REGION1_128=$(SCRATCH_REGION1_128) \
 	SCRATCH_REGION2_128=$(SCRATCH_REGION2_128) \
 	SCRATCH_REGION1_SIZE_128=$(SCRATCH_REGION1_SIZE_128) \
 	SCRATCH_REGION2_SIZE_128=$(SCRATCH_REGION2_SIZE_128) \
 	SCRATCH_REGION_SIZE_256=$(SCRATCH_REGION_SIZE_256) \
+	SCRATCH_REGION2_SIZE_256=$(SCRATCH_REGION2_SIZE_256) \
 	KERNEL_REGION=$(KERNEL_REGION) \
 	KERNEL_REGION_SIZE=$(KERNEL_REGION_SIZE)