2002-07-01 23:47:49

by Pavel Roskin

[permalink] [raw]
Subject: Cyrix IRQ routing is wrong?

Hello!

I'm using Linux 2.4.19-rc1 with pcmcia-cs 3.1.34 on EM-350A system
(http://www.voxtechnologies.com/Embedded_Platforms/em-350a.htm) with Cyrix
MediaGX. CONFIG_PCMCIA is disabled, so the drivers come from pcmcia-cs.
Every time the i82365 driver is loaded, the following message appears in
the kernel log:

Intel ISA/PCI/CardBus PCIC probe:
PCI: Found IRQ 11 for device 00:11.0
IRQ routing conflict for 00:11.0, have irq 15, want irq 11
PCI: Found IRQ 15 for device 00:11.1
IRQ routing conflict for 00:11.1, have irq 11, want irq 15

It happens regardless of whether I'm using CONFIG_PCI_GOBIOS or
CONFIG_PCI_GODIRECT in the kernel config.

My understanding is that the first number comes from the PCI config space,
whereas the second number comes from pirq_cyrix_get(), a Cyrix specific
function that accesses the routing registers. The later numbers are
ignored if there is a conflict.

I have found that the following patch fixes this warning. I don't know if
it's correct. The reason for the warning may be a hardware bug, but I'll
post it anyway so that poeple with the documentation for Cyrix could
recheck this code.

======================================
--- linux.orig/arch/i386/kernel/pci-irq.c
+++ linux/arch/i386/kernel/pci-irq.c
@@ -243,12 +243,12 @@ static int pirq_opti_set(struct pci_dev
*/
static int pirq_cyrix_get(struct pci_dev *router, struct pci_dev *dev, int pirq)
{
- return read_config_nybble(router, 0x5C, (pirq-1)^1);
+ return read_config_nybble(router, 0x5C, (pirq-1));
}

static int pirq_cyrix_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq)
{
- write_config_nybble(router, 0x5C, (pirq-1)^1, irq);
+ write_config_nybble(router, 0x5C, (pirq-1), irq);
return 1;
}

======================================

The existing code uses the upper nibble in the same byte for lower pirq,
but it seems that we should start with the lower nibble for EM-350A.

When using PCI interrupts in the i82365 driver (parameter irq_mode=0), all
PCMCIA cards work properly and generate interrupts, with and without the
above patch.

The fix in the latest beta of pcmcia-cs has no effect on 2.4.x kernels.
It implements exactly the same logic, which is used in 2.4.x kernels
(upper nibble first).

Possibly relevant part of initial kernel messages:

PCI: PCI BIOS revision 2.10 entry at 0xfad80, last bus=0
PCI: Probing PCI hardware
PCI: Using IRQ router NatSemi [1078/0100] at 00:12.0

lspci output:

00:00.0 Host bridge: Cyrix Corporation PCI Master
00:10.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139 (rev 10)
00:11.0 CardBus bridge: Ricoh Co Ltd RL5c476 II (rev 80)
00:11.1 CardBus bridge: Ricoh Co Ltd RL5c476 II (rev 80)
00:12.0 ISA bridge: Cyrix Corporation 5530 Legacy [Kahlua] (rev 30)
00:12.1 Bridge: Cyrix Corporation 5530 SMI [Kahlua]
00:12.2 IDE interface: Cyrix Corporation 5530 IDE [Kahlua]
00:12.3 Multimedia audio controller: Cyrix Corporation 5530 Audio [Kahlua]
00:12.4 VGA compatible controller: Cyrix Corporation 5530 Video [Kahlua]

--
Regards,
Pavel Roskin


2002-07-03 23:28:46

by Alan Cox

[permalink] [raw]
Subject: Re: Cyrix IRQ routing is wrong?

> The existing code uses the upper nibble in the same byte for lower pirq,
> but it seems that we should start with the lower nibble for EM-350A.

On all my boards its upper first and the current code works while the
patch you have hangs the box

2002-07-04 00:36:02

by Pavel Roskin

[permalink] [raw]
Subject: Re: Cyrix IRQ routing is wrong?

Hi, Alan!

[Adding PCI maintainter Martin Mares to cc:]

On Thu, 4 Jul 2002, Alan Cox wrote:

> > The existing code uses the upper nibble in the same byte for lower pirq,
> > but it seems that we should start with the lower nibble for EM-350A.
>
> On all my boards its upper first and the current code works while the
> patch you have hangs the box

Ive just sent another message to the mailing list. I can easily accept
that EM-350A (embedded system with Geode) may have hardware bugs. But
let's consider following:

1) 2.4.17 was using the code I want to restore. Where was your hanging
box then?
2) The comment in 2.5.24 is saying what my code does and what 2.4.17 was
doing.

In case if it turns out that we need to distinguish between different
systems, here's more info about my box:

lspci (version 2.1.8):

