Skip to content

Commit c194ae4

Browse files
committed
Toshiba: now Kioxia
1 parent 90edd07 commit c194ae4

File tree

11 files changed

+32
-31
lines changed

11 files changed

+32
-31
lines changed

FlashDetector/resources/lang/chs.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
"intel": "英特尔",
66
"micron": "美光",
77
"samsung": "三星",
8-
"sandisk": "闪迪",
8+
"westerndigital": "西数",
99
"skhynix": "SK海力士",
1010
"spectek": "美光白片",
11-
"toshiba": "东芝",
11+
"kioxia": "铠侠",
1212
"nand": "NAND",
1313
"inand": "iNAND",
1414
"issd": "iSSD",

FlashDetector/resources/lang/eng.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
"intel": "Intel",
44
"micron": "Micron",
55
"samsung": "Samsung",
6-
"sandisk": "SanDisk",
6+
"westerndigital": "Western Digital",
77
"skhynix": "SKHynix",
88
"spectek": "SpecTek",
9-
"toshiba": "Toshiba",
9+
"kioxia": "Kioxia",
1010
"nand": "NAND",
1111
"inand": "iNAND",
1212
"issd": "iSSD",

FlashDetector/sf.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "FlashDetector",
3-
"version": "0",
3+
"version": "1",
44
"api": 6,
55
"description": "Universal NAND Flash Part Number Decoder",
66
"author": "iTX Technologies",

