summaryrefslogtreecommitdiffstats
path: root/utils/bcmflash/main.cpp
diff options
context:
space:
mode:
authorEvan Lojewski <github@meklort.com>2020-11-01 12:58:52 -0700
committerGitHub <noreply@github.com>2020-11-01 12:58:52 -0700
commite223b341640c3eff0ab0e2189346e07afa171b39 (patch)
treef37ec2587574dd63853e6f4fe371068469104a74 /utils/bcmflash/main.cpp
parent8dd6ad9871e35d0f3383e973207b8538d30a03a7 (diff)
downloadbcm5719-ortega-e223b341640c3eff0ab0e2189346e07afa171b39.tar.gz
bcm5719-ortega-e223b341640c3eff0ab0e2189346e07afa171b39.zip
bcmflash: Enable extracting raw vpd information. (#156)
Diffstat (limited to 'utils/bcmflash/main.cpp')
-rw-r--r--utils/bcmflash/main.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/utils/bcmflash/main.cpp b/utils/bcmflash/main.cpp
index 499abee..063acf3 100644
--- a/utils/bcmflash/main.cpp
+++ b/utils/bcmflash/main.cpp
@@ -770,5 +770,21 @@ int main(int argc, char const *argv[])
dump_vpd(gVPD, gVPDLength);
+ if (extract)
+ {
+ if (!bcmflash_file_write("vpd.bin", nvram.contents.vpd.bytes, sizeof(nvram.contents.vpd)))
+ {
+ exit(-1);
+ }
+
+ if (gVPD != nvram.contents.vpd.bytes)
+ {
+ if (!bcmflash_file_write("vpd-e.bin", gVPD, gVPDLength))
+ {
+ exit(-1);
+ }
+ }
+ }
+
return 0;
}
OpenPOWER on IntegriCloud