00:00.0 Host bridge: Cyrix Corporation PCI Master
00:10.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139 (rev
10)
00:11.0 CardBus bridge: Ricoh Co Ltd RL5c476 II (rev 80)
00:11.1 CardBus bridge: Ricoh Co Ltd RL5c476 II (rev 80)
00:12.0 ISA bridge: Cyrix Corporation 5530 Legacy [Kahlua] (rev 30)
00:12.1 Bridge: Cyrix Corporation 5530 SMI [Kahlua]
00:12.2 IDE interface: Cyrix Corporation 5530 IDE [Kahlua]
00:12.3 Multimedia audio controller: Cyrix Corporation 5530 Audio [Kahlua]
00:12.4 VGA compatible controller: Cyrix Corporation 5530 Video [Kahlua]

dump_pirq (from pcmcia-cs.02-Jul-02):

Interrupt routing table found at address 0xfdae0:
Version 1.0, size 0x0050
Interrupt router is device 00:12.0
PCI exclusive interrupt mask: 0x8c00 [10,11,15]
Compatible router: vendor 0x1078 device 0x0002

Device 00:13.0 (slot 1):
INTA: link 0x01, irq mask 0xdeb8 [3,4,5,7,9,10,11,12,14,15]
INTB: link 0x02, irq mask 0xdeb8 [3,4,5,7,9,10,11,12,14,15]
INTC: link 0x03, irq mask 0xdeb8 [3,4,5,7,9,10,11,12,14,15]
INTD: link 0x04, irq mask 0xdeb8 [3,4,5,7,9,10,11,12,14,15]

Device 00:11.0 (slot 2): CardBus bridge
INTA: link 0x03, irq mask 0xdeb8 [3,4,5,7,9,10,11,12,14,15]
INTB: link 0x04, irq mask 0xdeb8 [3,4,5,7,9,10,11,12,14,15]
INTC: link 0x01, irq mask 0xdeb8 [3,4,5,7,9,10,11,12,14,15]
INTD: link 0x02, irq mask 0xdeb8 [3,4,5,7,9,10,11,12,14,15]

Device 00:10.0 (slot 3): Ethernet controller
INTA: link 0x02, irq mask 0xdeb8 [3,4,5,7,9,10,11,12,14,15]
INTB: link 0x03, irq mask 0xdeb8 [3,4,5,7,9,10,11,12,14,15]
INTC: link 0x04, irq mask 0xdeb8 [3,4,5,7,9,10,11,12,14,15]
INTD: link 0x01, irq mask 0xdeb8 [3,4,5,7,9,10,11,12,14,15]

Interrupt router at 00:12.0: CYRIX 5530 PCI-to-ISA bridge
PIRQ (link 0x01): irq 10
PIRQ (link 0x02): irq 10
PIRQ (link 0x03): irq 15
PIRQ (link 0x04): irq 11
Level mask: 0x8c00 [10,11,15]

# cat /proc/cpuinfo
processor : 0
vendor_id : CyrixInstead
cpu family : 5
model : 9
model name : Geode(TM) Integrated Processor by National Semi
stepping : 1
cpu MHz : 233.865
cache size : 16 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 2
wp : yes
flags : fpu tsc msr cx8 cmov mmx cxmmx
bogomips : 466.94

# cat /proc/interrupts
CPU0
0: 483792 XT-PIC timer
1: 3 XT-PIC keyboard
2: 0 XT-PIC cascade
4: 1368 XT-PIC serial
8: 1 XT-PIC rtc
10: 18 XT-PIC eth0
11: 0 XT-PIC i82365
12: 0 XT-PIC PS/2 Mouse
14: 2213 XT-PIC ide0
15: 0 XT-PIC i82365
NMI: 0
ERR: 0

# lspci -x -s 00:11
00:11.0 CardBus bridge: Ricoh Co Ltd RL5c476 II (rev 80)
00: 80 11 76 04 07 00 10 02 80 00 07 06 00 20 82 00
10: 00 00 00 d1 dc 00 00 02 00 01 04 b0 00 10 00 d1
20: 00 20 00 d1 00 30 00 d1 00 00 00 00 00 00 00 00
30: 00 00 00 00 00 00 00 00 00 00 00 00 0f 01 80 07
40: 12 34 56 78 01 00 00 00 00 00 00 00 00 00 00 00
50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

00:11.1 CardBus bridge: Ricoh Co Ltd RL5c476 II (rev 80)
00: 80 11 76 04 07 00 10 02 80 00 07 06 00 20 82 00
10: 00 50 00 d1 dc 00 00 02 00 05 08 b0 00 60 00 d1
20: 00 70 00 d1 00 80 00 d1 00 00 00 00 00 00 00 00
30: 00 00 00 00 00 00 00 00 00 00 00 00 0b 02 80 07
40: 12 34 56 78 01 00 00 00 00 00 00 00 00 00 00 00
50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

--
Regards,
Pavel Roskin

2002-07-04 00:38:46

