Digilent Embedded Linux User Manual
Page 6

Using Zynq with Linux
www.digilentinc.com
page 6 of 23
Copyright Digilent, Inc. All rights reserved. Other product and company names mentioned may be trademarks of their respective owners.
Properties
Properties are key-value pairs. The value of a property can either be a character string (e.g. the value
for compatible property), or a list of either decimal or hexadecimal numbers (e.g. the value of reg
property).
Each node requires a compatible property. A compatibility string will be assigned to that property.
You can use it to match device drivers with devices defined in the device tree. In Example 3, the
compatible property for device node leds is set to string “gpio-leds”, which indicates the
gpio-leds driver will be used for the device.
Usually, the device node name includes the base address of the device. However, the kernel actually
obtains the physical address of device registers via the reg property. The value of the reg property
contains a list of paired numbers separated by commas. Each pair begins with the base address of
the device, followed by the size of the register space. The corresponding kernel driver can usually
obtain the physical memory address with the function platform_get_resource and map the
physical memory into kernel virtual memory space by functions such as ioremap.
If your device has interrupt functionality, you must specify the interrupt number in the interrupt
property and set the interrupt-parent property to the phandler of the interrupt controller. You can
obtain the phandler of the interrupt controller with &(name field of interrupt controller).
For more in depth information on using the Zynq AP SoC interrupt controller with a device tree, see
Documentation/devicetree/bindings/arm/gic.txt within the kernel source.
OLED DTS Node: An Example
We abstract the following codes from the ZedBoard default device tree.
1
Example 4.
1
gpiops: gpio@e000a000 {
compatible = "xlnx,ps7-gpio-1.00.a";
#gpio-cells = <2>;
reg = <0xe000a000 0x1000>;
interrupts = <0x0 0x14 0x0>;
interrupt-parent = <&gic>;
gpio-controller;
};
zed_oled {
compatible = "dglnt,pmodoled-gpio";
/* GPIO Pins */
vbat-gpio = <&gpiops 55 0>;
vdd-gpio = <&gpiops 56 0>;
res-gpio = <&gpiops 57 0>;
dc-gpio = <&gpiops 58 0>;
/* SPI-GPIOs */
spi-bus-num = <2>;
spi-sclk-gpio = <&gpiops 59 0>;
spi-sdin-gpio = <&gpiops 60 0>;
};