Skip to content

Commit

Permalink
SKHynix: update interface
Browse files Browse the repository at this point in the history
  • Loading branch information
PeratX committed Oct 29, 2019
1 parent 977de92 commit 47486a4
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 19 deletions.
3 changes: 0 additions & 3 deletions FlashDetector/resources/lang/chs.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"spectek": "美光白片",
"toshiba": "东芝",
"nand": "NAND",
"e2nand": "E2NAND",
"inand": "iNAND",
"issd": "iSSD",
"nandcon": "带有控制器的NAND",
Expand Down Expand Up @@ -59,8 +58,6 @@
"enterprise": "企业级",
"pageSize": "页大小",
"blockSize": "块大小",
"doubleStackPackage": "多堆封装",
"dualInterface": "双接口",
"eccEnabled": "ECC已启用",
"halfPageAndSize": "半页大小",
"packageFunctionalityPartialType": "封装可用部分类型",
Expand Down
3 changes: 0 additions & 3 deletions FlashDetector/resources/lang/eng.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"spectek": "SpecTek",
"toshiba": "Toshiba",
"nand": "NAND",
"e2nand": "E2NAND",
"inand": "iNAND",
"issd": "iSSD",
"nandcon": "NAND with Controller",
Expand Down Expand Up @@ -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",
Expand Down
1 change: 0 additions & 1 deletion FlashDetector/src/iTXTech/FlashDetector/Constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
22 changes: 10 additions & 12 deletions FlashDetector/src/iTXTech/FlashDetector/Decoder/SKHynix.php
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down Expand Up @@ -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],
Expand Down Expand Up @@ -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,
Expand All @@ -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"){
Expand Down

0 comments on commit 47486a4

Please sign in to comment.