diff options
| author | John Baldwin <jhb@FreeBSD.org> | 2008-11-16 17:42:02 +0000 |
|---|---|---|
| committer | John Baldwin <jhb@FreeBSD.org> | 2008-11-16 17:42:02 +0000 |
| commit | 284c87f60ea12364d2cbf81ae2ebd1fd9c7ca788 (patch) | |
| tree | b65bdf61a799cb56906bea0847235a1bd148de23 /sys/dev/ppc | |
| parent | 62162dfc948bf1425ebf1b6b6df1d52cd8656f83 (diff) | |
Notes
Diffstat (limited to 'sys/dev/ppc')
| -rw-r--r-- | sys/dev/ppc/ppc.c | 122 | ||||
| -rw-r--r-- | sys/dev/ppc/ppc_acpi.c | 2 |
2 files changed, 62 insertions, 62 deletions
diff --git a/sys/dev/ppc/ppc.c b/sys/dev/ppc/ppc.c index 432b73a24090..b318932fc7e7 100644 --- a/sys/dev/ppc/ppc.c +++ b/sys/dev/ppc/ppc.c @@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$"); #include <sys/module.h> #include <sys/malloc.h> #include <sys/proc.h> - + #include <machine/bus.h> #include <machine/resource.h> #include <sys/rman.h> @@ -114,8 +114,8 @@ static char *ppc_epp_protocol[] = { " (EPP 1.9)", " (EPP 1.7)", 0 }; * ppc_ecp_sync() XXX */ void -ppc_ecp_sync(device_t dev) { - +ppc_ecp_sync(device_t dev) +{ int i, r; struct ppc_data *ppc = DEVTOSOFTC(dev); @@ -149,7 +149,7 @@ ppc_detect_fifo(struct ppc_data *ppc) char ecr_sav; char ctr_sav, ctr, cc; short i; - + /* save registers */ ecr_sav = r_ecr(ppc); ctr_sav = r_ctr(ppc); @@ -236,7 +236,7 @@ ppc_detect_fifo(struct ppc_data *ppc) LOG_PPC(__func__, ppc, "can't empty the FIFO"); goto error; } - + w_ctr(ppc, ctr_sav); w_ecr(ppc, ecr_sav); @@ -407,9 +407,9 @@ ppc_pc873xx_detect(struct ppc_data *ppc, int chipset_mode) /* XXX mode never for static int index = 0; int idport, irq; int ptr, pcr, val, i; - + while ((idport = pc873xx_basetab[index++])) { - + /* XXX should check first to see if this location is already claimed */ /* @@ -456,7 +456,7 @@ ppc_pc873xx_detect(struct ppc_data *ppc, int chipset_mode) /* XXX mode never for } printf("\n"); } - + /* * We think we have one. Is it enabled and where we want it to be? */ @@ -513,7 +513,7 @@ ppc_pc873xx_detect(struct ppc_data *ppc, int chipset_mode) /* XXX mode never for } outb(idport, PC873_PTR); - ptr = inb(idport + 1); + ptr = inb(idport + 1); /* get irq settings */ if (ppc->ppc_base == 0x378) @@ -523,7 +523,7 @@ ppc_pc873xx_detect(struct ppc_data *ppc, int chipset_mode) /* XXX mode never for if (bootverbose) printf("PC873xx irq %d at 0x%x\n", irq, ppc->ppc_base); - + /* * Check if irq settings are correct */ @@ -553,7 +553,7 @@ ppc_pc873xx_detect(struct ppc_data *ppc, int chipset_mode) /* XXX mode never for outb(idport, PC873_PCR); pcr = inb(idport + 1); - + if ((ptr & PC873_CFGLOCK) || !chipset_mode) { if (bootverbose) printf("PC873xx %s", (ptr & PC873_CFGLOCK)?"locked":"unlocked"); @@ -563,7 +563,7 @@ ppc_pc873xx_detect(struct ppc_data *ppc, int chipset_mode) /* XXX mode never for printf(", NIBBLE"); if (pcr & PC873_EPPEN) { - ppc->ppc_avm |= PPB_EPP; + ppc->ppc_avm |= PPB_EPP; if (bootverbose) printf(", EPP"); @@ -596,8 +596,8 @@ ppc_pc873xx_detect(struct ppc_data *ppc, int chipset_mode) /* XXX mode never for ptr = inb(idport + 1); if (ptr & PC873_EXTENDED) { ppc->ppc_avm |= PPB_SPP; - if (bootverbose) - printf(", SPP"); + if (bootverbose) + printf(", SPP"); } } } else { @@ -652,7 +652,7 @@ ppc_pc873xx_detect(struct ppc_data *ppc, int chipset_mode) /* XXX mode never for if (bootverbose) printf(", PS/2"); - + } else { /* default to NIBBLE mode */ ptr &= ~PC873_EXTENDED; @@ -699,7 +699,7 @@ ppc_smc37c66xgt_detect(struct ppc_data *ppc, int chipset_mode) /* * Detection: enter configuration mode and read CRD register. */ - + s = splhigh(); outb(csr, SMC665_iCODE); outb(csr, SMC665_iCODE); @@ -914,7 +914,7 @@ ppc_smc37c935_detect(struct ppc_data *ppc, int chipset_mode) ppc->ppc_model = type; outb(SMC935_IND, SMC935_LOGDEV); /* select parallel port, */ - outb(SMC935_DAT, 3); /* which is logical device 3 */ + outb(SMC935_DAT, 3); /* which is logical device 3 */ /* set io port base */ outb(SMC935_IND, SMC935_PORTHI); @@ -983,7 +983,7 @@ ppc_smc37c935_detect(struct ppc_data *ppc, int chipset_mode) #define efdr ((efer == 0x250) ? 0x252 : 0x3f1) static int w83877f_efers[] = { 0x250, 0x3f0, 0x3f0, 0x250 }; -static int w83877f_keys[] = { 0x89, 0x86, 0x87, 0x88 }; +static int w83877f_keys[] = { 0x89, 0x86, 0x87, 0x88 }; static int w83877f_keyiter[] = { 1, 2, 2, 1 }; static int w83877f_hefs[] = { WINB_HEFERE, WINB_HEFRAS, WINB_HEFERE | WINB_HEFRAS, 0 }; @@ -1322,14 +1322,14 @@ ppc_exec_microseq(device_t dev, struct ppb_microseq **p_msq) mi = *p_msq; for (;;) { - switch (mi->opcode) { + switch (mi->opcode) { case MS_OP_RSET: cc = r_reg(mi->arg[0].i, ppc); cc &= (char)mi->arg[2].i; /* clear mask */ cc |= (char)mi->arg[1].i; /* assert mask */ - w_reg(mi->arg[0].i, ppc, cc); + w_reg(mi->arg[0].i, ppc, cc); INCR_PC; - break; + break; case MS_OP_RASSERT_P: reg = mi->arg[1].i; @@ -1348,7 +1348,7 @@ ppc_exec_microseq(device_t dev, struct ppb_microseq **p_msq) INCR_PC; break; - case MS_OP_RFETCH_P: + case MS_OP_RFETCH_P: reg = mi->arg[1].i; mask = (char)mi->arg[2].i; ptr = ppc->ppc_ptr; @@ -1364,17 +1364,17 @@ ppc_exec_microseq(device_t dev, struct ppb_microseq **p_msq) ppc->ppc_ptr = ptr; INCR_PC; - break; + break; - case MS_OP_RFETCH: + case MS_OP_RFETCH: *((char *) mi->arg[2].p) = r_reg(mi->arg[0].i, ppc) & (char)mi->arg[1].i; INCR_PC; - break; + break; case MS_OP_RASSERT: - case MS_OP_DELAY: - + case MS_OP_DELAY: + /* let's suppose the next instr. is the same */ prefetch: for (;mi->opcode == MS_OP_RASSERT; INCR_PC) @@ -1406,30 +1406,30 @@ ppc_exec_microseq(device_t dev, struct ppb_microseq **p_msq) INCR_PC; break; - case MS_OP_SET: - ppc->ppc_accum = mi->arg[0].i; + case MS_OP_SET: + ppc->ppc_accum = mi->arg[0].i; INCR_PC; - break; + break; - case MS_OP_DBRA: - if (--ppc->ppc_accum > 0) - mi += mi->arg[0].i; + case MS_OP_DBRA: + if (--ppc->ppc_accum > 0) + mi += mi->arg[0].i; INCR_PC; - break; + break; - case MS_OP_BRSET: - cc = r_str(ppc); - if ((cc & (char)mi->arg[0].i) == (char)mi->arg[0].i) - mi += mi->arg[1].i; + case MS_OP_BRSET: + cc = r_str(ppc); + if ((cc & (char)mi->arg[0].i) == (char)mi->arg[0].i) + mi += mi->arg[1].i; INCR_PC; - break; + break; - case MS_OP_BRCLEAR: - cc = r_str(ppc); - if ((cc & (char)mi->arg[0].i) == 0) - mi += mi->arg[1].i; + case MS_OP_BRCLEAR: + cc = r_str(ppc); + if ((cc & (char)mi->arg[0].i) == 0) + mi += mi->arg[1].i; INCR_PC; - break; + break; case MS_OP_BRSTAT: cc = r_str(ppc); @@ -1484,9 +1484,9 @@ ppc_exec_microseq(device_t dev, struct ppb_microseq **p_msq) INCR_PC; break; - case MS_OP_PUT: - case MS_OP_GET: - case MS_OP_RET: + case MS_OP_PUT: + case MS_OP_GET: + case MS_OP_RET: /* can't return to ppb level during the execution * of a submicrosequence */ if (stack) @@ -1499,10 +1499,10 @@ ppc_exec_microseq(device_t dev, struct ppb_microseq **p_msq) /* return to ppb level of execution */ return (0); - default: - panic("%s: unknown microsequence opcode 0x%x", - __func__, mi->opcode); - } + default: + panic("%s: unknown microsequence opcode 0x%x", + __func__, mi->opcode); + } } /* unreached */ @@ -1605,7 +1605,7 @@ void ppc_reset_epp(device_t dev) { struct ppc_data *ppc = DEVTOSOFTC(dev); - + ppc_reset_epp_timeout(ppc); return; @@ -1668,19 +1668,18 @@ ppc_probe(device_t dev, int rid) next_bios_ppc += 1; if (bootverbose) device_printf(dev, - "parallel port found at 0x%x\n", - (int) port); + "parallel port found at 0x%lx\n", port); } #else - if((next_bios_ppc < BIOS_MAX_PPC) && - (*(BIOS_PORTS+next_bios_ppc) != 0) ) { - port = *(BIOS_PORTS+next_bios_ppc++); + if ((next_bios_ppc < BIOS_MAX_PPC) && + (*(BIOS_PORTS + next_bios_ppc) != 0)) { + port = *(BIOS_PORTS + next_bios_ppc++); if (bootverbose) - device_printf(dev, "parallel port found at 0x%x\n", - (int) port); + device_printf(dev, + "parallel port found at 0x%lx\n", port); } else { device_printf(dev, "parallel port not found.\n"); - return ENXIO; + return (ENXIO); } #endif /* PC98 */ bus_set_resource(dev, SYS_RES_IOPORT, rid, port, @@ -1804,7 +1803,7 @@ ppc_attach(device_t dev) ppc_models[ppc->ppc_model], ppc_avms[ppc->ppc_avm], ppc_modes[ppc->ppc_mode], (PPB_IS_EPP(ppc->ppc_mode)) ? ppc_epp_protocol[ppc->ppc_epp] : ""); - + if (ppc->ppc_fifo) device_printf(dev, "FIFO with %d/%d/%d bytes threshold\n", ppc->ppc_fifo, ppc->ppc_wthr, ppc->ppc_rthr); @@ -1884,6 +1883,7 @@ u_char ppc_io(device_t ppcdev, int iop, u_char *addr, int cnt, u_char byte) { struct ppc_data *ppc = DEVTOSOFTC(ppcdev); + switch (iop) { case PPB_OUTSB_EPP: bus_write_multi_1(ppc->res_ioport, PPC_EPP_DATA, addr, cnt); diff --git a/sys/dev/ppc/ppc_acpi.c b/sys/dev/ppc/ppc_acpi.c index 04cee681a921..032f19677611 100644 --- a/sys/dev/ppc/ppc_acpi.c +++ b/sys/dev/ppc/ppc_acpi.c @@ -33,7 +33,7 @@ __FBSDID("$FreeBSD$"); #include <sys/kernel.h> #include <sys/module.h> #include <sys/bus.h> - + #include <machine/bus.h> #include <isa/isareg.h> |