by Linus Torvalds

[permalink] [raw]
Subject: Re: Cyrix IRQ routing is wrong?

In article <E17Ptae-0002Ir-00@http://www.linux.org.uk>,
Alan Cox <alan@http://www.linux.org.uk> wrote:
>> The existing code uses the upper nibble in the same byte for lower pirq,
>> but it seems that we should start with the lower nibble for EM-350A.
>
>On all my boards its upper first and the current code works while the
>patch you have hangs the box

The original code (and thus the one that Pavel documents) definitely
matches the documentation closer, though. And clearly the "^1" is wrong
for some machines, and apparently right for others.

I'd like to know if there is some way to distinguish between the broken
PIRQ tables that Alan has, and the ones that match the docs (Pavel).

There are now three different pirq mappings:

- original
0x5c + (pirq-1)

- alan's original
0x5c + (pirq^1)

(This one is provably broken, since there is no way to access
the high nibble of 0x5c at all, since a pirq=0 would never be
set at all)

- alan's current
0x5c + ((pirq-1)^1)

I don't have any good "dump_pirq" dumps from Cyrix chips, so it's hard
to get better guesses. People with Cyrix routers should probably send me
(and cc Jeff Garzik) the output from dump_pirq _and_ the output from
"lspci -vxxx ; cat /proc/interrupts" (the latter so that the actual
mappings and the router entries are visible).

Linus

--- dump_pirq ---
#!/usr/bin/perl
#
# dump_pirq 1.20 2000/12/19 19:19:52
#
# A utility to parse the BIOS PCI IRQ Routing Table
#
# Copyright (C) 2000 David A. Hinds -- [email protected]
#

#-----------------------------------------------------------------------

sub dev {
my($devfn) = @_;
sprintf "%02x.%d", ($devfn>>3), ($devfn&7);
}

sub print_mask
{
my($mask) = @_;
printf "0x%04x [", $mask;
for (my $i = 0; $i < 16; $i++) {
next if (!($mask & (1<<$i)));
$mask &= ~(1<<$i);
print (($mask) ? "$i," : "$i");
}
print "]\n";
}

sub row {
my($tag, $link, $mask) = @_;
if ($link != 0) {
printf " INT$tag: link 0x%02x, irq mask ", $link;
print_mask($mask);
}
}

sub class_of
{
my($slot) = @_;
open(IN, "/sbin/lspci -s $slot |");
$_ = <IN>;
close(IN);
return (/^....... ([^:]+):/) ? $1 : "";
}

sub parse_pirq
{
my($buf) = @_;

my($p) = index($buf, "\$PIR");
my($minor,$major,$size,$rbus,$rdev,$mask,$cvd,$mini) =
unpack "CCSCCSLL", substr($buf, $p+4, 16);

printf "Interrupt routing table found at address 0xf%04x:\n", $p;
printf " Version $major.$minor, size 0x%04x\n", $size;
printf " Interrupt router is device %02x:%s\n", $rbus, dev($rdev);
print " PCI exclusive interrupt mask: ";
print_mask($mask);
if ($cvd) {
printf(" Compatible router: vendor 0x%04x device 0x%04x\n",
($cvd & 0xffff), ($cvd >> 16));
}

$ofs = 32;
while ($ofs < $size) {
# Parse a table entry describing a single PCI device
($bus, $devfn, $la, $ma, $lb, $mb, $lc, $mc, $ld, $md, $slot) =
unpack "CCCSCSCSCSC", substr($buf, $p+$ofs, 15);
$s = sprintf "%02x:%s", $bus, dev($devfn);
printf "\nDevice $s (slot $slot): %s\n", class_of($s);
row("A", $la, $ma); row("B", $lb, $mb);
row("C", $lc, $mc); row("D", $ld, $md);
push(@{$dev{$la}}, $s . "1");
push(@{$dev{$lb}}, $s . "2");
push(@{$dev{$lc}}, $s . "3");
push(@{$dev{$ld}}, $s . "4");
$ofs += 16;
}
return ($rbus, $rdev, $cvd);
}

#-----------------------------------------------------------------------

# The link values in the interrupt routing table are implementation
# dependent. Here, we'll try to interpret the link values for some
# known PCI bridge types.

%pIIx = (0x122e8086, "82371FB PIIX",
0x70008086, "82371SB PIIX3",
0x71108086, "82371AB PIIX4/PIIX4E",
0x71988086, "82443MX",
0x24108086, "82801AA ICH",
0x24208086, "82801AB ICH0",
0x24408086, "82801BA ICH2",
0x244c8086, "82801BAM ICH2-M");

%via = (0x05861106, "82C586",
0x05961106, "82C596",
0x06861106, "82C686");

%opti = (0xc7001045, "82C700");

%pico = (0x00021066, "PT86C523");

%ali = (0x153310b9, "Aladdin M1533");

%sis = (0x04961039, "85C496/497",
0x00081039, "85C503");

