Jump to content
  • 0

dts example for the Linux kernel for Microblaze


loberman

Question

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

@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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...