Skip to content

Commit

Permalink
FDB: version 48 (fdfdb updates)
Browse files Browse the repository at this point in the history
FDBGen: remove package for SpecTek
FDBGen: fix SKhynix in SMI ForceFlash
  • Loading branch information
PeratX committed Dec 30, 2019
1 parent 47c7c53 commit 19092e0
Show file tree
Hide file tree
Showing 8 changed files with 50,481 additions and 6,417 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

use iTXTech\FlashDetector\Decoder\Micron;
use iTXTech\FlashDetector\Decoder\SKHynix;
use iTXTech\FlashDetector\Decoder\SpecTek;
use iTXTech\FlashDetector\Fdb\Fdb;
use iTXTech\SimpleFramework\Util\StringUtil;

Expand Down Expand Up @@ -55,6 +56,9 @@ public static function merge(Fdb $fdb, string $data, string $filename) : void{
}
}
switch($vendor){
case "spectek":
$pn = SpecTek::removePackage($pn);
break;
case "micron":
$pn = Micron::removePackage($pn);
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

use iTXTech\FlashDetector\Decoder\Micron;
use iTXTech\FlashDetector\Decoder\SKHynix;
use iTXTech\FlashDetector\Decoder\SpecTek;
use iTXTech\FlashDetector\Fdb\Fdb;
use iTXTech\SimpleFramework\Util\StringUtil;

Expand Down Expand Up @@ -62,8 +63,9 @@ public static function merge(Fdb $fdb, string $data, string $filename) : void{
}
}
foreach($fdb->getVendor($vendor)->getPartNumbers() as $pn => $flash){
foreach($flash->getFlashIds() as $ids){
if(StringUtil::startsWith($ids, $flashId)){
foreach($flash->getFlashIds() as $id){
if(StringUtil::startsWith($id, $flashId)){
$fdb->getIddb()->getFlashId($id)->addController($sup);
$flash->addController($sup);
$found = true;
break;
Expand All @@ -73,6 +75,9 @@ public static function merge(Fdb $fdb, string $data, string $filename) : void{
if(!$found){
$pn = str_replace(["(T)", "(TOG)", "(TOG"], "", $rec[3]);
switch($vendor){
case "spectek":
$pn = SpecTek::removePackage($pn);
break;
case "micron":
$pn = Micron::removePackage($pn);
case "toshiba":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@

namespace iTXTech\FlashDetector\FDBGen\Generator;

use iTXTech\FlashDetector\Decoder\Micron;
use iTXTech\FlashDetector\Decoder\SKHynix;
use iTXTech\FlashDetector\Decoder\SpecTek;
use iTXTech\FlashDetector\Fdb\Fdb;
use iTXTech\SimpleFramework\Util\StringUtil;

Expand All @@ -31,7 +34,7 @@ public static function getDirName() : string{
public static function merge(Fdb $fdb, string $data, string $filename) : void{
$data = explode("\r\n", mb_convert_encoding($data, "UTF-8", "UTF-8"));
foreach($data as $line => $d){
if(!StringUtil::startsWith($d, "A")){
if(count($parts = explode("=", $d)) > 1 and !StringUtil::contains($parts[1], ",")){
$d = explode(",", explode("_", $d)[0]);
if(count($d) == 6){
for($i = 0; $i < 6; $i++){
Expand All @@ -56,12 +59,25 @@ public static function merge(Fdb $fdb, string $data, string $filename) : void{
}
$info = explode(",", $index);
$pn = explode("_", str_replace(" ", "", explode("(", @end($info))[0]))[0];
$vendor = str_replace([" ", "tsb", "ss", "hy", "hynix"], ["", "toshiba", "samsung", "hynix", "skhynix"],
strtolower(explode("_", $info[0])[0]));
$vendor = str_replace("skhynixnix", "skhynix",
str_replace([" ", "tsb", "ss", "hy", "hynix"], ["", "toshiba", "samsung", "hynix", "skhynix"],
strtolower(explode("_", $info[0])[0])));
if(is_numeric($vendor{strlen($vendor) - 1})){
$vendor = substr($vendor, 0, strlen($vendor) - 1);
}

switch($vendor){
case "spectek":
$pn = SpecTek::removePackage($pn);
break;
case "micron":
$pn = Micron::removePackage($pn);
break;
case "skhynix":
$pn = SKHynix::removePackage($pn);
break;
}

$fdb->getPartNumber($vendor, $pn, true)
->addFlashId($d);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

use iTXTech\FlashDetector\Decoder\Micron;
use iTXTech\FlashDetector\Decoder\SKHynix;
use iTXTech\FlashDetector\Decoder\SpecTek;
use iTXTech\FlashDetector\Fdb\Fdb;
use iTXTech\SimpleFramework\Util\StringUtil;

Expand Down Expand Up @@ -67,6 +68,9 @@ public static function merge(Fdb $fdb, string $data, string $filename) : void{
}
}
switch($vendor){
case "spectek":
$pn = SpecTek::removePackage($pn);
break;
case "micron":
$pn = Micron::removePackage($pn);
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

use iTXTech\FlashDetector\Decoder\Micron;
use iTXTech\FlashDetector\Decoder\SKHynix;
use iTXTech\FlashDetector\Decoder\SpecTek;
use iTXTech\FlashDetector\Fdb\Fdb;
use iTXTech\SimpleFramework\Util\StringUtil;

Expand Down Expand Up @@ -84,6 +85,9 @@ public static function merge(Fdb $fdb, string $data, string $filename) : void{
case "micron":
$info[1] = Micron::removePackage($info[1]);
break;
case "spectek":
$info[1] = SpecTek::removePackage($info[1]);
break;
}

$pn = $fdb->getPartNumber($vendor, $info[1], true)
Expand Down
Loading

0 comments on commit 19092e0

Please sign in to comment.