diff options
author | Felix Kronlage <fkr@cvs.openbsd.org> | 2006-06-21 11:27:04 +0000 |
---|---|---|
committer | Felix Kronlage <fkr@cvs.openbsd.org> | 2006-06-21 11:27:04 +0000 |
commit | 352c8b1d9301b87bb083059ee15e22c56b05486a (patch) | |
tree | 4f68cef0c815f080ce55b31a0616c587abe4b69a | |
parent | 834b1d43c7a47e7cb72960feacca338f86a433ef (diff) |
removal of '#ifdef rbus ... #else ...' directives, we use rbus in all
cases anyways, so we might as well remove code (the !rbus case) thats been
dead throughout the last years and just use the rbus code without ifdefs.
brad, miod "I am all for this diff"
ok deraadt, mickey
-rw-r--r-- | sys/dev/cardbus/cardbus.c | 9 | ||||
-rw-r--r-- | sys/dev/cardbus/cardbus_map.c | 25 | ||||
-rw-r--r-- | sys/dev/cardbus/cardbusvar.h | 38 | ||||
-rw-r--r-- | sys/dev/cardbus/ehci_cardbus.c | 6 | ||||
-rw-r--r-- | sys/dev/cardbus/if_ath_cardbus.c | 6 | ||||
-rw-r--r-- | sys/dev/cardbus/if_atw_cardbus.c | 10 | ||||
-rw-r--r-- | sys/dev/cardbus/if_ral_cardbus.c | 7 | ||||
-rw-r--r-- | sys/dev/cardbus/if_re_cardbus.c | 6 | ||||
-rw-r--r-- | sys/dev/cardbus/if_rl_cardbus.c | 10 | ||||
-rw-r--r-- | sys/dev/cardbus/if_rtw_cardbus.c | 10 | ||||
-rw-r--r-- | sys/dev/cardbus/if_xl_cardbus.c | 6 | ||||
-rw-r--r-- | sys/dev/cardbus/ohci_cardbus.c | 6 | ||||
-rw-r--r-- | sys/dev/cardbus/rbus.h | 4 | ||||
-rw-r--r-- | sys/dev/cardbus/uhci_cardbus.c | 6 | ||||
-rw-r--r-- | sys/dev/pci/pccbb.c | 227 | ||||
-rw-r--r-- | sys/dev/pci/pccbbvar.h | 4 |
16 files changed, 17 insertions, 363 deletions
diff --git a/sys/dev/cardbus/cardbus.c b/sys/dev/cardbus/cardbus.c index acc929f12ce..c98e8c58da7 100644 --- a/sys/dev/cardbus/cardbus.c +++ b/sys/dev/cardbus/cardbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cardbus.c,v 1.32 2005/12/07 12:42:16 fgsch Exp $ */ +/* $OpenBSD: cardbus.c,v 1.33 2006/06/21 11:27:03 fkr Exp $ */ /* $NetBSD: cardbus.c,v 1.24 2000/04/02 19:11:37 mycroft Exp $ */ /* @@ -127,11 +127,8 @@ cardbusattach(struct device *parent, struct device *self, void *aux) sc->sc_dmat = cba->cba_dmat; /* DMA tag */ sc->sc_cc = cba->cba_cc; sc->sc_cf = cba->cba_cf; - -#if rbus sc->sc_rbus_iot = cba->cba_rbus_iot; sc->sc_rbus_memt = cba->cba_rbus_memt; -#endif sc->sc_funcs = NULL; @@ -510,12 +507,8 @@ cardbus_attach_card(struct cardbus_softc *sc) ca.ca_iot = sc->sc_iot; ca.ca_memt = sc->sc_memt; ca.ca_dmat = sc->sc_dmat; - -#if rbus ca.ca_rbus_iot = sc->sc_rbus_iot; ca.ca_rbus_memt = sc->sc_rbus_memt; -#endif - ca.ca_tag = tag; ca.ca_bus = sc->sc_bus; ca.ca_device = sc->sc_device; diff --git a/sys/dev/cardbus/cardbus_map.c b/sys/dev/cardbus/cardbus_map.c index 201a220000f..4352398bf76 100644 --- a/sys/dev/cardbus/cardbus_map.c +++ b/sys/dev/cardbus/cardbus_map.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cardbus_map.c,v 1.5 2005/09/13 18:44:38 fgsch Exp $ */ +/* $OpenBSD: cardbus_map.c,v 1.6 2006/06/21 11:27:03 fkr Exp $ */ /* $NetBSD: cardbus_map.c,v 1.10 2000/03/07 00:31:46 mycroft Exp $ */ /* @@ -228,9 +228,7 @@ cardbus_mapreg_map(struct cardbus_softc *sc, int func, int reg, cardbus_chipset_tag_t cc = sc->sc_cc; cardbus_function_tag_t cf = sc->sc_cf; bus_space_tag_t bustag; -#if rbus rbus_tag_t rbustag; -#endif bus_space_handle_t handle; bus_addr_t base; bus_size_t size; @@ -248,20 +246,15 @@ cardbus_mapreg_map(struct cardbus_softc *sc, int func, int reg, &flags)) status = 1; bustag = sc->sc_iot; -#if rbus rbustag = sc->sc_rbus_iot; -#endif } else { if (cardbus_mem_find(cc, cf, tag, reg, type, &base, &size, &flags)) status = 1; bustag = sc->sc_memt; -#if rbus rbustag = sc->sc_rbus_memt; -#endif } if (status == 0) { -#if rbus bus_addr_t mask = size - 1; if (base != 0) mask = 0xffffffff; @@ -269,18 +262,6 @@ cardbus_mapreg_map(struct cardbus_softc *sc, int func, int reg, size, busflags | flags, &base, &handle)) { panic("io alloc"); } -#else - bus_addr_t start = 0x8300; - bus_addr_t end = 0x8400; - if (base != 0) { - bus_addr_t start = base; - bus_addr_t end = base + size; - } - if (bus_space_alloc(bustag, start, end, size, size, 0, 0, - &base, &handle)) { - panic("io alloc"); - } -#endif } cardbus_conf_write(cc, cf, tag, reg, base); @@ -320,7 +301,6 @@ cardbus_mapreg_unmap(struct cardbus_softc *sc, int func, int reg, cardbus_function_tag_t cf = sc->sc_cf; int st = 1; cardbustag_t cardbustag; -#if rbus rbus_tag_t rbustag; if (sc->sc_iot == tag) { @@ -333,15 +313,12 @@ cardbus_mapreg_unmap(struct cardbus_softc *sc, int func, int reg, rbustag = sc->sc_rbus_memt; } else return (1); -#endif cardbustag = cardbus_make_tag(cc, cf, sc->sc_bus, sc->sc_device, func); cardbus_conf_write(cc, cf, cardbustag, reg, 0); -#if rbus (*cf->cardbus_space_free)(cc, rbustag, handle, size); -#endif cardbus_free_tag(cc, cf, cardbustag); diff --git a/sys/dev/cardbus/cardbusvar.h b/sys/dev/cardbus/cardbusvar.h index 0b903048ed5..880402dbf04 100644 --- a/sys/dev/cardbus/cardbusvar.h +++ b/sys/dev/cardbus/cardbusvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cardbusvar.h,v 1.9 2005/09/13 18:44:38 fgsch Exp $ */ +/* $OpenBSD: cardbusvar.h,v 1.10 2006/06/21 11:27:03 fkr Exp $ */ /* $NetBSD: cardbusvar.h,v 1.17 2000/04/02 19:11:37 mycroft Exp $ */ /* @@ -37,10 +37,7 @@ #define _DEV_CARDBUS_CARDBUSVAR_H_ #include <dev/pci/pcivar.h> /* for pcitag_t */ - -#if 1 #include <dev/cardbus/rbus.h> -#endif typedef void *cardbus_chipset_tag_t; typedef int cardbus_intr_handle_t; @@ -178,8 +175,6 @@ typedef u_int16_t cardbus_product_id_t; /* XXX end */ -#if rbus - typedef struct cardbus_functions { int (*cardbus_space_alloc)(cardbus_chipset_tag_t, rbus_tag_t, bus_addr_t, bus_size_t, bus_addr_t, bus_size_t, int, bus_addr_t *, @@ -200,29 +195,6 @@ typedef struct cardbus_functions { cardbusreg_t); } cardbus_function_t, *cardbus_function_tag_t; -#else - -typedef struct cardbus_functions { - int (*cardbus_ctrl)(cardbus_chipset_tag_t, int); - int (*cardbus_power)(cardbus_chipset_tag_t, int); - int (*cardbus_mem_open)(cardbus_chipset_tag_t, int, u_int32_t, - u_int32_t); - int (*cardbus_mem_close)(cardbus_chipset_tag_t, int); - int (*cardbus_io_open)(cardbus_chipset_tag_t, int, u_int32_t, - u_int32_t); - int (*cardbus_io_close)(cardbus_chipset_tag_t, int); - void *(*cardbus_intr_establish)(cardbus_chipset_tag_t, int irq, - int level, int (*ih)(void *), void *sc); - void (*cardbus_intr_disestablish)(cardbus_chipset_tag_t ct, void *ih); - - cardbustag_t (*cardbus_make_tag)(cardbus_chipset_tag_t, int, int, int); - cardbusreg_t (*cardbus_conf_read)(cardbus_chipset_tag_t, cardbustag_t, - int); - void (*cardbus_conf_write)(cardbus_chipset_tag_t, cardbustag_t, int, - cardbusreg_t); -} cardbus_function_t, *cardbus_function_tag_t; -#endif /* rbus */ - /* * struct cbslot_attach_args is the attach argument for cardbus card. */ @@ -238,10 +210,8 @@ struct cbslot_attach_args { cardbus_function_tag_t cba_cf; /* cardbus functions */ int cba_intrline; /* interrupt line */ -#if rbus rbus_tag_t cba_rbus_iot; /* CardBus i/o rbus tag */ rbus_tag_t cba_rbus_memt; /* CardBus mem rbus tag */ -#endif int cba_cacheline; /* cache line size */ int cba_lattimer; /* latency timer */ @@ -273,10 +243,8 @@ struct cardbus_softc { cardbus_chipset_tag_t sc_cc; /* CardBus chipset */ cardbus_function_tag_t sc_cf; /* CardBus function */ -#if rbus rbus_tag_t sc_rbus_iot; /* CardBus i/o rbus tag */ rbus_tag_t sc_rbus_memt; /* CardBus mem rbus tag */ -#endif int sc_cacheline; /* cache line size */ int sc_lattimer; /* latency timer */ @@ -305,10 +273,8 @@ typedef struct cardbus_devfunc { int ct_dev; /* device number */ int ct_func; /* function number */ -#if rbus rbus_tag_t ct_rbus_iot; /* CardBus i/o rbus tag */ rbus_tag_t ct_rbus_memt; /* CardBus mem rbus tag */ -#endif u_int32_t ct_bar[6]; /* Base Address Regs 0 to 6 */ u_int32_t ct_lc; /* Latency timer and cache line size */ @@ -364,10 +330,8 @@ struct cardbus_attach_args { /* Interrupt information */ cardbus_intr_line_t ca_intrline; -#if rbus rbus_tag_t ca_rbus_iot; /* CardBus i/o rbus tag */ rbus_tag_t ca_rbus_memt; /* CardBus mem rbus tag */ -#endif struct cardbus_cis_info ca_cis; }; diff --git a/sys/dev/cardbus/ehci_cardbus.c b/sys/dev/cardbus/ehci_cardbus.c index 0b53289ef16..c1ca212ff6c 100644 --- a/sys/dev/cardbus/ehci_cardbus.c +++ b/sys/dev/cardbus/ehci_cardbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ehci_cardbus.c,v 1.5 2005/12/30 04:11:40 dlg Exp $ */ +/* $OpenBSD: ehci_cardbus.c,v 1.6 2006/06/21 11:27:03 fkr Exp $ */ /* $NetBSD: ehci_cardbus.c,v 1.6.6.3 2004/09/21 13:27:25 skrll Exp $ */ /* @@ -130,10 +130,6 @@ ehci_cardbus_attach(struct device *parent, struct device *self, void *aux) sc->sc_ct = ct; sc->sc.sc_bus.dmatag = ca->ca_dmat; -#if rbus -#else -XXX (ct->ct_cf->cardbus_mem_open)(cc, 0, iob, iob + 0x40); -#endif (ct->ct_cf->cardbus_ctrl)(cc, CARDBUS_MEM_ENABLE); (ct->ct_cf->cardbus_ctrl)(cc, CARDBUS_BM_ENABLE); diff --git a/sys/dev/cardbus/if_ath_cardbus.c b/sys/dev/cardbus/if_ath_cardbus.c index 867ff879c94..5ea1e0153b0 100644 --- a/sys/dev/cardbus/if_ath_cardbus.c +++ b/sys/dev/cardbus/if_ath_cardbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ath_cardbus.c,v 1.8 2006/01/29 20:39:37 fgsch Exp $ */ +/* $OpenBSD: if_ath_cardbus.c,v 1.9 2006/06/21 11:27:03 fkr Exp $ */ /* $NetBSD: if_ath_cardbus.c,v 1.4 2004/08/02 19:14:28 mycroft Exp $ */ /* @@ -159,10 +159,6 @@ ath_cardbus_attach(struct device *parent, struct device *self, void *aux) */ if (Cardbus_mapreg_map(ct, ATH_PCI_MMBA, CARDBUS_MAPREG_TYPE_MEM, 0, &sc->sc_st, &sc->sc_sh, &adr, &csc->sc_mapsize) == 0) { -#if rbus -#else - (*ct->ct_cf->cardbus_mem_open)(cc, 0, adr, adr+csc->sc_mapsize); -#endif csc->sc_bar_val = adr | CARDBUS_MAPREG_TYPE_MEM; } diff --git a/sys/dev/cardbus/if_atw_cardbus.c b/sys/dev/cardbus/if_atw_cardbus.c index cdfc15862a1..a692372e9b7 100644 --- a/sys/dev/cardbus/if_atw_cardbus.c +++ b/sys/dev/cardbus/if_atw_cardbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_atw_cardbus.c,v 1.12 2005/09/24 09:09:15 jsg Exp $ */ +/* $OpenBSD: if_atw_cardbus.c,v 1.13 2006/06/21 11:27:03 fkr Exp $ */ /* $NetBSD: if_atw_cardbus.c,v 1.9 2004/07/23 07:07:55 dyoung Exp $ */ /*- @@ -179,10 +179,6 @@ atw_cardbus_attach(struct device *parent, struct device *self, void *aux) printf(": atw_cardbus_attach mapped %d bytes mem space\n%s", csc->sc_mapsize, sc->sc_dev.dv_xname); #endif -#if rbus -#else - (*ct->ct_cf->cardbus_mem_open)(cc, 0, adr, adr+csc->sc_mapsize); -#endif csc->sc_cben = CARDBUS_MEM_ENABLE; csc->sc_csr |= CARDBUS_COMMAND_MEM_ENABLE; csc->sc_bar_reg = ATW_PCI_MMBA; @@ -194,10 +190,6 @@ atw_cardbus_attach(struct device *parent, struct device *self, void *aux) printf(": atw_cardbus_attach mapped %d bytes I/O space\n%s", csc->sc_mapsize, sc->sc_dev.dv_xname); #endif -#if rbus -#else - (*ct->ct_cf->cardbus_io_open)(cc, 0, adr, adr+csc->sc_mapsize); -#endif csc->sc_cben = CARDBUS_IO_ENABLE; csc->sc_csr |= CARDBUS_COMMAND_IO_ENABLE; csc->sc_bar_reg = ATW_PCI_IOBA; diff --git a/sys/dev/cardbus/if_ral_cardbus.c b/sys/dev/cardbus/if_ral_cardbus.c index 9307379250b..29130a099be 100644 --- a/sys/dev/cardbus/if_ral_cardbus.c +++ b/sys/dev/cardbus/if_ral_cardbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ral_cardbus.c,v 1.6 2006/01/09 20:03:31 damien Exp $ */ +/* $OpenBSD: if_ral_cardbus.c,v 1.7 2006/06/21 11:27:03 fkr Exp $ */ /*- * Copyright (c) 2005, 2006 @@ -151,11 +151,6 @@ ral_cardbus_attach(struct device *parent, struct device *self, void *aux) return; } -#if rbus -#else - (*cf->cardbus_mem_open)(cc, 0, base, base + csc->sc_mapsize); -#endif - csc->sc_bar_val = base | CARDBUS_MAPREG_TYPE_MEM; /* set up the PCI configuration registers */ diff --git a/sys/dev/cardbus/if_re_cardbus.c b/sys/dev/cardbus/if_re_cardbus.c index f2dcad57024..752f3a906a2 100644 --- a/sys/dev/cardbus/if_re_cardbus.c +++ b/sys/dev/cardbus/if_re_cardbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_re_cardbus.c,v 1.4 2006/06/17 17:58:17 brad Exp $ */ +/* $OpenBSD: if_re_cardbus.c,v 1.5 2006/06/21 11:27:03 fkr Exp $ */ /* * Copyright (c) 2005 Peter Valchev <pvalchev@openbsd.org> @@ -132,10 +132,6 @@ re_cardbus_attach(struct device *parent, struct device *self, void *aux) */ if (Cardbus_mapreg_map(ct, RL_PCI_LOMEM, CARDBUS_MAPREG_TYPE_MEM, 0, &sc->rl_btag, &sc->rl_bhandle, &adr, &csc->sc_mapsize) == 0) { -#if rbus -#else - (*ct->ct_cf->cardbus_mem_open)(cc, 0, adr, adr+csc->sc_mapsize); -#endif csc->sc_cben = CARDBUS_MEM_ENABLE; csc->sc_csr |= CARDBUS_COMMAND_MEM_ENABLE; csc->sc_bar_reg = RL_PCI_LOMEM; diff --git a/sys/dev/cardbus/if_rl_cardbus.c b/sys/dev/cardbus/if_rl_cardbus.c index 7a7aa77919a..2b73ed846fc 100644 --- a/sys/dev/cardbus/if_rl_cardbus.c +++ b/sys/dev/cardbus/if_rl_cardbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_rl_cardbus.c,v 1.12 2006/06/17 17:58:17 brad Exp $ */ +/* $OpenBSD: if_rl_cardbus.c,v 1.13 2006/06/21 11:27:03 fkr Exp $ */ /* $NetBSD: if_rl_cardbus.c,v 1.3.8.3 2001/11/14 19:14:02 nathanw Exp $ */ /* @@ -170,10 +170,6 @@ rl_cardbus_attach(parent, self, aux) #ifdef RL_USEIOSPACE if (Cardbus_mapreg_map(ct, RL_PCI_LOIO, CARDBUS_MAPREG_TYPE_IO, 0, &sc->rl_btag, &sc->rl_bhandle, &adr, &csc->sc_mapsize) == 0) { -#if rbus -#else - (*ct->ct_cf->cardbus_io_open)(cc, 0, adr, adr+csc->sc_mapsize); -#endif csc->sc_cben = CARDBUS_IO_ENABLE; csc->sc_csr |= CARDBUS_COMMAND_IO_ENABLE; csc->sc_bar_reg = RL_PCI_LOIO; @@ -182,10 +178,6 @@ rl_cardbus_attach(parent, self, aux) #else if (Cardbus_mapreg_map(ct, RL_PCI_LOMEM, CARDBUS_MAPREG_TYPE_MEM, 0, &sc->rl_btag, &sc->rl_bhandle, &adr, &csc->sc_mapsize) == 0) { -#if rbus -#else - (*ct->ct_cf->cardbus_mem_open)(cc, 0, adr, adr+csc->sc_mapsize); -#endif csc->sc_cben = CARDBUS_MEM_ENABLE; csc->sc_csr |= CARDBUS_COMMAND_MEM_ENABLE; csc->sc_bar_reg = RL_PCI_LOMEM; diff --git a/sys/dev/cardbus/if_rtw_cardbus.c b/sys/dev/cardbus/if_rtw_cardbus.c index b6487b630d4..5ab049f07e1 100644 --- a/sys/dev/cardbus/if_rtw_cardbus.c +++ b/sys/dev/cardbus/if_rtw_cardbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_rtw_cardbus.c,v 1.9 2005/09/08 12:44:56 jsg Exp $ */ +/* $OpenBSD: if_rtw_cardbus.c,v 1.10 2006/06/21 11:27:03 fkr Exp $ */ /* $NetBSD: if_rtw_cardbus.c,v 1.4 2004/12/20 21:05:34 dyoung Exp $ */ /*- @@ -237,10 +237,6 @@ rtw_cardbus_attach(struct device *parent, struct device *self, void *aux) RTW_DPRINTF(RTW_DEBUG_ATTACH, ("%s: %s mapped %lu bytes mem space\n", sc->sc_dev.dv_xname, __func__, (long)csc->sc_mapsize)); -#if rbus -#else - (*ct->ct_cf->cardbus_mem_open)(cc, 0, adr, adr+csc->sc_mapsize); -#endif csc->sc_cben = CARDBUS_MEM_ENABLE; csc->sc_csr |= CARDBUS_COMMAND_MEM_ENABLE; csc->sc_bar_reg = RTW_PCI_MMBA; @@ -251,10 +247,6 @@ rtw_cardbus_attach(struct device *parent, struct device *self, void *aux) RTW_DPRINTF(RTW_DEBUG_ATTACH, ("%s: %s mapped %lu bytes I/O space\n", sc->sc_dev.dv_xname, __func__, (long)csc->sc_mapsize)); -#if rbus -#else - (*ct->ct_cf->cardbus_io_open)(cc, 0, adr, adr+csc->sc_mapsize); -#endif csc->sc_cben = CARDBUS_IO_ENABLE; csc->sc_csr |= CARDBUS_COMMAND_IO_ENABLE; csc->sc_bar_reg = RTW_PCI_IOBA; diff --git a/sys/dev/cardbus/if_xl_cardbus.c b/sys/dev/cardbus/if_xl_cardbus.c index 50a613b9b3d..d788b0c64a5 100644 --- a/sys/dev/cardbus/if_xl_cardbus.c +++ b/sys/dev/cardbus/if_xl_cardbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_xl_cardbus.c,v 1.15 2004/10/07 21:16:59 brad Exp $ */ +/* $OpenBSD: if_xl_cardbus.c,v 1.16 2006/06/21 11:27:03 fkr Exp $ */ /* $NetBSD: if_xl_cardbus.c,v 1.13 2000/03/07 00:32:52 mycroft Exp $ */ /* @@ -242,10 +242,6 @@ xl_cardbus_attach(parent, self, aux) iob = adr; sc->xl_bhandle = ioh; -#if rbus -#else - (ct->ct_cf->cardbus_io_open)(cc, 0, iob, iob + 0x40); -#endif (ct->ct_cf->cardbus_ctrl)(cc, CARDBUS_IO_ENABLE); command = cardbus_conf_read(cc, cf, ca->ca_tag, diff --git a/sys/dev/cardbus/ohci_cardbus.c b/sys/dev/cardbus/ohci_cardbus.c index 598640d37e1..8e9e215d903 100644 --- a/sys/dev/cardbus/ohci_cardbus.c +++ b/sys/dev/cardbus/ohci_cardbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ohci_cardbus.c,v 1.5 2006/05/22 15:58:00 dlg Exp $ */ +/* $OpenBSD: ohci_cardbus.c,v 1.6 2006/06/21 11:27:03 fkr Exp $ */ /* $NetBSD: ohci_cardbus.c,v 1.19 2004/08/02 19:14:28 mycroft Exp $ */ /* @@ -129,10 +129,6 @@ ohci_cardbus_attach(struct device *parent, struct device *self, void *aux) sc->sc_ct = ct; sc->sc.sc_bus.dmatag = ca->ca_dmat; -#if rbus -#else -XXX (ct->ct_cf->cardbus_mem_open)(cc, 0, iob, iob + 0x40); -#endif (ct->ct_cf->cardbus_ctrl)(cc, CARDBUS_MEM_ENABLE); (ct->ct_cf->cardbus_ctrl)(cc, CARDBUS_BM_ENABLE); diff --git a/sys/dev/cardbus/rbus.h b/sys/dev/cardbus/rbus.h index 7811c77740a..2446712ddc4 100644 --- a/sys/dev/cardbus/rbus.h +++ b/sys/dev/cardbus/rbus.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rbus.h,v 1.5 2006/06/08 22:38:40 fkr Exp $ */ +/* $OpenBSD: rbus.h,v 1.6 2006/06/21 11:27:03 fkr Exp $ */ /* $NetBSD: rbus.h,v 1.3 1999/12/15 12:28:55 kleink Exp $ */ /* * Copyright (c) 1999 @@ -70,8 +70,6 @@ /* require sys/extent.h */ /* require machine/bus.h */ -#define rbus 1 - struct extent; diff --git a/sys/dev/cardbus/uhci_cardbus.c b/sys/dev/cardbus/uhci_cardbus.c index 62dea9d467a..1ce96546686 100644 --- a/sys/dev/cardbus/uhci_cardbus.c +++ b/sys/dev/cardbus/uhci_cardbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uhci_cardbus.c,v 1.2 2005/12/30 04:01:18 dlg Exp $ */ +/* $OpenBSD: uhci_cardbus.c,v 1.3 2006/06/21 11:27:03 fkr Exp $ */ /* * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -118,10 +118,6 @@ uhci_cardbus_attach(struct device *parent, struct device *self, void *aux) sc->sc_ct = ct; sc->sc.sc_bus.dmatag = ca->ca_dmat; -#if rbus -#else -XXX (ct->ct_cf->cardbus_io_open)(cc, 0, iob, iob + 0x40); -#endif (ct->ct_cf->cardbus_ctrl)(cc, CARDBUS_IO_ENABLE); (ct->ct_cf->cardbus_ctrl)(cc, CARDBUS_BM_ENABLE); diff --git a/sys/dev/pci/pccbb.c b/sys/dev/pci/pccbb.c index a92ecde8bd5..e0e3fcc66c9 100644 --- a/sys/dev/pci/pccbb.c +++ b/sys/dev/pci/pccbb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pccbb.c,v 1.45 2006/06/14 08:36:31 fkr Exp $ */ +/* $OpenBSD: pccbb.c,v 1.46 2006/06/21 11:27:03 fkr Exp $ */ /* $NetBSD: pccbb.c,v 1.96 2004/03/28 09:49:31 nakayama Exp $ */ /* @@ -115,12 +115,6 @@ void pccbb_pcmcia_deactivate_card(struct pcic_handle *); int pccbb_ctrl(cardbus_chipset_tag_t, int); int pccbb_power(cardbus_chipset_tag_t, int); int pccbb_cardenable(struct pccbb_softc * sc, int function); -#if !rbus -int pccbb_io_open(cardbus_chipset_tag_t, int, u_int32_t, u_int32_t); -int pccbb_io_close(cardbus_chipset_tag_t, int); -int pccbb_mem_open(cardbus_chipset_tag_t, int, u_int32_t, u_int32_t); -int pccbb_mem_close(cardbus_chipset_tag_t, int); -#endif /* !rbus */ void *pccbb_intr_establish(struct pccbb_softc *, int irq, int level, int (*ih) (void *), void *sc); void pccbb_intr_disestablish(struct pccbb_softc *, void *ih); @@ -164,18 +158,12 @@ void pccbb_pcmcia_do_mem_map(struct pcic_handle *, int); void pccbb_powerhook(int, void *); /* bus-space allocation and deallocation functions */ -#if rbus - int pccbb_rbus_cb_space_alloc(cardbus_chipset_tag_t, rbus_tag_t, bus_addr_t addr, bus_size_t size, bus_addr_t mask, bus_size_t align, int flags, bus_addr_t * addrp, bus_space_handle_t * bshp); int pccbb_rbus_cb_space_free(cardbus_chipset_tag_t, rbus_tag_t, bus_space_handle_t, bus_size_t); -#endif /* rbus */ - -#if rbus - int pccbb_open_win(struct pccbb_softc *, bus_space_tag_t, bus_addr_t, bus_size_t, bus_space_handle_t, int flags); int pccbb_close_win(struct pccbb_softc *, bus_space_tag_t, @@ -188,8 +176,6 @@ void pccbb_winset(bus_addr_t align, struct pccbb_softc *, bus_space_tag_t); void pccbb_winlist_show(struct pccbb_win_chain *); -#endif /* rbus */ - /* for config_defer */ void pccbb_pci_callback(struct device *); @@ -219,7 +205,6 @@ static struct pcmcia_chip_functions pccbb_pcmcia_funcs = { pccbb_pcmcia_card_detect }; -#if rbus static struct cardbus_functions pccbb_funcs = { pccbb_rbus_cb_space_alloc, pccbb_rbus_cb_space_free, @@ -232,21 +217,6 @@ static struct cardbus_functions pccbb_funcs = { pccbb_conf_read, pccbb_conf_write, }; -#else -static struct cardbus_functions pccbb_funcs = { - pccbb_ctrl, - pccbb_power, - pccbb_mem_open, - pccbb_mem_close, - pccbb_io_open, - pccbb_io_close, - pccbb_cb_intr_establish, - pccbb_cb_intr_disestablish, - pccbb_make_tag, - pccbb_conf_read, - pccbb_conf_write, -}; -#endif int pcicbbmatch(parent, match, aux) @@ -417,10 +387,8 @@ pccbbattach(parent, self, aux) TAILQ_INIT(&sc->sc_memwindow); TAILQ_INIT(&sc->sc_iowindow); -#if rbus sc->sc_rbus_iot = rbus_pccbb_parent_io(self, pa); sc->sc_rbus_memt = rbus_pccbb_parent_mem(self, pa); -#endif /* rbus */ sc->sc_flags &= ~CBB_MEMHMAPPED; @@ -584,7 +552,6 @@ pccbb_pci_callback(self) if (!(sc->sc_flags & CBB_MEMHMAPPED)) { /* The socket registers aren't mapped correctly. */ -#if rbus if (rbus_space_alloc(sc->sc_rbus_memt, 0, 0x1000, 0x0fff, (sc->sc_chipset == CB_RX5C47X || sc->sc_chipset == CB_TI113X) ? 0x10000 : 0x1000, @@ -596,21 +563,6 @@ pccbb_pci_callback(self) DPRINTF(("%s: CardBus register address 0x%lx -> 0x%x\n", sc->sc_dev.dv_xname, sockbase, pci_conf_read(pc, sc->sc_tag, PCI_SOCKBASE))); -#else - sc->sc_base_memt = sc->sc_memt; -#if !defined CBB_PCI_BASE -#define CBB_PCI_BASE 0x20000000 -#endif - if (bus_space_alloc(sc->sc_base_memt, CBB_PCI_BASE, 0xffffffff, - 0x1000, 0x1000, 0, 0, &sockbase, &sc->sc_base_memh)) { - /* cannot allocate memory space */ - return; - } - pci_conf_write(pc, sc->sc_tag, PCI_SOCKBASE, sockbase); - DPRINTF(("%s: CardBus register address 0x%x -> 0x%x\n", - sc->sc_dev.dv_xname, sock_base, pci_conf_read(pc, - sc->sc_tag, PCI_SOCKBASE))); -#endif sc->sc_flags |= CBB_MEMHMAPPED; } @@ -651,10 +603,8 @@ pccbb_pci_callback(self) cba.cba_cf = &pccbb_funcs; cba.cba_intrline = sc->sc_intrline; -#if rbus cba.cba_rbus_iot = sc->sc_rbus_iot; cba.cba_rbus_memt = sc->sc_rbus_memt; -#endif cba.cba_cacheline = PCI_CACHELINE(bhlc); cba.cba_lattimer = PCI_CB_LATENCY(busreg); @@ -900,9 +850,7 @@ pccbb_pcmcia_attach_setup(sc, paa) struct pcmciabus_attach_args *paa; { struct pcic_handle *ph = &sc->sc_pcmcia_h; -#if rbus rbus_tag_t rb; -#endif /* initialize pcmcia part in pccbb_softc */ ph->ph_parent = (struct device *)sc; @@ -941,11 +889,9 @@ pccbb_pcmcia_attach_setup(sc, paa) paa->pch = ph; paa->iobase = 0; /* I don't use them */ paa->iosize = 0; -#if rbus rb = ((struct pccbb_softc *)(ph->ph_parent))->sc_rbus_iot; paa->iobase = rb->rb_start + rb->rb_offset; paa->iosize = rb->rb_end - rb->rb_start; -#endif return; } @@ -1580,121 +1526,6 @@ pccbb_cardenable(sc, function) return 1; } -#if !rbus -/* - * int pccbb_io_open(cardbus_chipset_tag_t, int, u_int32_t, u_int32_t) - */ -int -pccbb_io_open(ct, win, start, end) - cardbus_chipset_tag_t ct; - int win; - u_int32_t start, end; -{ - struct pccbb_softc *sc = (struct pccbb_softc *)ct; - int basereg; - int limitreg; - - if ((win < 0) || (win > 2)) { -#if defined DIAGNOSTIC - printf("cardbus_io_open: window out of range %d\n", win); -#endif - return 0; - } - - basereg = win * 8 + 0x2c; - limitreg = win * 8 + 0x30; - - DPRINTF(("pccbb_io_open: 0x%x[0x%x] - 0x%x[0x%x]\n", - start, basereg, end, limitreg)); - - pci_conf_write(sc->sc_pc, sc->sc_tag, basereg, start); - pci_conf_write(sc->sc_pc, sc->sc_tag, limitreg, end); - return 1; -} - -/* - * int pccbb_io_close(cardbus_chipset_tag_t, int) - */ -int -pccbb_io_close(ct, win) - cardbus_chipset_tag_t ct; - int win; -{ - struct pccbb_softc *sc = (struct pccbb_softc *)ct; - int basereg; - int limitreg; - - if ((win < 0) || (win > 2)) { -#if defined DIAGNOSTIC - printf("cardbus_io_close: window out of range %d\n", win); -#endif - return 0; - } - - basereg = win * 8 + 0x2c; - limitreg = win * 8 + 0x30; - - pci_conf_write(sc->sc_pc, sc->sc_tag, basereg, 0); - pci_conf_write(sc->sc_pc, sc->sc_tag, limitreg, 0); - return 1; -} - -/* - * int pccbb_mem_open(cardbus_chipset_tag_t, int, u_int32_t, u_int32_t) - */ -int -pccbb_mem_open(ct, win, start, end) - cardbus_chipset_tag_t ct; - int win; - u_int32_t start, end; -{ - struct pccbb_softc *sc = (struct pccbb_softc *)ct; - int basereg; - int limitreg; - - if ((win < 0) || (win > 2)) { -#if defined DIAGNOSTIC - printf("cardbus_mem_open: window out of range %d\n", win); -#endif - return 0; - } - - basereg = win * 8 + 0x1c; - limitreg = win * 8 + 0x20; - - pci_conf_write(sc->sc_pc, sc->sc_tag, basereg, start); - pci_conf_write(sc->sc_pc, sc->sc_tag, limitreg, end); - return 1; -} - -/* - * int pccbb_mem_close(cardbus_chipset_tag_t, int) - */ -int -pccbb_mem_close(ct, win) - cardbus_chipset_tag_t ct; - int win; -{ - struct pccbb_softc *sc = (struct pccbb_softc *)ct; - int basereg; - int limitreg; - - if ((win < 0) || (win > 2)) { -#if defined DIAGNOSTIC - printf("cardbus_mem_close: window out of range %d\n", win); -#endif - return 0; - } - - basereg = win * 8 + 0x1c; - limitreg = win * 8 + 0x20; - - pci_conf_write(sc->sc_pc, sc->sc_tag, basereg, 0); - pci_conf_write(sc->sc_pc, sc->sc_tag, limitreg, 0); - return 1; -} -#endif - /* * void *pccbb_cb_intr_establish(cardbus_chipset_tag_t ct, * int irq, @@ -1987,9 +1818,8 @@ pccbb_pcmcia_io_alloc(pch, start, size, align, pcihp) bus_space_tag_t iot; bus_space_handle_t ioh; bus_addr_t mask; -#if rbus rbus_tag_t rb; -#endif + if (align == 0) { align = size; /* XXX: funny??? */ } @@ -2028,31 +1858,10 @@ pccbb_pcmcia_io_alloc(pch, start, size, align, pcihp) iot = ((struct pccbb_softc *)(ph->ph_parent))->sc_iot; -#if rbus rb = ((struct pccbb_softc *)(ph->ph_parent))->sc_rbus_iot; if (rbus_space_alloc(rb, start, size, mask, align, 0, &ioaddr, &ioh)) { return 1; } -#else - if (start) { - ioaddr = start; - if (bus_space_map(iot, start, size, 0, &ioh)) { - return 1; - } - DPRINTF(("pccbb_pcmcia_io_alloc map port 0x%lx+0x%lx\n", - (u_long) ioaddr, (u_long) size)); - } else { - flags |= PCMCIA_IO_ALLOCATED; - if (bus_space_alloc(iot, 0x700 /* ph->sc->sc_iobase */ , - 0x800, /* ph->sc->sc_iobase + ph->sc->sc_iosize */ - size, align, 0, 0, &ioaddr, &ioh)) { - /* No room be able to be get. */ - return 1; - } - DPRINTF(("pccbb_pcmmcia_io_alloc alloc port 0x%lx+0x%lx\n", - (u_long) ioaddr, (u_long) size)); - } -#endif pcihp->iot = iot; pcihp->ioh = ioh; @@ -2076,24 +1885,14 @@ pccbb_pcmcia_io_free(pch, pcihp) pcmcia_chipset_handle_t pch; struct pcmcia_io_handle *pcihp; { -#if !rbus - bus_space_tag_t iot = pcihp->iot; -#endif bus_space_handle_t ioh = pcihp->ioh; bus_size_t size = pcihp->size; -#if rbus struct pccbb_softc *sc = (struct pccbb_softc *)((struct pcic_handle *)pch)->ph_parent; rbus_tag_t rb = sc->sc_rbus_iot; rbus_space_free(rb, ioh, size, NULL); -#else - if (pcihp->flags & PCMCIA_IO_ALLOCATED) - bus_space_free(iot, ioh, size); - else - bus_space_unmap(iot, ioh, size); -#endif } /* @@ -2505,9 +2304,7 @@ pccbb_pcmcia_mem_alloc(pch, size, pcmhp) bus_addr_t addr; bus_size_t sizepg; struct pccbb_softc *sc = (struct pccbb_softc *)ph->ph_parent; -#if rbus rbus_tag_t rb; -#endif /* out of sc->memh, allocate as many pages as necessary */ @@ -2529,22 +2326,12 @@ pccbb_pcmcia_mem_alloc(pch, size, pcmhp) addr = 0; /* XXX gcc -Wuninitialized */ -#if rbus rb = sc->sc_rbus_memt; if (rbus_space_alloc(rb, 0, sizepg * PCIC_MEM_PAGESIZE, sizepg * PCIC_MEM_PAGESIZE - 1, PCIC_MEM_PAGESIZE, 0, &addr, &memh)) { return 1; } -#else - if (bus_space_alloc(sc->sc_memt, sc->sc_mem_start, sc->sc_mem_end, - sizepg * PCIC_MEM_PAGESIZE, PCIC_MEM_PAGESIZE, - 0, /* boundary */ - 0, /* flags */ - &addr, &memh)) { - return 1; - } -#endif DPRINTF( ("pccbb_pcmcia_alloc_mem: addr 0x%lx size 0x%lx, realsize 0x%lx\n", @@ -2574,14 +2361,10 @@ pccbb_pcmcia_mem_free(pch, pcmhp) pcmcia_chipset_handle_t pch; struct pcmcia_mem_handle *pcmhp; { -#if rbus struct pcic_handle *ph = (struct pcic_handle *)pch; struct pccbb_softc *sc = (struct pccbb_softc *)ph->ph_parent; rbus_space_free(sc->sc_rbus_memt, pcmhp->memh, pcmhp->realsize, NULL); -#else - bus_space_free(pcmhp->memt, pcmhp->memh, pcmhp->realsize); -#endif } /* @@ -2920,7 +2703,6 @@ pccbb_pcmcia_intr_string(pch, ih) return ""; /* card shares interrupt of the bridge */ } -#if rbus /* * int * pccbb_rbus_cb_space_alloc(cardbus_chipset_tag_t ct, rbus_tag_t rb, @@ -3014,9 +2796,6 @@ pccbb_rbus_cb_space_free(ct, rb, bsh, size) return rbus_space_free(rb, bsh, size, NULL); } -#endif /* rbus */ - -#if rbus int pccbb_open_win(sc, bst, addr, size, bsh, flags) @@ -3261,8 +3040,6 @@ pccbb_winset(align, sc, bst) } } -#endif /* rbus */ - void pccbb_powerhook(why, arg) int why; diff --git a/sys/dev/pci/pccbbvar.h b/sys/dev/pci/pccbbvar.h index 3515d6d912f..5ce6e8b8de0 100644 --- a/sys/dev/pci/pccbbvar.h +++ b/sys/dev/pci/pccbbvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pccbbvar.h,v 1.10 2006/04/02 23:29:05 brad Exp $ */ +/* $OpenBSD: pccbbvar.h,v 1.11 2006/06/21 11:27:03 fkr Exp $ */ /* $NetBSD: pccbbvar.h,v 1.13 2000/06/08 10:28:29 haya Exp $ */ /* * Copyright (c) 1999 HAYAKAWA Koichi. All rights reserved. @@ -120,10 +120,8 @@ struct pccbb_softc { bus_space_tag_t sc_memt; bus_dma_tag_t sc_dmat; -#if rbus rbus_tag_t sc_rbus_iot; /* rbus for i/o donated from parent */ rbus_tag_t sc_rbus_memt; /* rbus for mem donated from parent */ -#endif bus_space_tag_t sc_base_memt; bus_space_handle_t sc_base_memh; |