I'm looking into the firmware for a 68EC020 based device, and find multiple examples of a cache access code that goes something like this:
save D0 to the stack
get CACR into D0
save it to the stack
load zero to D0
write D0 to CACR
stall for an amount of time that varies in places in the firmware
restore CACR from value saved in stack
restore D0 from the stack
From what I'm reading about the 68EC020 cache, disabling cache (which I think is what this does?) does not change the cache contents. So I'm not understanding what these code routines in the firmware do. Flush the cache? What am I missing here?
Can't tell. But what is it doing when it is "stalling"?
Why not post on the NXP Community Forums in the "ColdFire/68K Microcontrollers and Processors" part?
On Tuesday, June 20, 2023 at 3:15:48 AM UTC+10, Roger Hanscom wrote:
I'm looking into the firmware for a 68EC020 based device, and find multiple examples of a cache access code that goes something like this:
save D0 to the stack
get CACR into D0
save it to the stack
load zero to D0
write D0 to CACR
stall for an amount of time that varies in places in the firmware
Perhaps a delay and it was deemed too difficult to generate accurate timings with the cache enabled.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 379 |
Nodes: | 16 (2 / 14) |
Uptime: | 68:02:49 |
Calls: | 8,084 |
Calls today: | 2 |
Files: | 13,068 |
Messages: | 5,849,529 |