%cyrix = (0x01001078, "5530");

%all_routers = (%pIIx, %via, %opti, %pico, %ali, %sis, %cyrix);

sub outb
{
my($data,$port) = @_;
open(IO, ">/dev/port") || die;
sysseek(IO, $port, 0) || die;
my $x = pack "C", $data;
syswrite(IO, $x, 1);
close(IO);
}

sub inb
{
my($port) = @_;
my($data);
open(IO, "/dev/port") || die;
sysseek(IO, $port, 0) || die;
sysread(IO, $data, 1);
close(IO);
return unpack "C", $data;
}

sub dump_router
{
my($rbus, $rdev, $cvd) = @_;
my($buf, @p, $i, $irq);

printf "\nInterrupt router at %02x:%s: ", $rbus, dev($rdev);
$rf = sprintf "/proc/bus/pci/%02x/%s", $rbus, dev($rdev);
open(IN, $rf);
if (sysread(IN, $buf, 0x100) != 0x100) {
print "\nCould not read router info from $rf.\n";
exit;
}
close(IN);
my $vd = unpack "L", substr($buf, 0, 4);

if ((defined $pIIx{$vd}) || (defined $pIIx{$cvd})) {

$name = (defined $pIIx{$vd}) ? $pIIx{$vd} : $pIIx{$cvd};
printf "Intel $name PCI-to-ISA bridge\n";
@p = unpack "CCCCC", substr($buf, 0x60, 5);
for ($i = 0; $i < 4; $i++) {
printf " PIRQ%d (link 0x%02x): ", $i+1, 0x60+$i;
print (($p[$i] < 16) ? "irq $p[$i]\n" : "unrouted\n");
}
print " Serial IRQ:";
print (($p[4] & 0x80) ? " [enabled]" : " [disabled]");
print (($p[4] & 0x40) ? " [continuous]" : " [quiet]");
print " [frame=", (($p[4] >> 2) & 15) + 17, "]";
print " [pulse=", (($p[4] & 3) * 4 + 4), "]\n";
print " Level mask: "; print_mask((inb(0x4d1)<<8) + inb(0x4d0));

} elsif ((defined $via{$vd}) || (defined $via{$cvd})) {

$name = (defined $via{$vd}) ? $via{$vd} : $via{$cvd};
printf "VIA $name PCI-to-ISA bridge\n";
$p = unpack "L", substr($buf, 0x55, 4);
%tag = (1, "A", 2, "B", 3, "C", 5, "D");
foreach $link (1,2,3,5) {
$irq = ($p >> ($link * 4)) & 15;
print " PIRQ$tag{$link} (link 0x0$link): ";
print ($irq ? "irq $irq\n" : "unrouted\n");
}

} elsif ((defined $opti{$vd}) || (defined $opti{$cvd})) {

$name = (defined $opti{$vd}) ? $opti{$vd} : $opti{$cvd};
printf "OPTi $name PCI-to-ISA bridge\n";
$p = unpack "S", substr($buf, 0xb8, 2);
for ($i = 0; $i < 4; $i++) {
$irq = ($p >> ($i * 4)) & 15;
printf " PCIRQ$i (link 0x%02x): ", ($i<<4)+0x02;
print ($irq ? "irq $irq\n" : "unrouted\n");
}

} elsif ((defined $pico{$vd} || defined $pico{$cvd})) {

$name = (defined $pico{$vd}) ? $pico{$vd} : $pico{$cvd};
printf "PicoPower $name PCI-to-ISA bridge\n";
outb(0x10, 0x24); $p = inb(0x26);
outb(0x11, 0x24); $p += inb(0x26)<<8;
@tag = ("A", "B", "C", "D");
for ($i = 0; $i < 4; $i++) {
$irq = ($p >> ($i * 4)) & 15;
print " INT$tag[$i] (link 0x0", $i+1, "): ";
print ($irq ? "irq $irq\n" : "unrouted\n");
}

} elsif ((defined $ali{$vd} || defined $ali{$cvd})) {

$name = (defined $ali{$vd}) ? $ali{$vd} : $ali{$cvd};
printf "AcerLabs $name PCI-to-ISA bridge\n";
$p = unpack "L", substr($buf, 0x48, 4);
# This mapping is insane!
@map = (0, 9, 3, 10, 4, 5, 7, 6, 1, 11, 0, 12, 0, 14, 0, 15);
for ($i = 0; $i < 8; $i++) {
$irq = ($p >> ($i*4)) & 15;
print " INT", $i+1, " (link ", $i+1, "): ";
print ($map[$irq] ? "irq $map[$irq]\n" : "unrouted\n");
}
$s = unpack "C", substr($buf, 0x70, 1);
print " Serial IRQ:";
print (($s & 0x80) ? " [enabled]" : " [disabled]");
print (($s & 0x40) ? " [continuous]" : " [quiet]");
print " [frame=", (($s >> 2) & 15) + 17, "]";
print " [pulse=", (($s & 3) * 4 + 4), "]\n";

} elsif ((defined $sis{$vd}) || (defined $sis{$cvd})) {

$name = (defined $sis{$vd}) ? $sis{$vd} : $sis{$cvd};
printf "SiS $name PCI-to-ISA bridge\n";
$base = ($name eq "85C496/497") ? 0xc0 : 0x41;
@p = unpack "CCCC", substr($buf, $base, 4);
@tag = ("A", "B", "C", "D");
for ($i = 0; $i < 4; $i++) {
$irq = ($p[$i] & 0x80) ? 0 : ($p[$i] & 0x0f);
printf " INT$tag[$i] (link 0x%02x): ", $i+$base;
print ($irq ? "irq $irq\n" : "unrouted\n");
}

} elsif ((defined $cyrix{$vd}) || (defined $cyrix{$cvd})) {

$name = (defined $cyrix{$vd}) ? $cyrix{$vd} : $cyrix{$cvd};
printf "CYRIX $name PCI-to-ISA bridge\n";
$p = unpack "S", substr($buf, 0x5c, 2);
%tag = ("A", "B", "C", "D");
for ($i = 0; $i < 4; $i++) {
$irq = ($p >> ($i * 4)) & 15;
printf " PIRQ$tag{$i} (link 0x%02x): ", $i+1;
print ($irq ? "irq $irq\n" : "unrouted\n");
}

} else {

printf("unknown vendor 0x%04x device 0x%04x\n",
($vd & 0xffff), ($vd >> 16));
foreach $k (sort keys %dev) {
next if ($k == 0);
printf " PIRQ? (link 0x%02x): ", $k;
$irq = 0;
foreach $d (@{$dev{$k}}) {
$d =~ /(..):(..)\..(.)/;
($bus,$dev,$pin) = ($1,$2,$3);
for ($fn = 0; $fn < 8; $fn++) {
open(IN, "/proc/bus/pci/$bus/$dev.$fn") || last;
sysread(IN, $buf, 0x100);
close(IN);
($i,$p) = unpack "CC", substr($buf, 0x3c, 2);
$irq = $i if (($p == $pin) && $i && ($i != 255));
}
}
print ($irq ? "irq $irq\n" : "unrouted?\n");
}
}

}

