loberman Posted January 10, 2018 Share Posted January 10, 2018 Firstly I am NOT using Petalinux, I am building my own kernels, I have the pmod OLED working via a standalone application and now I am working on getting it accessible under Linux. The Vivado device tree generator does not create a spi entry for the OLED in the dts files. Can I get an example of what I need to add to the kernel dts file so I can access the pmod OLED from Linux via SPI. Thanks Laurence Link to comment Share on other sites More sharing options...
jpeyron Posted January 10, 2018 Share Posted January 10, 2018 Hi @loberman, I have reached out to more experienced embedded linux engineers to see if they have any input for you. thank you, Jon Link to comment Share on other sites More sharing options...
loberman Posted January 10, 2018 Author Share Posted January 10, 2018 Hello Jon Thank you, I am also working on a dts entry and will let you know if I get there first. Link to comment Share on other sites More sharing options...
morsucci Posted January 10, 2018 Share Posted January 10, 2018 @loberman thank you for your question. I have used the PMOD OLED with a petalinux project and have attached the device tree for it here. Keep in mind you'll need to change the address in the entry to your relevant hardware address. SPI_OLED: axi_quad_spi@41e10000 { bits-per-word = <8>; compatible = "xlnx,xps-spi-2.00.a"; fifo-size = <16>; interrupt-parent = <&intc>; interrupts = <0 31 1>; num-cs = <0x1>; reg = <0x41e10000 0x10000>; xlnx,num-ss-bits = <0x1>; xlnx,spi-mode = <0>; }; Keep in mind, if you want to control the VBATC, D/C, VDDC, and RES pins, you'll need a GPIO entry as well, like this one: axi_gpio_0: gpio@41200000 { #gpio-cells = <2>; compatible = "xlnx,xps-gpio-1.00.a"; gpio-controller ; reg = <0x41200000 0x10000>; xlnx,all-inputs = <0x0>; xlnx,all-inputs-2 = <0x0>; xlnx,all-outputs = <0x0>; xlnx,all-outputs-2 = <0x0>; xlnx,dout-default = <0x00000000>; xlnx,dout-default-2 = <0x00000000>; xlnx,gpio-width = <0x8>; xlnx,gpio2-width = <0x20>; xlnx,interrupt-present = <0x0>; xlnx,is-dual = <0x1>; xlnx,tri-default = <0xFFFFFFFF>; xlnx,tri-default-2 = <0xFFFFFFFF>; }; If you are using the PMOD OLED IP core provided by digilent, you'll have a GPIO controller and SPI controller wrapped up in that core, so it is a matter of finding the correct addresses for each core and changing the GPIO width to 4 to match the 4 gpio pins on the PMOD OLED. Let me know if you have any questions. Mitchell Link to comment Share on other sites More sharing options...
loberman Posted January 10, 2018 Author Share Posted January 10, 2018 Awesome and Thanks, trying it and will reply back Link to comment Share on other sites More sharing options...
loberman Posted January 13, 2018 Author Share Posted January 13, 2018 Still working on this, trying to get the spidev driver to work and will post when done. Link to comment Share on other sites More sharing options...
Question
loberman
Firstly I am NOT using Petalinux, I am building my own kernels,
I have the pmod OLED working via a standalone application and now I am working on getting it accessible under Linux.
The Vivado device tree generator does not create a spi entry for the OLED in the dts files.
Can I get an example of what I need to add to the kernel dts file so I can access the pmod OLED from Linux via SPI.
Thanks
Laurence
Link to comment
Share on other sites
5 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.