Re: RiscPC support
Posted: Sun Jun 23, 2013
Horizontal, if you look in vectors.vidc_abort at _VIDC_horizontal, R3 is the register used to adjust the values to match the VIDC20 documentation, some or all of them will need adjusting.
All except HCSR have bit 0 cleared and HCR has bits 0 and 1 cleared, so all R3 values will need adjusting by -2 or -4 if it's HCR that's wrong. A quick way to check if it's all that need adjusting would be to find the SUBLO R0, R0, R3 near the end and add SUBLO R0, R0, #2 after (implemented in the adffs-2 module). I suspect it's not all values though, so may need some testing to find which.
STM code looks okay, I didn't spot anything glaringly obvious at any rate. Upload your test code so I can test under emulation. I did test STM way back, so something could be broken further up the chain.
I did however notice a bug in the CR code, which was corrupting one of the STM code's registers. I've uploaded the fixed ADFFS module and source to the dev site.
EDIT: I've now tested the STM code and confirmed it's working, so the issue must be further down the VIDC code.
EDIT2: The pixel rate issue...what I've been unable to establish in Acorn docs is which clocks are set to which value. At the top of adffs.vectors.vidc_abort there are two #set values which may need changing:
reference_clock is the clock speed of the reference clock
RCLK determines which reference clock to use. 0 - VCLK, 1 - HCLK, 2 - RCLK
According to the doc "ARM DDI 0030E", RCLK is "recommended" to be 24MHz - which being the only figure I could find, is what the code is using. It could well be that RCLK isn't even used on the RiscPC and we have to use VCLK. We need the RiscPC TRM's to know for sure.
EDIT3: I've just found the RiscPC TRM, which I've put on the dev site. 1-14 says the reference clock is 64MHz, which is contradicted on 1-17 where its shown as 24MHz. Acorn_RPCTRM_MainPCBCircuiDiagram5of7.pdf (in RiscPCTRM_Drawings.zip) however clearly states RCLK (pin 124) is 24Mhz, so it must be a coding issue where I'm working out the pixel rate. If you let me know the VIDC1 clock and CR value I'll debug the code and check what pixel rate we end up with.
All except HCSR have bit 0 cleared and HCR has bits 0 and 1 cleared, so all R3 values will need adjusting by -2 or -4 if it's HCR that's wrong. A quick way to check if it's all that need adjusting would be to find the SUBLO R0, R0, R3 near the end and add SUBLO R0, R0, #2 after (implemented in the adffs-2 module). I suspect it's not all values though, so may need some testing to find which.
STM code looks okay, I didn't spot anything glaringly obvious at any rate. Upload your test code so I can test under emulation. I did test STM way back, so something could be broken further up the chain.
I did however notice a bug in the CR code, which was corrupting one of the STM code's registers. I've uploaded the fixed ADFFS module and source to the dev site.
EDIT: I've now tested the STM code and confirmed it's working, so the issue must be further down the VIDC code.
EDIT2: The pixel rate issue...what I've been unable to establish in Acorn docs is which clocks are set to which value. At the top of adffs.vectors.vidc_abort there are two #set values which may need changing:
reference_clock is the clock speed of the reference clock
RCLK determines which reference clock to use. 0 - VCLK, 1 - HCLK, 2 - RCLK
According to the doc "ARM DDI 0030E", RCLK is "recommended" to be 24MHz - which being the only figure I could find, is what the code is using. It could well be that RCLK isn't even used on the RiscPC and we have to use VCLK. We need the RiscPC TRM's to know for sure.
EDIT3: I've just found the RiscPC TRM, which I've put on the dev site. 1-14 says the reference clock is 64MHz, which is contradicted on 1-17 where its shown as 24MHz. Acorn_RPCTRM_MainPCBCircuiDiagram5of7.pdf (in RiscPCTRM_Drawings.zip) however clearly states RCLK (pin 124) is 24Mhz, so it must be a coding issue where I'm working out the pixel rate. If you let me know the VIDC1 clock and CR value I'll debug the code and check what pixel rate we end up with.