#-----------------------------------------------------------------------

# Grab the BIOS from 0xf0000-0xfffff
open(IN, "/dev/mem") || die "cannot open /dev/mem\n";
sysseek(IN, 0xf0000, 0) || die;
die if (sysread(IN, $buf, 0x10000) != 0x10000);
close(IN);

if (index($buf, "\$PIR") >= 0) {

# Dump the PIRQ table, and the router information
($rbus, $rdev, $cvd) = parse_pirq($buf);
dump_router($rbus, $rdev, $cvd);

} else {

# Scan for any interrupt router device we recognize
print "No PCI interrupt routing table was found.\n";
open(DEV, "/proc/bus/pci/devices");
while (<DEV>) {
($rbus,$rdev,$vd) = /^(..)(..)\s+(........)/;
$rbus = hex($rbus); $rdev = hex($rdev); $vd = hex($vd);
$vd = (($vd & 0xffff0000) >> 16) | (($vd & 0xffff) << 16);
if (defined $all_routers{$vd}) {
dump_router($rbus, $rdev, $vd);
$nr++;
}
}
print "\nNo known PCI interrupt routers were found.\n" if (!$nr);

}

2002-07-04 08:46:32

by Rob van Nieuwkerk

[permalink] [raw]
Subject: Re: Cyrix IRQ routing is wrong?


Hi,

Linus wrote:
> I don't have any good "dump_pirq" dumps from Cyrix chips, so it's hard
> to get better guesses. People with Cyrix routers should probably send me
> (and cc Jeff Garzik) the output from dump_pirq _and_ the output from
> "lspci -vxxx ; cat /proc/interrupts" (the latter so that the actual
> mappings and the router entries are visible).

I just fell in the middle of this thread and don't exactly know what it's
all about. but I do have a Geode base board available. So here is my
info. Please contact me if you want to know more !

Greetings,
Rob van Nieuwkerk

PS: anyone else seeing screen corruption in console/text mode with these
boards ? (some chracters from before a screen update stay on the screen).


board:
------
Axiom Technology, SBC84510VEE, 3.5" Capa board, 300 MHz Geode


kernel:
-------
standard RH 7.3 update (2.4.18-5)


