From: Adrian M. <ad...@mc...> - 2001-11-23 08:35:10
|
On Friday 23 Nov 2001 5:13 am, M. R. Brown wrote: > * Adrian McMenamin <ad...@mc...> on Thu, Nov 22, 2001: > > The good news is that I am now pretty confident that this task (writing > > the driver) is doable... > > Two things about directly accessing the AICA hardware: > > 1) Use io_request_region() to reserve AICA registers and RAM, > 2) Use the in{b,w,l}() out{b,w,l}() macros when accessing registers. This > lets us do things like wait for the G2 bus FIFO (0xa05f688c) and other > cool stuff, without the device driver ever needing to worry about it: > > void outl(u32 val, void *addr) > { > while ((u32 *)*(0xa05f688c) & 1) ; > *reg = val; > } > > You only have to worry about AICA-specific stuff in your driver at this > point, you don't have to get all funky like libdream or KOS. > Thanks for the tips. No need to worry about the driver getting "all funky" :-> At the moment the thing I am interested in is getting some noise to come out of the speakers! > See, even the kernel can do sane abstraction ;). > > M. R. |