Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference in writing a platform device driver for x86 and ARM

I previously worked on ARM Specific platform drivers, recently shifted to Intel Atom based. On ARM, it used to have arch/arm/boot/dts/xx.dts and arch/arm/mach-xx/ for adding platform devices. I am not seeing these files or folders on x86. When I went into arch/x86/... there is no dts files or platform files.

How can i add my platform device information, if i want to add my platform device into Intel Atom platform? Where can i get the dts files specific to x86(assuming even though dts is not specific any architecture)?

like image 915
anikhan Avatar asked Aug 28 '15 07:08

anikhan


1 Answers

There are two new features that allows you to have one driver for x86 and ARM worlds simultaneously. First is _DSD method in the ACPI which allows the vendor to supply any device properties they need to have the IP works properly. The second part is the unified device properties interface in the Linux kernel (look at drivers/base/property.c). Thus, if your device needs let's say clock-frequency property you just write in the driver something like this:

u32 clock_freq;
int err;

err = device_property_read_u32(…, &clock_freq);
if (err)
  dev_err(…, "A mandatory property not found!\n");
like image 191
0andriy Avatar answered Nov 27 '22 11:11

0andriy