maybe relevant boot messages:
-----------------------------
Jul 4 10:03:35 ravel kernel: 8139too Fast Ethernet driver 0.9.24
Jul 4 10:03:35 ravel kernel: PCI: Found IRQ 11 for device 00:0e.0
Jul 4 10:03:35 ravel kernel: IRQ routing conflict for 00:0e.0, have irq 10, want irq 11
Jul 4 10:03:35 ravel kernel: eth0: RealTek RTL8139 Fast Ethernet at 0xc4869000, 00:60:e0:01:98:00, IRQ 10
Jul 4 10:03:35 ravel kernel: PCI: Assigned IRQ 5 for device 00:0f.0
Jul 4 10:03:35 ravel kernel: eth1: RealTek RTL8139 Fast Ethernet at 0xc486b000, 00:60:e0:01:97:ff, IRQ 5


dump_pirq output:
-----------------
Interrupt routing table found at address 0xfd9e0:
Version 1.0, size 0x0050
Interrupt router is device 00:12.0
PCI exclusive interrupt mask: 0x0c20 [5,10,11]
Compatible router: vendor 0x1078 device 0x0002

Device 00:0e.0 (slot 1): Ethernet controller
INTA: link 0x02, irq mask 0xdeb8 [3,4,5,7,9,10,11,12,14,15]
INTB: link 0x03, irq mask 0xdeb8 [3,4,5,7,9,10,11,12,14,15]
INTC: link 0x04, irq mask 0xdeb8 [3,4,5,7,9,10,11,12,14,15]
INTD: link 0x01, irq mask 0xdeb8 [3,4,5,7,9,10,11,12,14,15]

Device 00:0f.0 (slot 2): Ethernet controller
INTA: link 0x03, irq mask 0xdeb8 [3,4,5,7,9,10,11,12,14,15]
INTB: link 0x04, irq mask 0xdeb8 [3,4,5,7,9,10,11,12,14,15]
INTC: link 0x01, irq mask 0xdeb8 [3,4,5,7,9,10,11,12,14,15]
INTD: link 0x02, irq mask 0xdeb8 [3,4,5,7,9,10,11,12,14,15]

Device 00:13.0 (slot 0): USB Controller
INTA: link 0x01, irq mask 0xdeb8 [3,4,5,7,9,10,11,12,14,15]

Interrupt router at 00:12.0: CYRIX 5530 PCI-to-ISA bridge
PIRQ (link 0x01): irq 11
PIRQ (link 0x02): irq 10
PIRQ (link 0x03): irq 5
PIRQ (link 0x04): irq 5


cat /proc/cpuinfo:
------------------
processor : 0
vendor_id : CyrixInstead
cpu family : 5
model : 9
model name : Geode(TM) Integrated Processor by National Semi
stepping : 1
cpu MHz : 300.681
cache size : 16 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 2
wp : yes
flags : fpu tsc msr cx8 cmov mmx cxmmx
bogomips : 599.65


cat /proc/interrupts:
---------------------
CPU0
0: 239687 XT-PIC timer
1: 2 XT-PIC keyboard
2: 0 XT-PIC cascade
8: 1 XT-PIC rtc
10: 4651 XT-PIC eth0
11: 347 XT-PIC usb-ohci
14: 19932 XT-PIC ide0
NMI: 0
ERR: 0


lspci -vxxx:
------------
00:00.0 Host bridge: Cyrix Corporation PCI Master
Flags: bus master, medium devsel, latency 0
00: 78 10 01 00 07 00 80 02 00 00 00 06 00 00 00 00
10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
40: 1e 14 00 c1 00 00 00 00 00 00 00 00 00 00 00 00
50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

00:0e.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C (rev 10)
Subsystem: Realtek Semiconductor Co., Ltd. RT8139
Flags: bus master, medium devsel, latency 32, IRQ 10
I/O ports at e000 [size=256]
Memory at d1000000 (32-bit, non-prefetchable) [size=256]
Expansion ROM at <unassigned> [disabled] [size=256K]
Capabilities: [50] Power Management version 2
Capabilities: [60] Vital Product Data
00: ec 10 39 81 07 00 90 02 10 00 00 02 00 20 00 00
10: 01 e0 00 00 00 00 00 d1 00 00 00 00 00 00 00 00
20: 00 00 00 00 00 00 00 00 00 00 00 00 ec 10 39 81
30: 00 00 00 00 50 00 00 00 00 00 00 00 0a 01 20 40
40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
50: 01 60 c2 f7 00 00 00 00 00 00 00 00 00 00 00 00
60: 03 00 ff ff ff fe ff ff 00 00 00 00 00 00 00 00
70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

00:0f.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C (rev 10)
Subsystem: Realtek Semiconductor Co., Ltd. RT8139
Flags: bus master, medium devsel, latency 32, IRQ 5
I/O ports at e400 [size=256]
Memory at d1001000 (32-bit, non-prefetchable) [size=256]
Capabilities: [50] Power Management version 2
00: ec 10 39 81 07 00 90 02 10 00 00 02 00 20 00 00
10: 01 e4 00 00 00 10 00 d1 00 00 00 00 00 00 00 00
20: 00 00 00 00 00 00 00 00 00 00 00 00 ec 10 39 81
30: 00 00 00 00 50 00 00 00 00 00 00 00 05 01 20 40
40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
50: 01 00 c2 f7 00 00 00 00 00 00 00 00 00 00 00 00
60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

