pcmcia: use dev_printk and dev_dbg in yenta_socket
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
This commit is contained in:
parent
6e86841d05
commit
dd797d81d3
|
@ -140,7 +140,8 @@ static int o2micro_override(struct yenta_socket *socket)
|
||||||
a = config_readb(socket, O2_RESERVED1);
|
a = config_readb(socket, O2_RESERVED1);
|
||||||
b = config_readb(socket, O2_RESERVED2);
|
b = config_readb(socket, O2_RESERVED2);
|
||||||
|
|
||||||
printk(KERN_INFO "Yenta O2: res at 0x94/0xD4: %02x/%02x\n", a, b);
|
dev_printk(KERN_INFO, &socket->dev->dev,
|
||||||
|
"O2: res at 0x94/0xD4: %02x/%02x\n", a, b);
|
||||||
|
|
||||||
switch (socket->dev->device) {
|
switch (socket->dev->device) {
|
||||||
/*
|
/*
|
||||||
|
@ -153,7 +154,9 @@ static int o2micro_override(struct yenta_socket *socket)
|
||||||
case PCI_DEVICE_ID_O2_6812:
|
case PCI_DEVICE_ID_O2_6812:
|
||||||
case PCI_DEVICE_ID_O2_6832:
|
case PCI_DEVICE_ID_O2_6832:
|
||||||
case PCI_DEVICE_ID_O2_6836:
|
case PCI_DEVICE_ID_O2_6836:
|
||||||
printk(KERN_INFO "Yenta O2: old bridge, disabling read prefetch/write burst\n");
|
dev_printk(KERN_INFO, &socket->dev->dev,
|
||||||
|
"Yenta O2: old bridge, disabling read "
|
||||||
|
"prefetch/write burst\n");
|
||||||
config_writeb(socket, O2_RESERVED1,
|
config_writeb(socket, O2_RESERVED1,
|
||||||
a & ~(O2_RES_READ_PREFETCH | O2_RES_WRITE_BURST));
|
a & ~(O2_RES_READ_PREFETCH | O2_RES_WRITE_BURST));
|
||||||
config_writeb(socket, O2_RESERVED2,
|
config_writeb(socket, O2_RESERVED2,
|
||||||
|
@ -161,7 +164,8 @@ static int o2micro_override(struct yenta_socket *socket)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
printk(KERN_INFO "Yenta O2: enabling read prefetch/write burst\n");
|
dev_printk(KERN_INFO , &socket->dev->dev,
|
||||||
|
"O2: enabling read prefetch/write burst\n");
|
||||||
config_writeb(socket, O2_RESERVED1,
|
config_writeb(socket, O2_RESERVED1,
|
||||||
a | O2_RES_READ_PREFETCH | O2_RES_WRITE_BURST);
|
a | O2_RES_READ_PREFETCH | O2_RES_WRITE_BURST);
|
||||||
config_writeb(socket, O2_RESERVED2,
|
config_writeb(socket, O2_RESERVED2,
|
||||||
|
|
|
@ -339,8 +339,8 @@ static void ti12xx_irqroute_func0(struct yenta_socket *socket)
|
||||||
|
|
||||||
mfunc = mfunc_old = config_readl(socket, TI122X_MFUNC);
|
mfunc = mfunc_old = config_readl(socket, TI122X_MFUNC);
|
||||||
devctl = config_readb(socket, TI113X_DEVICE_CONTROL);
|
devctl = config_readb(socket, TI113X_DEVICE_CONTROL);
|
||||||
printk(KERN_INFO "Yenta TI: socket %s, mfunc 0x%08x, devctl 0x%02x\n",
|
dev_printk(KERN_INFO, &socket->dev->dev,
|
||||||
pci_name(socket->dev), mfunc, devctl);
|
"TI: mfunc 0x%08x, devctl 0x%02x\n", mfunc, devctl);
|
||||||
|
|
||||||
/* make sure PCI interrupts are enabled before probing */
|
/* make sure PCI interrupts are enabled before probing */
|
||||||
ti_init(socket);
|
ti_init(socket);
|
||||||
|
@ -354,8 +354,8 @@ static void ti12xx_irqroute_func0(struct yenta_socket *socket)
|
||||||
* We're here which means PCI interrupts are _not_ delivered. try to
|
* We're here which means PCI interrupts are _not_ delivered. try to
|
||||||
* find the right setting (all serial or parallel)
|
* find the right setting (all serial or parallel)
|
||||||
*/
|
*/
|
||||||
printk(KERN_INFO "Yenta TI: socket %s probing PCI interrupt failed, trying to fix\n",
|
dev_printk(KERN_INFO, &socket->dev->dev,
|
||||||
pci_name(socket->dev));
|
"TI: probing PCI interrupt failed, trying to fix\n");
|
||||||
|
|
||||||
/* for serial PCI make sure MFUNC3 is set to IRQSER */
|
/* for serial PCI make sure MFUNC3 is set to IRQSER */
|
||||||
if ((devctl & TI113X_DCR_IMODE_MASK) == TI12XX_DCR_IMODE_ALL_SERIAL) {
|
if ((devctl & TI113X_DCR_IMODE_MASK) == TI12XX_DCR_IMODE_ALL_SERIAL) {
|
||||||
|
@ -379,8 +379,8 @@ static void ti12xx_irqroute_func0(struct yenta_socket *socket)
|
||||||
|
|
||||||
pci_irq_status = yenta_probe_cb_irq(socket);
|
pci_irq_status = yenta_probe_cb_irq(socket);
|
||||||
if (pci_irq_status == 1) {
|
if (pci_irq_status == 1) {
|
||||||
printk(KERN_INFO "Yenta TI: socket %s all-serial interrupts ok\n",
|
dev_printk(KERN_INFO, &socket->dev->dev,
|
||||||
pci_name(socket->dev));
|
"TI: all-serial interrupts ok\n");
|
||||||
mfunc_old = mfunc;
|
mfunc_old = mfunc;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
@ -395,8 +395,8 @@ static void ti12xx_irqroute_func0(struct yenta_socket *socket)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* serial PCI interrupts not working fall back to parallel */
|
/* serial PCI interrupts not working fall back to parallel */
|
||||||
printk(KERN_INFO "Yenta TI: socket %s falling back to parallel PCI interrupts\n",
|
dev_printk(KERN_INFO, &socket->dev->dev,
|
||||||
pci_name(socket->dev));
|
"TI: falling back to parallel PCI interrupts\n");
|
||||||
devctl &= ~TI113X_DCR_IMODE_MASK;
|
devctl &= ~TI113X_DCR_IMODE_MASK;
|
||||||
devctl |= TI113X_DCR_IMODE_SERIAL; /* serial ISA could be right */
|
devctl |= TI113X_DCR_IMODE_SERIAL; /* serial ISA could be right */
|
||||||
config_writeb(socket, TI113X_DEVICE_CONTROL, devctl);
|
config_writeb(socket, TI113X_DEVICE_CONTROL, devctl);
|
||||||
|
@ -427,8 +427,8 @@ static void ti12xx_irqroute_func0(struct yenta_socket *socket)
|
||||||
pci_irq_status = yenta_probe_cb_irq(socket);
|
pci_irq_status = yenta_probe_cb_irq(socket);
|
||||||
if (pci_irq_status == 1) {
|
if (pci_irq_status == 1) {
|
||||||
mfunc_old = mfunc;
|
mfunc_old = mfunc;
|
||||||
printk(KERN_INFO "Yenta TI: socket %s parallel PCI interrupts ok\n",
|
dev_printk(KERN_INFO, &socket->dev->dev,
|
||||||
pci_name(socket->dev));
|
"TI: parallel PCI interrupts ok\n");
|
||||||
} else {
|
} else {
|
||||||
/* not working, back to old value */
|
/* not working, back to old value */
|
||||||
mfunc = mfunc_old;
|
mfunc = mfunc_old;
|
||||||
|
@ -440,8 +440,9 @@ static void ti12xx_irqroute_func0(struct yenta_socket *socket)
|
||||||
out:
|
out:
|
||||||
if (pci_irq_status < 1) {
|
if (pci_irq_status < 1) {
|
||||||
socket->cb_irq = 0;
|
socket->cb_irq = 0;
|
||||||
printk(KERN_INFO "Yenta TI: socket %s no PCI interrupts. Fish. Please report.\n",
|
dev_printk(KERN_INFO, &socket->dev->dev,
|
||||||
pci_name(socket->dev));
|
"Yenta TI: no PCI interrupts. Fish. "
|
||||||
|
"Please report.\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -513,8 +514,9 @@ static void ti12xx_irqroute_func1(struct yenta_socket *socket)
|
||||||
|
|
||||||
mfunc = mfunc_old = config_readl(socket, TI122X_MFUNC);
|
mfunc = mfunc_old = config_readl(socket, TI122X_MFUNC);
|
||||||
devctl = config_readb(socket, TI113X_DEVICE_CONTROL);
|
devctl = config_readb(socket, TI113X_DEVICE_CONTROL);
|
||||||
printk(KERN_INFO "Yenta TI: socket %s, mfunc 0x%08x, devctl 0x%02x\n",
|
dev_printk(KERN_INFO, &socket->dev->dev,
|
||||||
pci_name(socket->dev), mfunc, devctl);
|
"TI: mfunc 0x%08x, devctl 0x%02x\n",
|
||||||
|
mfunc, devctl);
|
||||||
|
|
||||||
/* if IRQs are configured as tied, align irq of func1 with func0 */
|
/* if IRQs are configured as tied, align irq of func1 with func0 */
|
||||||
sysctl = config_readl(socket, TI113X_SYSTEM_CONTROL);
|
sysctl = config_readl(socket, TI113X_SYSTEM_CONTROL);
|
||||||
|
@ -533,9 +535,8 @@ static void ti12xx_irqroute_func1(struct yenta_socket *socket)
|
||||||
* We're here which means PCI interrupts are _not_ delivered. try to
|
* We're here which means PCI interrupts are _not_ delivered. try to
|
||||||
* find the right setting
|
* find the right setting
|
||||||
*/
|
*/
|
||||||
printk(KERN_INFO "Yenta TI: socket %s probing PCI interrupt failed, trying to fix\n",
|
dev_printk(KERN_INFO, &socket->dev->dev,
|
||||||
pci_name(socket->dev));
|
"TI: probing PCI interrupt failed, trying to fix\n");
|
||||||
|
|
||||||
|
|
||||||
/* if all serial: set INTRTIE, probe again */
|
/* if all serial: set INTRTIE, probe again */
|
||||||
if ((devctl & TI113X_DCR_IMODE_MASK) == TI12XX_DCR_IMODE_ALL_SERIAL) {
|
if ((devctl & TI113X_DCR_IMODE_MASK) == TI12XX_DCR_IMODE_ALL_SERIAL) {
|
||||||
|
@ -544,8 +545,8 @@ static void ti12xx_irqroute_func1(struct yenta_socket *socket)
|
||||||
if (ti12xx_tie_interrupts(socket, &old_irq)) {
|
if (ti12xx_tie_interrupts(socket, &old_irq)) {
|
||||||
pci_irq_status = yenta_probe_cb_irq(socket);
|
pci_irq_status = yenta_probe_cb_irq(socket);
|
||||||
if (pci_irq_status == 1) {
|
if (pci_irq_status == 1) {
|
||||||
printk(KERN_INFO "Yenta TI: socket %s all-serial interrupts, tied ok\n",
|
dev_printk(KERN_INFO, &socket->dev->dev,
|
||||||
pci_name(socket->dev));
|
"TI: all-serial interrupts, tied ok\n");
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -582,8 +583,8 @@ static void ti12xx_irqroute_func1(struct yenta_socket *socket)
|
||||||
|
|
||||||
pci_irq_status = yenta_probe_cb_irq(socket);
|
pci_irq_status = yenta_probe_cb_irq(socket);
|
||||||
if (pci_irq_status == 1) {
|
if (pci_irq_status == 1) {
|
||||||
printk(KERN_INFO "Yenta TI: socket %s parallel PCI interrupts ok\n",
|
dev_printk(KERN_INFO, &socket->dev->dev,
|
||||||
pci_name(socket->dev));
|
"TI: parallel PCI interrupts ok\n");
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -593,13 +594,13 @@ static void ti12xx_irqroute_func1(struct yenta_socket *socket)
|
||||||
if (pci_irq_status == -1)
|
if (pci_irq_status == -1)
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* still nothing: set INTRTIE */
|
/* still nothing: set INTRTIE */
|
||||||
if (ti12xx_tie_interrupts(socket, &old_irq)) {
|
if (ti12xx_tie_interrupts(socket, &old_irq)) {
|
||||||
pci_irq_status = yenta_probe_cb_irq(socket);
|
pci_irq_status = yenta_probe_cb_irq(socket);
|
||||||
if (pci_irq_status == 1) {
|
if (pci_irq_status == 1) {
|
||||||
printk(KERN_INFO "Yenta TI: socket %s parallel PCI interrupts, tied ok\n",
|
dev_printk(KERN_INFO, &socket->dev->dev,
|
||||||
pci_name(socket->dev));
|
"TI: parallel PCI interrupts, tied ok\n");
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -610,8 +611,8 @@ static void ti12xx_irqroute_func1(struct yenta_socket *socket)
|
||||||
out:
|
out:
|
||||||
if (pci_irq_status < 1) {
|
if (pci_irq_status < 1) {
|
||||||
socket->cb_irq = 0;
|
socket->cb_irq = 0;
|
||||||
printk(KERN_INFO "Yenta TI: socket %s no PCI interrupts. Fish. Please report.\n",
|
dev_printk(KERN_INFO, &socket->dev->dev,
|
||||||
pci_name(socket->dev));
|
"TI: no PCI interrupts. Fish. Please report.\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -815,11 +816,13 @@ static int ti12xx_override(struct yenta_socket *socket)
|
||||||
/* make sure that memory burst is active */
|
/* make sure that memory burst is active */
|
||||||
val_orig = val = config_readl(socket, TI113X_SYSTEM_CONTROL);
|
val_orig = val = config_readl(socket, TI113X_SYSTEM_CONTROL);
|
||||||
if (disable_clkrun && PCI_FUNC(socket->dev->devfn) == 0) {
|
if (disable_clkrun && PCI_FUNC(socket->dev->devfn) == 0) {
|
||||||
printk(KERN_INFO "Yenta: Disabling CLKRUN feature\n");
|
dev_printk(KERN_INFO, &socket->dev->dev,
|
||||||
|
"Disabling CLKRUN feature\n");
|
||||||
val |= TI113X_SCR_KEEPCLK;
|
val |= TI113X_SCR_KEEPCLK;
|
||||||
}
|
}
|
||||||
if (!(val & TI122X_SCR_MRBURSTUP)) {
|
if (!(val & TI122X_SCR_MRBURSTUP)) {
|
||||||
printk(KERN_INFO "Yenta: Enabling burst memory read transactions\n");
|
dev_printk(KERN_INFO, &socket->dev->dev,
|
||||||
|
"Enabling burst memory read transactions\n");
|
||||||
val |= TI122X_SCR_MRBURSTUP;
|
val |= TI122X_SCR_MRBURSTUP;
|
||||||
}
|
}
|
||||||
if (val_orig != val)
|
if (val_orig != val)
|
||||||
|
@ -830,10 +833,12 @@ static int ti12xx_override(struct yenta_socket *socket)
|
||||||
* CSC interrupts to PCI rather than INTVAL.
|
* CSC interrupts to PCI rather than INTVAL.
|
||||||
*/
|
*/
|
||||||
val = config_readb(socket, TI1250_DIAGNOSTIC);
|
val = config_readb(socket, TI1250_DIAGNOSTIC);
|
||||||
printk(KERN_INFO "Yenta: Using %s to route CSC interrupts to PCI\n",
|
dev_printk(KERN_INFO, &socket->dev->dev,
|
||||||
(val & TI1250_DIAG_PCI_CSC) ? "CSCINT" : "INTVAL");
|
"Using %s to route CSC interrupts to PCI\n",
|
||||||
printk(KERN_INFO "Yenta: Routing CardBus interrupts to %s\n",
|
(val & TI1250_DIAG_PCI_CSC) ? "CSCINT" : "INTVAL");
|
||||||
(val & TI1250_DIAG_PCI_IREQ) ? "PCI" : "ISA");
|
dev_printk(KERN_INFO, &socket->dev->dev,
|
||||||
|
"Routing CardBus interrupts to %s\n",
|
||||||
|
(val & TI1250_DIAG_PCI_IREQ) ? "PCI" : "ISA");
|
||||||
|
|
||||||
/* do irqrouting, depending on function */
|
/* do irqrouting, depending on function */
|
||||||
if (PCI_FUNC(socket->dev->devfn) == 0)
|
if (PCI_FUNC(socket->dev->devfn) == 0)
|
||||||
|
@ -858,8 +863,9 @@ static int ti1250_override(struct yenta_socket *socket)
|
||||||
diag |= TI1250_DIAG_PCI_CSC | TI1250_DIAG_PCI_IREQ;
|
diag |= TI1250_DIAG_PCI_CSC | TI1250_DIAG_PCI_IREQ;
|
||||||
|
|
||||||
if (diag != old) {
|
if (diag != old) {
|
||||||
printk(KERN_INFO "Yenta: adjusting diagnostic: %02x -> %02x\n",
|
dev_printk(KERN_INFO, &socket->dev->dev,
|
||||||
old, diag);
|
"adjusting diagnostic: %02x -> %02x\n",
|
||||||
|
old, diag);
|
||||||
config_writeb(socket, TI1250_DIAGNOSTIC, diag);
|
config_writeb(socket, TI1250_DIAGNOSTIC, diag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -924,7 +930,9 @@ static void ene_tune_bridge(struct pcmcia_socket *sock, struct pci_bus *bus)
|
||||||
/* default to clear TLTEnable bit, old behaviour */
|
/* default to clear TLTEnable bit, old behaviour */
|
||||||
test_c9 &= ~ENE_TEST_C9_TLTENABLE;
|
test_c9 &= ~ENE_TEST_C9_TLTENABLE;
|
||||||
|
|
||||||
printk(KERN_INFO "yenta EnE: chaning testregister 0xC9, %02x -> %02x\n", old_c9, test_c9);
|
dev_printk(KERN_INFO, &socket->dev->dev,
|
||||||
|
"EnE: chaning testregister 0xC9, %02x -> %02x\n",
|
||||||
|
old_c9, test_c9);
|
||||||
config_writeb(socket, ENE_TEST_C9, test_c9);
|
config_writeb(socket, ENE_TEST_C9, test_c9);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,11 +38,7 @@ static int pwr_irqs_off;
|
||||||
module_param(pwr_irqs_off, bool, 0644);
|
module_param(pwr_irqs_off, bool, 0644);
|
||||||
MODULE_PARM_DESC(pwr_irqs_off, "Force IRQs off during power-on of slot. Use only when seeing IRQ storms!");
|
MODULE_PARM_DESC(pwr_irqs_off, "Force IRQs off during power-on of slot. Use only when seeing IRQ storms!");
|
||||||
|
|
||||||
#if 0
|
#define debug(x, s, args...) dev_dbg(&s->dev->dev, x, ##args)
|
||||||
#define debug(x,args...) printk(KERN_DEBUG "%s: " x, __func__ , ##args)
|
|
||||||
#else
|
|
||||||
#define debug(x,args...)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Don't ask.. */
|
/* Don't ask.. */
|
||||||
#define to_cycles(ns) ((ns)/120)
|
#define to_cycles(ns) ((ns)/120)
|
||||||
|
@ -69,13 +65,13 @@ MODULE_PARM_DESC (override_bios, "yenta ignore bios resource allocation");
|
||||||
static inline u32 cb_readl(struct yenta_socket *socket, unsigned reg)
|
static inline u32 cb_readl(struct yenta_socket *socket, unsigned reg)
|
||||||
{
|
{
|
||||||
u32 val = readl(socket->base + reg);
|
u32 val = readl(socket->base + reg);
|
||||||
debug("%p %04x %08x\n", socket, reg, val);
|
debug("%04x %08x\n", socket, reg, val);
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void cb_writel(struct yenta_socket *socket, unsigned reg, u32 val)
|
static inline void cb_writel(struct yenta_socket *socket, unsigned reg, u32 val)
|
||||||
{
|
{
|
||||||
debug("%p %04x %08x\n", socket, reg, val);
|
debug("%04x %08x\n", socket, reg, val);
|
||||||
writel(val, socket->base + reg);
|
writel(val, socket->base + reg);
|
||||||
readl(socket->base + reg); /* avoid problems with PCI write posting */
|
readl(socket->base + reg); /* avoid problems with PCI write posting */
|
||||||
}
|
}
|
||||||
|
@ -84,7 +80,7 @@ static inline u8 config_readb(struct yenta_socket *socket, unsigned offset)
|
||||||
{
|
{
|
||||||
u8 val;
|
u8 val;
|
||||||
pci_read_config_byte(socket->dev, offset, &val);
|
pci_read_config_byte(socket->dev, offset, &val);
|
||||||
debug("%p %04x %02x\n", socket, offset, val);
|
debug("%04x %02x\n", socket, offset, val);
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,7 +88,7 @@ static inline u16 config_readw(struct yenta_socket *socket, unsigned offset)
|
||||||
{
|
{
|
||||||
u16 val;
|
u16 val;
|
||||||
pci_read_config_word(socket->dev, offset, &val);
|
pci_read_config_word(socket->dev, offset, &val);
|
||||||
debug("%p %04x %04x\n", socket, offset, val);
|
debug("%04x %04x\n", socket, offset, val);
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,32 +96,32 @@ static inline u32 config_readl(struct yenta_socket *socket, unsigned offset)
|
||||||
{
|
{
|
||||||
u32 val;
|
u32 val;
|
||||||
pci_read_config_dword(socket->dev, offset, &val);
|
pci_read_config_dword(socket->dev, offset, &val);
|
||||||
debug("%p %04x %08x\n", socket, offset, val);
|
debug("%04x %08x\n", socket, offset, val);
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void config_writeb(struct yenta_socket *socket, unsigned offset, u8 val)
|
static inline void config_writeb(struct yenta_socket *socket, unsigned offset, u8 val)
|
||||||
{
|
{
|
||||||
debug("%p %04x %02x\n", socket, offset, val);
|
debug("%04x %02x\n", socket, offset, val);
|
||||||
pci_write_config_byte(socket->dev, offset, val);
|
pci_write_config_byte(socket->dev, offset, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void config_writew(struct yenta_socket *socket, unsigned offset, u16 val)
|
static inline void config_writew(struct yenta_socket *socket, unsigned offset, u16 val)
|
||||||
{
|
{
|
||||||
debug("%p %04x %04x\n", socket, offset, val);
|
debug("%04x %04x\n", socket, offset, val);
|
||||||
pci_write_config_word(socket->dev, offset, val);
|
pci_write_config_word(socket->dev, offset, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void config_writel(struct yenta_socket *socket, unsigned offset, u32 val)
|
static inline void config_writel(struct yenta_socket *socket, unsigned offset, u32 val)
|
||||||
{
|
{
|
||||||
debug("%p %04x %08x\n", socket, offset, val);
|
debug("%04x %08x\n", socket, offset, val);
|
||||||
pci_write_config_dword(socket->dev, offset, val);
|
pci_write_config_dword(socket->dev, offset, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline u8 exca_readb(struct yenta_socket *socket, unsigned reg)
|
static inline u8 exca_readb(struct yenta_socket *socket, unsigned reg)
|
||||||
{
|
{
|
||||||
u8 val = readb(socket->base + 0x800 + reg);
|
u8 val = readb(socket->base + 0x800 + reg);
|
||||||
debug("%p %04x %02x\n", socket, reg, val);
|
debug("%04x %02x\n", socket, reg, val);
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -134,20 +130,20 @@ static inline u8 exca_readw(struct yenta_socket *socket, unsigned reg)
|
||||||
u16 val;
|
u16 val;
|
||||||
val = readb(socket->base + 0x800 + reg);
|
val = readb(socket->base + 0x800 + reg);
|
||||||
val |= readb(socket->base + 0x800 + reg + 1) << 8;
|
val |= readb(socket->base + 0x800 + reg + 1) << 8;
|
||||||
debug("%p %04x %04x\n", socket, reg, val);
|
debug("%04x %04x\n", socket, reg, val);
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void exca_writeb(struct yenta_socket *socket, unsigned reg, u8 val)
|
static inline void exca_writeb(struct yenta_socket *socket, unsigned reg, u8 val)
|
||||||
{
|
{
|
||||||
debug("%p %04x %02x\n", socket, reg, val);
|
debug("%04x %02x\n", socket, reg, val);
|
||||||
writeb(val, socket->base + 0x800 + reg);
|
writeb(val, socket->base + 0x800 + reg);
|
||||||
readb(socket->base + 0x800 + reg); /* PCI write posting... */
|
readb(socket->base + 0x800 + reg); /* PCI write posting... */
|
||||||
}
|
}
|
||||||
|
|
||||||
static void exca_writew(struct yenta_socket *socket, unsigned reg, u16 val)
|
static void exca_writew(struct yenta_socket *socket, unsigned reg, u16 val)
|
||||||
{
|
{
|
||||||
debug("%p %04x %04x\n", socket, reg, val);
|
debug("%04x %04x\n", socket, reg, val);
|
||||||
writeb(val, socket->base + 0x800 + reg);
|
writeb(val, socket->base + 0x800 + reg);
|
||||||
writeb(val >> 8, socket->base + 0x800 + reg + 1);
|
writeb(val >> 8, socket->base + 0x800 + reg + 1);
|
||||||
|
|
||||||
|
@ -207,7 +203,7 @@ static int yenta_get_status(struct pcmcia_socket *sock, unsigned int *value)
|
||||||
|
|
||||||
|
|
||||||
if (state & CB_CBCARD) {
|
if (state & CB_CBCARD) {
|
||||||
val |= SS_CARDBUS;
|
val |= SS_CARDBUS;
|
||||||
val |= (state & CB_CARDSTS) ? SS_STSCHG : 0;
|
val |= (state & CB_CARDSTS) ? SS_STSCHG : 0;
|
||||||
val |= (state & (CB_CDETECT1 | CB_CDETECT2)) ? 0 : SS_DETECT;
|
val |= (state & (CB_CDETECT1 | CB_CDETECT2)) ? 0 : SS_DETECT;
|
||||||
val |= (state & CB_PWRCYCLE) ? SS_POWERON | SS_READY : 0;
|
val |= (state & CB_PWRCYCLE) ? SS_POWERON | SS_READY : 0;
|
||||||
|
@ -650,8 +646,10 @@ static int yenta_allocate_res(struct yenta_socket *socket, int nr, unsigned type
|
||||||
root = pci_find_parent_resource(socket->dev, res);
|
root = pci_find_parent_resource(socket->dev, res);
|
||||||
if (root && (request_resource(root, res) == 0))
|
if (root && (request_resource(root, res) == 0))
|
||||||
return 0;
|
return 0;
|
||||||
printk(KERN_INFO "yenta %s: Preassigned resource %d busy or not available, reconfiguring...\n",
|
dev_printk(KERN_INFO, &socket->dev->dev,
|
||||||
pci_name(socket->dev), nr);
|
"Preassigned resource %d busy or not available, "
|
||||||
|
"reconfiguring...\n",
|
||||||
|
nr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type & IORESOURCE_IO) {
|
if (type & IORESOURCE_IO) {
|
||||||
|
@ -674,8 +672,9 @@ static int yenta_allocate_res(struct yenta_socket *socket, int nr, unsigned type
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
printk(KERN_INFO "yenta %s: no resource of type %x available, trying to continue...\n",
|
dev_printk(KERN_INFO, &socket->dev->dev,
|
||||||
pci_name(socket->dev), type);
|
"no resource of type %x available, trying to continue...\n",
|
||||||
|
type);
|
||||||
res->start = res->end = res->flags = 0;
|
res->start = res->end = res->flags = 0;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -923,7 +922,8 @@ static int yenta_probe_cb_irq(struct yenta_socket *socket)
|
||||||
socket->probe_status = 0;
|
socket->probe_status = 0;
|
||||||
|
|
||||||
if (request_irq(socket->cb_irq, yenta_probe_handler, IRQF_SHARED, "yenta", socket)) {
|
if (request_irq(socket->cb_irq, yenta_probe_handler, IRQF_SHARED, "yenta", socket)) {
|
||||||
printk(KERN_WARNING "Yenta: request_irq() in yenta_probe_cb_irq() failed!\n");
|
dev_printk(KERN_WARNING, &socket->dev->dev,
|
||||||
|
"request_irq() in yenta_probe_cb_irq() failed!\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -960,8 +960,9 @@ static void yenta_get_socket_capabilities(struct yenta_socket *socket, u32 isa_i
|
||||||
else
|
else
|
||||||
socket->socket.irq_mask = 0;
|
socket->socket.irq_mask = 0;
|
||||||
|
|
||||||
printk(KERN_INFO "Yenta: ISA IRQ mask 0x%04x, PCI irq %d\n",
|
dev_printk(KERN_INFO, &socket->dev->dev,
|
||||||
socket->socket.irq_mask, socket->cb_irq);
|
"ISA IRQ mask 0x%04x, PCI irq %d\n",
|
||||||
|
socket->socket.irq_mask, socket->cb_irq);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1051,8 +1052,9 @@ static void yenta_fixup_parent_bridge(struct pci_bus *cardbus_bridge)
|
||||||
|
|
||||||
/* Show that the wanted subordinate number is not possible: */
|
/* Show that the wanted subordinate number is not possible: */
|
||||||
if (cardbus_bridge->subordinate > upper_limit)
|
if (cardbus_bridge->subordinate > upper_limit)
|
||||||
printk(KERN_WARNING "Yenta: Upper limit for fixing this "
|
dev_printk(KERN_WARNING, &cardbus_bridge->dev,
|
||||||
"bridge's parent bridge: #%02x\n", upper_limit);
|
"Upper limit for fixing this "
|
||||||
|
"bridge's parent bridge: #%02x\n", upper_limit);
|
||||||
|
|
||||||
/* If we have room to increase the bridge's subordinate number, */
|
/* If we have room to increase the bridge's subordinate number, */
|
||||||
if (bridge_to_fix->subordinate < upper_limit) {
|
if (bridge_to_fix->subordinate < upper_limit) {
|
||||||
|
@ -1061,10 +1063,11 @@ static void yenta_fixup_parent_bridge(struct pci_bus *cardbus_bridge)
|
||||||
unsigned char subordinate_to_assign =
|
unsigned char subordinate_to_assign =
|
||||||
min(cardbus_bridge->subordinate, upper_limit);
|
min(cardbus_bridge->subordinate, upper_limit);
|
||||||
|
|
||||||
printk(KERN_INFO "Yenta: Raising subordinate bus# of parent "
|
dev_printk(KERN_INFO, &bridge_to_fix->dev,
|
||||||
"bus (#%02x) from #%02x to #%02x\n",
|
"Raising subordinate bus# of parent "
|
||||||
bridge_to_fix->number,
|
"bus (#%02x) from #%02x to #%02x\n",
|
||||||
bridge_to_fix->subordinate, subordinate_to_assign);
|
bridge_to_fix->number,
|
||||||
|
bridge_to_fix->subordinate, subordinate_to_assign);
|
||||||
|
|
||||||
/* Save the new subordinate in the bus struct of the bridge */
|
/* Save the new subordinate in the bus struct of the bridge */
|
||||||
bridge_to_fix->subordinate = subordinate_to_assign;
|
bridge_to_fix->subordinate = subordinate_to_assign;
|
||||||
|
@ -1091,8 +1094,8 @@ static int __devinit yenta_probe (struct pci_dev *dev, const struct pci_device_i
|
||||||
* Bail out if so.
|
* Bail out if so.
|
||||||
*/
|
*/
|
||||||
if (!dev->subordinate) {
|
if (!dev->subordinate) {
|
||||||
printk(KERN_ERR "Yenta: no bus associated with %s! "
|
dev_printk(KERN_ERR, &dev->dev, "no bus associated! "
|
||||||
"(try 'pci=assign-busses')\n", pci_name(dev));
|
"(try 'pci=assign-busses')\n");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1127,7 +1130,7 @@ static int __devinit yenta_probe (struct pci_dev *dev, const struct pci_device_i
|
||||||
goto disable;
|
goto disable;
|
||||||
|
|
||||||
if (!pci_resource_start(dev, 0)) {
|
if (!pci_resource_start(dev, 0)) {
|
||||||
printk(KERN_ERR "No cardbus resource!\n");
|
dev_printk(KERN_ERR, &dev->dev, "No cardbus resource!\n");
|
||||||
ret = -ENODEV;
|
ret = -ENODEV;
|
||||||
goto release;
|
goto release;
|
||||||
}
|
}
|
||||||
|
@ -1146,8 +1149,8 @@ static int __devinit yenta_probe (struct pci_dev *dev, const struct pci_device_i
|
||||||
* report the subsystem vendor and device for help debugging
|
* report the subsystem vendor and device for help debugging
|
||||||
* the irq stuff...
|
* the irq stuff...
|
||||||
*/
|
*/
|
||||||
printk(KERN_INFO "Yenta: CardBus bridge found at %s [%04x:%04x]\n",
|
dev_printk(KERN_INFO, &dev->dev, "CardBus bridge found [%04x:%04x]\n",
|
||||||
pci_name(dev), dev->subsystem_vendor, dev->subsystem_device);
|
dev->subsystem_vendor, dev->subsystem_device);
|
||||||
|
|
||||||
yenta_config_init(socket);
|
yenta_config_init(socket);
|
||||||
|
|
||||||
|
@ -1179,8 +1182,12 @@ static int __devinit yenta_probe (struct pci_dev *dev, const struct pci_device_i
|
||||||
socket->poll_timer.data = (unsigned long)socket;
|
socket->poll_timer.data = (unsigned long)socket;
|
||||||
socket->poll_timer.expires = jiffies + HZ;
|
socket->poll_timer.expires = jiffies + HZ;
|
||||||
add_timer(&socket->poll_timer);
|
add_timer(&socket->poll_timer);
|
||||||
printk(KERN_INFO "Yenta: no PCI IRQ, CardBus support disabled for this socket.\n"
|
dev_printk(KERN_INFO, &dev->dev,
|
||||||
KERN_INFO "Yenta: check your BIOS CardBus, BIOS IRQ or ACPI settings.\n");
|
"no PCI IRQ, CardBus support disabled for this "
|
||||||
|
"socket.\n");
|
||||||
|
dev_printk(KERN_INFO, &dev->dev,
|
||||||
|
"check your BIOS CardBus, BIOS IRQ or ACPI "
|
||||||
|
"settings.\n");
|
||||||
} else {
|
} else {
|
||||||
socket->socket.features |= SS_CAP_CARDBUS;
|
socket->socket.features |= SS_CAP_CARDBUS;
|
||||||
}
|
}
|
||||||
|
@ -1188,7 +1195,8 @@ static int __devinit yenta_probe (struct pci_dev *dev, const struct pci_device_i
|
||||||
/* Figure out what the dang thing can do for the PCMCIA layer... */
|
/* Figure out what the dang thing can do for the PCMCIA layer... */
|
||||||
yenta_interrogate(socket);
|
yenta_interrogate(socket);
|
||||||
yenta_get_socket_capabilities(socket, isa_interrupts);
|
yenta_get_socket_capabilities(socket, isa_interrupts);
|
||||||
printk(KERN_INFO "Socket status: %08x\n", cb_readl(socket, CB_SOCKET_STATE));
|
dev_printk(KERN_INFO, &dev->dev,
|
||||||
|
"Socket status: %08x\n", cb_readl(socket, CB_SOCKET_STATE));
|
||||||
|
|
||||||
yenta_fixup_parent_bridge(dev->subordinate);
|
yenta_fixup_parent_bridge(dev->subordinate);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue