version 1.3, 2007/10/16 21:35:30 |
version 1.5, 2007/10/16 22:34:49 |
|
|
#include <sys/bus.h> |
#include <sys/bus.h> |
|
|
#include <arch/testarm/dev/taconsreg.h> |
#include <arch/testarm/dev/taconsreg.h> |
|
#include <arch/testarm/dev/taconsvar.h> |
#include <dev/fcons/fconsvar.h> |
#include <dev/fcons/fconsvar.h> |
#include <libkern/printf.h> |
#include <libkern/printf.h> |
|
|
|
|
tacons_attach(struct device *self, uint32_t loc, uint8_t flags) |
tacons_attach(struct device *self, uint32_t loc, uint8_t flags) |
{ |
{ |
struct tacons_dd *ddp = self->dv_devdata; |
struct tacons_dd *ddp = self->dv_devdata; |
struct fcons_handle *fhp = &ddp->td_consops; |
struct fcons_handle *fhp = &ddp->td_fh; |
|
|
/* aquire bus handle from parent */ |
/* aquire bus handle from parent */ |
ddp->td_bhp = self->dv_parent->dv_aux; |
ddp->td_bhp = self->dv_parent->dv_aux; |
|
|
fhp->getc = tacons_getc; |
fhp->getc = tacons_getc; |
fhp->putc = tacons_putc; |
fhp->putc = tacons_putc; |
|
|
|
/* give our dd to fcons_handle */ |
|
fhp->fh_ownerdd = ddp; |
|
|
self->dv_aux = fhp; |
self->dv_aux = fhp; |
|
|
printf("testarm simple console (non-blocking, halt)\n"); |
printf("testarm simple console (non-blocking, halt)\n"); |
|
|
*/ |
*/ |
struct tacons_dd *tdp = ddp; |
struct tacons_dd *tdp = ddp; |
|
|
return( bus_write_1(tdp->td_dhp, tdp->td_ioaddr, ch) ); |
bus_write_1(tdp->td_bhp, tdp->td_ioaddr, ch); |
} |
} |
|
|
|
|