*** tpb <[email protected]> has joined #litex | 00:00 | |
*** shorne <[email protected]> has joined #litex | 01:06 | |
*** nelgau <[email protected]> has joined #litex | 03:19 | |
*** nelgau <[email protected]> has quit IRC (Remote host closed the connection) | 04:19 | |
*** Degi_ <[email protected]> has joined #litex | 04:44 | |
*** Degi <[email protected]> has quit IRC (Ping timeout: 256 seconds) | 04:44 | |
*** Degi_ is now known as Degi | 04:44 | |
*** FabM <FabM!~FabM@2a03:d604:103:600:f51d:e513:8c9f:fdb4> has joined #litex | 07: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 #litex | 10: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 #litex | 16:08 | |
*** FabM <FabM!~FabM@armadeus/team/FabM> has quit IRC (Ping timeout: 245 seconds) | 17:40 | |
Peanut | Is 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 |
---|---|---|
Peanut | Also missing is /dev/i2c/ | 22:58 |
somlo | Peanut: 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 |
Peanut | Good point - and the .dts shows where they are in memory space, I guess. | 23:08 |
somlo | alternatively, 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 |
Peanut | Yes, 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 |
somlo | yeah, .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 |
Peanut | The kernel does have the driver "[19.671763] i2c_dev: i2c /dev entries driver" | 23:09 |
Peanut | I see.. the .dts says "compatible = "litex,i2c", (...), status = "okay", which sounds somewhat promissing. | 23:11 |
Wolfvak | can you post the .dts in a pastebin? there's a chance the device driver is simply not enabled in the kernel config, too | 23:11 |
somlo | not 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 |
somlo | there are more elegant ways to debug things, but I'm old :D | 23:11 |
somlo | right, also what Wolfvak said :) | 23:12 |
somlo | check your kernel .config and make sure you're enabling the i2c driver... | 23:12 |
Wolfvak | also, the way you say it sounds like you have set up an I2C bus driver, but not an I2C device driver | 23:13 |
Peanut | I 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 |
Wolfvak | ah yeah, that should work | 23:17 |
Peanut | https://epboven.home.xs4all.nl/butterstick.dts.txt | 23:17 |
Wolfvak | looks right, just make sure the driver is enabled in the config and it should work, you can always check /sys/class/i2c if needed though | 23:19 |
Peanut | /sys/class/i2c-dev is empty, and so is /sys/class/i2c-adapter | 23:20 |
Wolfvak | sounds like the driver is not compiled in | 23:23 |
Wolfvak | you can also check /sys/firmware iirc, you can look for the exact devicetree node there and see if there's any driver associated with it | 23: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 |
Peanut | I'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 |
Peanut | No wait, there's differences - I built the ButterStick buildroot/kernel myself, whereas the OrangeCrab came from the LiteX Github repositories. | 23:34 |
Peanut | So I'm going to see if I can compare the two - but that's for tomorrow, goodnight and thanks! | 23:45 |
Peanut | Oh, 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/!