Define gfrg240 partition layout
(I55a5e756a54c9d422ca288117a1057168574ed8e with new file locations)
remove definition of unused PLATFORM_DEFAULT_BOARD_ID
Change-Id: Ie89b2a64ead104677d8ec1a1da63883cb88adee6
diff --git a/arch/arc/plat-qtn/sdk-qsr1000/common/current_platform.h b/arch/arc/plat-qtn/sdk-qsr1000/common/current_platform.h
index e8e3e34..8f8492e 100644
--- a/arch/arc/plat-qtn/sdk-qsr1000/common/current_platform.h
+++ b/arch/arc/plat-qtn/sdk-qsr1000/common/current_platform.h
@@ -7,6 +7,6 @@
#define ARC_HW_REV_NEEDS_TLBMISS_FIX
#define TOPAZ_SUPPORT_UMM 1
#define TOPAZ_SUPPORT_256MB_DDR 1
-#define FLASH_SUPPORT_64KB
#define WPA_TKIP_SUPPORT 0
#define SIGMA_TESTBED_SUPPORT 0
+#define GFRG240 1
diff --git a/arch/arc/plat-qtn/sdk-qsr1000/common/ruby_partitions.h b/arch/arc/plat-qtn/sdk-qsr1000/common/ruby_partitions.h
index 1af2bc5..0ebd4a0 100644
--- a/arch/arc/plat-qtn/sdk-qsr1000/common/ruby_partitions.h
+++ b/arch/arc/plat-qtn/sdk-qsr1000/common/ruby_partitions.h
@@ -28,6 +28,41 @@
#ifndef __RUBY_PARTITIONS_H
#define __RUBY_PARTITIONS_H
+#ifdef GFRG240
+#define UBOOT_TEXT_PARTITION_SIZE 0x0040000 /* 256K */
+#define UBOOT_ENV_PARTITION_SIZE 0x0010000 /* 64K */
+#define UBOOT_RESERVED_A_PARTITION_SIZE 0x0030000 /* 192K */
+#define UBOOT_VENDOR_PARTITION_SIZE 0x0080000 /* 512K */
+#define UBOOT_RESERVED_B_PARTITION_SIZE 0x0100000 /* 1M */
+#define UBOOT_HNVRAM_PARTITION_SIZE 0x0200000 /* 2M */
+#define UBOOT_KERNEL_PARTITION_SIZE 0x1C00000 /* 28M (x2) */
+#define UBOOT_DATA_PARTITION_SIZE 0x0400000 /* 4M */
+
+#define CONFIG_ENV_OFFSET 0x0040000 /* offset of uboot environment */
+
+#define MTD_PARTNAME_UBOOT_BIN "uboot"
+#define MTD_PARTNAME_UBOOT_ENV "uboot_env"
+#define MTD_PARTNAME_RESERVED_A "reserved_a"
+#define MTD_PARTNAME_VENDOR "vendor"
+#define MTD_PARTNAME_RESERVED_B "reserved_b"
+#define MTD_PARTNAME_HNVRAM "hnvram"
+#define MTD_PARTNAME_KERNEL0 "kernel0"
+#define MTD_PARTNAME_KERNEL1 "kernel1"
+#define MTD_PARTNAME_DATA "data+ubi"
+
+/*
+ * quantenna stores files in the uboot env partition.
+ * limit the size of uboot environment to 24K, and allow
+ * quantenna file storage in the remaining 40K.
+*/
+#define CONFIG_ENV_SHRUNK_SIZE (24 * 1024) /* limited uboot environment */
+#define BOOT_CFG_DEF_START CONFIG_ENV_SHRUNK_SIZE /* qtn file starts after uboot-env */
+#define BOOT_CFG_SIZE (UBOOT_ENV_PARTITION_SIZE - CONFIG_ENV_SHRUNK_SIZE)
+#define BOOT_CFG_DATA_SIZE (UBOOT_ENV_PARTITION_SIZE - sizeof(u32))
+
+
+#else // #ifdef GFRG240
+
#define F64K_UBOOT_PIGGY_PARTITION_SIZE 0x5000
#if defined(FLASH_SUPPORT_256KB)
@@ -97,6 +132,8 @@
#define IMG_SIZE_LIMIT_PLATFORM IMG_SIZE_16M_FLASH_2_IMG
+#endif // #ifdef GFRG240
+
#endif // #ifndef __RUBY_PARTITIONS_H
diff --git a/drivers/qtn/ruby/spi_flash.c b/drivers/qtn/ruby/spi_flash.c
index c1fd557..061a665 100644
--- a/drivers/qtn/ruby/spi_flash.c
+++ b/drivers/qtn/ruby/spi_flash.c
@@ -604,6 +604,7 @@
#define RUBY_MTD_PART(name, size, offset) {name, size, offset, 0}
#endif
+#ifndef GFRG240
static struct mtd_partition __initdata parts_64K[] = {
RUBY_MTD_PART(MTD_PARTNAME_UBOOT_BIN, F64K_UBOOT_PIGGY_PARTITION_SIZE, 0),
RUBY_MTD_PART(MTD_PARTNAME_UBOOT_ENV, F64K_ENV_PARTITION_SIZE, MTDPART_OFS_NXTBLK),
@@ -665,6 +666,19 @@
RUBY_MTD_PART(MTD_PARTNAME_DATA, RUBY_MIN_DATA_PARTITION_SIZE, MTDPART_OFS_NXTBLK),
RUBY_MTD_PART(MTD_PARTNAME_EXTEND, MTDPART_SIZ_FULL, MTDPART_OFS_NXTBLK),
};
+#else
+static struct mtd_partition __initdata parts_64M[] = {
+ RUBY_MTD_PART(MTD_PARTNAME_UBOOT_BIN, UBOOT_TEXT_PARTITION_SIZE, 0),
+ RUBY_MTD_PART(MTD_PARTNAME_UBOOT_ENV, UBOOT_ENV_PARTITION_SIZE, MTDPART_OFS_NXTBLK),
+ RUBY_MTD_PART(MTD_PARTNAME_RESERVED_A, UBOOT_RESERVED_A_PARTITION_SIZE, MTDPART_OFS_NXTBLK),
+ RUBY_MTD_PART(MTD_PARTNAME_VENDOR, UBOOT_VENDOR_PARTITION_SIZE, MTDPART_OFS_NXTBLK),
+ RUBY_MTD_PART(MTD_PARTNAME_RESERVED_B, UBOOT_RESERVED_B_PARTITION_SIZE, MTDPART_OFS_NXTBLK),
+ RUBY_MTD_PART(MTD_PARTNAME_HNVRAM, UBOOT_HNVRAM_PARTITION_SIZE, MTDPART_OFS_NXTBLK),
+ RUBY_MTD_PART(MTD_PARTNAME_KERNEL0, UBOOT_KERNEL_PARTITION_SIZE, MTDPART_OFS_NXTBLK),
+ RUBY_MTD_PART(MTD_PARTNAME_KERNEL1, UBOOT_KERNEL_PARTITION_SIZE, MTDPART_OFS_NXTBLK),
+ RUBY_MTD_PART(MTD_PARTNAME_DATA, MTDPART_SIZ_FULL, MTDPART_OFS_NXTBLK),
+};
+#endif /* ifndef GFRG240 */
struct mtd_partition_table {
int flashsz;
@@ -674,6 +688,7 @@
static const struct mtd_partition_table partition_tables[] = {
{ FLASH_64MB, parts_64M, ARRAY_SIZE(parts_64M) },
+#ifndef GFRG240
{ FLASH_32MB, parts_32M, ARRAY_SIZE(parts_32M) },
{ FLASH_16MB, parts_16M, ARRAY_SIZE(parts_16M) },
{ FLASH_8MB, parts_8M, ARRAY_SIZE(parts_8M) },
@@ -683,6 +698,7 @@
{ FLASH_256KB, parts_256K, ARRAY_SIZE(parts_256K) },
#endif
{ FLASH_64KB, parts_64K, ARRAY_SIZE(parts_64K) },
+#endif /* ifndef GFRG240 */
};
#if 0