This bites in two places in the emac driver.
One is the register layout in "struct emac" where we have
two pointers. One to the Rx ring and one to the Tx ring.
We set each of these once and for all during initialization
so there is not much code involved.
The other is in the buffer ring descriptor, which looks like this for the working code on the 32 bit H3 chip:
struct emac_desc {
vu32 status;
i32 size;
char * buf;
struct emac_desc *next;
} __aligned(ARM_DMA_ALIGN);
Here we have two pointers and a fair bit of code is involved.
Note that on my H5, addresses can all fit nicely in 32 bits, so the upper 32 bits of all 64 bit addresses can confidently be expected to be zero. We can write code like this:
u32 base; base = (u32)(u64) &buffer;Chaining two casts like this keeps the compiler from complaining.
Even after fixing these pointers, I get no proper results from the driver.
Tom's electronics pages / tom@mmto.org