From 516fdf9478262766d1d546f7c681c7a057e3fbbd Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Tue, 23 Oct 2001 07:04:03 +0000 Subject: Add a tunable (hw.pcic.boot_deactivated) which will boot the system with the pccards deactivated. This can work around some problems in pccard system, but is also for people that want to explicitly turn on cards after boot rather that at boot. MFC after: 7 days Submitted by: iwasaki-san Reviewed by: ume-san, shiba-san --- sys/pccard/pcic.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'sys') diff --git a/sys/pccard/pcic.c b/sys/pccard/pcic.c index 14ab1db99abc..f801e113f42f 100644 --- a/sys/pccard/pcic.c +++ b/sys/pccard/pcic.c @@ -88,6 +88,12 @@ SYSCTL_INT(_hw_pcic, OID_AUTO, irq, CTLFLAG_RD, &pcic_override_irq, 0, "Override the IRQ configured by the config system for all pcic devices"); +int pcic_boot_deactivated = 0; +TUNABLE_INT("hw.pcic.boot_deactivated", &pcic_boot_deactivated); +SYSCTL_INT(_hw_pcic, OID_AUTO, boot_deactivated, CTLFLAG_RD, + &pcic_boot_deactivated, 0, + "Override the automatic powering up of pccards at boot."); + /* * Read a register from the PCIC. */ @@ -383,7 +389,14 @@ pcic_attach(device_t dev) /* Check for changes */ pcic_setb(sp, PCIC_POWER, PCIC_PCPWRE | PCIC_DISRST); sp->slt->laststate = sp->slt->state = empty; - pcic_do_stat_delta(sp); + if (pcic_boot_deactivated) { + if ((sp->getb(sp, PCIC_STATUS) & PCIC_CD) == PCIC_CD) { + sp->slt->state = inactive; + pccard_event(sp->slt, card_deactivated); + } + } else { + pcic_do_stat_delta(sp); + } } return (bus_generic_attach(dev)); -- cgit v1.3