百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
P

pata-gpio

> 编程语言
开源

用于通过 GPIO 进行 PATA 位点击的 Linux 内核驱动

181 stars0 点赞3 次浏览
访问官网GitHub

工具介绍

用于通过 GPIO 进行 PATA 位点击的 Linux 内核驱动

pata-gpio

Overview

DISCLAIMER: This driver was developed for fun and learning ATA internals. If you're looking for a practical way to use PATA devices, look for commercial USB adapters.

pata-gpio is a Linux kernel driver for GPIO bitbanged PATA (also known as ATA/ATAPI or IDE).
Pin configuration can be set via device tree, the regular ATA framework is used.

IDE Primary/Secondary device support is implemented.

Performance

On a Raspberry Pi 4 (with direct GPIO) about 800 KiB/s reading, 500 KiB/s writing speed is possible. Most of the performance bottleneck is down to the usage of libgpiod (kernel gpio abstraction), which is optimized for tasks like switching LEDs. Data transmission is well outside the design scope of libgpiod.

DMA and interrupts are not implemented at the moment.

Device tree configuration

Pin configuration can be specified in the device tree.
An example device tree is provided as atapi-direct.dts.
This includes the pin configuration for the schematic linked at the bottom of this readme.

The following device tree properties are present:

Property Usage Required
databus-gpios list of 16 GPIO pins, connected to ATA D0 - D15 in this order yes
cs-gpios list of 2 GPIO pins, connected to ATA CS0 and CS1 in this order yes
address-gpios list of 3 GPIO pins, connected to ATA DA0, DA1 and DA2 in this order yes
strobe-write-gpio GPIO pin, connected to ATA IOW line yes
strobe-read-gpio GPIO pin, connected to ATA IOR line yes
reset-gpio GPIO pin, connected to ATA RESET line no

Interrupts

The driver has experimental interrupt support. An example configuration with GPIO interrupts is outlined in atapi-direct-irq.dts.
Interrupts are configured via the generic interrupts property. If the interrupts property is not specified the driver falls back to polling.

Compiling

Before loading (and running) the kernel module, make sure to load the device tree overlay.
This can be done via the config.txt (on a Raspberry Pi): dtoverlay=atapi-direct, or by running ./loaddt.sh.
The latter script will also compile and save the device tree to /boot/overlays/atapi-direct.dtbo.

This module needs kernel headers, regular build dependencies and a kernel with the config option CONFIG_ATA_SFF=y set.
The ATA_SFF option is not the default on Raspberry Pis, so you will need to build a custom kernel.

Compile the module using:
make

Load the module using:
insmod pata-gpio.ko

A helper script called ./run.sh is provided, which will remove any loaded pata-gpio module, compile it and load the resulting module.
Further status information can be shown by running dmesg.

Additional info

Adapter PCB
Adapter schematic

Older schematic (not SMI-ready)
Video: Audio CD streaming
Twitter: Project presentation

Credits

Thanks to @Toble_Miner for a lot of help in the development of this driver!

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Clinuxpataraspberrypiretro

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言