diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pccard/card_if.m | 1 | ||||
-rw-r--r-- | sys/dev/pccard/pccard.c | 10 | ||||
-rw-r--r-- | sys/dev/pccbb/pccbb.c | 23 | ||||
-rw-r--r-- | sys/dev/pcic/i82365.c | 6 | ||||
-rw-r--r-- | sys/dev/pcic/i82365var.h | 2 | ||||
-rw-r--r-- | sys/dev/ray/if_ray.c | 4 | ||||
-rw-r--r-- | sys/pccard/pccard_nbk.c | 4 | ||||
-rw-r--r-- | sys/pccard/pcic.c | 7 |
8 files changed, 29 insertions, 28 deletions
diff --git a/sys/dev/pccard/card_if.m b/sys/dev/pccard/card_if.m index 7952b86..621a041 100644 --- a/sys/dev/pccard/card_if.m +++ b/sys/dev/pccard/card_if.m @@ -64,6 +64,7 @@ METHOD int set_memory_offset { device_t child; int rid; u_int32_t cardaddr; + u_int32_t *deltap; } METHOD int get_memory_offset { diff --git a/sys/dev/pccard/pccard.c b/sys/dev/pccard/pccard.c index efa170e..2de5db0 100644 --- a/sys/dev/pccard/pccard.c +++ b/sys/dev/pccard/pccard.c @@ -391,7 +391,6 @@ pccard_function_enable(struct pccard_function *pf) struct pccard_function *tmp; int reg; device_t dev = pf->sc->dev; - uint32_t addr; if (pf->cfe == NULL) { DEVPRVERBOSE((dev, "No config entry could be allocated.\n")); @@ -450,10 +449,7 @@ pccard_function_enable(struct pccard_function *pf) CARD_SET_RES_FLAGS(device_get_parent(dev), dev, SYS_RES_MEMORY, pf->ccr_rid, PCCARD_A_MEM_ATTR); CARD_SET_MEMORY_OFFSET(device_get_parent(dev), dev, - pf->ccr_rid, pf->ccr_base); - CARD_GET_MEMORY_OFFSET(device_get_parent(dev), dev, - pf->ccr_rid, &addr); - pf->pf_ccr_offset = pf->ccr_base - addr; + pf->ccr_rid, pf->ccr_base, &pf->pf_ccr_offset); pf->pf_ccrt = rman_get_bustag(pf->ccr_res); pf->pf_ccrh = rman_get_bushandle(pf->ccr_res); pf->pf_ccr_realsize = 1; @@ -841,11 +837,11 @@ pccard_set_res_flags(device_t dev, device_t child, int type, int rid, static int pccard_set_memory_offset(device_t dev, device_t child, int rid, - u_int32_t offset) + u_int32_t offset, u_int32_t *deltap) { return CARD_SET_MEMORY_OFFSET(device_get_parent(dev), child, rid, - offset); + offset, deltap); } static int diff --git a/sys/dev/pccbb/pccbb.c b/sys/dev/pccbb/pccbb.c index caa22fd..c319e2f 100644 --- a/sys/dev/pccbb/pccbb.c +++ b/sys/dev/pccbb/pccbb.c @@ -98,11 +98,6 @@ #define PCIC_MASK2(SC,REG,MASK,MASK2) \ PCIC_WRITE(SC,REG,(PCIC_READ(SC,REG) MASK) MASK2) -#if !defined(lint) -static const char rcsid[] = - "$FreeBSD$"; -#endif - struct pccbb_sclist { struct pccbb_softc *sc; STAILQ_ENTRY(pccbb_sclist) entries; @@ -242,7 +237,7 @@ static int pccbb_pcic_release_resource(device_t self, device_t child, int type, static int pccbb_pcic_set_res_flags(device_t self, device_t child, int type, int rid, u_int32_t flags); static int pccbb_pcic_set_memory_offset(device_t self, device_t child, int rid, - u_int32_t offset); + u_int32_t offset, u_int32_t *deltap); static int pccbb_power_enable_socket(device_t self, device_t child); static void pccbb_power_disable_socket(device_t self, device_t child); static int pccbb_activate_resource(device_t self, device_t child, int type, @@ -1706,11 +1701,12 @@ pccbb_pcic_set_res_flags(device_t self, device_t child, int type, int rid, static int pccbb_pcic_set_memory_offset(device_t self, device_t child, int rid, - u_int32_t cardaddr) + u_int32_t cardaddr, u_int32_t *deltap) { struct pccbb_softc *sc = device_get_softc(self); int win; struct pccbb_reslist *rle; + u_int32_t delta; win = -1; @@ -1726,11 +1722,14 @@ pccbb_pcic_set_memory_offset(device_t self, device_t child, int rid, return 1; } - /* Fixup size since cardaddr must align to PCIC_MEM_PAGESIZE */ - /* XXX This should be a marco XXX */ - sc->mem[win].realsize = (sc->mem[win].size + - (cardaddr & (PCIC_MEM_PAGESIZE - 1))) & ~(PCIC_MEM_PAGESIZE - 1); - cardaddr &= ~(PCIC_MEM_PAGESIZE - 1); + delta = cardaddr % PCIC_MEM_PAGESIZE; + if (deltap) + *deltap = delta; + cardaddr -= delta; + sc->mem[win].realsize = sc->mem[win].size + delta + + PCIC_MEM_PAGESIZE - 1; + sc->mem[win].realsize = sc->mem[win].realsize - + (sc->mem[win].realsize % PCIC_MEM_PAGESIZE); sc->mem[win].offset = cardaddr - sc->mem[win].addr; pccbb_pcic_do_mem_map(sc, win); diff --git a/sys/dev/pcic/i82365.c b/sys/dev/pcic/i82365.c index 8d8219d..eeb0304 100644 --- a/sys/dev/pcic/i82365.c +++ b/sys/dev/pcic/i82365.c @@ -1471,9 +1471,11 @@ pcic_set_res_flags(device_t dev, device_t child, int type, int rid, } int -pcic_set_memory_offset(device_t dev, device_t child, int rid, u_int32_t offset) +pcic_set_memory_offset(device_t dev, device_t child, int rid, u_int32_t offset, + u_int32_t *deltap) { - return 0; + /* XXX BAD XXX */ + return EIO; } static void diff --git a/sys/dev/pcic/i82365var.h b/sys/dev/pcic/i82365var.h index b87f958..1d6ce09 100644 --- a/sys/dev/pcic/i82365var.h +++ b/sys/dev/pcic/i82365var.h @@ -163,6 +163,6 @@ int pcic_disable_socket(device_t dev, device_t child); int pcic_set_res_flags(device_t dev, device_t child, int type, int rid, u_int32_t flags); int pcic_set_memory_offset(device_t dev, device_t child, int rid, - u_int32_t offset); + u_int32_t offset, u_int32_t *deltap); #define PCIC_SOFTC(d) (struct pcic_softc *) device_get_softc(d) diff --git a/sys/dev/ray/if_ray.c b/sys/dev/ray/if_ray.c index e81cd43..7f35cb2 100644 --- a/sys/dev/ray/if_ray.c +++ b/sys/dev/ray/if_ray.c @@ -3366,7 +3366,7 @@ ray_res_alloc_am(struct ray_softc *sc) RAY_PRINTF(sc, "fixing up AM card address from 0x%x to 0x0", offset); error = CARD_SET_MEMORY_OFFSET(device_get_parent(sc->dev), - sc->dev, sc->am_rid, 0); + sc->dev, sc->am_rid, 0, NULL); if (error) { RAY_PRINTF(sc, "CARD_SET_MEMORY_OFFSET returned 0x%0x", error); @@ -3454,7 +3454,7 @@ ray_res_alloc_cm(struct ray_softc *sc) RAY_PRINTF(sc, "fixing up CM card address from 0x%x to 0x0", offset); error = CARD_SET_MEMORY_OFFSET(device_get_parent(sc->dev), - sc->dev, sc->cm_rid, 0); + sc->dev, sc->cm_rid, 0, NULL); if (error) { RAY_PRINTF(sc, "CARD_SET_MEMORY_OFFSET returned 0x%0x", error); diff --git a/sys/pccard/pccard_nbk.c b/sys/pccard/pccard_nbk.c index 2d951f0..40cb7d8 100644 --- a/sys/pccard/pccard_nbk.c +++ b/sys/pccard/pccard_nbk.c @@ -305,10 +305,10 @@ pccard_get_res_flags(device_t bus, device_t child, int restype, int rid, static int pccard_set_memory_offset(device_t bus, device_t child, int rid, - u_int32_t offset) + u_int32_t offset, u_int32_t *deltap) { return CARD_SET_MEMORY_OFFSET(device_get_parent(bus), child, rid, - offset); + offset, deltap); } static int diff --git a/sys/pccard/pcic.c b/sys/pccard/pcic.c index 8b5c934..4cc58cb 100644 --- a/sys/pccard/pcic.c +++ b/sys/pccard/pcic.c @@ -83,6 +83,7 @@ static struct pcic_slot { static struct slot_ctrl cinfo; static struct isa_pnp_id pcic_ids[] = { + {0x65374d24, NULL}, /* IBM3765 */ {PCIC_PNP_82365, NULL}, /* PNP0E00 */ {PCIC_PNP_CL_PD6720, NULL}, /* PNP0E01 */ {PCIC_PNP_VLSI_82C146, NULL}, /* PNP0E02 */ @@ -977,13 +978,15 @@ pcic_get_res_flags(device_t bus, device_t child, int restype, int rid, } static int -pcic_set_memory_offset(device_t bus, device_t child, int rid, u_int32_t offset) +pcic_set_memory_offset(device_t bus, device_t child, int rid, u_int32_t offset, + u_int32_t *deltap) { struct pccard_devinfo *devi = device_get_ivars(child); struct mem_desc *mp = &devi->slt->mem[rid]; mp->card = offset; - + if (deltap) + *deltap = 0; /* XXX BAD XXX */ return (pcic_memory(devi->slt, rid)); } |