From 60ef93a073b06876b06fb40b08663ad33895a3d3 Mon Sep 17 00:00:00 2001
From: Tian Hao <haotia@gmail.com>
Date: Sun, 2 Apr 2017 00:09:10 +0800
Subject: [PATCH] mtd: bcm47xxpart: add partition workaround for PHICOMM K3

Signed-off-by: Tian Hao <haotia@gmail.com>
---
 drivers/mtd/bcm47xxpart.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/mtd/bcm47xxpart.c b/drivers/mtd/bcm47xxpart.c
index e796a804..64c6858f 100644
--- a/drivers/mtd/bcm47xxpart.c
+++ b/drivers/mtd/bcm47xxpart.c
@@ -270,6 +270,14 @@ static int bcm47xxpart_parse(struct mtd_info *master,
 			 */
 			bcm47xxpart_add_part(&parts[curr_part++], "tplink", offset, MTD_WRITEABLE);
 			continue;
+		} else if (of_machine_is_compatible("phicomm,k3") && offset == 0x180000) {
+			/*
+			* This device has nvram_back, res_info, pro_info and dev_info from
+			* 0x180000 (end of nvram) to 0x400000 (start of linux). These partitions
+			* has essential information for original firwamre. We do not want these.
+			*/
+			bcm47xxpart_add_part(&parts[curr_part++], "phicomm", offset, MTD_WRITEABLE);
+			continue;
 		}

 		/* Read beginning of the block */
--
2.11.0

