Auto-generate linux drivers with alternative kernel interfaces#414
Auto-generate linux drivers with alternative kernel interfaces#414jjts merged 12 commits intoIObundle:mainfrom
Conversation
The /dev interface can be used as an alternative to sysfs for accessing peripheral CSRs.
…ses sysfs interface
There was a problem hiding this comment.
Pull request overview
This PR adds support for auto-generating Linux device drivers with three alternative kernel-userspace interfaces: /dev, sysfs, and ioctl. The implementation extends the iob_linux_device_drivers module to generate appropriate driver and user-space code for each interface, and updates the iob_system_linux rootfs to include pre-compiled test programs for the iob_timer peripheral.
Key Changes:
- Auto-generation of Linux kernel drivers supporting
/dev,sysfs, andioctlinterfaces - Generation of interface-specific user-space sources for each kernel interface
- Addition of missing Verilog sources for Altera/Quartus FPGA modules
Reviewed changes
Copilot reviewed 6 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
create_peripheral_device_drivers.py |
Core implementation adding support for three kernel-userspace interfaces with auto-generation of driver and user-space code |
iob_eth |
Submodule reference update |
minicom_linux_script.txt |
Test script updated to test all three driver interfaces for iob_timer |
device_driver_tutorial.md |
Documentation updated to reference the new auto-generation capabilities |
ddio_out_clkbuf.v |
Added missing Verilog source for Altera DDIO output module |
clk_buf_altclkctrl_0.v |
Added missing Verilog source for Altera clock buffer module |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
py2hwsw/lib/software/iob_linux_device_drivers/scripts/create_peripheral_device_drivers.py
Outdated
Show resolved
Hide resolved
py2hwsw/lib/software/iob_linux_device_drivers/scripts/create_peripheral_device_drivers.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
P-Miranda
left a comment
There was a problem hiding this comment.
with the commands:
cd py2hwsw/lib
make sim-run CORE=iob_timer
tree ../../../iob_timer_V0.81/software/linuxthe ../../../iob_timer_V0.81/software/linux/user/Makefile
uses: riscv64-unknown-linux-gnu-gcc compiler, which is not available from py2hwsw nix-shell environment.
Not sure if this is a problem or not.
I have been using the nix-shell environment from the iob_linux repository to compile all software related to linux, including those user-space functions. Running the |
This is a dependency of PR IObundle/soc-linux#6
Add missing verilog sources for quartus modules.
Update iob_linux_device_drivers software module.
The new version auto-generates the peripheral's Linux kernel module with support for three alternative interfaces:
/dev,sysfs, andioctl.It also generates the corresponding user-space sources for each of those interfaces.
To test this new module, setup the iob_timer core and list the generated sources with:
Update iob_system_linux rootfs to include a pre-compiled version of the new auto-generated iob_timer kernel module driver and associated user-space functions. It also includes three pre-compiled user-space programs to test the iob_timer driver with each interface.