Page MenuHomeFreeBSD

PowerPC: Add CPLD driver for AmigaOne X5000
ClosedPublic

Authored by jhibbits on Sat, Jan 11, 10:59 PM.

Details

Summary

The CPLD is the communications medium between the CPU and the XMOS
"Xena" event coprocessor. It provides a mailbox communication feature,
along with dual-port RAM to be used between the CPU and XMOS. Also, it
provides basic board stats as well, such as PCIe presence, JTAG signals,
and CPU fan speed reporting (in revolutions per second). Only fan speed
is implemented, as a sysctl.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

jhibbits created this revision.Sat, Jan 11, 10:59 PM
jhibbits updated this revision to Diff 66640.Sun, Jan 12, 3:42 AM

Fix the build. Last minute splitting of the driver out to have a header before submitting, but didn't build test first.

cpld0: <AmigaOne Cyrus CPLD> mem 0x4000000002010000-0x400000000201ffff on lbc0
cpld0: Build date: 2015-05-06
cpld0: Build time: 17:17:17
cpld0: Hardware revision: 8720

sys/powerpc/amigaone/cpld_x5000.c
192 ↗(On Diff #66640)

+ mda.mda_si_drv1 = sc;

jhibbits updated this revision to Diff 66947.Sat, Jan 18, 1:14 AM

Stash off the softc in the cdev. It might be helpful to *not* dereference a
NULL pointer.

bdragon added inline comments.Sat, Jan 18, 1:51 AM
sys/powerpc/amigaone/cpld.h
10 ↗(On Diff #66947)

I think you accidentally joined in your license template, this line is twice as long as it should be in both files.

bdragon accepted this revision.Sat, Jan 18, 1:58 AM

Works on my X5000, and looks good to me (other than needing to add that missing newline in the license in both cases)

cpld0: <AmigaOne Cyrus CPLD> mem 0x4000000002010000-0x400000000201ffff on lbc0
cpld0: Build date: 2015-05-06
cpld0: Build time: 17:17:17
cpld0: Hardware revision: 8720
root@:~ # sysctl dev.cpld
dev.cpld.0.cpu_fan: 2700
dev.cpld.0.%parent: lbc0
dev.cpld.0.%pnpinfo: 
dev.cpld.0.%location: 
dev.cpld.0.%driver: cpld
dev.cpld.0.%desc: AmigaOne Cyrus CPLD
dev.cpld.%parent:
This revision is now accepted and ready to land.Sat, Jan 18, 1:58 AM
This revision was automatically updated to reflect the committed changes.