Hi,
We are using StarterWare on a AM335x processor. In relation to the SYS/BIOS Ind. SDK code I have the following question regarding memory access ordering on Cortex-A8 processor:
MMU is enabled and all the peripheral register after address 0x44000000 are in a memory range that is defined as "Device, shareable, execute never"
As an example I want to access a PHY over the MDIO module within the PRUICSS. Therefore I do the following:
- Write the needed information with the GO flag set to the PRUICSS MDIO MII USRACCESS0 register
- Wait until the GO flag in the USRACCESS0 register is cleared by the peripheral
The code looks like that:
// Lesezugriff auf MDIO auslösen HWREG(SOC_PRUICSS_REGS+PRUICSS_MII_MDIO_USRACCESS0)=(PRUICSS_MII_MDIO_USRACCESS0_GO | (phyaddr<<PRUICSS_MII_MDIO_USRACCESS0_PHYADR_SHIFT) | (regoffset<<PRUICSS_MII_MDIO_USRACCESS0_REGADR_SHIFT)); // Warten, bis der Lesezugriff ausgeführt wurde while(HWREG(SOC_PRUICSS_REGS+PRUICSS_MII_MDIO_USRACCESS0) & PRUICSS_MII_MDIO_USRACCESS0_GO);
Do I need a "DMB" instruction in between the write operation and the while() loop?
The question is, is it possible that the processor is already reading the register although the write to the same register ist not finished yet or is this blocked by the memory type "Device"?
Thanks and best regards,
Patrick