Videos
I've working on Xilinx MPSoC chips for almost an year. I wrote user space applications for most of time and built yocto linux images. Kernel side is still a blackbox for me. Now my job requires to develop linux drivers. How long will it take to learn? I can give 8 hours per day. I'm also considering taking a course from Doulos.
What i understood for now is, product owner has already written some functions to reach peripheral hardware and all i have to do is reaching them with calling some special functions using its .c files. Blockquote
Your understanding is partly correct - the board vendor has already written drivers (functions for reading/writing the hardware registers). However, it is not as simple as just linking against the c files of the drivers.
In Linux, the mechanism for using these drivers (driver API) varies depending on the use-case. The drivers can be accessed from both the user and kernel space. Both of these spaces have different APIs to interact with drivers. There is a lot of layering (abstraction) in the Linux kernel drivers and a large part of the effort is getting familiar with the all the abstraction levels involved.
While using the driver from userspace, the most common API is to use the device files representing a device and doing file operations on it. For example, a usb-to-serial UART is commonly represented by device file /dev/ttyUSB0 and all the interaction with the driver goes through this device file. You can search for writing character drivers on Linux to get more understanding on this. In essence, your Linux kernel driver needs to create a device file and you need to map the operations done on this device file (open, read, write, close, ioctl) to the device hardware-specific functions in your driver.
Linux builds upon that to create specific driver subsystems. For example, the Linux framebuffer subsystem, which is commonly used to draw graphics on the display. It is also a device file, but has operations that are common for all of the framebuffer devices. The device-specific functions will go into another separate driver that contains hardware-specific bits. The goal is simple, to keep the generic reusable code and hardware-specific bits separate.
If you want to by-pass the userspace API and interface with some other kernel code or driver directly, you need to write a kernel module that runs in the kernel space and here, you can link against functions exported by the common kernel driver from vendor. This was just to give you a basic idea, there are a lot of underlying details that will be unveiled once you actually start writing some code interfacing with drivers. I would suggest starting with the simple character driver. You can follow this tutorial
It is quite complex task for embedded Linux newbie I'm afraid. I think you should start with learning Linux kernel API. You need some electronic knowledge also. Take a look at some Linux kernel module programming guide and try to write some simple modules for Linux kernel. Then you can learn about memory mappings and in general how does memory work in Linux kernel. You need this knowledge because in embedded world you need to know how to get access to given device. You will need also know when use "volatile" C language keyword and much more. A lot of things to learn...