1 /**************************************************************************
2 Etherboot - BOOTP/TFTP Bootstrap Program
3 Prism2 NIC driver for Etherboot
6 Written by Michael Brown of Fen Systems Ltd
8 ***************************************************************************/
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License as
13 * published by the Free Software Foundation; either version 2, or (at
14 * your option) any later version.
17 #define WLAN_HOSTIF WLAN_PLX
20 static struct pci_id prism2_plx_nics[] = {
21 PCI_ROM(0x1385, 0x4100, "ma301", "Netgear MA301"),
22 PCI_ROM(0x10b7, 0x7770, "3c-airconnect", "3Com AirConnect"),
23 PCI_ROM(0x111a, 0x1023, "ss1023", "Siemens SpeedStream SS1023"),
24 PCI_ROM(0x15e8, 0x0130, "correga", "Correga"),
25 PCI_ROM(0x1638, 0x1100, "smc2602w", "SMC EZConnect SMC2602W"), /* or Eumitcom PCI WL11000, Addtron AWA-100 */
26 PCI_ROM(0x16ab, 0x1100, "gl24110p", "Global Sun Tech GL24110P"),
27 PCI_ROM(0x16ab, 0x1101, "16ab-1101", "Unknown"),
28 PCI_ROM(0x16ab, 0x1102, "wdt11", "Linksys WDT11"),
29 PCI_ROM(0x16ec, 0x3685, "usr2415", "USR 2415"),
30 PCI_ROM(0xec80, 0xec00, "f5d6000", "Belkin F5D6000"),
31 PCI_ROM(0x126c, 0x8030, "emobility", "Nortel emobility"),
34 static struct pci_driver prism2_plx_driver =
35 PCI_DRIVER ( "Prism2_PLX", prism2_plx_nics, PCI_NO_CLASS );
38 * Find PLX card. Prints out information strings from PCMCIA CIS as visual
39 * confirmation of presence of card.
42 * hw device structure to be filled in
43 * p PCI device structure
48 static int prism2_find_plx ( hfa384x_t *hw, struct pci_device *p )
51 uint32_t plx_lcr = 0; /* PLX9052 Local Configuration Register Base (I/O) */
52 uint32_t attr_mem = 0; /* Prism2 Attribute Memory Base */
53 uint32_t iobase = 0; /* Prism2 I/O Base */
54 unsigned char *cis_tpl = NULL;
55 unsigned char *cis_string;
57 /* Obtain all memory and IO base addresses */
58 pci_read_config_dword( p, PLX_LOCAL_CONFIG_REGISTER_BASE, &plx_lcr);
59 plx_lcr &= PCI_BASE_ADDRESS_IO_MASK;
60 pci_read_config_dword( p, PRISM2_PLX_ATTR_MEM_BASE, &attr_mem);
61 pci_read_config_dword( p, PRISM2_PLX_IO_BASE, &iobase);
62 iobase &= PCI_BASE_ADDRESS_IO_MASK;
64 /* Fill out hw structure */
65 hw->membase = attr_mem;
67 printf ( "PLX9052 has local config registers at %#hx\n", plx_lcr );
68 printf ( "Prism2 has attribute memory at %#x and I/O base at %#hx\n", attr_mem, iobase );
70 /* Search for CIS strings */
71 printf ( "Searching for PCMCIA card...\n" );
72 cis_tpl = bus_to_virt(attr_mem);
73 while ( *cis_tpl != CISTPL_END ) {
74 if ( *cis_tpl == CISTPL_VERS_1 ) {
75 /* CISTPL_VERS_1 contains some nice text strings */
76 printf ( "...found " );
78 cis_string = cis_tpl + CISTPL_VERS_1_STR_OFF;
79 while ( ! ( ( *cis_string == 0 ) && ( *(cis_string+CIS_STEP) == 0 ) ) ) {
80 printf ( "%c", *cis_string == 0 ? ' ' : *cis_string );
81 cis_string += CIS_STEP;
85 /* printf ( "CIS tuple type %#hhx, length %#hhx\n", *cis_tpl, *(cis_tpl+CISTPL_LEN_OFF) ); */
86 cis_tpl += CISTPL_HEADER_LEN + CIS_STEP * ( *(cis_tpl+CISTPL_LEN_OFF) );
89 printf ( "...nothing found\n" );
91 ((unsigned char *)bus_to_virt(attr_mem))[COR_OFFSET] = COR_VALUE; /* Write COR to enable PC card */
95 static int prism2_plx_probe ( struct dev *dev ) {
96 struct nic *nic = nic_device ( dev );
97 struct pci_device *pci = pci_device ( dev );
98 hfa384x_t *hw = &hw_global;
100 if ( ! find_pci_device ( pci, &prism2_plx_driver ) )
103 /* Find and intialise PLX Prism2 card */
104 if ( ! prism2_find_plx ( hw, pci ) ) return 0;
105 nic->ioaddr = hw->iobase;
107 return prism2_probe ( nic, hw );
110 BOOT_DRIVER ( "Prism2_PLX", prism2_plx_probe );