summaryrefslogtreecommitdiffstats
path: root/sys/pccard/pcic.c
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2002-07-20 22:29:23 +0000
committerimp <imp@FreeBSD.org>2002-07-20 22:29:23 +0000
commit1d6ce2645d4b061648e6cfaa09780a73fcd10020 (patch)
tree5df41ea50324914b8bd4b3937687ffcfb505afce /sys/pccard/pcic.c
parentd9f77c5b739a154c9ca07cbdf0e2679cd57449d5 (diff)
downloadFreeBSD-src-1d6ce2645d4b061648e6cfaa09780a73fcd10020.zip
FreeBSD-src-1d6ce2645d4b061648e6cfaa09780a73fcd10020.tar.gz
Add support for writing to mapping high memory for pccard memory
windows. Right now we only support pci chips that are memory mapped. These are the most common bridges in use today and will help a large majority of the users. I/O mapped PCI chips support this functionality in a different way, as do some of the ISA bridges (but only when mounted on a motherboard). These chips are not supported by this change.
Diffstat (limited to 'sys/pccard/pcic.c')
-rw-r--r--sys/pccard/pcic.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/pccard/pcic.c b/sys/pccard/pcic.c
index 3e028e7..ec9b1bd 100644
--- a/sys/pccard/pcic.c
+++ b/sys/pccard/pcic.c
@@ -223,14 +223,25 @@ pcic_memory(struct slot *slt, int win)
}
if (mp->flags & MDF_ACTIVE) {
unsigned long sys_addr = (uintptr_t)(void *)mp->start >> 12;
+ if ((sys_addr >> 12) != 0 &&
+ (sp->sc->flags & PCIC_YENTA_HIGH_MEMORY) == 0) {
+ printf("This pcic does not support mapping > 24M\n");
+ return (ENXIO);
+ }
/*
* Write the addresses, card offsets and length.
* The values are all stored as the upper 12 bits of the
* 24 bit address i.e everything is allocated as 4 Kb chunks.
+ * Memory mapped cardbus bridges extend this slightly to allow
+ * one to set the upper 8 bits of the 32bit address as well.
+ * If the chip supports it, then go ahead and write those
+ * upper 8 bits.
*/
pcic_putw(sp, reg, sys_addr & 0xFFF);
pcic_putw(sp, reg+2, (sys_addr + (mp->size >> 12) - 1) & 0xFFF);
pcic_putw(sp, reg+4, ((mp->card >> 12) - sys_addr) & 0x3FFF);
+ if (sp->sc->flags & PCIC_YENTA_HIGH_MEMORY)
+ sp->putb(sp, PCIC_MEMORY_HIGH0 + win, sys_addr >> 12);
/*
* Each 16 bit register has some flags in the upper bits.
*/
OpenPOWER on IntegriCloud