Chapter 4
The Linux Kernel
4.1
Writing Our DeviceTree
Now that we have OPT3001EVM connected to our Beagle Bone Black, we
need to tell Linux about it. Recent Linux Kernel release utilize Open Firmware
as the methodology for firmware to tell the Operating System about devices
which sit under non-enumerable buses. The language used by Open firmware is
known as DeviceTree
With a DeviceTree source such as below, we can tell Linux that we have
an OPT3001 device sitting under I2C Bus 2 and can be accessed through I2C
address 0x44.
/* arch/arm/boot/dts/am335x-boneblack.dts */
&i2c2 {
status =
"okay"
;
pinctrl-names =
"default"
;
pinctrl-0 = <&i2c2_pins>;
clock-frequency = <400000>;
light@44 {
status =
"okay"
;
pinctrl-names =
"default"
;
pinctrl-0 = <&light_pins>;
compatible =
"opt3001"
;
reg = <0x44>;
interrupts-extended = <&gpio1 28 IRQ_TYPE_LEVEL_HIGH>;
};
};
Note that we have two undefined pinctrl DeviceTree nodes. Let’s define them:
/* arch/arm/boot/dts/am335x-boneblack.dts */
5
Содержание OPT3001EVM
Страница 1: ...OPT3001EVM Linux Getting Started Guide Felipe Balbi August 18 2014 ...
Страница 2: ...This page is intentionally left blank ...
Страница 7: ...CHAPTER 3 HARDWARE PLATFORM 4 Figure 3 1 connecting opt3001evm to beagle bone black ...
Страница 15: ...CHAPTER 4 THE LINUX KERNEL 12 Figure 4 10 Exitting menuconfig ...
Страница 19: ...This page is intentionally left blank ...