rockbox/utils/hwstub/tools/lua
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
..
atj hwstub: fix atj213x dsp lua code 2015-11-17 22:40:31 +01:00
jz hwstub: add various jz stuff and xburst tests 2017-01-24 15:25:14 +01:00
pp hwstub: add some PP and Sansa View code 2014-05-11 19:56:15 +02:00
rk27xx hwstub: Add support for rk27xx lradc block 2014-06-15 12:53:28 +02:00
stmp hwstub: fix lcdif pin setup for 18-bit bus 2013-12-24 15:24:50 +01:00
atj.lua hwstub: port hwstub_shell to the new library 2016-04-08 19:38:18 +02:00
dumper.lua
fiiox1.lua hwstub/jz4760b: fix some typos in lua script after register name changes 2017-01-24 15:22:43 +01:00
help.lua hwstub: port hwstub_shell to the new library 2016-04-08 19:38:18 +02:00
hwlib.lua hwstub: Add completion and some pretty printing to the shell 2015-06-28 17:55:17 +02:00
i2c_scan.lua hwstub: implement i2c and i2c eeprom dump 2013-12-06 01:56:04 +01:00
irivere150.lua hwstub: lua functions for atj213x/irivere150 2014-11-28 19:37:14 +01:00
jz.lua hwstub/tools/shell: add JZ4760B and Fiio X1 code 2017-01-24 15:17:46 +01:00
load.lua hwstub: port hwstub_shell to the new library 2016-04-08 19:38:18 +02:00
pp.lua hwstub: port hwstub_shell to the new library 2016-04-08 19:38:18 +02:00
rk27xx.lua hwstub: port hwstub_shell to the new library 2016-04-08 19:38:18 +02:00
sansaexpress.lua hstub: add Sansa Express lcd code 2013-12-03 01:35:34 +01:00
sansaview.lua hwstub: add some PP and Sansa View code 2014-05-11 19:56:15 +02:00
sonynwze360.lua hwstub: rework i2c completely 2013-10-22 00:34:44 +02:00
sonynwze370.lua hwstub: fix lcd drivers for sony NWZ 2013-09-26 16:41:30 +02:00
stmp.lua hwstub: port hwstub_shell to the new library 2016-04-08 19:38:18 +02:00
xburst.lua hwstub: add various jz stuff and xburst tests 2017-01-24 15:25:14 +01:00
zenmozaic.lua hwstub: improve lcdif, digtctl, add sony nwz-e370 2013-09-05 23:16:27 +02:00
zenv.lua
zenxfistyle.lua hwstub: update zenxfistyle code 2013-12-24 15:25:32 +01:00