<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rockbox/utils/hwstub/tools/lua, branch wolf3d</title>
<subtitle>My Rockbox tree</subtitle>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/rockbox/'/>
<entry>
<title>hwstub: add code to dump STMP rom</title>
<updated>2017-11-12T13:14:30+00:00</updated>
<author>
<name>Amaury Pouly</name>
<email>amaury.pouly@gmail.com</email>
</author>
<published>2017-11-12T13:14:30+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/rockbox/commit/?id=ec4fa0333c41aebb16e7106b1e9f583eb54aa26c'/>
<id>ec4fa0333c41aebb16e7106b1e9f583eb54aa26c</id>
<content type='text'>
Change-Id: I083024662f3c085f7bcd2f85b0a68de85725b0f3
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change-Id: I083024662f3c085f7bcd2f85b0a68de85725b0f3
</pre>
</div>
</content>
</entry>
<entry>
<title>hwstub/jz4760b: add lua code to probe for ei/di and ext instructions</title>
<updated>2017-01-24T14:34:20+00:00</updated>
<author>
<name>Amaury Pouly</name>
<email>amaury.pouly@gmail.com</email>
</author>
<published>2017-01-18T13:39:03+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/rockbox/commit/?id=fdb98c258f56c8fbdc28e256ed3edab0bf47009b'/>
<id>fdb98c258f56c8fbdc28e256ed3edab0bf47009b</id>
<content type='text'>
Add lua code to check whether ei/di and ext instructions are supported. This
is unclear since xburst is somewhere between mips32r1 and mips32r2. Details
results are below, but in summary: they don't work (ei has no effect, di/ext
cause illegal instruction exceptions)

&gt; ./hwstub_shell -q -b -e 'require("jz/misc"); JZ.misc.enable_sram()' \
  -f lua/xburst.lua -e "XBURST.test_ext_inst(0xb32d0000)"
[...]
Selecting soc jz4760b. Redirecting HW to hwstub.soc.jz4760b
  data: d7168acf
error: lua/xburst.lua:209: call failed
trapped exception in call

&gt; ./hwstub_shell -q -b -e 'require("jz/misc"); JZ.misc.enable_sram()' \
  -f lua/xburst.lua -e "XBURST.test_ei_di_inst(0xb32d0000)"
[...]
Selecting soc jz4760b. Redirecting HW to hwstub.soc.jz4760b
Testing ei
  Test SR
    Enable interrupts with CP0
    SR: 0x1
    Disable interrupts with CP0
    SR: 0x0
  Test ei/di
    Enable interrupts with ei
    SR: 0x0
    Disable interrupts with di
error: lua/xburst.lua:244: call failed
trapped exception in call

Change-Id: I2e162b5dd5e70488bcd8b58f3ca401a3ecab3c4b
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add lua code to check whether ei/di and ext instructions are supported. This
is unclear since xburst is somewhere between mips32r1 and mips32r2. Details
results are below, but in summary: they don't work (ei has no effect, di/ext
cause illegal instruction exceptions)

&gt; ./hwstub_shell -q -b -e 'require("jz/misc"); JZ.misc.enable_sram()' \
  -f lua/xburst.lua -e "XBURST.test_ext_inst(0xb32d0000)"
[...]
Selecting soc jz4760b. Redirecting HW to hwstub.soc.jz4760b
  data: d7168acf
error: lua/xburst.lua:209: call failed
trapped exception in call

&gt; ./hwstub_shell -q -b -e 'require("jz/misc"); JZ.misc.enable_sram()' \
  -f lua/xburst.lua -e "XBURST.test_ei_di_inst(0xb32d0000)"
[...]
Selecting soc jz4760b. Redirecting HW to hwstub.soc.jz4760b
Testing ei
  Test SR
    Enable interrupts with CP0
    SR: 0x1
    Disable interrupts with CP0
    SR: 0x0
  Test ei/di
    Enable interrupts with ei
    SR: 0x0
    Disable interrupts with di
error: lua/xburst.lua:244: call failed
trapped exception in call