FlashDetector/src/iTXTech/FlashDetector/Constants.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,12 @@ interface Constants{
3636
public const VENDOR_INTEL = "intel";
3737
public const VENDOR_MICRON = "micron";
3838
public const VENDOR_SAMSUNG = "samsung";
39-
public const VENDOR_SANDISK = "sandisk";
39+
public const VENDOR_WESTERN_DIGITAL = "westerndigital";
4040
public const VENDOR_SKHYNIX = "skhynix";
4141
public const VENDOR_SPECTEK = "spectek";
42+
public const VENDOR_KIOXIA = "kioxia";
4243
public const VENDOR_TOSHIBA = "toshiba";
44+
public const VENDOR_SANDISK = "sandisk";
4345

4446
public const NAND_TYPE_NAND = "nand";
4547
public const NAND_TYPE_INAND = "inand";

FlashDetector/src/iTXTech/FlashDetector/Decoder/Intel.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ public static function decode(string $partNumber) : FlashInfo{
108108
"M" => [2, 2, 2, true],
109109
"N" => [4, 4, 4, true],
110110
"O" => [8, 8, 4, true],
111+
"P" => [8, 8, 8, true],//L74
111112
"W" => [16, 8, 4, true]
112113
], [-1, -1, -1, false]);
113114
$flashInfo->setClassification(new Classification(

FlashDetector/src/iTXTech/FlashDetector/Decoder/Toshiba.php renamed to FlashDetector/src/iTXTech/FlashDetector/Decoder/Kioxia.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,16 @@
2121
namespace iTXTech\FlashDetector\Decoder;
2222

2323
use iTXTech\FlashDetector\Constants;
24+
use iTXTech\FlashDetector\Fdb\PartNumber;
25+
use iTXTech\FlashDetector\FlashDetector;
2426
use iTXTech\FlashDetector\FlashInfo;
2527
use iTXTech\FlashDetector\Property\Classification;
2628
use iTXTech\FlashDetector\Property\FlashInterface;
2729
use iTXTech\SimpleFramework\Util\StringUtil;
2830

29-
//TODO: rename to Kioxia
30-
class Toshiba extends Decoder{
31+
class Kioxia extends Decoder{
3132
public static function getName() : string{
32-
return Constants::VENDOR_TOSHIBA;
33+
return Constants::VENDOR_KIOXIA;
3334
}
3435

3536
public static function check(string $partNumber) : bool{
@@ -226,4 +227,9 @@ public static function decode(string $partNumber) : FlashInfo{
226227

227228
return $flashInfo;
228229
}
230+
231+
public static function getFlashInfoFromFdb(FlashInfo $info) : ?PartNumber{
232+
return FlashDetector::getFdb()->getPartNumber($info->getVendor(), $info->getPartNumber()) ??
233+
FlashDetector::getFdb()->getPartNumber(Constants::VENDOR_TOSHIBA, $info->getPartNumber());
234+
}
229235
}

FlashDetector/src/iTXTech/FlashDetector/Decoder/SanDisk.php renamed to FlashDetector/src/iTXTech/FlashDetector/Decoder/WesternDigital.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@
2727
use iTXTech\FlashDetector\Property\Classification;
2828
use iTXTech\SimpleFramework\Util\StringUtil;
2929

30-
//TODO: rename to Western Digital
31-
class SanDisk extends Decoder{
30+
class WesternDigital extends Decoder{
3231
public const CELL_LEVEL = [
3332
"C" => 3,
3433
"F" => 2,
@@ -57,7 +56,7 @@ class SanDisk extends Decoder{
5756
];
5857

5958
public static function getName() : string{
60-
return Constants::VENDOR_SANDISK;
59+
return Constants::VENDOR_WESTERN_DIGITAL;
6160
}
6261

6362
public static function check(string $partNumber) : bool{
@@ -138,7 +137,8 @@ public static function decode(string $partNumber) : FlashInfo{
138137
}
139138

140139
public static function getFlashInfoFromFdb(FlashInfo $info) : ?PartNumber{
141-
$data = FlashDetector::getFdb()->getPartNumber(self::getName(), $info->getPartNumber());
140+
$data = FlashDetector::getFdb()->getPartNumber(self::getName(), $info->getPartNumber()) ??
141+
FlashDetector::getFdb()->getPartNumber(Constants::VENDOR_SANDISK, $info->getPartNumber());
142142
if($data != null){
143143
$comment = "";
144144
$parts = explode("/", $data->getComment() ?? "");
@@ -149,7 +149,7 @@ public static function getFlashInfoFromFdb(FlashInfo $info) : ?PartNumber{
149149
}elseif($part == "CODE"){
150150
$extraInfo[Constants::SANDISK_CODE] = true;
151151
}elseif($part{0} == "T"){
152-
$extraInfo[Constants::VENDOR_TOSHIBA] = substr($part, 1);
152+
$extraInfo[Constants::VENDOR_KIOXIA] = substr($part, 1);
153153
}else{
154154
$comment .= $part . "/";
155155
}

FlashDetector/src/iTXTech/FlashDetector/Decoder/SanDiskShortCode.php renamed to FlashDetector/src/iTXTech/FlashDetector/Decoder/WesternDigitalShortCode.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@
2323
use iTXTech\FlashDetector\Constants;
2424
use iTXTech\FlashDetector\FlashInfo;
2525

26-
class SanDiskShortCode extends SanDisk{
27-
26+
class WesternDigitalShortCode extends WesternDigital{
2827
public static function check(string $partNumber) : bool{
2928
//example: 05055-032G
3029
if(strlen($partNumber) == 10){
@@ -36,14 +35,10 @@ public static function check(string $partNumber) : bool{
3635
return false;
3736
}
3837

39-
public static function getName() : string{
40-
return Constants::VENDOR_SANDISK;
41-
}
42-
4338
public static function decode(string $partNumber) : FlashInfo{
4439
$flashInfo = (new FlashInfo($partNumber))->setVendor(self::getName())
4540
->setDensity(self::matchFromStart(explode("-", $partNumber, 2)[1],
46-
SanDisk::DENSITY, 0));
41+
WesternDigital::DENSITY, 0));
4742
return $flashInfo;
4843
}
4944
}

FlashDetector/src/iTXTech/FlashDetector/FlashDetector.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@
2525
use iTXTech\FlashDetector\Decoder\Micron;
2626
use iTXTech\FlashDetector\Decoder\MicronFbgaCode;
2727
use iTXTech\FlashDetector\Decoder\Samsung;
28-
use iTXTech\FlashDetector\Decoder\SanDisk;
29-
use iTXTech\FlashDetector\Decoder\SanDiskShortCode;
28+
use iTXTech\FlashDetector\Decoder\WesternDigital;
29+
use iTXTech\FlashDetector\Decoder\WesternDigitalShortCode;
3030
use iTXTech\FlashDetector\Decoder\SKHynix;
3131
use iTXTech\FlashDetector\Decoder\SKHynix3D;
3232
use iTXTech\FlashDetector\Decoder\SKHynixLegacy;
3333
use iTXTech\FlashDetector\Decoder\SpecTek;
34-
use iTXTech\FlashDetector\Decoder\Toshiba;
34+
use iTXTech\FlashDetector\Decoder\Kioxia;
3535
use iTXTech\FlashDetector\Fdb\Fdb;
3636
use iTXTech\FlashDetector\Property\Classification;
3737
use iTXTech\SimpleFramework\Util\StringUtil;
@@ -101,13 +101,13 @@ public static function init(string $lang = "eng", string $fallbackLang = "eng"){
101101
self::registerDecoder(SKHynix3D::class);
102102
self::registerDecoder(SKHynix::class);
103103
self::registerDecoder(SKHynixLegacy::class);
104-
self::registerDecoder(Toshiba::class);
104+
self::registerDecoder(Kioxia::class);
105105
self::registerDecoder(Samsung::class);
106106
self::registerDecoder(Intel::class);
107107
self::registerDecoder(MicronFbgaCode::class);
108108
self::registerDecoder(SpecTek::class);
109-
self::registerDecoder(SanDisk::class);
110-
self::registerDecoder(SanDiskShortCode::class);
109+
self::registerDecoder(WesternDigital::class);
110+
self::registerDecoder(WesternDigitalShortCode::class);
111111
if(Loader::getInstance() !== null){
112112
self::$lang = json_decode(Loader::getInstance()->getResourceAsText("lang/$lang.json"), true);
113113
self::$fallbackLang = json_decode(Loader::getInstance()

FlashDetector/src/iTXTech/FlashDetector/FlashInfo.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,6 @@ public function toArray(bool $raw = true) : array{
192192
$info["interface"] = $interface;//hack!
193193
}
194194
$info["rawVendor"] = $this->vendor;
195-
//backward compatibility
196-
$info["manufacturer"] = $info["vendor"];
197-
$info["rawManufacturer"] = $info["rawVendor"];
198195
return $info;
199196
}
200197

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ $ composer install
2424

2525
1. `Intel`/`Micron (SpecTek)`
2626
1. `Samsung`
27-
1. `Western Digital (SanDisk)`/`Toshiba`
27+
1. `Western Digital (SanDisk)`/`Kioxia (Toshiba)`
2828
1. `SKHynix`
2929

3030
### Controllers

0 commit comments

Comments
 (0)