1
0
Fork 0
forked from len0rd/rockbox
foxbox/utils
Amaury Pouly 8e07d68452 hwstub: add various jz stuff and xburst tests
The JZ misc allows to enable and test SRAM.
The XBurst code uses the coprocessor interface to analyse the cpu. It also
provides a test platform for various features like EBASE and exceptions.
I was able to test and confirm that on jz4760b (thus xburst), EBASE works
(but top 2 bits are not controllable and always 01). The processor claims
to support vector interrupts but this is untested. The values in ConfigX
are not to be trusted blindly, clearly some are wrong. I tried to use the
JZ4780 Config7 "ebase gate" to change bit 30 of EBASE but it does not work,
which suggests that JZ480 uses a newer version of XBurst. Detailled log below:

> ./hwstub_shell -q -f lua/xburst.lua -e "XBURST.init()"
[...]
XBurst:
  PRId: 0x2ed0024f
    CPU: JZ4760(B)
  Config: 0x80000483
    Architecture Type: MIPS32
    Architecture Level: Release 2 (or more)
    MMU Type: Standard TLB
  Config1: 0x3e63318a
    MMU Size: 32
    ICache
      Sets per way: 128
      Ways: 4
      Line size: 32
    DCache
      Sets per way: 128
      Ways: 4
      Line size: 32
    FPU: no
  Config2: 0x80000000
  Config3: 0x20
    Vectored interrupt: yes
  Config7: 0x0

> ./hwstub_shell -q -e 'require("jz/misc"); JZ.misc.enable_sram()' \
  -f lua/xburst.lua -e "XBURST.test_ebase(0x80000000);XBURST.test_ebase(0xb32d0000)
[...]
Testing EBASE...
  Disable BEV
  SR value: 0x2000fc00
  EBASE value: 0x80000000
    Value after writing 0x80000000: 0x80000000
    Value after writing 0x80040000: 0x80040000
  Test result: EBase seems to work
    Disable config7 gate: write 0x0 to Config7
    Value after writing 0xfffff000: 0xbffff000
    Enable config7 gate: write 0x80 to Config7
    Value after writing 0xc0000000: 0x80000000
  Config7 result: Config7 gate does not work
Exception test with EBASE at 0x80000000...
  Writing instructions to memory
  Old SR: 0x2000fc00
  New SR: 0xfc00
  EBASE: 80000000
  Before: cafebabe
  After: deadbeef
  Exception result: Exception and EBASE are working
Testing EBASE...
  Disable BEV
  SR value: 0x2000fc00
  EBASE value: 0x80000000
    Value after writing 0x80000000: 0x80000000
    Value after writing 0x80040000: 0x80040000
  Test result: EBase seems to work
    Disable config7 gate: write 0x0 to Config7
    Value after writing 0xfffff000: 0xbffff000
    Enable config7 gate: write 0x80 to Config7
    Value after writing 0xc0000000: 0x80000000
  Config7 result: Config7 gate does not work
Exception test with EBASE at 0xb32d0000...
  Writing instructions to memory
  Old SR: 0x2000fc00
  New SR: 0xfc00
  EBASE: b32d0000
  Before: cafebabe
  After: deadbeef
  Exception result: Exception and EBASE are working

Change-Id: I894227981a141a8c14419b36ed9f519baf145ad1
2017-01-24 15:25:14 +01:00
..
AMS/hacking amsinfo: save files with .bin extension 2011-12-13 03:01:16 +00:00
analysis Introduce a new analysis tool to detect which macros are defined in each build. 2015-02-16 11:31:05 +01:00
atj2137 Fix uninitialized variable (should fix libusb retry handling) 2015-01-04 13:35:47 +01:00
bootchart Add simple bootchart -> gnuplot shell script 2010-04-05 19:58:51 +00:00
common update deploy.py to recognize and use Qt5 2016-01-17 18:38:28 +01:00
disassembler/arm Make sure files which aren't windows-specific use \n line endings only 2010-06-17 16:59:51 +00:00
e200tool Add new tool to upload code on e200/c200/view in manufacturer mode 2014-04-07 22:25:06 +02:00
editors Move sample.emacs to utils/editors 2010-02-18 23:32:08 +00:00
hwpatcher hwpatcher: add generic RKW file patching script 2014-09-02 22:35:26 +02:00
hwstub hwstub: add various jz stuff and xburst tests 2017-01-24 15:25:14 +01:00
imxtools imxtools/sbtools: switch SHA1 implementation to Crypto++ 2017-01-16 19:59:28 +01:00
ipod Add some notes describing how the bin2note exploit works 2009-07-16 17:40:55 +00:00
jz4740_tools Fix crash on uninitialized variable 2015-01-13 21:57:24 +01:00
jz4760_tools jz4760b_tools: improve usbboot tool 2017-01-24 15:23:21 +01:00
meizu_dfu meizu_dfu: supports a single argument to run some code from RAM 2010-06-08 23:04:17 +00:00
MTP MTP: put libs after files in the Makefile, to please old gcc versions 2014-12-13 12:58:08 +01:00
nwztools nwztools/upgtools: add real KAS for NW-ZX100 and fix typo 2017-01-14 12:02:34 +01:00
regtools jz4760b/regtools: fix/rename some register fields, add clock analyzer to qeditor 2017-01-24 15:25:14 +01:00
rk27utils Fix uninitialized variable (should fix libusb retry handling) 2015-01-04 13:35:47 +01:00
rknanoutils rknanoutils: fix boot tool 2013-03-21 19:02:03 +01:00
rockbox_api Fix menu (update to newer one) 2008-10-09 12:28:09 +00:00
samsungtools samsungtool: allow firmware creation 2012-12-06 12:17:50 +01:00
scsi imxtools: various fixes for Windows 2017-01-07 15:52:33 +01:00
skinupdater SKIN BREAK: %pb, %bl and %pv (bar types) changed so the image is the last param instead of the first. skin updater, skins and manual all updated. 2010-06-09 16:15:01 +00:00
tcctool tcctool: fix Makefile 2013-09-18 13:14:20 +02:00
themeeditor Convert one more file from DOS to UNIX. 2011-11-06 22:52:21 +00:00
time-sync time-sync: allow passing an arbitrary time. 2013-06-09 19:51:08 +02:00
ypr0tools ypr1: Add some commands to rockbox.sh which are needed for playback 2014-03-09 23:25:50 +01:00
zenutils Clean up bogus 'make compiler happy' code 2015-01-12 21:13:00 +01:00
parse_testcodec.rb utils/parse_testcodec.rb: add support for Opus files 2015-07-17 00:51:22 +02:00