diff options
author | Evan Lojewski <github@meklort.com> | 2019-02-16 09:07:52 -0700 |
---|---|---|
committer | Evan Lojewski <github@meklort.com> | 2019-02-16 09:07:52 -0700 |
commit | 846634c9d1ab0412e943aaf74fe39136a4cbdf15 (patch) | |
tree | 16f7ae5ff55f95e0b51768d0cb6822cdd426b8df /utils | |
parent | 5d66dc22d45ea7eca86f3899f1a488a91ff7eabb (diff) | |
download | bcm5719-ortega-846634c9d1ab0412e943aaf74fe39136a4cbdf15.tar.gz bcm5719-ortega-846634c9d1ab0412e943aaf74fe39136a4cbdf15.zip |
Enable the simulator to use any of the bcm5719 ports.
Diffstat (limited to 'utils')
-rw-r--r-- | utils/bcmregtool/main.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/utils/bcmregtool/main.cpp b/utils/bcmregtool/main.cpp index 3cea4ed..09c276d 100644 --- a/utils/bcmregtool/main.cpp +++ b/utils/bcmregtool/main.cpp @@ -62,7 +62,7 @@ #include <OptionParser.h> #include <vector> #include <string> - +#include <iostream> #include <bcm5719_GEN.h> using namespace std; @@ -141,6 +141,13 @@ int main(int argc, char const *argv[]) { OptionParser parser = OptionParser().description("BCM Register Utility"); + parser.add_option("-f", "--function") + .dest("function") + .type("int") + .set_default("0") + .metavar("FUNCTION") + .help("Read registers from the specified pci function."); + parser.add_option("-r", "--reset") .dest("reset") @@ -177,7 +184,11 @@ int main(int argc, char const *argv[]) vector<string> args = parser.args(); - initHAL(NULL); + if(!initHAL(NULL, options.get("function"))) + { + cerr << "Unable to locate pci device with function " << (int)options.get("function") << endl; + exit(-1); + } if(options.get("reset")) |