Change-Id: I2e162b5dd5e70488bcd8b58f3ca401a3ecab3c4b
</pre>
</div>
</content>
</entry>
<entry>
<title>hwstub: add Fiio X3II IPL/SPL dumping code</title>
<updated>2017-01-24T14:25:14+00:00</updated>
<author>
<name>Amaury Pouly</name>
<email>amaury.pouly@gmail.com</email>
</author>
<published>2016-10-23T19:52:59+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/rockbox/commit/?id=06c5e5f4c1e1938aa38763d6e5661ba31e8f2ad4'/>
<id>06c5e5f4c1e1938aa38763d6e5661ba31e8f2ad4</id>
<content type='text'>
Change-Id: I76f7cffc700e8051d02936c24e8a70a0f8925edf
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change-Id: I76f7cffc700e8051d02936c24e8a70a0f8925edf
</pre>
</div>
</content>
</entry>
<entry>
<title>hwstub: add Shanling M2 IPL/SPL dumping code</title>
<updated>2017-01-24T14:25:14+00:00</updated>
<author>
<name>Amaury Pouly</name>
<email>amaury.pouly@gmail.com</email>
</author>
<published>2016-10-23T19:12:13+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/rockbox/commit/?id=3a219cefe1560692107afaffa7ce91c0a9f63279'/>
<id>3a219cefe1560692107afaffa7ce91c0a9f63279</id>
<content type='text'>
Change-Id: I14987d9783dd371f4990a5bcfbfb2d1c0c9be213
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change-Id: I14987d9783dd371f4990a5bcfbfb2d1c0c9be213
</pre>
</div>
</content>
</entry>
<entry>
<title>hwstub: add various jz stuff and xburst tests</title>
<updated>2017-01-24T14:25:14+00:00</updated>
<author>
<name>Amaury Pouly</name>
<email>amaury.pouly@gmail.com</email>
</author>
<published>2017-01-23T21:48:42+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/rockbox/commit/?id=8e07d6845277efb96e067306f1ec9bc378c58bc0'/>
<id>8e07d6845277efb96e067306f1ec9bc378c58bc0</id>
<content type='text'>
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:

&gt; ./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

&gt; ./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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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:

&gt; ./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

&gt; ./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
</pre>
</div>
</content>
</entry>
<entry>
<title>hwstub/jz4760b: fix some typos in lua script after register name changes</title>
<updated>2017-01-24T14:22:43+00:00</updated>
<author>
<name>Amaury Pouly</name>
<email>amaury.pouly@gmail.com</email>
</author>
<published>2017-01-24T14:22:43+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/rockbox/commit/?id=f698b201adf18e0e046554d382531df1ae6d1d27'/>
<id>f698b201adf18e0e046554d382531df1ae6d1d27</id>
<content type='text'>
Change-Id: Ie46ec293fcd5a16143818e77cd6c79cc08620fb5
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change-Id: Ie46ec293fcd5a16143818e77cd6c79cc08620fb5
</pre>
</div>
</content>
</entry>
<entry>
<title>hwstub/tools/shell: add JZ4760B and Fiio X1 code</title>
<updated>2017-01-24T14:17:46+00:00</updated>
<author>
<name>Amaury Pouly</name>
<email>amaury.pouly@gmail.com</email>
</author>
<published>2016-03-19T21:57:58+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/rockbox/commit/?id=4fd9400458f131e61a18142105c2d2d3a082a057'/>
<id>4fd9400458f131e61a18142105c2d2d3a082a057</id>
<content type='text'>
The jz code can do several useful things like dumping the IPL and SPL.
The Fiio code can play with backlight and has code do dump the IPL
and SPL with the correct parameters (extracted by reverse engineering).

Change-Id: I317b3174f5db8d38c9a56670c1d45565142ec208
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The jz code can do several useful things like dumping the IPL and SPL.
The Fiio code can play with backlight and has code do dump the IPL
and SPL with the correct parameters (extracted by reverse engineering).

