summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvan Lojewski <github@meklort.com>2020-11-27 19:36:58 -0700
committerGitHub <noreply@github.com>2020-11-27 19:36:58 -0700
commitaafb2f96cb72257ae23f7d839969d675f75570a9 (patch)
treecb4a88b696ac57c7bc7f4dd5fffd16aed203eff4
parente748bb2049be7151efa2369a3bc0c50d13e4aa82 (diff)
downloadbcm5719-ortega-aafb2f96cb72257ae23f7d839969d675f75570a9.tar.gz
bcm5719-ortega-aafb2f96cb72257ae23f7d839969d675f75570a9.zip
bcmflash: Print additional information about the firmware configuration. (#182)
-rw-r--r--utils/bcmflash/main.cpp63
-rw-r--r--utils/bcmregtool/main.cpp9
2 files changed, 59 insertions, 13 deletions
diff --git a/utils/bcmflash/main.cpp b/utils/bcmflash/main.cpp
index 3910697..1a48e9b 100644
--- a/utils/bcmflash/main.cpp
+++ b/utils/bcmflash/main.cpp
@@ -53,6 +53,7 @@
#include <OptionParser.h>
#include <bcm5719-endian.h>
#include <bcm5719_DEVICE.h>
+#include <bcm5719_GEN.h>
#include <bcm5719_eeprom.h>
#include <stdbool.h>
#include <stdint.h>
@@ -282,6 +283,10 @@ bool set_mac(uint32_t dest[2], const char *mac_str)
void dump_info(NVRAMInfo_t *info, NVRAMInfo2_t *info2)
{
+ RegGENGenCfgHw_t hw;
+ RegGENGenCfgHw2_t hw2;
+ RegGENGenCfgFeature_t feature;
+
printf("\n=== Info ===\n");
printf("Firmware Revision: 0x%04X\n", be16toh(info->firmwareRevision));
@@ -302,7 +307,15 @@ void dump_info(NVRAMInfo_t *info, NVRAMInfo2_t *info2)
printf("Function 2G Subsystem ID 0x%04X\n", be16toh(info2->pciSubsystemF2GPHY));
printf("Function 3G Subsystem ID 0x%04X\n", be16toh(info2->pciSubsystemF3GPHY));
- printf("Shared Cfg: 0x%08X\n", be32toh(info->cfgShared));
+ printf("Shared Cfg: 0x%08X", be32toh(info->cfgShared));
+ RegGENGenCfgShared_t shared;
+ shared.r32 = be32toh(info->cfgShared);
+ shared.print();
+
+ printf("Cfg5: 0x%08X", be32toh(info2->cfg5));
+ RegGENGenCfg5_t cfg5;
+ cfg5.r32 = be32toh(info2->cfg5);
+ cfg5.print();
printf("Power Dissipated: 0x%02X 0x%02X 0x%02X 0x%02X\n", info->powerDissipatedD3, info->powerDissipatedD2, info->powerDissipatedD1,
info->powerDissipatedD0);
@@ -344,30 +357,54 @@ void dump_info(NVRAMInfo_t *info, NVRAMInfo2_t *info2)
printf("\n=== Port 0 ===\n");
printf("Subsystem ID: 0x%04X\n", be16toh(info2->pciSubsystemF0GPHY));
printf("MAC: 0x%04X%08X\n", be32toh(info->macAddr0[0]), be32toh(info->macAddr0[1]));
- printf("Feature: 0x%08X\n", be32toh(info->func0CfgFeature));
- printf("Cfg: 0x%08X\n", be32toh(info->func0CfgHW));
- printf("Cfg2: 0x%08X\n", be32toh(info2->func0CfgHW2));
+ printf("Feature: 0x%08X", be32toh(info->func0CfgFeature));
+ feature.r32 = be32toh(info->func0CfgFeature);
+ feature.print();
+ printf("Cfg: 0x%08X", be32toh(info->func0CfgHW));
+ hw.r32 = be32toh(info->func0CfgHW);
+ hw.print();
+ printf("Cfg2: 0x%08X", be32toh(info2->func0CfgHW2));
+ hw2.r32 = be32toh(info2->func0CfgHW2);
+ hw2.print();
printf("\n=== Port 1 ===\n");
printf("Subsystem ID: 0x%04X\n", be16toh(info2->pciSubsystemF1GPHY));
printf("MAC: 0x%04X%08X\n", be32toh(info->macAddr1[0]), be32toh(info->macAddr1[1]));
- printf("Feature: 0x%08X\n", be32toh(info->func1CfgFeature));
- printf("Cfg: 0x%08X\n", be32toh(info->func1CfgHW));
- printf("Cfg2: 0x%08X\n", be32toh(info2->func1CfgHW2));
+ printf("Feature: 0x%08X", be32toh(info->func1CfgFeature));
+ feature.r32 = be32toh(info->func1CfgFeature);
+ feature.print();
+ printf("Cfg: 0x%08X", be32toh(info->func1CfgHW));
+ hw.r32 = be32toh(info->func1CfgHW);
+ hw.print();
+ printf("Cfg2: 0x%08X", be32toh(info2->func1CfgHW2));
+ hw2.r32 = be32toh(info2->func1CfgHW2);
+ hw2.print();
printf("\n=== Port 2 ===\n");
printf("Subsystem ID: 0x%04X\n", be16toh(info2->pciSubsystemF2GPHY));
printf("MAC: 0x%04X%08X\n", be32toh(info2->macAddr2[0]), be32toh(info2->macAddr2[1]));
- printf("Feature: 0x%08X\n", be32toh(info2->func2CfgFeature));
- printf("Cfg: 0x%08X\n", be32toh(info2->func2CfgHW));
- printf("Cfg2: 0x%08X\n", be32toh(info2->func2CfgHW2));
+ printf("Feature: 0x%08X", be32toh(info2->func2CfgFeature));
+ feature.r32 = be32toh(info2->func2CfgFeature);
+ feature.print();
+ printf("Cfg: 0x%08X", be32toh(info2->func2CfgHW));
+ hw.r32 = be32toh(info2->func2CfgHW);
+ hw.print();
+ printf("Cfg2: 0x%08X", be32toh(info2->func2CfgHW2));
+ hw2.r32 = be32toh(info2->func2CfgHW2);
+ hw2.print();
printf("\n=== Port 3 ===\n");
printf("Subsystem ID: 0x%04X\n", be16toh(info2->pciSubsystemF3GPHY));
printf("MAC: 0x%04X%08X\n", be32toh(info2->macAddr3[0]), be32toh(info2->macAddr3[1]));
- printf("Feature: 0x%08X\n", be32toh(info2->func3CfgFeature));
- printf("Cfg: 0x%08X\n", be32toh(info2->func3CfgHW));
- printf("Cfg2: 0x%08X\n", be32toh(info2->func3CfgHW2));
+ printf("Feature: 0x%08X", be32toh(info2->func3CfgFeature));
+ feature.r32 = be32toh(info2->func3CfgFeature);
+ feature.print();
+ printf("Cfg: 0x%08X", be32toh(info2->func3CfgHW));
+ hw.r32 = be32toh(info2->func3CfgHW);
+ hw.print();
+ printf("Cfg2: 0x%08X", be32toh(info2->func3CfgHW2));
+ hw2.r32 = be32toh(info2->func3CfgHW2);
+ hw2.print();
printf("\n=== SMBus ===\n");
printf("Device Address: 0x%02X\n", info->SMBusAddr);
diff --git a/utils/bcmregtool/main.cpp b/utils/bcmregtool/main.cpp
index 0691574..16670eb 100644
--- a/utils/bcmregtool/main.cpp
+++ b/utils/bcmregtool/main.cpp
@@ -359,6 +359,8 @@ int main(int argc, char const *argv[])
parser.add_option("--nvic").dest("nvic").set_default("0").action("store_true").help("Print NVIC registers");
+ parser.add_option("--gen").dest("gen").set_default("0").action("store_true").help("Print GEN registers");
+
parser.add_option("--unlock").dest("unlock").set_default("0").action("store_true").help("Unlock NVM and APE registers");
parser.add_option("-apereset", "--apereset").dest("apereset").set_default("0").action("store_true").help("File to boot on the APE.");
@@ -775,6 +777,13 @@ int main(int argc, char const *argv[])
exit(0);
}
+ if (options.get("gen"))
+ {
+ GEN.print();
+
+ exit(0);
+ }
+
if (options.get("network"))
{
RegMIIStatus_t stat;
OpenPOWER on IntegriCloud