summaryrefslogtreecommitdiff
path: root/test-cli/test/helpers/get_dieid.py
diff options
context:
space:
mode:
authorManel Caro <mcaro@iatec.biz>2021-11-06 16:28:38 +0100
committerManel Caro <mcaro@iatec.biz>2021-11-06 16:28:38 +0100
commitcf19bfe18cbd283b188a858ee1629f9909c924f4 (patch)
tree1efb23519727130058401df090ab1b5f4cc8ba99 /test-cli/test/helpers/get_dieid.py
parentb6932fbaf898724ae87c29f8965621610f377084 (diff)
parentd5b273a3b58a250742049df4ca0ef0ba54f53d33 (diff)
downloadboard-cf19bfe18cbd283b188a858ee1629f9909c924f4.zip
board-cf19bfe18cbd283b188a858ee1629f9909c924f4.tar.gz
board-cf19bfe18cbd283b188a858ee1629f9909c924f4.tar.bz2
Merge branch 'sopa-test'rel.0.1sopa-test
Diffstat (limited to 'test-cli/test/helpers/get_dieid.py')
-rw-r--r--test-cli/test/helpers/get_dieid.py43
1 files changed, 0 insertions, 43 deletions
diff --git a/test-cli/test/helpers/get_dieid.py b/test-cli/test/helpers/get_dieid.py
deleted file mode 100644
index b20f143..0000000
--- a/test-cli/test/helpers/get_dieid.py
+++ /dev/null
@@ -1,43 +0,0 @@
-import mmap
-import os
-import struct
-MAP_MASK = mmap.PAGESIZE - 1
-WORD = 4
-def read(addr):
- """ Read from any location in memory
- Returns the readed value in hexadecimal format
- Keyword arguments:
- - addr: The memory address to be readed.
- """
- fd = os.open("/dev/mem", os.O_RDWR | os.O_SYNC)
- # Map one page
- mm = mmap.mmap(fd, mmap.PAGESIZE, mmap.MAP_SHARED, mmap.PROT_WRITE | mmap.PROT_READ, offset=addr & ~MAP_MASK)
- mm.seek(addr & MAP_MASK)
- retval = struct.unpack('I', mm.read(WORD))
- mm.close()
- os.close(fd)
- return "%08X" % retval[0]
-
-def getRegisters(model):
- if model.find("IGEP0046") == 0:
- registers = [0x021BC420, 0x021BC410]
- elif model.find("IGEP0000") == 0:
- registers = [0x021BC420, 0x021BC410]
- elif model.find("IGEP0034") == 0 or model.find("SOPA0000") == 0:
- registers = [0x44e10630, 0x44e10634, 0x44e10638, 0x44e1063C]
- elif model.find("OMAP3") == 0:
- registers = [0x4830A224, 0x4830A220, 0x4830A21C, 0x4830A218]
- elif model.find("OMAP5") == 0:
- registers = [0x4A002210, 0x4A00220C, 0x4A002208, 0x4A002200]
- return registers
-
-def genDieid(modelid):
- registers=getRegisters(modelid)
- id=""
- for i in range(len(registers)):
- id=id+(read(registers[i]))
- return id
-
-#if __name__ == "__main__":
- #registers = [0x021BC420, 0x021BC410]
- #print(main(registers))