How to access registers mapped in the fabric with a linux command line ? #71
-
Can I set the following register SDIO_register, located at address 0x4f00_0000, via the linux prompt or do I need to use softconsole? devmem 0x4f00_0000 0x1Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 12 comments
-
Linux can access this register, your example devmem command looks correct if using Buildroot, Yocto includes devmem2 so something like: devmem2 0x4f000000 w 0x1 should work 🙂 Just keep in mind that setting / unsetting this register will swap your access between eMMC and SD so you could lock up your system by changing it on the go. |
Beta Was this translation helpful? Give feedback.
-
Ok, I do not have the linux devmem2 command on my current dev board. I guess I need update my linux, which I started to do but using the SD card. This is why I was trying to flip this bit in the fabric... I will update first the Linux in the eMMC. |
Beta Was this translation helpful? Give feedback.
-
Hmm ok, I'm a bit confused by "I started to do but using the SD card. This is why I was trying to flip this bit in the fabric..." as the latest HSS versions can set the bit on power on and determine if an SD card is inserted and if its not it'll clear the bit and mount eMMC so you shouldn't really need to mess with it. If you want the latest HSS without building it the programming file in the releases of this repo also programs the eNVM with the HSS |
Beta Was this translation helpful? Give feedback.
-
Ha ok, as the board boot either way (SD card connected or not) I was not sure which linux image was booting. I've already started to update the eMMC. I will check after. Thanks for the explanation, I was not grasping the role of HSS at boot time, just started reading the Microchip_PolarFire_SoC_Software_Development_and_Tool_Flow_User_Guide_V1.pdf |
Beta Was this translation helpful? Give feedback.
-
Hmm I'll need to double check - you may need to build the full development tools image to include devmem2 (the releases *.wic files are the core-image-minimal build). If you're building the full image devmem2 is definitely there if you're using the provided image I'll follow up. Ahh that doc may need an update with this info as it could have been created before the switching feature was added. You might be interested in this training series around PolarFire SoC if you haven't seen it :) |
Beta Was this translation helpful? Give feedback.
-
Hey @rroulleau devmem2 etc aren't in the minimal dev images you'll need to build the the full development image to get them but yes once you update with the .wic image you should be good to go :) |
Beta Was this translation helpful? Give feedback.
-
My HSS version on my icicle kit is the following:
Does it support the SD boot mode? from the HSS menu it does not look likely and even with SD card plugged in it only boot from eMMC, can you confirm? I will look at updating the HSS on my board. [update] just find out only >= 0.99.15 support the dynamic boot, just can not find the latest HSS version on the github... |
Beta Was this translation helpful? Give feedback.
-
Ahhh ok that probably won't help you much - if you want to save building the HSS and going through that flow you can use the programming file here - we're providing the HSS as an eNVM client with the design releases so programming with this file will get you up to the latest version. 🙂 |
Beta Was this translation helpful? Give feedback.
-
I got the SD card booting linux. HSS update did help indeed. |
Beta Was this translation helpful? Give feedback.
-
Excellent :) Yes devemem can access FIC 3 (sdio_register is on this FIC so you've already done it), The LEDs are connected to MSS GPIO 2 though and won't be accessible at 0x42000000 - you could use sysfs you should be able to set / unset the LEDs and the GPIO driver or do it by hand using devmem, check out this video on how this was done using the Yocto image to set and clear the GPIOs |
Beta Was this translation helpful? Give feedback.
-
Thanks for the video link. The HSS update seems to have solve my issues. |
Beta Was this translation helpful? Give feedback.
-
when I try to access register I get an error : This codes worked here : https://www.youtube.com/watch?v=88xk1dV3jDs&list=PL9B4edd-p2agS6QkXUZjAvjlPiyAO5RP0&index=7&ab_channel=MicrochipTechnology%2CInc. My latest Image was Linux + FreeRTOS amp demo image. Actually I try to access temperature value;
Same error. |
Beta Was this translation helpful? Give feedback.
Linux can access this register, your example devmem command looks correct if using Buildroot, Yocto includes devmem2 so something like:
devmem2 0x4f000000 w 0x1
should work 🙂 Just keep in mind that setting / unsetting this register will swap your access between eMMC and SD so you could lock up your system by changing it on the go.