From 47486a4f16742cdecfbbb39b445fa202f5740db4 Mon Sep 17 00:00:00 2001 From: PeratX <1215714524@qq.com> Date: Tue, 29 Oct 2019 13:29:26 +0800 Subject: [PATCH] SKHynix: update interface --- FlashDetector/resources/lang/chs.json | 3 --- FlashDetector/resources/lang/eng.json | 3 --- .../src/iTXTech/FlashDetector/Constants.php | 1 - .../iTXTech/FlashDetector/Decoder/SKHynix.php | 22 +++++++++---------- 4 files changed, 10 insertions(+), 19 deletions(-) diff --git a/FlashDetector/resources/lang/chs.json b/FlashDetector/resources/lang/chs.json index 34b04fe..b35e3f3 100644 --- a/FlashDetector/resources/lang/chs.json +++ b/FlashDetector/resources/lang/chs.json @@ -10,7 +10,6 @@ "spectek": "美光白片", "toshiba": "东芝", "nand": "NAND", - "e2nand": "E2NAND", "inand": "iNAND", "issd": "iSSD", "nandcon": "带有控制器的NAND", @@ -59,8 +58,6 @@ "enterprise": "企业级", "pageSize": "页大小", "blockSize": "块大小", - "doubleStackPackage": "多堆封装", - "dualInterface": "双接口", "eccEnabled": "ECC已启用", "halfPageAndSize": "半页大小", "packageFunctionalityPartialType": "封装可用部分类型", diff --git a/FlashDetector/resources/lang/eng.json b/FlashDetector/resources/lang/eng.json index 8f377f7..aadb0f7 100644 --- a/FlashDetector/resources/lang/eng.json +++ b/FlashDetector/resources/lang/eng.json @@ -8,7 +8,6 @@ "spectek": "SpecTek", "toshiba": "Toshiba", "nand": "NAND", - "e2nand": "E2NAND", "inand": "iNAND", "issd": "iSSD", "nandcon": "NAND with Controller", @@ -57,8 +56,6 @@ "enterprise": "Enterprise", "pageSize": "Page size", "blockSize": "Block size", - "doubleStackPackage": "Double stack package", - "dualInterface": "Dual interface", "eccEnabled": "ECC enabled", "halfPageAndSize": "Half page and size", "packageFunctionalityPartialType": "Package functionality partial type", diff --git a/FlashDetector/src/iTXTech/FlashDetector/Constants.php b/FlashDetector/src/iTXTech/FlashDetector/Constants.php index 3918497..daa27a5 100644 --- a/FlashDetector/src/iTXTech/FlashDetector/Constants.php +++ b/FlashDetector/src/iTXTech/FlashDetector/Constants.php @@ -42,7 +42,6 @@ interface Constants{ public const VENDOR_TOSHIBA = "toshiba"; public const NAND_TYPE_NAND = "nand"; - public const NAND_TYPE_E2NAND = "e2nand"; public const NAND_TYPE_INAND = "inand"; public const NAND_TYPE_ISSD = "issd"; public const NAND_TYPE_CON = "nandcon"; diff --git a/FlashDetector/src/iTXTech/FlashDetector/Decoder/SKHynix.php b/FlashDetector/src/iTXTech/FlashDetector/Decoder/SKHynix.php index 5772e8d..25b3bcd 100644 --- a/FlashDetector/src/iTXTech/FlashDetector/Decoder/SKHynix.php +++ b/FlashDetector/src/iTXTech/FlashDetector/Decoder/SKHynix.php @@ -25,6 +25,7 @@ use iTXTech\FlashDetector\FlashDetector; use iTXTech\FlashDetector\FlashInfo; use iTXTech\FlashDetector\Property\Classification; +use iTXTech\FlashDetector\Property\FlashInterface; use iTXTech\SimpleFramework\Util\StringUtil; class SKHynix extends Decoder{ @@ -94,7 +95,7 @@ class SKHynix extends Decoder{ "2" => [1, 1, false, 1], "4" => [2, 2, true, 1], "5" => [2, 2, false, 1], - "D" => [-1, -1, false, 2],//Dual Interface + "D" => [2, 2, false, 2],//Dual Interface "F" => [4, 4, false, 2],//Dual Interface "T" => [5, 5, false, 1], "U" => [6, 6, false, 1], @@ -158,17 +159,13 @@ public static function decode(string $partNumber) : FlashInfo{ $flashInfo = (new FlashInfo($partNumber)) ->setVendor(self::getName()); if(in_array($level = self::shiftChars($partNumber, 3), ["H2J", "H2D", "H26"])){ - //TODO: SKHynix E2NAND return $flashInfo->setType(Constants::NAND_TYPE_CON) ->setExtraInfo([Constants::UNSUPPORTED_REASON => Constants::SKHYNIX_UNSUPPORTED]); }else{ $flashInfo->setType(Constants::NAND_TYPE_NAND); } - if($level == "H25"){ - return $flashInfo->setExtraInfo([Constants::UNSUPPORTED_REASON => Constants::SKHYNIX_UNSUPPORTED]); - } $flashInfo - ->setVoltage(self::getOrDefault(self::shiftChars($partNumber, 1), self::VOLTAGE)) + ->setVoltage(self::getOrDefault($voltage = self::shiftChars($partNumber, 1), self::VOLTAGE)) ->setDensity(self::getOrDefault(self::shiftChars($partNumber, 2), self::DENSITY, 0)) ->setDeviceWidth(self::getOrDefault(self::shiftChars($partNumber, 1), [ "8" => 8, @@ -183,15 +180,16 @@ public static function decode(string $partNumber) : FlashInfo{ $mode = self::getOrDefault(self::shiftChars($partNumber, 1), self::MODE, [-1, -1, false, -1]); $flashInfo->setClassification(new Classification( $mode[0], $mode[3], $mode[1], $classification[1])); - $flashInfo//->setInterface((new FlashInterface(false))->setAsync(true)->setSync(true))//Async default = true - ->setGeneration(self::getOrDefault(self::shiftChars($partNumber, 1), Samsung::GENERATION)) + if($voltage == "Q"){ + $flashInfo->setInterface((new FlashInterface(false))->setAsync(true)->setSync(true)); + }else{ + $flashInfo->setInterface((new FlashInterface(false))->setAsync(true)->setSync(false)); + } + $flashInfo->setGeneration(self::getOrDefault(self::shiftChars($partNumber, 1), Samsung::GENERATION)) ->setPackage(self::getOrDefault(self::shiftChars($partNumber, 1), self::PACKAGE)); $packageMaterial = self::shiftChars($partNumber, 1); - $extra = [ - "doubleStackPackage" => $classification[1] === -1, - "dualInterface" => $mode[3] > 1,//maybe this property is Channel - ]; + $extra = []; if(in_array($packageMaterial, ["P", "R"])){ $extra[Constants::LEAD_FREE] = true; }elseif($packageMaterial == "L"){