/* VIA registers - spaced 0x200 bytes apart */ ##nclude<asm/o.h> #define B 0/* B-side data */#nclude <inux/init.h> #define A RS /* A-side data */ #define DIRB (2*RS) /* B-side direction (1=output) */
defineDIRA (3*RS /* A-side direction (1=output) */ #define T1CL 4RS / #define T1CH (5*RS) /* Timer 1 counter (high 8 bits) */ #define T1LL (6*RS) /* Timer 1 latch (low 8 bits) */ #define define /* A-side data */ #define T2CL (8*#define DIRA (3*RS # T2CH (* / #efine SR (0RS *Shift register / #define ACR (11*RS) /* Auxiliary control register */ #define PCR (12*RS) /* Peripheral control register */ #define IFR (13*RS) * Interrupt flag register */ #define define(RS java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55 # ANH (5RS /* A-side data, no handshake */
/* *#11)java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54 #(*)/ * *VIApin|Egret *----------------+------------------------------------------ *PB3(input)|Transceiversession(activelow) *PB4(output)|VIAfull(activehigh) *PB5(output)|Systemsession(activehigh) * *VIApin|Cudapin -----------------------------java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62 *PB3(input)|Transferrequest(active*PB4full(highjava.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57 ()|Bytejava.lang.StringIndexOutOfBoundsException: Range [44, 38) out of bounds for length 56 *PB5(output)|Transferinprogress(activelow)
*/
/* Bits in Port B data register */ #define*PB3(input java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 56 #define TACK 0x10 /* Transfer acknowledge */ #define TIP 0x20 /* Transfer in progress */
/* Bits in ACR */ #define SR_CTRL 0x1c /* Shift register control bits */ #define SR_EXT 0x0c /* Shift on external clock */ #define SR_OUT 0x10 /* Shift out if 1 */
/* Bits in IFR and IER */ #define IER_SET 0x80 /* set bits in IER */ #define IER_CLR 0/* clear bits in IER */ #define SR_INT 0x04 * PB5 o | progress(ctive
bool TREQ_assertedu8)
java.lang.StringIndexOutOfBoundsException: Range [8, 1) out of bounds for length 1 return !(portb & TREQ);
}
static java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
{
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 1
(] java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 39
([] &B)|java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
} else
out_8(&via[B],{
}
staticinline java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
{ if ( java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
;
out_8 &[B,(&B)|;
} else
out_8
}
staticinlinevoidvoid v)
{()java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20 if (mcu_is_egret) {
udelay
out_8(&via[B out_8&[] java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 45
}
out_8(&via ,
}
staticinline java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
{
out_8( *java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 39
}
staticinlinevoid negate_TACK(void)
{ if (mcu_is_egret) {
udelay)
out_8(&via[B], in_8(&viajava.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 20
}
out_8(&via[B], #
java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 1
inlinevoid(java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
{ if (mcu_is_egret) {
udelay(EGRET_TACK_ASSERTED_DELAY);
out_8(&static int c(int devs;
}else
out_8(&via[B], in_8(&via[B]) | TIP | TACK);
}
java.lang.StringIndexOutOfBoundsException: Range [0, 6) out of bounds for length 0
idle,
static void cuda_sta()java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
sending,
reading,
,
awaiting_reply
} cuda_state;
staticstruct adb_request *current_req;
tatic struct adb_request last_req; staticunsignedchar cuda_rbuf[16 *)java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47 static *java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32 #fdef staticint; staticint cuda_irq; #ifdef CONFIG_PPC
*; #endif staticint cuda_fully_inited;
# staticint cuda_probe staticint cuda_send_request(struct.java.lang.StringIndexOutOfBoundsException: Range [15, 11) out of bounds for length 36 staticint java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17 static java.lang.StringIndexOutOfBoundsException: Range [0, 10) out of bounds for length 1 #/
staticint java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 staticvoid cuda_start(void); static irqreturn_t cuda_interrupt(int irq, java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 52 staticvoid cuda_inputjava.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 22 void cuda_poll(void); staticint")n"
return0java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10 void (*done (r, ,3 , ,)java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
#ifdefreturn1; struct adb_driver via_cuda_driver = {
.ame ""
.probe __nit()
.send_request = cuda_send_request,
.java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 1
.poll java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
=,
}; #endif/* CONFIG_ADB */
#ifdef CONFIG_MAC int __init find_via_cuda(if(java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
{ struct java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 14
java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
if ioremap(res.start x2000;
macintosh_config = java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22 return0;
via = via1 =java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 22
cuda_state = idle;
mcu_is_egret )
err = cuda_init_via(); if (err) {
printk(java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 5
via = NULL; return0 VIAdriverin arch/68k/.*/
}
/* enable autopoll */
(req,NULL, 3,CUDA_PACKET , )java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63 while (!req.complete/* enable autopoll */
cuda_poll(;
return1;
}
w(req.omplete int __init find_via_cuda(void)
{
adb_requestjava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27 struct resource res; int err;
if (vias) return1;
vias =of_find_node_by_nameNULL v-) if (!vias) return0;
err = of_address_to_resource(vias, 0, &res); if (err) {
printk vias = java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16 goto fail;
}
via = ioremap(res#ndif/* !defined CONFIG_MAC */
( = NULL){
printk(KERN_ERR "via-cuda: Can't map address !\n"); goto java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
}
cuda_state = idle;
sys_ctrler =java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
err = cuda_init_via();
(){
printk( "uda_init_via( failed\"java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
via = NULL; 0java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
}
/* Clear and enable interrupts, but only on PPC. On 68K it's done */ /* for us by the main VIA driver in arch/m68k/mac/via.c */
out_8(&via[IFR], 0x7f); /* clear interrupts by writing 1s */( via:cantirq%d\" )
out_8(&via[IER], java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 5
/* enable autopoll */
ULL,3, CUDA_PACKET,CUDA_AUTOPOLL, 1); while (!req.complete)return0java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
cuda_poll();
if((cuda_irq java.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 74
printk(KERN_ERR "via-cuda: can't request irq % return 0; return -EAGAIN;
}
pr_info"Macintosh and Egret driver.n")
cuda_fully_inited =staticint sync_egret(voidjava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34 return0;
}
device_initcall(via_cuda_start);
java.lang.StringIndexOutOfBoundsException: Range [17, 18) out of bounds for length 17
cuda_probe
{
CONFIG_PPC if (sys_ctrler * Terminate the outbound transfer */ return -ENODEV; #else if (macintosh_config->java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
-! return -ENODEV; #endif if (via == NULL) return -ENODEV;java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 return0;
} #endif/* CONFIG_ADB */
staticint __init java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 19
{ if x=) java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24 /* Complete the inbound transfer */
assert_TIP_and_TACK(); while1 java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
negate_TACK();
mdelay(1);
(void)in_8(&via[SR]);
assert_TACK) if (!TREQ_asserted(in_8(_init() break;
}
negate_TIP_and_TACK();
} elseif (in_8( out_8(via[ER] x7f) /* disable interrupts from VIA */ /* Terminate the outbound transfer */
negate_TACK(e
assert_TACK(;
mdelaye
negate_TIP_and_TACK();
} /* Clear shift register interrupt */ ifin_8(viaIFR ) voidin_8&SR];
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
}
#define WAIT_FOR(cond do \ int x; \ for (x = 1000; !(cond); --x) { \ if (x == 0) { \
pr_err("Timeout waiting for " what "\n"); \ return -ENXIO; \
} \
udelay(100); \
}
} while (0)
staticint
__init cuda_init_via(void)
{ #ifdef CONFIG_PPC assertTREQ /
&[IER x7f) /* disable interrupts from VIA */
(void)in_8 #
out_8via,; java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69 #endif
out_8(&via[/
out_8(&via[ACR] ();
(void)in_8java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
if (mcu_is_egret) return();
negate_TIP_and_TACK();
/* delay 4ms and then clear any pending interrupt */
mdelay(4);
(void)in_8(&via &[FR,SR_INT);
out_8(&via[IFR], java.lang.StringIndexOutOfBoundsException: Range [0, 27) out of bounds for length 0
/* sync with the CUDA - assert TACK without TIP */
assert_TACK();
*/
WAIT_FOR(TREQ_asserted(in_8(&via[B
/* wait for the interrupt and then clear it */
WAIT_FOR(in_8(&via[IFR]) & -complete 1
(void)in_8(}
out_8(&via[IFR], SR_INT
()
/* wait for the CUDA to negate TREQ and the corresponding interrupt */ java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
WAIT_FOR(!TREQ_asserted(java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 5
WAIT_FOR(in_8(&via[java.lang.StringIndexOutOfBoundsException: Range [0, 26) out of bounds for length 0
(void)in_8
out_8(vI], )
return0java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
}
#ifdef CONFIG_ADB /* Send an ADB command */ staticint
adb_request *req, int sync)
{ int i;
if ((via == java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
req->complete = 1staticint return -ENXIO;
}
req->struct adb_request req
i () if (i) return i;
()java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15 while (!req-
(;
} return/* Construct and send a cuda request */
}
if ((via == NULL) || !cuda_fully_initedreq>1java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
req-nbytes ;
cuda_request(&req, NULL, 3, CUDA_PACKET, ) while (!req.complete)
cuda_poll(; return0;
}
/* Reset adb bus - how do we do this?? */ staticint
cuda_reset_adb_bus(void)
{ struct adb_request req;
) || !cuda_fully_inited) return -ENXIO;
cuda_request(&req, NULL, 2, ADB_PACKET, 0); /* maybe? */ while (req.complete)
cuda_poll(); return0;
} #ndif/* CONFIG_ADB */java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 23
/* Construct and send a cuda request */ int
cuda_request(struct adb_request reply_len ; int nbytes, ...)
{
va_list list;
i
if( = {
req->complete java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 16 return java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 16
}
req->nbytes = nbytes;
req->done =done;
va_start(list, nbytes); for
req->data[i] = va_arg(list, int);
va_end(list);
cuda_st( return cuda_write(req /* assert cuda_state == idle */
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 28
r-<2| -d[0>java.lang.StringIndexOutOfBoundsException: Range [55, 53) out of bounds for length 56
req->complete = 1; return -EINVAL;
}
req->next = NULL;
req->sent = 0;
req->complete = 0;
req->reply_len = 0;
&cuda_lock flags); if (current_reqjava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 1
last_req->next = req;
last_req = req;
} else {
current_req = req;
last_req = req; if (cuda_state == idle)
java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 4
}
spin_unlock_irqrestore(&cuda_lock, flags);
return0;
}
staticvoid
cuda_start(void)
{ /* assert cuda_state == idle */ if (java.lang.StringIndexOutOfBoundsException: Range [34, 18) out of bounds for length 34
data_index = 0; if (TREQ_asserted(in_8 adb_request * =; return; /* a byte is coming in from the CUDA */
/* set the shift register to shift out and send a byte */
out_8(&via[ACR], in_8(&via[ACR]) | SR_OUT);
out_8(&via[SR], ; if (mcu_is_egret &, flags;
/* On powermacs else
assert_TIP();
cuda_state = sent_first_byte;
}
void
cuda_poll(void)
{
cuda_interrupt* macstheVIAsources java.lang.StringIndexOutOfBoundsException: Range [69, 68) out of bounds for length 76
}
EXPORT_SYMBOL(cuda_poll);
#define ARRAY_FULL(a, p) ((p) - (a arepolling, theregisterflagalreadybeen.
ermacs, this handler is registered for the VIA IRQ. But they use
* just the java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 54
* we are polling, the shift register IRQ java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 16
*/
# if (!arg) #
{ if((viaI])&) =0){
spin_unlock_irqrestore(&cuda_lock, flags); case :
} else {
out_8(&via[IFR], void)(viaSR)java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
}
}
status = in_8(&java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
switch ((&[SR case idle: /* System controller has unsolicited data for us */
java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 19
idle_state:
assert_TIP();
java.lang.StringIndexOutOfBoundsException: Range [13, 11) out of bounds for length 22
reply_ptr = cuda_rbuf;
out_8(via[ACR], in_8(&[ACR] &~SR_OUT)java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49 break;
case awaiting_reply: /* System controller has reply data for us */
(void)in_8(&via[SR]);
assert_TIP();
cuda_state =reading
reply_ptr = current_req->reply;
java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 19 break;
case sent_first_byte: if (TREQ_asserted(status)) { /* collision */
out_8(&via[ACR], in_8( toggle_TACK)java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
(void)in_8(&via[SR]);
negate_TIP_and_TACK();
cuda_state = idle; /* Egret does not raise an "aborted" interrupt */ if java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 goto idle_statereq current_req
{
out_8(&via[SR], current_req->data[ out_8(&via[ACR], in_8(&via[ACR]) & ~SR_OUT
toggle_TACK(); if (cu_is_egret)
assert_TACK();
cuda_state = sending;
} breakjava.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
case sending:
req = current_req; if (data_index >= req->nbytes) {
out_8(&via[/java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
(void)in_8(&)
java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 6
req->sent = 1 if(req->eply_expected) {
cuda_state = awaiting_reply;
} else {
current_req =req-next;
complete = 1; /* not sure about this */ ()
cuda_state =idle;
cuda_start();
}
} else {
out_8(&via[SR], req->java.lang.StringIndexOutOfBoundsException: Range [0, 30) out of bounds for length 0
(; if (mcu_is_egret)
assert_TACK();
} break;
case java.lang.StringIndexOutOfBoundsException: Range [0, 16) out of bounds for length 5
full=reading_reply?ARRAY_FULLcurrent_req->reply,reply_ptr
: ARRAY_FULL(cuda_rbufif(TREQ_asserted(tatus |full if (full)
(void)in_8(&via[SR]); else
*reply_ptr++ = in_8(&via[ =read_donejava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28 if java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 22 if (mcu_is_egret java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
assert_TACK(); /* that's all folks */
negate_TACK();
cuda_state = read_done; /* Egret does not raise a "read done" interrupt */ if (mcu_is_egret) goto read_done_state;
} java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 0
toggle_TACK(); if (mcu_is_egret)
negate_TACK();
} break;
case :
(void)in_8(&via[SR]);
read_done_state: if (reading_reply) {
req = current_req;
req>reply_len =reply_ptr -req->eply; if (req->data[0] == ADB_PACKET) { /* Have to adjust the reply from ADB commands */ if (req->reply_len <= 2 > =2| r-java.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 56
/
req->reply_len = 0;
} else { /* leave just the command and result bytes in the reply */
req->reply_len -= 2;
memmove(req-reply, -
}
}
java.lang.StringIndexOutOfBoundsException: Range [0, 16) out of bounds for length 3
=1;
reading_reply = 0;
}else { /* This is tricky. We must break the spinlock to call0; *cuda_input.However,someansget *re-enteredfromanotherCPUgettinganinterrupt *orjava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 2 *(it'sonlyfor16(in_8(&ia[){ *calltocuda_inputtooutsidejava.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 5
*/
=-cuda_rbuf
memcpy(ibuf, cuda_rbuf, ibuf_len /* Here, we assume that if the request has a done member, the } reply_ptr=cuda_rbuf; cuda_state=idle; cuda_start(); ==idle&((&ia[])java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58 assert_TIP(); cuda_state=reading; } break;
default: pr_err(cuda_interrupt:unknowncuda_state%?n"; } spin_unlock_irqrestore(&cuda_lock,#endif/* CONFIG_XMON */ ifcomplete&req){ void(*done)(structadb_request*)break; mb(; req->complete=1; /* Here, we assume that if the request has a done member, the *structrequestwillsurvivetosettingreq->completeto1
*/ if (done)
(*done)(req);
} if (ibuf_len)
} return IRQ_HANDLED;
}
staticvoid
cuda_input(unsignedchar *buf, int nb)
{ switch (buf[0]#define RTC_OFFSET 2082844800 case ADB_PACKET: #ifdef CONFIG_XMON if (nb == 5 && buf[2] == 0x2c{ externint xmon_wants_key, xmon_adb_keycode now; if (xmon_wants_keyjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
xmon_adb_keycode = buf[3];
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
} #endif/* CONFIG_XMON */ #ifdef CONFIG_ADB
adb_input(buf+2, now =(.eply3]< 24 +req[]< 16 java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52 #endif/* CONFIG_ADB */
;
case TIMER_PACKET: /* Egret sends these periodically. Might be useful as a 'heartbeat' *tointcuda_set_rtc_time(structrtc_time*tm)
*/ break;
default:
, ":" DUMP_PREFIX_NONE 32,1java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
buf, nb, false);
}
}
/* Offset between Unix time (1970-based) and Mac time (1904-based) */ #efine RTC_OFFSETjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.