tools: pack: Choose nand-4k only for nand

nand-4k is auto picked only for nand and not for norplusnand.

Change-Id: Id78940ebebde7d8e814a8334d11b65f69ac1520e
Signed-off-by: Saravanan Jaganathan <sjaganat@codeaurora.org>
diff --git a/tools/pack.py b/tools/pack.py
index 916484f..2f251b9 100644
--- a/tools/pack.py
+++ b/tools/pack.py
@@ -1318,10 +1318,10 @@
 
         if flinfo.type != "emmc":
             if root.find(".//data[@type='NAND_PARAMETER']/entry") != None:
-                if flinfo.type == "nand":
-                    flash_param = root.find(".//data[@type='NAND_PARAMETER']/entry[@type='2k']")
-                else:
+                if flinfo.type == "nand-4k":
                     flash_param = root.find(".//data[@type='NAND_PARAMETER']/entry[@type='4k']")
+                else:
+                    flash_param = root.find(".//data[@type='NAND_PARAMETER']/entry[@type='2k']")
             else:
                 flash_param = root.find(".//data[@type='NAND_PARAMETER']")
 
@@ -1595,7 +1595,7 @@
     root = ET.parse(config)
 
 # Add nand-4k flash type, if nand flash type is specified
-    if "nand" in parser.flash_type:
+    if "nand" in parser.flash_type.split(","):
         if root.find(".//data[@type='NAND_PARAMETER']/entry") != None:
             parser.flash_type = parser.flash_type + ",nand-4k"