00:12.0 ISA bridge: Cyrix Corporation 5530 Legacy [Kahlua] (rev 30)
Flags: bus master, medium devsel, latency 0
00: 78 10 00 01 1f 00 80 02 30 00 01 06 04 00 80 00
10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
40: 81 50 ce 45 01 00 00 00 00 00 00 00 00 00 00 00
50: 7b 10 e8 0b 00 00 00 00 00 00 03 08 ab 55 01 00
60: 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
80: 07 00 00 0e 00 00 00 00 00 00 01 08 00 00 01 00
90: 00 0c 10 f0 00 00 00 00 04 00 04 00 04 00 02 00
a0: 00 00 00 00 00 00 00 00 00 00 00 00 04 00 00 00
b0: 00 00 00 00 0c 02 a2 08 40 07 12 0c 00 00 00 00
c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

00:12.1 Bridge: Cyrix Corporation 5530 SMI [Kahlua]
Flags: medium devsel
Memory at 40012000 (32-bit, non-prefetchable) [size=256]
00: 78 10 01 01 02 00 80 02 00 00 80 06 00 00 00 00
10: 00 20 01 40 00 00 00 00 00 00 00 00 00 00 00 00
20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
50: 7b 10 e8 0b 00 00 00 00 00 00 03 08 ab 55 01 00
60: 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
80: 07 00 00 0e 00 00 00 00 00 00 01 08 00 00 01 00
90: 00 0c 10 f0 00 00 00 00 04 00 04 00 04 00 02 00
a0: 00 00 00 00 00 00 00 00 00 00 00 00 04 00 00 00
b0: 00 00 00 00 0c 02 a2 08 00 01 2e 0c 00 00 00 00
c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

00:12.2 IDE interface: Cyrix Corporation 5530 IDE [Kahlua] (prog-if 80 [Master])
Flags: bus master, medium devsel, latency 0
I/O ports at f000 [size=16]
00: 78 10 02 01 05 00 80 02 00 80 01 01 00 00 00 00
10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
20: 01 f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00
30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
50: 7b 10 e8 0b 00 00 00 00 00 00 03 08 ab 55 01 00
60: 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
80: 07 00 00 0e 00 00 00 00 00 00 01 08 00 00 01 00
90: 00 0c 10 f0 00 00 00 00 04 00 04 00 04 00 02 00
a0: 00 00 00 00 00 00 00 00 00 00 00 00 04 00 00 00
b0: 00 00 00 00 0c 02 a2 08 ef 04 9c 0c 00 00 00 00
c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

00:12.3 Multimedia audio controller: Cyrix Corporation 5530 Audio [Kahlua]
Flags: bus master, medium devsel, latency 0
Memory at 40011000 (32-bit, non-prefetchable) [size=128]
00: 78 10 03 01 06 00 80 02 00 00 01 04 00 00 00 00
10: 00 10 01 40 00 00 00 00 00 00 00 00 00 00 00 00
20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
50: 7b 10 e8 0b 00 00 00 00 00 00 03 08 ab 55 01 00
60: 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
80: 07 00 00 0e 00 00 00 00 00 00 01 08 00 00 01 00
90: 00 0c 10 f0 00 00 00 00 04 00 04 00 04 00 02 00
a0: 00 00 00 00 00 00 00 00 00 00 00 00 04 00 00 00
b0: 00 00 00 00 0c 02 a2 08 43 20 b0 0c 00 00 00 00
c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

00:12.4 VGA compatible controller: Cyrix Corporation 5530 Video [Kahlua] (prog-if 00 [VGA])
Subsystem: Cyrix Corporation: Unknown device 0001
Flags: medium devsel
Memory at 40800000 (32-bit, non-prefetchable) [size=8M]
00: 78 10 04 01 03 00 80 02 00 00 00 03 00 00 80 02
10: 00 00 80 40 00 00 00 00 00 00 00 00 00 00 00 00
20: 00 00 00 00 00 00 00 00 00 00 00 00 78 10 01 00
30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
40: 00 00 00 00 00 00 00 00 00 00 00 00 00 03 00 00
50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

00:13.0 USB Controller: Compaq Computer Corporation ZFMicro Chipset USB (rev 06) (prog-if 10 [OHCI])
Subsystem: Compaq Computer Corporation ZFMicro Chipset USB
Flags: bus master, medium devsel, latency 32, IRQ 11
Memory at d1005000 (32-bit, non-prefetchable) [size=4K]
00: 11 0e f8 a0 07 00 80 02 06 10 03 0c 08 20 00 00
10: 00 50 00 d1 00 00 00 00 00 00 00 00 00 00 00 00
20: 00 00 00 00 00 00 00 00 00 00 00 00 11 0e f8 a0
30: 00 00 00 00 00 00 00 00 00 00 00 00 0b 01 00 50
40: 00 00 0f 00 00 00 00 00 00 00 00 00 00 00 00 00
50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

