summaryrefslogtreecommitdiffstats
path: root/sys/pccard/pcicvar.h
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2001-09-04 04:47:58 +0000
committerimp <imp@FreeBSD.org>2001-09-04 04:47:58 +0000
commitb2ea2b171b8f6407d574462ca2013565079904ec (patch)
treedebe7561bea176c6e277b8af756d91eb8d3640e5 /sys/pccard/pcicvar.h
parente24b3c902b4e4c09d5da29badc6a2760db5f0100 (diff)
downloadFreeBSD-src-b2ea2b171b8f6407d574462ca2013565079904ec.zip
FreeBSD-src-b2ea2b171b8f6407d574462ca2013565079904ec.tar.gz
Move to using a chip function + function pointers to deal with the
function and csc interrupt routing path (eg, ISA or PCI) so that we can more easily switch between the two. When we don't have a card ISR, put the function interrupt into ISA mode. This effectively masks the interrupt since it happens once, and not again until we have an ISR. This should help hangs, and might help people that unwisely update the kernel w/o updating pccardd. This is done at mapirq time. Force CL-PD6729/30 to use ISA interrupt routing and maybe even detect the number of pccard slots properly (this is still WIP). We aren't going to support PCI interrupts for this release. A future release should support them, however. Shibata-san's 3.3V fixes are not included. Add a hack which should, in i386, rewrite IRQ 0 cardbus bridges to be IRQ 255, which should cause interrupts to be routed. This is mostly untested since my one tester disappeared after reporting nothing changed. Implement, but do not use, a power method called cardbus. It looked like a great way to get around the 3.3V problem, but it seems that you can only use it to power cardbus cards (I get no CIS when I enable it, so maybe we're programming things bogusly). GC the intr and argp stuff from the slot database. Improve the ToPIC support with the power hacks that Nakagawa-san published in FreeBSD Press and that Hiroyuki Aizu-san ported to -stable. The ToPIC hacks were for 3.3V support in ToPIC 100, but it looks like the '97 also has identical registers, so use them too. Add some #defines for the cardbus power stuff. Finally implement making CSC on the Ricoh chips ISA or PCI. This will allow polling mode to work on vaios, I think. Add some minor debugging. This should likely be cleaned up or put behing a bootverbose. Some of this work, and earlier work, was influanced by Chiharu Shibata-san's power handing patches posted to bsd-nomads:15866. MFC: Soon, if possible.
Diffstat (limited to 'sys/pccard/pcicvar.h')
-rw-r--r--sys/pccard/pcicvar.h30
1 files changed, 22 insertions, 8 deletions
diff --git a/sys/pccard/pcicvar.h b/sys/pccard/pcicvar.h
index 04626ef..154860d 100644
--- a/sys/pccard/pcicvar.h
+++ b/sys/pccard/pcicvar.h
@@ -37,8 +37,6 @@ struct pcic_slot {
void (*putb)(struct pcic_slot *, int, u_int8_t);
bus_space_tag_t bst;
bus_space_handle_t bsh;
- driver_intr_t *intr;
- void *argp;
};
enum pcic_intr_way { pcic_iw_isa = 1, pcic_iw_pci = 2 };
@@ -47,12 +45,14 @@ struct pcic_softc
{
u_int32_t slotmask;/* Mask of valid slots */
u_int32_t flags; /* Interesting flags */
-#define PCIC_AB_POWER 0x00000001 /* Use old A/B step power */
-#define PCIC_DF_POWER 0x00000002 /* Uses DF step regs */
-#define PCIC_PD_POWER 0x00000004 /* Uses CL-PD regs */
-#define PCIC_VG_POWER 0x00000008 /* Uses VG power regs */
-#define PCIC_KING_POWER 0x00000010 /* Uses IBM KING regs */
-#define PCIC_RICOH_POWER 0x0000020 /* Uses the ricoh power regs */
+#define PCIC_AB_POWER 0x00000001 /* Use old A/B step power */
+#define PCIC_DF_POWER 0x00000002 /* Uses DF step regs */
+#define PCIC_PD_POWER 0x00000004 /* Uses CL-PD regs */
+#define PCIC_VG_POWER 0x00000008 /* Uses VG power regs */
+#define PCIC_KING_POWER 0x00000010 /* Uses IBM KING regs */
+#define PCIC_RICOH_POWER 0x00000020 /* Uses the ricoh power regs */
+#define PCIC_CARDBUS_POWER 0x00000040 /* Cardbus power regs */
+
enum pcic_intr_way csc_route; /* How to route csc interrupts */
enum pcic_intr_way func_route; /* How to route function ints */
int iorid; /* Rid of I/O region */
@@ -70,6 +70,19 @@ struct pcic_softc
int cd_pending; /* debounce timeout active */
int cd_present; /* debounced card-present state */
struct callout_handle cd_ch; /* handle for pcic_cd_insert */
+ struct pcic_chip *chip;
+};
+
+typedef int (pcic_intr_way_t)(struct pcic_slot *, enum pcic_intr_way);
+typedef int (pcic_intr_mapirq_t)(struct pcic_slot *, int irq);
+typedef void (pcic_init_t)(device_t);
+
+struct pcic_chip
+{
+ pcic_intr_way_t *func_intr_way;
+ pcic_intr_way_t *csc_intr_way;
+ pcic_intr_mapirq_t *map_irq;
+ pcic_init_t *init;
};
extern devclass_t pcic_devclass;
@@ -92,6 +105,7 @@ int pcic_get_res_flags(device_t bus, device_t child, int restype, int rid,
unsigned char pcic_getb_io(struct pcic_slot *sp, int reg);
driver_intr_t pcic_isa_intr;
int pcic_isa_intr1(void *);
+pcic_intr_mapirq_t pcic_isa_mapirq;
void pcic_putb_io(struct pcic_slot *sp, int reg, unsigned char val);
int pcic_set_memory_offset(device_t bus, device_t child, int rid,
u_int32_t offset
OpenPOWER on IntegriCloud