Linux version: 4.19 Platform: Xilinx Ultrascale+ Zynq In the programmable logic I’ve created a memory mapped device located at physical address 0xA0001000. I’m using uio_pdrv_genirq as my device driver. The device shows up as uio0 and I’m ready to read and write to it, using mmap. I want to be able to guarantee that any writes that I make get
Tag: linux-device-driver
Resubmitting DMA Engine transactions
I’m writing a custom high-speed Linux SPI driver for an embedded SoC. To send data to the SPI peripheral (DMA_MEM_TO_DEV) I’m the Linux DMA Engine API. https://www.kernel.org/doc/Documentation/dmaengine/client.txt Based on the documentation, the steps for setting up and executing a DMA transaction are: Allocate a DMA slave channel : dma_request_channel Set slave and controller specific parameters : dmaengine_slave_config Get a descriptor
Adaptation from old init_timer to new timer_setup
I have been trying to port a driver from 2.6 to 4.X without support from the original board manufacturer (and very limited Linux experience). The original driver uses init_timer() and passes in a pointer to the timer_list structure. That timer_list structure’s data element was set to a pointer to another memory structure and the function element set to the callback.
How can I use the cat command to read from a character device with my own character device driver?
I am trying to write a simple read/write character driver for a beaglebone. One of the tasks is to be able to use the cat command to read from the device, but I am unable to do so. Here is the code for my read function for my character device driver located inside char_drvr.c: Read executes successfully (the correct value
Serial port hangs on close()
I developed this simple kernel module, which emulates a serial port by using a FIFO queue and a timer (read from hardware : out from the queue, write to hardware : insert in the queue). Source code is shown next. Then, I wrote a simple test-application which configures the port settings (baud rate, parity, stop bits, etc) and starts a
Why driver need to map DMA buffers when dma-engine is in device?
DMA buffers are memory mapped by the driver. For example, in pci-skeleton.c, which uses rtl8319 we have: But DMA engine can reside in soc or in device. **Is it that dma buffers should be allocated even if DMA engine is in device ? Why ? ** rtl8139cp datasheet (I think the dma is part of the device, but not sure
Purpose and usage of GPIO-Hog declaration
Questions What is the purpose and use-case of the gpio-hog declaration? Can a ‘hogged’ gpio pin be interfaced with from Userspace? If a ‘hogged’ gpio pin cannot be interfaced with from Userspace, then is there any mechanism to configure GPIO pins in the dts file for Userspace interaction? Background I am trying to configure many (10+) GPIOs to speak with
What is “Recipe for target ‘gconfig’ failed” mean when I do “make xconfig” in Linux terminal?
I am really new on Linux drivers and I am trying to Compile Linux kernel 2.6, I did these steps so far on my Linux 4.0 1) I got Latest Linux kernel code for 2.x.y.z and Extract tar (.tar.bz3) file 2) Installed gcc, 3)Try to make below but all of them occurred with error: Error: Please help me to undrestand!
cannot get data from IR sensor on embedded linux using official driver
I run a linux image (made with buildroot and the 4.11.2 kernel provided by the manufacturer) on a nanopi NEO air board with an IR sensor plugged directly on the IR pin. I want to use the sensor to get data from an IR remote control. I followed the procedure found here, with the same driver, and got the same
Why am I getting an error message when trying to “cat” my char device driver?
I’ve written a simple character device driver for Linux. It is a simple message storing/retrieving system where the messages are stored in kernel space. I should be able to do something like this: and then retrieve the message with The messages are stored in a queue. When I try to retrieve a message that I hard coded in for testing