2002-07-05 14:09:59

by Alan Cox

[permalink] [raw]
Subject: Re: Cyrix IRQ routing is wrong?

> 1) 2.4.17 was using the code I want to restore. Where was your hanging
> box then?

Hanging. Thats why I fixed it when Nat Semi documentation for the old cyrix
appeared

2002-07-05 14:46:48

by Christer Weinigel

[permalink] [raw]
Subject: Re: Cyrix IRQ routing is wrong?

Alan Cox <alan@http://www.linux.org.uk> writes:

> > 1) 2.4.17 was using the code I want to restore. Where was your hanging
> > box then?
>
> Hanging. Thats why I fixed it when Nat Semi documentation for the old cyrix
> appeared

So your BIOS probably has a buggy PIRQ table.

>From page 155 of the CS5530 manual found at:

http://www.national.com/ds/CS/CS5530.pdf

Index 5Ch PCI Interrupt Steering Register 1 (R/W) Reset Value = 00h

7:4 INTB# Target Interrupt: Selects target interrupt for INTB#
3:0 INTA# Target Interrupt: Selects target interrupt for INTA#

Index 5Dh PCI Interrupt Steering Register 2 (R/W) Reset Value = 00h
7:4 INTD# Target Interrupt: Selects target interrupt for INTD#
3:0 INTC# Target Interrupt: Selects target interrupt for INTC#

So I have to switch that code around on most GX1 boards that I use or
I'll get a lot of messages about IRQ routing conflicts.

/Christer

--
"Just how much can I get away with and still go to heaven?"

2002-07-05 14:59:55

by Christer Weinigel

[permalink] [raw]
Subject: Re: Cyrix IRQ routing is wrong?

Rob van Nieuwkerk <[email protected]> writes:
> PS: anyone else seeing screen corruption in console/text mode with these
> boards ? (some chracters from before a screen update stay on the screen).
>
> board:
> ------
> Axiom Technology, SBC84510VEE, 3.5" Capa board, 300 MHz Geode

The Geode doesn't really have a text mode, VGA is simulated in SMI
mode by the "VSA BIOS", which is more or less buggy depending on what
exact BIOS revision you are using. In text mode, each byte written to
the screen will result in a SMI interrupt that then draws into the
real hardware frame buffer.

My suggestion is to never ever use the text mode on a Geode platform
and instead use the VESA framebuffer to seleect a framebuffer mode
that is directly supported by the hardware. That way mode, only
modifications of the resolution or the palette will result in SMI
interrupts and that code does not seem to be as buggy as the text mode
emulation.

/Christer

--
"Just how much can I get away with and still go to heaven?"

2002-07-05 20:40:42

by Alan Cox

[permalink] [raw]
Subject: Re: Cyrix IRQ routing is wrong?

> So I have to switch that code around on most GX1 boards that I use or
> I'll get a lot of messages about IRQ routing conflicts.

I've tested multiple boards too - what BIOS are yours ?

2002-07-05 21:04:09

by Alan

[permalink] [raw]
Subject: Re: Cyrix IRQ routing is wrong?

> My suggestion is to never ever use the text mode on a Geode platform
> and instead use the VESA framebuffer to seleect a framebuffer mode
> that is directly supported by the hardware. That way mode, only
> modifications of the resolution or the palette will result in SMI
> interrupts and that code does not seem to be as buggy as the text mode
> emulation.

Also to note - performance in both modes is actually about the same so
you might as well enjoy the penguins. Do check for BIOS updates too
the fact its SMI code and the thing is mostly smoke and mirrors (or
just smoke if the fan fails) does mean bios stuff fixes apparent hardware
problems

2002-07-05 21:11:17

by Pavel Roskin

[permalink] [raw]
Subject: Re: Cyrix IRQ routing is wrong?

Hi, Alan!

On Fri, 5 Jul 2002, Alan Cox wrote:

> > So I have to switch that code around on most GX1 boards that I use or
> > I'll get a lot of messages about IRQ routing conflicts.
>
> I've tested multiple boards too - what BIOS are yours ?

I'm not Christer, but I'll reply :-)
These are some strings extracted from the BIOS for EM-350A:

Award Modular BIOS v4.51PG
EM-350A Ver.B 11-21-2000
11/21/2000-GXm-Cx5530-2A434L7JC-00

Attached is a tarball with /proc/interrupts, output of "lspci -vxxx" and
dump_irq, all taken on EM-350A.

The brigde is 5530. i.e. the one that is documented in
http://www.national.com/ds/CS/CS5530.pdf

I also checked http://www.national.com/ds/CS/CS5530A.pdf, and it also says
that INTA is controlled by the bits 0:3 of the register 0x5c.

--
Regards,
Pavel Roskin


Attachments:
em-350a.tar.gz (1.88 kB)