diff options
author | Evan Lojewski <github@meklort.com> | 2019-02-09 15:59:35 -0700 |
---|---|---|
committer | Evan Lojewski <github@meklort.com> | 2019-02-09 15:59:35 -0700 |
commit | c7abbe964d09a0c744da30bf26214781b9d814dc (patch) | |
tree | 6fce036739400b11daeac764be40a0810bc5d33f /utils | |
parent | cb3e5ff8d63e97f27c9d24996a032de221b0dcb1 (diff) | |
download | bcm5719-ortega-c7abbe964d09a0c744da30bf26214781b9d814dc.tar.gz bcm5719-ortega-c7abbe964d09a0c744da30bf26214781b9d814dc.zip |
Update NVM API to use words instead of bytes.
Diffstat (limited to 'utils')
-rw-r--r-- | utils/bcmregtool/main.cpp | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/utils/bcmregtool/main.cpp b/utils/bcmregtool/main.cpp index 19763f8..3718abd 100644 --- a/utils/bcmregtool/main.cpp +++ b/utils/bcmregtool/main.cpp @@ -63,14 +63,6 @@ int main(int argc, char const *argv[]) return ERROR_NO_PCI_DEVS; } - // if ((memfd = open("/dev/mem", O_RDWR|O_SYNC)) < 0 ) - // { - // printf("Error /dev/mem file. \n"); - // close(memfd); - // return (-1); - // } - - while ((pDirent = readdir(pDir)) != NULL) { const char* pPCIPath = pDirent->d_name; @@ -139,27 +131,22 @@ int main(int argc, char const *argv[]) // printf("\n\n=========\n\n"); - // printf("DEVICE.SoftwareArbitration: %x\n", (uint32_t)DEVICE.SoftwareArbitration.r32); printf("Grab lock...\n"); NVRam_acquireLock(); NVRam_enable(); - uint32_t length = NVRam_readByte(8); // current stage length - uint32_t offset = NVRam_readByte(0xc); // current stage offset + uint32_t length = NVRam_readWord(8); // current stage length + uint32_t offset = NVRam_readWord(0xc); // current stage offset printf("NVRam_read(8) = %x\n", length); printf("NVRam_read(C) = %x\n", offset); // uint32_t next_stage_hdr = offset + (length*4); // uint32_t next_stage_size = next_stage_hdr + 4; - // printf("NVRam_read(%x) = %x\n", next_stage_hdr, NVRam_readByte(next_stage_hdr)); - // printf("NVRam_read(%x) = %x\n", next_stage_size, NVRam_readByte(next_stage_size)); + // printf("NVRam_read(%x) = %x\n", next_stage_hdr, NVRam_readWord(next_stage_hdr)); + // printf("NVRam_read(%x) = %x\n", next_stage_size, NVRam_readWord(next_stage_size)); - // printf("DEVICE.SoftwareArbitration: %x\n", DEVICE.SoftwareArbitration.r32); - - // printf("Release lock...\n"); NVRam_releaseLock(); - // printf("DEVICE.SoftwareArbitration: %x\n", DEVICE.SoftwareArbitration.r32); return 0; -}
\ No newline at end of file +} |