Hi!
Running qemu turns out, that some of the coprocessor registers are not supported.
@reyalp: yes, there are some bugs: The regions base addresses are all wrong:
Those are the values of the base address field, which is NOT the actual base address.
Actually, the base address is combined with the other fields, so if you just ignore the lower part of the registers, you get the correct base address.
I actually updated cpuinfo.c to reflect this after posting. Sorry for not making that clear from the start. Your manual decoding looks very similar to mine for the a540 (interestingly, the ROM region on mine starts at FF8 even though the actual ROM starts at FFC)
On my system, the HCLK, MCLK and LCLK can be read like this:
+ if(conf.debug_display == DEBUG_DISPLAY_CLOCKS) {
+ sprintf(sbuf,"hclk %d",*(int *)(0xC0400044));
+ draw_string(16,16,sbuf, conf.osd_color);
+ sprintf(sbuf,"lclk %d",*(int *)(0xC0400048));
+ draw_string(16,32,sbuf, conf.osd_color);
+ sprintf(sbuf,"mclk %d",*(int *)(0xC040004c));
+ draw_string(16,48,sbuf, conf.osd_color);
+ }
LCLK was the only one I could see changing on the fly. The values are an enum: = 72, 1=36, 3=18. 2 is a mystery
You can look for "printclock" to check the addresses.
edit: here's a bit from my notes on the a540 memory layout
0x0000 0000 region 0 start. -- nocache nobuf
0x0000 0000 region 2 start. RW cache buf
0x0000 0000 ITCM start
0x0000 0FFF ITCM end
0x0000 1900 Copied from FFEF3DF0 (firmware code + init data)
0x0000 D210 Zeroed (firmware BSS ?)
0x0009 22CC end zeroed
0x0009 22D0 chdk start
0x000E 72D0 chdk end
0x01FF FFFF region 2 end / RAM end
0x1000 0000 region 3 start. RW nocache nobuf
0x103C 79A0 bitmap fb start
0x105B 8AC0 raw buffer start
0x10D1 33B0 raw buffer end
0x105F 17A0 viewport fb start
0x11FF FFFF region 3 end
0x4000 0000 region 4 start. RW cache buf
0x4000 0000 DTCM start
0x4000 0FFF DTCM end
0x4000 0FFF region 4 end
0x7FFF FFFF region 0 end
0xC000 0000 region 1 start. RW nocache nobuf
0xC020 0000 ? mmio ?
0xC040 0000 ? mmio ?
0xC0FF FFFF region 1 end
0xFF80 0000 region 5 start. RW cache buf
0xFFC0 0000 ROM start
0xFFEF 3DF0 copied data start
0XFFEF F6FF end
0xFFFF FFFF region 4 / ROM ends