Change-Id: I317b3174f5db8d38c9a56670c1d45565142ec208
</pre>
</div>
</content>
</entry>
<entry>
<title>hwstub: port hwstub_shell to the new library</title>
<updated>2016-04-08T17:38:18+00:00</updated>
<author>
<name>Amaury Pouly</name>
<email>amaury.pouly@gmail.com</email>
</author>
<published>2016-02-07T21:46:58+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/rockbox/commit/?id=f6c61eb11a13f7a5141a980f56b9a14b3309c449'/>
<id>f6c61eb11a13f7a5141a980f56b9a14b3309c449</id>
<content type='text'>
Also use this opportunity to cleanup support for multiple devices: the shell
now supports dynamic changes in the device and will call init() everytime
a new device is selected, to prepare a new environment. The shell now
honors register width on register read/write. The shell also provides access
to variants as follows by creating a subtable under the register using the
variant type in UPPER case and having the same layout as a register.
For example if register HW.GPIO.DIR has variants "set" and "clr", those can
be used like this:
HW.GPIO.DIR.SET.write(0xff)
HW.GPIO.DIR.CLR.write(0xff00)

Change-Id: I943947fa98bce875de0cba4338e8b7196a4c1165
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Also use this opportunity to cleanup support for multiple devices: the shell
now supports dynamic changes in the device and will call init() everytime
a new device is selected, to prepare a new environment. The shell now
honors register width on register read/write. The shell also provides access
to variants as follows by creating a subtable under the register using the
variant type in UPPER case and having the same layout as a register.
For example if register HW.GPIO.DIR has variants "set" and "clr", those can
be used like this:
HW.GPIO.DIR.SET.write(0xff)
HW.GPIO.DIR.CLR.write(0xff00)

Change-Id: I943947fa98bce875de0cba4338e8b7196a4c1165
</pre>
</div>
</content>
</entry>
<entry>
<title>hwstub: fix atj213x dsp lua code</title>
<updated>2015-11-17T21:40:31+00:00</updated>
<author>
<name>Marcin Bukat</name>
<email>marcin.bukat@gmail.com</email>
</author>
<published>2015-11-17T21:40:31+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/rockbox/commit/?id=ad5e5c42fb00334ec0e9b0e9e8c69c4b7d05ac7a'/>
<id>ad5e5c42fb00334ec0e9b0e9e8c69c4b7d05ac7a</id>
<content type='text'>
Change-Id: I5fbd1799b958bedbe74f91bdcdd8a544e15d2a78
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change-Id: I5fbd1799b958bedbe74f91bdcdd8a544e15d2a78
</pre>
</div>
</content>
</entry>
<entry>
<title>hwstub: Add ajt213x lua interface for DSP block</title>
<updated>2015-11-17T12:35:09+00:00</updated>
<author>
<name>Marcin Bukat</name>
<email>marcin.bukat@gmail.com</email>
</author>
<published>2015-11-17T12:25:28+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/rockbox/commit/?id=f47f04b65fc7603ec5926dd5f941d6690a0daf91'/>
<id>f47f04b65fc7603ec5926dd5f941d6690a0daf91</id>
<content type='text'>
With this you can upload and run code on DSP core in atj213x.

The files can be produced using as2181. You can download
this assembler from https://github.com/wodz/as2181
You should use extended mode (-x switch) since DSP core
in atj is non standard and uses 24bit operands.
PX register has different meaning as well and is used as MSB
when loading other registers with immediates (immediate field
is 16bit in instruction so to set register to 24bit value
you need to store MSB in PX prior to this).

MAC MR is 56bit accordingly.

HIP interface seems to be mapped at standard addresses
(except that regular 218x doesn't have HIP).

Have a fun!

Change-Id: I9a80ca0dd3718ba8435ae8579bfffa66e067e022
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With this you can upload and run code on DSP core in atj213x.

The files can be produced using as2181. You can download
this assembler from https://github.com/wodz/as2181
You should use extended mode (-x switch) since DSP core
in atj is non standard and uses 24bit operands.
PX register has different meaning as well and is used as MSB
when loading other registers with immediates (immediate field
is 16bit in instruction so to set register to 24bit value
you need to store MSB in PX prior to this).

MAC MR is 56bit accordingly.

HIP interface seems to be mapped at standard addresses
(except that regular 218x doesn't have HIP).

Have a fun!

Change-Id: I9a80ca0dd3718ba8435ae8579bfffa66e067e022
</pre>
</div>
</content>
</entry>
</feed>
