Friday, 2022-01-14

*** tpb <[email protected]> has joined #litex00:00
*** shorne <[email protected]> has joined #litex01:06
*** nelgau <[email protected]> has joined #litex03:19
*** nelgau <[email protected]> has quit IRC (Remote host closed the connection)04:19
*** Degi_ <[email protected]> has joined #litex04:44
*** Degi <[email protected]> has quit IRC (Ping timeout: 256 seconds)04:44
*** Degi_ is now known as Degi04:44
*** FabM <FabM!~FabM@2a03:d604:103:600:f51d:e513:8c9f:fdb4> has joined #litex07:32
*** peeps <peeps!~peepsalot@openscad/peepsalot> has quit IRC (Read error: Connection reset by peer)10:31
*** peeps[zen] <peeps[zen]!~peepsalot@openscad/peepsalot> has joined #litex10:34
*** cr1901 <cr1901!~cr1901@2601:8d:8600:911:309e:48f3:3884:ae8> has quit IRC (Read error: Connection reset by peer)16:07
*** cr1901 <cr1901!~cr1901@2601:8d:8600:911:51a1:26ce:1709:19d8> has joined #litex16:08
*** FabM <FabM!~FabM@armadeus/team/FabM> has quit IRC (Ping timeout: 245 seconds)17:40
PeanutIs there a way, from Linux running on the target FPGA, to see all the devices/CSR? I have added a i2c driver to the butterstick platform and linux-on-vexriscv build. I can see that it gets added to the .dts, but the i2cdetect in the Linux userspace doesn't seem to detect it.22:56
PeanutAlso missing is /dev/i2c/ 22:58
somloPeanut: from a brute force perspective, you can always map physical memory to userspace (e.g., using `mmap()`) and then access it at your leisure (since CSRs are memory mapped)23:07
PeanutGood point - and the .dts shows where they are in memory space, I guess.23:08
somloalternatively, you more likely want a linux device driver for your particular device to do that on your behalf (and that's how you end up with things like /dev/i2c/... to use your example)23:08
PeanutYes, what I'm trying to find out is why the kernel hasn't picked up that there is an i2c device to use, as it is now listed in the .dtb.23:08
somloyeah, .dts tells the booting kernel where to look for which devices, and initialize them if it knows how (if the "compat" string matches some kernel specific device driver, when it all boils down to it)23:09
PeanutThe kernel does have the driver "[19.671763] i2c_dev: i2c /dev entries driver"23:09
PeanutI see.. the .dts says "compatible = "litex,i2c", (...), status = "okay", which sounds somewhat promissing.23:11
Wolfvakcan you post the .dts in a pastebin? there's a chance the device driver is simply not enabled in the kernel config, too23:11
somlonot familiar with i2c, but if it were me I'd recompile the kernel with added `pr_warn("Got Here\n")` statements in the i2c driver probe function, and see if any of it gets executed, and where it fails :)23:11
somlothere are more elegant ways to debug things, but I'm old :D23:11
somloright, also what Wolfvak said :)23:12
somlocheck your kernel .config and make sure you're enabling the i2c driver...23:12
Wolfvakalso, the way you say it sounds like you have set up an I2C bus driver, but not an I2C device driver23:13
PeanutI seem to have Wolfvak: Regarding your last comment: I'm trying to make the FPGA act as an I2C controller, and don't have a particular device driver in mind yet (i2cget will do for now). Does that make sense?23:16
Wolfvakah yeah, that should work23:17
Peanuthttps://epboven.home.xs4all.nl/butterstick.dts.txt23:17
Wolfvaklooks right, just make sure the driver is enabled in the config and it should work, you can always check /sys/class/i2c if needed though23:19
Peanut/sys/class/i2c-dev is empty, and so is /sys/class/i2c-adapter23:20
Wolfvaksounds like the driver is not compiled in23:23
Wolfvakyou can also check /sys/firmware iirc, you can look for the exact devicetree node there and see if there's any driver associated with it23:24
Peanut/sys/firmware/devicetree/base/soc/i2c@f0003800 exists - put that's probably just the unpacked contents of the .dtb. Good to see that the kernel got the right .dtb at least.23:29
PeanutI've just rebuilt the same thing for the OrangeCrab, which does come with native i2c - it bomes up with the same devicetree fragment, just at a slightly different address, all the other options are the same. And on the OrangeCrab, the i2c is perfectly usable. Interesting.23:30
PeanutNo wait, there's differences - I built the ButterStick buildroot/kernel myself, whereas the OrangeCrab came from the LiteX Github repositories.23:34
PeanutSo I'm going to see if I can compare the two - but that's for tomorrow, goodnight and thanks!23:45
PeanutOh, and I just found the kernel config file: "CONFIG_I2C=y, CONFIG_I2C_LITEX=y, CONFIG_I2C_CHARDEV=y"23:49

Generated by irclog2html.py 2.17.2 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!