Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Please help with ZYNQ custom AXI slave UIO driving on Linux.

Status
Not open for further replies.

electrodarkness

Member level 1
Joined
May 2, 2010
Messages
39
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
Ganesti, Transylvania, Romania
Activity points
1,649
Hello everyone!

I've got a ZYBO devboard, and I've loaded an SD card with MainLine Linux 4.9.51 kernel with Xenomai patch, uBoot(with SPL), an FPGA bit file which contains some AXI Slave GPIOs, and a custom PWM driver with AXI Slave interface. I've modified the generated device tree to use the GPIOs and the PWM module with the generic uio driver. On a second partition I have Ubuntu 16.04 file system with python jupyter notebook installed.

I tried to control the GPIOs (both inputs and outputs) with /dev/mem in C, which worked as intended. Next I wrote a python script with mmap and uio usage and the GPIOs worked flawlessly. When I tried to do the same with the PWM module, I don't know how to manage 4 32bit registers. mmap only lets me write 8bit values, but the pwm module has 4 registers: 0 - duty cycle, 1 - min threshold, 2 - max threshold, 3 - enable output, each being a 32 bit register.

I attach my device tree, gpio python script which worked, and the PWM script which doesn't work.

Any ideas what should I do differently? should I decompose the 32b registers into 4 x 8b ones?
Any advice would be really appreciated!

Thanks in advance,
Áron.
 

Attachments

  • devicetree.txt
    2.6 KB · Views: 93
  • gpio_mmio.txt
    1.6 KB · Views: 98
  • pwm_mmio.txt
    2.2 KB · Views: 91

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top