Skip to content

Commit 78ee5b3

Browse files
3x380VJeff Garzik
authored andcommitted
Add support for Seeq 8003 on Challenge S Mezz board.
Thanks to Jö Fahlke for donating hardware. Signed-off-by: Ladislav Michl <[email protected]> Forward porting of Ladis' 2.4 patch. Signed-off-by: Ralf Baechle <[email protected]> Signed-off-by: Jeff Garzik <[email protected]>
1 parent 18604c5 commit 78ee5b3

File tree

1 file changed

+25
-3
lines changed

1 file changed

+25
-3
lines changed

drivers/net/sgiseeq.c

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ static inline void setup_rx_ring(struct sgiseeq_rx_desc *buf, int nbufs)
624624

625625
#define ALIGNED(x) ((((unsigned long)(x)) + 0xf) & ~(0xf))
626626

627-
static int sgiseeq_init(struct hpc3_regs* hpcregs, int irq)
627+
static int sgiseeq_init(struct hpc3_regs* hpcregs, int irq, int has_eeprom)
628628
{
629629
struct sgiseeq_init_block *sr;
630630
struct sgiseeq_private *sp;
@@ -650,7 +650,9 @@ static int sgiseeq_init(struct hpc3_regs* hpcregs, int irq)
650650

651651
#define EADDR_NVOFS 250
652652
for (i = 0; i < 3; i++) {
653-
unsigned short tmp = ip22_nvram_read(EADDR_NVOFS / 2 + i);
653+
unsigned short tmp = has_eeprom ?
654+
ip22_eeprom_read(&hpcregs->eeprom, EADDR_NVOFS / 2+i) :
655+
ip22_nvram_read(EADDR_NVOFS / 2+i);
654656

655657
dev->dev_addr[2 * i] = tmp >> 8;
656658
dev->dev_addr[2 * i + 1] = tmp & 0xff;
@@ -678,6 +680,11 @@ static int sgiseeq_init(struct hpc3_regs* hpcregs, int irq)
678680
setup_rx_ring(sp->rx_desc, SEEQ_RX_BUFFERS);
679681
setup_tx_ring(sp->tx_desc, SEEQ_TX_BUFFERS);
680682

683+
/* Setup PIO and DMA transfer timing */
684+
sp->hregs->pconfig = 0x161;
685+
sp->hregs->dconfig = HPC3_EDCFG_FIRQ | HPC3_EDCFG_FEOP |
686+
HPC3_EDCFG_FRXDC | HPC3_EDCFG_PTO | 0x026;
687+
681688
/* Setup PIO and DMA transfer timing */
682689
sp->hregs->pconfig = 0x161;
683690
sp->hregs->dconfig = HPC3_EDCFG_FIRQ | HPC3_EDCFG_FEOP |
@@ -729,8 +736,23 @@ static int sgiseeq_init(struct hpc3_regs* hpcregs, int irq)
729736

730737
static int __init sgiseeq_probe(void)
731738
{
739+
unsigned int tmp, ret1, ret2 = 0;
740+
732741
/* On board adapter on 1st HPC is always present */
733-
return sgiseeq_init(hpc3c0, SGI_ENET_IRQ);
742+
ret1 = sgiseeq_init(hpc3c0, SGI_ENET_IRQ, 0);
743+
/* Let's see if second HPC is there */
744+
if (!(ip22_is_fullhouse()) &&
745+
get_dbe(tmp, (unsigned int *)&hpc3c1->pbdma[1]) == 0) {
746+
sgimc->giopar |= SGIMC_GIOPAR_MASTEREXP1 |
747+
SGIMC_GIOPAR_EXP164 |
748+
SGIMC_GIOPAR_HPC264;
749+
hpc3c1->pbus_piocfg[0][0] = 0x3ffff;
750+
/* interrupt/config register on Challenge S Mezz board */
751+
hpc3c1->pbus_extregs[0][0] = 0x30;
752+
ret2 = sgiseeq_init(hpc3c1, SGI_GIO_0_IRQ, 1);
753+
}
754+
755+
return (ret1 & ret2) ? ret1 : 0;
734756
}
735757

736758
static void __exit sgiseeq_exit(void)

0 commit comments

Comments
 (0)