VF50 access to the registers

We want to access directly registers for tests. devmem2 works only with some of them:

root@col-vf50:~# devmem2 0x400481dc
/dev/mem opened.
Memory mapped at address 0x76f4a000.
Read at address 0x400481DC (0x76f4a1dc): 0x000022ED

root@col-vf50:~# devmem2 0x400d0024
/dev/mem opened.
Memory mapped at address 0x76f2f000.
Bus error

Is there other tool/way to access them. It can be simple read

Hi @tomasz.ciesla !

Welcome to the Toradex Community! :smiley:

Do you really need a tool to simply read memory addresses?

According to the VFxxx Reference Manual (https://www.nxp.com/docs/en/reference-manual/VFXXXRM.pdf, page 232), you are trying to read addresses related to Ethernet MAC0.

If it is related to Ethernet, maybe the ethtool (also available on BSP 2.8) is a better tool to perform such readings.

The devmem2 is a simplistic wrapper around /dev/mem. And the error that you are facing (I tested and also faced the same) is a processor fault (BUS ERROR).

For me, there is a little more information:

root@colibri-vf:~# devmem2 0x400d0024
/dev/[ 5058.214939] Unhandled fault: external abort on non-linefetch (0x1008) at 0x76f17024
mem opened.[ 5058.244622] pgd = 8d2a4000
[ 5058.257857] [76f17024] *pgd=8d2b8831, *pte=400d0303, *ppte=400d0a33

Memory mapped at address 0x76f17000.
Bus error (core dumped)
root@colibri-vf:~# 

Those pte, ppte and pgd are messages directly from the kernel: Page Table Management

So, other tools similar to devmem2 would probably raise the same error.

Another possibility for the failure is that the ethernet driver grabbed the addresses and /dev/mem is not able to access it.

Best regards,

We want to perform deeper optimization of power consumption. The idea is to start by checking if all unused parts of SoC are off at registers level: like 0x400d0024 - there’s a clock disable bit for Ethernet submodule there

Hi @tomasz.ciesla !

Have you tried to disable the ethernet node at the device tree and use devmem2 afterward?

Best regards,

we do not enable it in device tree, but it may be worth to check if clock is disabled there… same story is with all audio subsystems

Since ethernet is not enabled in DT, perhaps it stays gated (see CCM CCG), which may explain why you get bus error. It must be ungated to allow register access

1 Like

thanks, it was the case :smiley: enabling the clock

devmem2 0x4006b064 w 0x0000000f

unlocks read of Ethernet registers

root@col-vf50:~# devmem2 0x400d0024
/dev/mem opened.
Memory mapped at address 0x76f93000.
Read at address  0x400D0024 (0x76f93024): 0xF0000000

we’ll go thru clock enable regs first to check if all unused things are off