1 diff -Nur linux-2.6.12.5/arch/mips/Kconfig linux-2.6.12.5-brcm/arch/mips/Kconfig
2 --- linux-2.6.12.5/arch/mips/Kconfig 2005-08-15 02:20:18.000000000 +0200
3 +++ linux-2.6.12.5-brcm/arch/mips/Kconfig 2005-08-28 16:21:04.700803432 +0200
5 Members include the Acer PICA, MIPS Magnum 4000, MIPS Millenium and
6 Olivetti M700-10 workstations.
9 + bool "Support for BCM947xx based boards"
10 + select DMA_NONCOHERENT
13 + select CPU_LITTLE_ENDIAN
15 + Support for BCM947xx based boards
18 bool "Support for Acer PICA 1 chipset (EXPERIMENTAL)"
19 depends on MACH_JAZZ && EXPERIMENTAL
22 config CPU_LITTLE_ENDIAN
23 bool "Generate little endian code"
24 - default y if ACER_PICA_61 || CASIO_E55 || DDB5074 || DDB5476 || DDB5477 || MACH_DECSTATION || IBM_WORKPAD || LASAT || MIPS_COBALT || MIPS_ITE8172 || MIPS_IVR || SOC_AU1X00 || NEC_OSPREY || OLIVETTI_M700 || SNI_RM200_PCI || VICTOR_MPC30X || ZAO_CAPCELLA
25 + default y if ACER_PICA_61 || CASIO_E55 || DDB5074 || DDB5476 || DDB5477 || MACH_DECSTATION || IBM_WORKPAD || LASAT || MIPS_COBALT || MIPS_ITE8172 || MIPS_IVR || SOC_AU1X00 || NEC_OSPREY || OLIVETTI_M700 || SNI_RM200_PCI || VICTOR_MPC30X || ZAO_CAPCELLA || BCM47XX
26 default n if MIPS_EV64120 || MIPS_EV96100 || MOMENCO_OCELOT || MOMENCO_OCELOT_G || SGI_IP22 || SGI_IP27 || SGI_IP32 || TOSHIBA_JMR3927
28 Some MIPS machines can be configured for either little or big endian
29 diff -Nur linux-2.6.12.5/arch/mips/Kconfig.orig linux-2.6.12.5-brcm/arch/mips/Kconfig.orig
30 --- linux-2.6.12.5/arch/mips/Kconfig.orig 1970-01-01 01:00:00.000000000 +0100
31 +++ linux-2.6.12.5-brcm/arch/mips/Kconfig.orig 2005-08-15 02:20:18.000000000 +0200
36 + # Horrible source of confusion. Die, die, die ...
40 + bool "64-bit kernel"
42 + Select this option if you want to build a 64-bit kernel. You should
43 + only select this option if you have hardware that actually has a
44 + 64-bit processor and if your application will actually benefit from
45 + 64-bit processing, otherwise say N. You must say Y for kernels for
46 + SGI IP27 (Origin 200 and 2000) and SGI IP32 (O2). If in doubt say N.
53 + depends on MIPS64 = 'n'
56 +mainmenu "Linux/MIPS Kernel Configuration"
58 +source "init/Kconfig"
60 +menu "Machine selection"
63 + bool "Support for the Jazz family of machines"
66 + select GENERIC_ISA_DMA
70 + This a family of machines based on the MIPS R4030 chipset which was
71 + used by several vendors to build RISC/os and Windows NT workstations.
72 + Members include the Acer PICA, MIPS Magnum 4000, MIPS Millenium and
73 + Olivetti M700-10 workstations.
76 + bool "Support for Acer PICA 1 chipset (EXPERIMENTAL)"
77 + depends on MACH_JAZZ && EXPERIMENTAL
78 + select DMA_NONCOHERENT
80 + This is a machine with a R4400 133/150 MHz CPU. To compile a Linux
81 + kernel that runs on these, say Y here. For details about Linux on
82 + the MIPS architecture, check out the Linux/MIPS FAQ on the WWW at
83 + <http://www.linux-mips.org/>.
85 +config MIPS_MAGNUM_4000
86 + bool "Support for MIPS Magnum 4000"
87 + depends on MACH_JAZZ
88 + select DMA_NONCOHERENT
90 + This is a machine with a R4000 100 MHz CPU. To compile a Linux
91 + kernel that runs on these, say Y here. For details about Linux on
92 + the MIPS architecture, check out the Linux/MIPS FAQ on the WWW at
93 + <http://www.linux-mips.org/>.
96 + bool "Support for Olivetti M700-10"
97 + depends on MACH_JAZZ
98 + select DMA_NONCOHERENT
100 + This is a machine with a R4000 100 MHz CPU. To compile a Linux
101 + kernel that runs on these, say Y here. For details about Linux on
102 + the MIPS architecture, check out the Linux/MIPS FAQ on the WWW at
103 + <http://www.linux-mips.org/>.
106 + bool "Support for NEC VR41XX-based machines"
108 +config NEC_CMBVR4133
109 + bool "Support for NEC CMB-VR4133"
110 + depends on MACH_VR41XX
112 + select DMA_NONCOHERENT
118 + bool "Support for Rockhopper baseboard"
119 + depends on NEC_CMBVR4133
121 + select HAVE_STD_PC_SERIAL_PORT
124 + bool "Support for CASIO CASSIOPEIA E-10/15/55/65"
125 + depends on MACH_VR41XX
126 + select DMA_NONCOHERENT
131 + bool "Support for IBM WorkPad z50"
132 + depends on MACH_VR41XX
133 + select DMA_NONCOHERENT
137 +config TANBAC_TB0226
138 + bool "Support for TANBAC TB0226 (Mbase)"
139 + depends on MACH_VR41XX
140 + select DMA_NONCOHERENT
144 + The TANBAC TB0226 (Mbase) is a MIPS-based platform manufactured by TANBAC.
145 + Please refer to <http://www.tanbac.co.jp/> about Mbase.
147 +config TANBAC_TB0229
148 + bool "Support for TANBAC TB0229 (VR4131DIMM)"
149 + depends on MACH_VR41XX
150 + select DMA_NONCOHERENT
154 + The TANBAC TB0229 (VR4131DIMM) is a MIPS-based platform manufactured by TANBAC.
155 + Please refer to <http://www.tanbac.co.jp/> about VR4131DIMM.
157 +config VICTOR_MPC30X
158 + bool "Support for Victor MP-C303/304"
159 + select DMA_NONCOHERENT
162 + depends on MACH_VR41XX
165 + bool "Support for ZAO Networks Capcella"
166 + depends on MACH_VR41XX
167 + select DMA_NONCOHERENT
172 + bool "Add PCI control unit support of NEC VR4100 series"
173 + depends on MACH_VR41XX && PCI
176 + tristate "Add NEC VRC4171 companion chip support"
177 + depends on MACH_VR41XX && ISA
179 + The NEC VRC4171/4171A is a companion chip for NEC VR4111/VR4121.
182 + tristate "Add NEC VRC4173 companion chip support"
183 + depends on MACH_VR41XX && PCI_VR41XX
185 + The NEC VRC4173 is a companion chip for NEC VR4122/VR4131.
187 +config TOSHIBA_JMR3927
188 + bool "Support for Toshiba JMR-TX3927 board"
190 + select DMA_NONCOHERENT
192 + select SWAP_IO_SPACE
195 + bool "Support for Cobalt Server (EXPERIMENTAL)"
196 + depends on EXPERIMENTAL
197 + select DMA_NONCOHERENT
202 +config MACH_DECSTATION
203 + bool "Support for DECstations"
205 + select DMA_NONCOHERENT
207 + depends on MIPS32 || EXPERIMENTAL
209 + This enables support for DEC's MIPS based workstations. For details
210 + see the Linux/MIPS FAQ on <http://www.linux-mips.org/> and the
211 + DECstation porting pages on <http://decstation.unix-ag.org/>.
213 + If you have one of the following DECstation Models you definitely
214 + want to choose R4xx0 for the CPU Type:
217 + DECstation 5000/150
218 + DECstation 5000/260
221 + otherwise choose R3000.
224 + bool "Support for Galileo EV64120 Evaluation board (EXPERIMENTAL)"
225 + depends on EXPERIMENTAL
226 + select DMA_NONCOHERENT
228 + select MIPS_GT64120
230 + This is an evaluation board based on the Galileo GT-64120
231 + single-chip system controller that contains a MIPS R5000 compatible
232 + core running at 75/100MHz. Their website is located at
233 + <http://www.marvell.com/>. Say Y here if you wish to build a
234 + kernel for this platform.
237 + bool "Enable Second PCI (PCI1)"
238 + depends on MIPS_EV64120
241 + bool "Support for Galileo EV96100 Evaluation board (EXPERIMENTAL)"
242 + depends on EXPERIMENTAL
243 + select DMA_NONCOHERENT
246 + select MIPS_GT96100
247 + select RM7000_CPU_SCACHE
248 + select SWAP_IO_SPACE
250 + This is an evaluation board based on the Galileo GT-96100 LAN/WAN
251 + communications controllers containing a MIPS R5000 compatible core
252 + running at 83MHz. Their website is <http://www.marvell.com/>. Say Y
253 + here if you wish to build a kernel for this platform.
256 + bool "Support for Globespan IVR board"
257 + select DMA_NONCOHERENT
260 + This is an evaluation board built by Globespan to showcase thir
261 + iVR (Internet Video Recorder) design. It utilizes a QED RM5231
262 + R5000 MIPS core. More information can be found out their website
263 + located at <http://www.globespan.net/>. Say Y here if you wish to
264 + build a kernel for this platform.
267 + bool "Support for LASAT Networks platforms"
268 + select DMA_NONCOHERENT
270 + select MIPS_GT64120
271 + select R5000_CPU_SCACHE
274 + tristate "PICVUE LCD display driver"
278 + tristate "PICVUE LCD display driver /proc interface"
282 + bool "DS1603 RTC driver"
286 + bool "LASAT sysctl interface"
290 + bool "Support for ITE 8172G board"
291 + select DMA_NONCOHERENT
294 + Ths is an evaluation board made by ITE <http://www.ite.com.tw/>
295 + with ATX form factor that utilizes a MIPS R5000 to work with its
296 + ITE8172G companion internet appliance chip. The MIPS core can be
297 + either a NEC Vr5432 or QED RM5231. Say Y here if you wish to build
298 + a kernel for this platform.
301 + bool "Support for older IT8172 (Rev C)"
302 + depends on MIPS_ITE8172
304 + Say Y here to support the older, Revision C version of the Integrated
305 + Technology Express, Inc. ITE8172 SBC. Vendor page at
306 + <http://www.ite.com.tw/ia/brief_it8172bsp.htm>; picture of the
307 + board at <http://www.mvista.com/partners/semiconductor/ite.html>.
310 + bool "Support for MIPS Atlas board"
312 + select DMA_NONCOHERENT
314 + select MIPS_GT64120
315 + select SWAP_IO_SPACE
317 + This enables support for the QED R5231-based MIPS Atlas evaluation
321 + bool "Support for MIPS Malta board"
323 + select HAVE_STD_PC_SERIAL_PORT
324 + select DMA_NONCOHERENT
325 + select GENERIC_ISA_DMA
328 + select MIPS_GT64120
329 + select SWAP_IO_SPACE
331 + This enables support for the VR5000-based MIPS Malta evaluation
335 + bool "Support for MIPS SEAD board (EXPERIMENTAL)"
336 + depends on EXPERIMENTAL
338 + select DMA_NONCOHERENT
340 +config MOMENCO_OCELOT
341 + bool "Support for Momentum Ocelot board"
342 + select DMA_NONCOHERENT
345 + select IRQ_CPU_RM7K
346 + select MIPS_GT64120
347 + select RM7000_CPU_SCACHE
348 + select SWAP_IO_SPACE
350 + The Ocelot is a MIPS-based Single Board Computer (SBC) made by
351 + Momentum Computer <http://www.momenco.com/>.
353 +config MOMENCO_OCELOT_G
354 + bool "Support for Momentum Ocelot-G board"
355 + select DMA_NONCOHERENT
358 + select IRQ_CPU_RM7K
360 + select RM7000_CPU_SCACHE
361 + select SWAP_IO_SPACE
363 + The Ocelot is a MIPS-based Single Board Computer (SBC) made by
364 + Momentum Computer <http://www.momenco.com/>.
366 +config MOMENCO_OCELOT_C
367 + bool "Support for Momentum Ocelot-C board"
368 + select DMA_NONCOHERENT
373 + select RM7000_CPU_SCACHE
374 + select SWAP_IO_SPACE
376 + The Ocelot is a MIPS-based Single Board Computer (SBC) made by
377 + Momentum Computer <http://www.momenco.com/>.
379 +config MOMENCO_OCELOT_3
380 + bool "Support for Momentum Ocelot-3 board"
382 + select DMA_NONCOHERENT
385 + select IRQ_CPU_RM7K
388 + select RM7000_CPU_SCACHE
389 + select SWAP_IO_SPACE
391 + The Ocelot-3 is based off Discovery III System Controller and
392 + PMC-Sierra Rm79000 core.
394 +config MOMENCO_JAGUAR_ATX
395 + bool "Support for Momentum Jaguar board"
397 + select DMA_NONCOHERENT
400 + select IRQ_CPU_RM7K
404 + select RM7000_CPU_SCACHE
405 + select SWAP_IO_SPACE
407 + The Jaguar ATX is a MIPS-based Single Board Computer (SBC) made by
408 + Momentum Computer <http://www.momenco.com/>.
410 +config JAGUAR_DMALOW
411 + bool "Low DMA Mode"
412 + depends on MOMENCO_JAGUAR_ATX
414 + Select to Y if jump JP5 is set on your board, N otherwise. Normally
415 + the jumper is set, so if you feel unsafe, just say Y.
418 + bool "Support for PMC-Sierra Yosemite eval board"
419 + select DMA_COHERENT
422 + select IRQ_CPU_RM7K
423 + select IRQ_CPU_RM9K
424 + select SWAP_IO_SPACE
426 + Yosemite is an evaluation board for the RM9000x2 processor
427 + manufactured by PMC-Sierra
429 +config HYPERTRANSPORT
430 + bool "Hypertransport Support for PMC-Sierra Yosemite"
431 + depends on PMC_YOSEMITE
434 + bool "Support for NEC DDB Vrc-5074 (EXPERIMENTAL)"
435 + depends on EXPERIMENTAL
436 + select DMA_NONCOHERENT
437 + select HAVE_STD_PC_SERIAL_PORT
443 + This enables support for the VR5000-based NEC DDB Vrc-5074
447 + bool "Support for NEC DDB Vrc-5476"
448 + select DMA_NONCOHERENT
449 + select HAVE_STD_PC_SERIAL_PORT
455 + This enables support for the R5432-based NEC DDB Vrc-5476
458 + Features : kernel debugging, serial terminal, NFS root fs, on-board
459 + ether port USB, AC97, PCI, PCI VGA card & framebuffer console,
460 + IDE controller, PS2 keyboard, PS2 mouse, etc.
463 + bool "Support for NEC DDB Vrc-5477"
464 + select DMA_NONCOHERENT
469 + This enables support for the R5432-based NEC DDB Vrc-5477,
470 + or Rockhopper/SolutionGear boards with R5432/R5500 CPUs.
472 + Features : kernel debugging, serial terminal, NFS root fs, on-board
473 + ether port USB, AC97, PCI, etc.
475 +config DDB5477_BUS_FREQUENCY
476 + int "bus frequency (in kHZ, 0 for auto-detect)"
481 + bool "Support for NEC Osprey board"
482 + select DMA_NONCOHERENT
486 + bool "Support for SGI IP22 (Indy/Indigo2)"
490 + select DMA_NONCOHERENT
491 + select IP22_CPU_SCACHE
493 + select SWAP_IO_SPACE
495 + This are the SGI Indy, Challenge S and Indigo2, as well as certain
496 + OEM variants like the Tandem CMN B006S. To compile a Linux kernel
497 + that runs on these, say Y here.
500 + bool "Support for SGI IP27 (Origin200/2000)"
508 + This are the SGI Origin 200, Origin 2000 and Onyx 2 Graphics
509 + workstations. To compile a Linux kernel that runs on these, say Y
514 +# depends on SGI_IP27
515 +# This options adds support for userspace processes upto 16TB size.
516 +# Normally the limit is just .5TB.
518 +config SGI_SN0_N_MODE
520 + depends on SGI_IP27
522 + The nodes of Origin 200, Origin 2000 and Onyx 2 systems can be
523 + configured in either N-Modes which allows for more nodes or M-Mode
524 + which allows for more memory. Your system is most probably
525 + running in M-Mode, so you should say N here.
529 + default y if SGI_IP27
531 + Say Y to upport efficient handling of discontiguous physical memory,
532 + for architectures which are either NUMA (Non-Uniform Memory Access)
533 + or have huge holes in the physical address space for other reasons.
534 + See <file:Documentation/vm/numa> for more.
537 + bool "NUMA Support"
538 + depends on SGI_IP27
540 + Say Y to compile the kernel to support NUMA (Non-Uniform Memory
541 + Access). This option is for configuring high-end multiprocessor
542 + server machines. If in doubt, say N.
544 +config MAPPED_KERNEL
545 + bool "Mapped kernel support"
546 + depends on SGI_IP27
548 + Change the way a Linux kernel is loaded into memory on a MIPS64
549 + machine. This is required in order to support text replication and
550 + NUMA. If you need to understand it, read the source code.
552 +config REPLICATE_KTEXT
553 + bool "Kernel text replication support"
554 + depends on SGI_IP27
556 + Say Y here to enable replicating the kernel text across multiple
557 + nodes in a NUMA cluster. This trades memory for speed.
559 +config REPLICATE_EXHANDLERS
560 + bool "Exception handler replication support"
561 + depends on SGI_IP27
563 + Say Y here to enable replicating the kernel exception handlers
564 + across multiple nodes in a NUMA cluster. This trades memory for
568 + bool "Support for SGI IP32 (O2) (EXPERIMENTAL)"
569 + depends on MIPS64 && EXPERIMENTAL
575 + select DMA_NONCOHERENT
577 + select R5000_CPU_SCACHE
578 + select RM7000_CPU_SCACHE
580 + If you want this kernel to run on SGI O2 workstation, say Y here.
584 + bool "Support for AMD/Alchemy Au1X00 SOCs"
587 + prompt "Au1X00 SOC Type"
588 + depends on SOC_AU1X00
590 + Say Y here to enable support for one of three AMD/Alchemy
591 + SOCs. For additional documentation see www.amd.com.
605 + prompt "AMD/Alchemy Au1x00 board support"
606 + depends on SOC_AU1X00
608 + These are evaluation boards built by AMD/Alchemy to
609 + showcase their Au1X00 Internet Edge Processors. The SOC design
610 + is based on the MIPS32 architecture running at 266/400/500MHz
611 + with many integrated peripherals. Further information can be
612 + found at their website, <http://www.amd.com/>. Say Y here if you
613 + wish to build a kernel for this platform.
616 + bool "PB1000 board"
617 + depends on SOC_AU1000
618 + select DMA_NONCOHERENT
620 + select SWAP_IO_SPACE
623 + bool "PB1100 board"
624 + depends on SOC_AU1100
625 + select DMA_NONCOHERENT
627 + select SWAP_IO_SPACE
630 + bool "PB1500 board"
631 + depends on SOC_AU1500
632 + select DMA_COHERENT
636 + bool "PB1550 board"
637 + depends on SOC_AU1550
638 + select DMA_COHERENT
640 + select MIPS_DISABLE_OBSOLETE_IDE
643 + bool "DB1000 board"
644 + depends on SOC_AU1000
645 + select DMA_NONCOHERENT
649 + bool "DB1100 board"
650 + depends on SOC_AU1100
651 + select DMA_NONCOHERENT
654 + bool "DB1500 board"
655 + depends on SOC_AU1500
656 + select DMA_COHERENT
658 + select MIPS_DISABLE_OBSOLETE_IDE
661 + bool "DB1550 board"
662 + depends on SOC_AU1550
664 + select DMA_COHERENT
665 + select MIPS_DISABLE_OBSOLETE_IDE
667 +config MIPS_BOSPORUS
668 + bool "Bosporus board"
669 + depends on SOC_AU1500
670 + select DMA_NONCOHERENT
673 + bool "Mirage board"
674 + depends on SOC_AU1500
675 + select DMA_NONCOHERENT
678 + bool "MyCable XXS1500 board"
679 + depends on SOC_AU1500
680 + select DMA_NONCOHERENT
683 + bool "4G Systems MTX-1 board"
684 + depends on SOC_AU1500
686 + select DMA_NONCOHERENT
690 +config SIBYTE_SB1xxx_SOC
691 + bool "Support for Broadcom BCM1xxx SOCs (EXPERIMENTAL)"
692 + depends on EXPERIMENTAL
694 + select DMA_COHERENT
695 + select SWAP_IO_SPACE
698 + prompt "BCM1xxx SOC-based board"
699 + depends on SIBYTE_SB1xxx_SOC
700 + default SIBYTE_SWARM
702 + Enable support for boards based on the SiByte line of SOCs
703 + from Broadcom. There are configurations for the known
704 + evaluation boards, or you can choose "Other" and add your
705 + own board support code.
708 + bool "BCM91250A-SWARM"
709 + select SIBYTE_SB1250
711 +config SIBYTE_SENTOSA
712 + bool "BCM91250E-Sentosa"
713 + select SIBYTE_SB1250
716 + bool "BCM91125E-Rhone"
717 + select SIBYTE_BCM1125H
719 +config SIBYTE_CARMEL
720 + bool "BCM91120x-Carmel"
721 + select SIBYTE_BCM1120
723 +config SIBYTE_PTSWARM
724 + bool "BCM91250PT-PTSWARM"
725 + select SIBYTE_SB1250
727 +config SIBYTE_LITTLESUR
728 + bool "BCM91250C2-LittleSur"
729 + select SIBYTE_SB1250
731 +config SIBYTE_CRHINE
732 + bool "BCM91120C-CRhine"
733 + select SIBYTE_BCM1120
735 +config SIBYTE_CRHONE
736 + bool "BCM91125C-CRhone"
737 + select SIBYTE_BCM1125
739 +config SIBYTE_UNKNOWN
746 + depends on SIBYTE_SB1xxx_SOC && !SIBYTE_UNKNOWN
750 + prompt "BCM1xxx SOC Type"
751 + depends on SIBYTE_UNKNOWN
752 + default SIBYTE_UNK_BCM1250
754 + Since you haven't chosen a known evaluation board from
755 + Broadcom, you must explicitly pick the SOC this kernel is
758 +config SIBYTE_UNK_BCM1250
760 + select SIBYTE_SB1250
762 +config SIBYTE_UNK_BCM1120
764 + select SIBYTE_BCM1120
766 +config SIBYTE_UNK_BCM1125
768 + select SIBYTE_BCM1125
770 +config SIBYTE_UNK_BCM1125H
772 + select SIBYTE_BCM1125H
776 +config SIBYTE_SB1250
780 +config SIBYTE_BCM1120
782 + select SIBYTE_BCM112X
784 +config SIBYTE_BCM1125
787 + select SIBYTE_BCM112X
789 +config SIBYTE_BCM1125H
792 + select SIBYTE_BCM112X
794 +config SIBYTE_BCM112X
798 + prompt "SiByte SOC Stepping"
799 + depends on SIBYTE_SB1xxx_SOC
801 +config CPU_SB1_PASS_1
803 + depends on SIBYTE_SB1250
804 + select CPU_HAS_PREFETCH
806 +config CPU_SB1_PASS_2_1250
808 + depends on SIBYTE_SB1250
809 + select CPU_SB1_PASS_2
811 + Also called BCM1250 Pass 2
813 +config CPU_SB1_PASS_2_2
815 + depends on SIBYTE_SB1250
816 + select CPU_HAS_PREFETCH
818 + Also called BCM1250 Pass 2.2
820 +config CPU_SB1_PASS_4
822 + depends on SIBYTE_SB1250
823 + select CPU_HAS_PREFETCH
825 + Also called BCM1250 Pass 3
827 +config CPU_SB1_PASS_2_112x
829 + depends on SIBYTE_BCM112X
830 + select CPU_SB1_PASS_2
832 +config CPU_SB1_PASS_3
834 + depends on SIBYTE_BCM112X
835 + select CPU_HAS_PREFETCH
839 +config CPU_SB1_PASS_2
842 +config SIBYTE_HAS_LDT
844 + depends on PCI && (SIBYTE_SB1250 || SIBYTE_BCM1125H)
848 + bool "Running under simulation"
849 + depends on SIBYTE_SB1xxx_SOC
851 + Build a kernel suitable for running under the GDB simulator.
852 + Primarily adjusts the kernel's notion of time.
855 + bool "Booting from CFE"
856 + depends on SIBYTE_SB1xxx_SOC
858 + Make use of the CFE API for enumerating available memory,
859 + controlling secondary CPUs, and possibly console output.
861 +config SIBYTE_CFE_CONSOLE
862 + bool "Use firmware console"
863 + depends on SIBYTE_CFE
865 + Use the CFE API's console write routines during boot. Other console
866 + options (VT console, sb1250 duart console, etc.) should not be
869 +config SIBYTE_STANDALONE
871 + depends on SIBYTE_SB1xxx_SOC && !SIBYTE_CFE
874 +config SIBYTE_STANDALONE_RAM_SIZE
875 + int "Memory size (in megabytes)"
876 + depends on SIBYTE_STANDALONE
879 +config SIBYTE_BUS_WATCHER
880 + bool "Support for Bus Watcher statistics"
881 + depends on SIBYTE_SB1xxx_SOC
883 + Handle and keep statistics on the bus error interrupts (COR_ECC,
886 +config SIBYTE_BW_TRACE
887 + bool "Capture bus trace before bus error"
888 + depends on SIBYTE_BUS_WATCHER
890 + Run a continuous bus trace, dumping the raw data as soon as
891 + a ZBbus error is detected. Cannot work if ZBbus profiling
892 + is turned on, and also will interfere with JTAG-based trace
893 + buffer activity. Raw buffer data is dumped to console, and
894 + must be processed off-line.
896 +config SIBYTE_SB1250_PROF
897 + bool "Support for SB1/SOC profiling - SB1/SCD perf counters"
898 + depends on SIBYTE_SB1xxx_SOC
900 +config SIBYTE_TBPROF
901 + bool "Support for ZBbus profiling"
902 + depends on SIBYTE_SB1xxx_SOC
904 +config SNI_RM200_PCI
905 + bool "Support for SNI RM200 PCI"
909 + select DMA_NONCOHERENT
910 + select GENERIC_ISA_DMA
911 + select HAVE_STD_PC_SERIAL_PORT
916 + The SNI RM200 PCI was a MIPS-based platform manufactured by Siemens
917 + Nixdorf Informationssysteme (SNI), parent company of Pyramid
918 + Technology and now in turn merged with Fujitsu. Say Y here to
919 + support this machine type.
921 +config TOSHIBA_RBTX4927
922 + bool "Support for Toshiba TBTX49[23]7 board"
924 + select DMA_NONCOHERENT
925 + select HAS_TXX9_SERIAL
929 + select SWAP_IO_SPACE
931 + This Toshiba board is based on the TX4927 processor. Say Y here to
932 + support this machine type
934 +config TOSHIBA_FPCIB0
935 + bool "FPCIB0 Backplane Support"
936 + depends on TOSHIBA_RBTX4927
938 +config RWSEM_GENERIC_SPINLOCK
942 +config RWSEM_XCHGADD_ALGORITHM
945 +config GENERIC_CALIBRATE_DELAY
949 +config HAVE_DEC_LOCK
954 +# Select some configuration options automatically based on user selections.
958 + depends on SNI_RM200_PCI || SGI_IP32 || SGI_IP27 || SGI_IP22 || MIPS_MAGNUM_4000 || OLIVETTI_M700 || ACER_PICA_61
967 +config DMA_NONCOHERENT
972 + depends on MACH_DECSTATION
975 +config GENERIC_ISA_DMA
977 + depends on SNI_RM200_PCI || MIPS_MAGNUM_4000 || OLIVETTI_M700 || ACER_PICA_61 || MIPS_MALTA
982 + depends on SNI_RM200_PCI || DDB5477 || DDB5476 || DDB5074 || MACH_JAZZ || MIPS_MALTA || MIPS_COBALT
989 +config MIPS_BONITO64
991 + depends on MIPS_ATLAS || MIPS_MALTA
996 + depends on MIPS_ATLAS || MIPS_MALTA
1004 +config MIPS_DISABLE_OBSOLETE_IDE
1007 +config CPU_LITTLE_ENDIAN
1008 + bool "Generate little endian code"
1009 + default y if ACER_PICA_61 || CASIO_E55 || DDB5074 || DDB5476 || DDB5477 || MACH_DECSTATION || IBM_WORKPAD || LASAT || MIPS_COBALT || MIPS_ITE8172 || MIPS_IVR || SOC_AU1X00 || NEC_OSPREY || OLIVETTI_M700 || SNI_RM200_PCI || VICTOR_MPC30X || ZAO_CAPCELLA
1010 + default n if MIPS_EV64120 || MIPS_EV96100 || MOMENCO_OCELOT || MOMENCO_OCELOT_G || SGI_IP22 || SGI_IP27 || SGI_IP32 || TOSHIBA_JMR3927
1012 + Some MIPS machines can be configured for either little or big endian
1013 + byte order. These modes require different kernels. Say Y if your
1014 + machine is little endian, N if it's a big endian machine.
1019 +config IRQ_CPU_RM7K
1025 +config DDB5XXX_COMMON
1027 + depends on DDB5074 || DDB5476 || DDB5477
1030 +config MIPS_BOARDS_GEN
1032 + depends on MIPS_ATLAS || MIPS_MALTA || MIPS_SEAD
1035 +config MIPS_GT64111
1037 + depends on MIPS_COBALT
1040 +config MIPS_GT64120
1042 + depends on MIPS_EV64120 || MIPS_EV96100 || LASAT || MIPS_ATLAS || MIPS_MALTA || MOMENCO_OCELOT
1047 + depends on TOSHIBA_JMR3927
1048 + select HAS_TXX9_SERIAL
1054 +config ITE_BOARD_GEN
1056 + depends on MIPS_IVR || MIPS_ITE8172
1059 +config SWAP_IO_SPACE
1063 +# Unfortunately not all GT64120 systems run the chip at the same clock.
1064 +# As the user for the clock rate and try to minimize the available options.
1067 + prompt "Galileo Chip Clock"
1068 + #default SYSCLK_83 if MIPS_EV64120
1069 + depends on MIPS_EV64120 || MOMENCO_OCELOT || MOMENCO_OCELOT_G
1070 + default SYSCLK_83 if MIPS_EV64120
1071 + default SYSCLK_100 if MOMENCO_OCELOT || MOMENCO_OCELOT_G
1074 + bool "75" if MIPS_EV64120
1077 + bool "83.3" if MIPS_EV64120
1080 + bool "100" if MIPS_EV64120 || MOMENCO_OCELOT || MOMENCO_OCELOT_G
1084 +config AU1X00_USB_DEVICE
1086 + depends on MIPS_PB1500 || MIPS_PB1100 || MIPS_PB1000
1089 +config MIPS_GT96100
1091 + depends on MIPS_EV96100
1094 + Say Y here to support the Galileo Technology GT96100 communications
1095 + controller card. There is a web page at <http://www.galileot.com/>.
1099 + depends on MIPS_ITE8172 || MIPS_IVR
1104 + depends on MIPS_ITE8172
1109 + depends on MACH_DECSTATION || MIPS_ATLAS || MIPS_MALTA || MOMENCO_JAGUAR_ATX || MOMENCO_OCELOT_3 || SIBYTE_SB1xxx_SOC || SGI_IP32 || SGI_IP22 || SNI_RM200_PCI
1112 +config MIPS_L1_CACHE_SHIFT
1114 + default "4" if MACH_DECSTATION
1115 + default "7" if SGI_IP27
1120 + depends on MACH_JAZZ || SNI_RM200_PCI || SGI_IP22 || SGI_IP32
1125 + depends on MIPS_MAGNUM_4000 || OLIVETTI_M700
1128 + The frame buffer device provides an abstraction for the graphics
1129 + hardware. It represents the frame buffer of some video hardware and
1130 + allows application software to access the graphics hardware through
1131 + a well-defined interface, so the software doesn't need to know
1132 + anything about the low-level (hardware register) stuff.
1134 + Frame buffer devices work identically across the different
1135 + architectures supported by Linux and make the implementation of
1136 + application programs easier and more portable; at this point, an X
1137 + server exists which uses the frame buffer device exclusively.
1138 + On several non-X86 architectures, the frame buffer device is the
1139 + only way to use the graphics hardware.
1141 + The device is accessed through special device nodes, usually located
1142 + in the /dev directory, i.e. /dev/fb*.
1144 + You need an utility program called fbset to make full use of frame
1145 + buffer devices. Please read <file:Documentation/fb/framebuffer.txt>
1146 + and the Framebuffer-HOWTO at <http://www.tldp.org/docs.html#howto>
1147 + for more information.
1149 + Say Y here and to the driver for your graphics board below if you
1150 + are compiling a kernel for a non-x86 architecture.
1152 + If you are compiling for the x86 architecture, you can say Y if you
1153 + want to play with it, but it is not essential. Please note that
1154 + running graphical applications that directly touch the hardware
1155 + (e.g. an accelerated X server) and that are not frame buffer
1156 + device-aware may cause unexpected results. If unsure, say N.
1158 +config HAVE_STD_PC_SERIAL_PORT
1163 + depends on NEC_OSPREY
1167 + bool "ARC console support"
1168 + depends on SGI_IP22 || SNI_RM200_PCI
1172 + depends on MACH_JAZZ || SNI_RM200_PCI || SGI_IP32
1177 + depends on MACH_JAZZ || SNI_RM200_PCI || SGI_IP22 || SGI_IP32
1182 + depends on SGI_IP27
1187 + depends on SGI_IP27
1190 +#config MAPPED_PCI_IO y
1192 +# depends on SGI_IP27
1197 + depends on SGI_IP27
1200 +config TOSHIBA_BOARDS
1202 + depends on TOSHIBA_JMR3927 || TOSHIBA_RBTX4927
1207 +menu "CPU selection"
1223 + Please make sure to pick the right CPU type. Linux/MIPS is not
1224 + designed to be generic, i.e. Kernels compiled for R3000 CPUs will
1225 + *not* work on R4000 machines and vice versa. However, since most
1226 + of the supported machines have an R4000 (or similar) CPU, R4x00
1227 + might be a safe bet. If the resulting kernel does not work,
1228 + try to recompile with R3000.
1237 + The options selects support for the NEC VR41xx series of processors.
1238 + Only choose this option if you have one of these processors as a
1239 + kernel built with this option will not run on any other type of
1240 + processor or vice versa.
1245 + MIPS Technologies R4300-series processors.
1250 + MIPS Technologies R4000-series processors other than 4300, including
1251 + the R4000, R4400, R4600, and 4700.
1259 + MIPS Technologies R5000-series processors other than the Nevada.
1266 + depends on MIPS32 && EXPERIMENTAL
1268 + MIPS Technologies R6000 and R6000A series processors. Note these
1269 + processors are extremly rare and the support for them is incomplete.
1274 + QED / PMC-Sierra RM52xx-series ("Nevada") processors.
1278 + depends on MIPS64 && EXPERIMENTAL
1280 + MIPS Technologies R8000 processors. Note these processors are
1281 + uncommon and the support for them is incomplete.
1286 + MIPS Technologies R10000-series processors.
1300 + prompt "Kernel page size"
1301 + default PAGE_SIZE_4KB
1303 +config PAGE_SIZE_4KB
1306 + This option select the standard 4kB Linux page size. On some
1307 + R3000-family processors this is the only available page size. Using
1308 + 4kB page size will minimize memory consumption and is therefore
1309 + recommended for low memory systems.
1311 +config PAGE_SIZE_8KB
1313 + depends on EXPERIMENTAL && CPU_R8000
1315 + Using 8kB page size will result in higher performance kernel at
1316 + the price of higher memory consumption. This option is available
1317 + only on the R8000 processor. Not that at the time of this writing
1318 + this option is still high experimental; there are also issues with
1319 + compatibility of user applications.
1321 +config PAGE_SIZE_16KB
1323 + depends on EXPERIMENTAL && !CPU_R3000 && !CPU_TX39XX
1325 + Using 16kB page size will result in higher performance kernel at
1326 + the price of higher memory consumption. This option is available on
1327 + all non-R3000 family processor. Not that at the time of this
1328 + writing this option is still high experimental; there are also
1329 + issues with compatibility of user applications.
1331 +config PAGE_SIZE_64KB
1333 + depends on EXPERIMENTAL && !CPU_R3000 && !CPU_TX39XX
1335 + Using 64kB page size will result in higher performance kernel at
1336 + the price of higher memory consumption. This option is available on
1337 + all non-R3000 family processor. Not that at the time of this
1338 + writing this option is still high experimental; there are also
1339 + issues with compatibility of user applications.
1343 +config BOARD_SCACHE
1346 +config IP22_CPU_SCACHE
1348 + select BOARD_SCACHE
1350 +config R5000_CPU_SCACHE
1352 + select BOARD_SCACHE
1354 +config RM7000_CPU_SCACHE
1356 + select BOARD_SCACHE
1358 +config SIBYTE_DMA_PAGEOPS
1359 + bool "Use DMA to clear/copy pages"
1360 + depends on CPU_SB1
1362 + Instead of using the CPU to zero and copy pages, use a Data Mover
1363 + channel. These DMA channels are otherwise unused by the standard
1364 + SiByte Linux port. Seems to give a small performance benefit.
1366 +config CPU_HAS_PREFETCH
1367 + bool "Enable prefetches" if CPU_SB1 && !CPU_SB1_PASS_2
1368 + default y if CPU_MIPS32 || CPU_MIPS64 || CPU_RM7000 || CPU_RM9000 || CPU_R10000
1371 + bool "Support for Virtual Tagged I-cache" if CPU_MIPS64 || CPU_MIPS32
1372 + default y if CPU_SB1
1374 +config SB1_PASS_1_WORKAROUNDS
1376 + depends on CPU_SB1_PASS_1
1379 +config SB1_PASS_2_WORKAROUNDS
1381 + depends on CPU_SB1 && (CPU_SB1_PASS_2_2 || CPU_SB1_PASS_2)
1384 +config SB1_PASS_2_1_WORKAROUNDS
1386 + depends on CPU_SB1 && CPU_SB1_PASS_2
1389 +config 64BIT_PHYS_ADDR
1390 + bool "Support for 64-bit physical address space"
1391 + depends on (CPU_R4X00 || CPU_R5000 || CPU_RM7000 || CPU_RM9000 || CPU_R10000 || CPU_SB1 || CPU_MIPS32 || CPU_MIPS64) && MIPS32
1393 +config CPU_ADVANCED
1394 + bool "Override CPU Options"
1397 + Saying yes here allows you to select support for various features
1398 + your CPU may or may not have. Most people should say N here.
1400 +config CPU_HAS_LLSC
1401 + bool "ll/sc Instructions available" if CPU_ADVANCED
1402 + default y if !CPU_ADVANCED && !CPU_R3000 && !CPU_VR41XX && !CPU_TX39XX
1404 + MIPS R4000 series and later provide the Load Linked (ll)
1405 + and Store Conditional (sc) instructions. More information is
1406 + available at <http://www.go-ecs.com/mips/miptek1.htm>.
1408 + Say Y here if your CPU has the ll and sc instructions. Say Y here
1409 + for better performance, N if you don't know. You must say Y here
1410 + for multiprocessor machines.
1412 +config CPU_HAS_LLDSCD
1413 + bool "lld/scd Instructions available" if CPU_ADVANCED
1414 + default y if !CPU_ADVANCED && !CPU_R3000 && !CPU_VR41XX && !CPU_TX39XX && !CPU_MIPS32
1416 + Say Y here if your CPU has the lld and scd instructions, the 64-bit
1417 + equivalents of ll and sc. Say Y here for better performance, N if
1418 + you don't know. You must say Y here for multiprocessor machines.
1421 + bool "Writeback Buffer available" if CPU_ADVANCED
1422 + default y if !CPU_ADVANCED && CPU_R3000 && MACH_DECSTATION
1424 + Say N here for slightly better performance. You must say Y here for
1425 + machines which require flushing of write buffers in software. Saying
1426 + Y is the safe option; N may result in kernel malfunction and crashes.
1428 +config CPU_HAS_SYNC
1430 + depends on !CPU_R3000
1434 +# - Highmem only makes sense for the 32-bit kernel.
1435 +# - The current highmem code will only work properly on physically indexed
1436 +# caches such as R3000, SB1, R7000 or those that look like they're virtually
1437 +# indexed such as R4000/R4400 SC and MC versions or R10000. So for the
1438 +# moment we protect the user and offer the highmem option only on machines
1439 +# where it's known to be safe. This will not offer highmem on a few systems
1440 +# such as MIPS32 and MIPS64 CPUs which may have virtual and physically
1441 +# indexed CPUs but we're playing safe.
1442 +# - We should not offer highmem for system of which we already know that they
1443 +# don't have memory configurations that could gain from highmem support in
1444 +# the kernel because they don't support configurations with RAM at physical
1445 +# addresses > 0x20000000.
1448 + bool "High Memory Support"
1449 + depends on MIPS32 && (CPU_R3000 || CPU_SB1 || CPU_R7000 || CPU_RM9000 || CPU_R10000) && !(MACH_DECSTATION || MOMENCO_JAGUAR_ATX)
1452 + bool "Multi-Processing support"
1453 + depends on CPU_RM9000 || (SIBYTE_SB1250 && !SIBYTE_STANDALONE) || SGI_IP27
1455 + This enables support for systems with more than one CPU. If you have
1456 + a system with only one CPU, like most personal computers, say N. If
1457 + you have a system with more than one CPU, say Y.
1459 + If you say N here, the kernel will run on single and multiprocessor
1460 + machines, but will use only one CPU of a multiprocessor machine. If
1461 + you say Y here, the kernel will run on many, but not all,
1462 + singleprocessor machines. On a singleprocessor machine, the kernel
1463 + will run faster if you say N here.
1465 + People using multiprocessor machines who say Y here should also say
1466 + Y to "Enhanced Real Time Clock Support", below.
1468 + See also the <file:Documentation/smp.txt> and the SMP-HOWTO
1469 + available at <http://www.tldp.org/docs.html#howto>.
1471 + If you don't know what to do here, say N.
1474 + int "Maximum number of CPUs (2-64)"
1477 + default "64" if SGI_IP27
1480 + This allows you to specify the maximum number of CPUs which this
1481 + kernel will support. The maximum supported value is 32 for 32-bit
1482 + kernel and 64 for 64-bit kernels; the minimum value which makes
1485 + This is purely to save memory - each supported CPU adds
1486 + approximately eight kilobytes to the kernel image.
1489 + bool "Preemptible Kernel"
1491 + This option reduces the latency of the kernel when reacting to
1492 + real-time or interactive events by allowing a low priority process to
1493 + be preempted even if it is in kernel mode executing a system call.
1494 + This allows applications to run more reliably even when the system is
1498 + bool "DS1742 BRAM/RTC support"
1499 + depends on TOSHIBA_JMR3927 || TOSHIBA_RBTX4927
1501 +config MIPS_INSANE_LARGE
1502 + bool "Support for large 64-bit configurations"
1503 + depends on CPU_R10000 && MIPS64
1505 + MIPS R10000 does support a 44 bit / 16TB address space as opposed to
1506 + previous 64-bit processors which only supported 40 bit / 1TB. If you
1507 + need processes of more than 1TB virtual address space, say Y here.
1508 + This will result in additional memory usage, so it is not
1509 + recommended for normal users.
1511 +config RWSEM_GENERIC_SPINLOCK
1517 +menu "Bus options (PCI, PCMCIA, EISA, ISA, TC)"
1523 + bool "Support for PCI controller"
1524 + depends on HW_HAS_PCI
1526 + Find out whether you have a PCI motherboard. PCI is the name of a
1527 + bus system, i.e. the way the CPU talks to the other stuff inside
1528 + your box. Other bus systems are ISA, EISA, or VESA. If you have PCI,
1529 + say Y, otherwise N.
1531 + The PCI-HOWTO, available from
1532 + <http://www.tldp.org/docs.html#howto>, contains valuable
1533 + information about which PCI hardware does work under Linux and which
1540 +source "drivers/pci/Kconfig"
1543 +# ISA support is now enabled via select. Too many systems still have the one
1544 +# or other ISA chip on the board that users don't know about so don't expect
1545 +# users to choose the right thing ...
1551 + bool "EISA support"
1552 + depends on SGI_IP22 || SNI_RM200_PCI
1555 + The Extended Industry Standard Architecture (EISA) bus was
1556 + developed as an open alternative to the IBM MicroChannel bus.
1558 + The EISA bus provided some of the features of the IBM MicroChannel
1559 + bus while maintaining backward compatibility with cards made for
1560 + the older ISA bus. The EISA bus saw limited use between 1988 and
1561 + 1995 when it was made obsolete by the PCI bus.
1563 + Say Y here if you are building a kernel for an EISA-based machine.
1567 +source "drivers/eisa/Kconfig"
1570 + bool "TURBOchannel support"
1571 + depends on MACH_DECSTATION
1573 + TurboChannel is a DEC (now Compaq (now HP)) bus for Alpha and MIPS
1574 + processors. Documentation on writing device drivers for TurboChannel
1576 + <http://www.cs.arizona.edu/computer.help/policy/DIGITAL_unix/AA-PS3HD-TET1_html/TITLE.html>.
1579 +# bool "Access.Bus support"
1592 +source "drivers/pcmcia/Kconfig"
1594 +source "drivers/pci/hotplug/Kconfig"
1598 +menu "Executable file formats"
1600 +source "fs/Kconfig.binfmt"
1602 +config TRAD_SIGNALS
1604 + default y if MIPS32
1607 + bool "Use 64-bit ELF format for building"
1610 + A 64-bit kernel is usually built using the 64-bit ELF binary object
1611 + format as it's one that allows arbitrary 64-bit constructs. For
1612 + kernels that are loaded within the KSEG compatibility segments the
1613 + 32-bit ELF format can optionally be used resulting in a somewhat
1614 + smaller binary, but this option is not explicitly supported by the
1615 + toolchain and since binutils 2.14 it does not even work at all.
1617 + Say Y to use the 64-bit format or N to use the 32-bit one.
1622 + bool "Include IRIX binary compatibility"
1623 + depends on !CPU_LITTLE_ENDIAN && MIPS32 && BROKEN
1625 +config MIPS32_COMPAT
1626 + bool "Kernel support for Linux/MIPS 32-bit binary compatibility"
1629 + Select this option if you want Linux/MIPS 32-bit binary
1630 + compatibility. Since all software available for Linux/MIPS is
1631 + currently 32-bit you should say Y here.
1635 + depends on MIPS32_COMPAT
1639 + bool "Kernel support for o32 binaries"
1640 + depends on MIPS32_COMPAT
1642 + Select this option if you want to run o32 binaries. These are pure
1643 + 32-bit binaries as used by the 32-bit Linux/MIPS port. Most of
1644 + existing binaries are in this format.
1649 + bool "Kernel support for n32 binaries"
1650 + depends on MIPS32_COMPAT
1652 + Select this option if you want to run n32 binaries. These are
1653 + 64-bit binaries using 32-bit quantities for addressing and certain
1654 + data that would normally be 64-bit. They are used in special
1659 +config BINFMT_ELF32
1661 + default y if MIPS32_O32 || MIPS32_N32
1664 + bool "Power Management support (EXPERIMENTAL)"
1665 + depends on EXPERIMENTAL && MACH_AU1X00
1669 +source "drivers/Kconfig"
1671 +source "fs/Kconfig"
1673 +source "arch/mips/Kconfig.debug"
1675 +source "security/Kconfig"
1677 +source "crypto/Kconfig"
1679 +source "lib/Kconfig"
1682 +# Use the generic interrupt handling code in kernel/irq/:
1684 +config GENERIC_HARDIRQS
1688 +config GENERIC_IRQ_PROBE
1695 diff -Nur linux-2.6.12.5/arch/mips/Makefile linux-2.6.12.5-brcm/arch/mips/Makefile
1696 --- linux-2.6.12.5/arch/mips/Makefile 2005-08-15 02:20:18.000000000 +0200
1697 +++ linux-2.6.12.5-brcm/arch/mips/Makefile 2005-08-28 16:39:59.077334424 +0200
1699 cflags-y += -I $(TOPDIR)/include/asm/gcc
1700 cflags-y += -G 0 -mno-abicalls -fno-pic -pipe
1701 cflags-y += $(call cc-option, -finline-limit=100000)
1702 -LDFLAGS_vmlinux += -G 0 -static -n
1703 +LDFLAGS_vmlinux += -G 0 -static -n -nostdlib
1704 MODFLAGS += -mlong-calls
1706 cflags-$(CONFIG_SB1XXX_CORELIS) += -mno-sched-prolog -fno-omit-frame-pointer
1707 @@ -167,9 +167,10 @@
1708 $(call set_gccflags,r4600,mips3,r4600,mips3,mips2) \
1711 -cflags-$(CONFIG_CPU_MIPS32) += \
1712 - $(call set_gccflags,mips32,mips32,r4600,mips3,mips2) \
1714 +#cflags-$(CONFIG_CPU_MIPS32) += \
1715 +# $(call set_gccflags,mips32,mips32,r4600,mips3,mips2) \
1717 +cflags-$(CONFIG_CPU_MIPS32) += -mips2 -Wa,--trap
1719 cflags-$(CONFIG_CPU_MIPS64) += \
1720 $(call set_gccflags,mips64,mips64,r4600,mips3,mips2) \
1721 @@ -618,6 +619,14 @@
1722 load-$(CONFIG_SIBYTE_SWARM) := 0xffffffff80100000
1725 +# Broadcom BCM47XX boards
1727 +core-$(CONFIG_BCM947XX) += arch/mips/bcm947xx/ arch/mips/bcm947xx/broadcom/
1728 +cflags-$(CONFIG_BCM947XX) += -Iarch/mips/bcm947xx/include
1729 +load-$(CONFIG_BCM947XX) := 0xffffffff80001000
1735 core-$(CONFIG_SNI_RM200_PCI) += arch/mips/sni/
1738 @$(MAKE) $(clean)=arch/mips/boot
1739 @$(MAKE) $(clean)=arch/mips/lasat
1740 + @$(MAKE) -C arch/mips/bcm47xx/compressed clean
1742 # Generate <asm/offset.h
1744 diff -Nur linux-2.6.12.5/arch/mips/bcm947xx/Makefile linux-2.6.12.5-brcm/arch/mips/bcm947xx/Makefile
1745 --- linux-2.6.12.5/arch/mips/bcm947xx/Makefile 1970-01-01 01:00:00.000000000 +0100
1746 +++ linux-2.6.12.5-brcm/arch/mips/bcm947xx/Makefile 2005-08-28 11:12:20.406862800 +0200
1749 +# Makefile for the BCM47xx specific kernel interface routines
1753 +obj-y := irq.o int-handler.o prom.o setup.o time.o
1754 diff -Nur linux-2.6.12.5/arch/mips/bcm947xx/broadcom/Makefile linux-2.6.12.5-brcm/arch/mips/bcm947xx/broadcom/Makefile
1755 --- linux-2.6.12.5/arch/mips/bcm947xx/broadcom/Makefile 1970-01-01 01:00:00.000000000 +0100
1756 +++ linux-2.6.12.5-brcm/arch/mips/bcm947xx/broadcom/Makefile 2005-08-28 11:12:20.407862648 +0200
1759 +# Makefile for the BCM47xx specific kernel interface routines
1763 +obj-y := sbutils.o linux_osl.o bcmsrom.o bcmutils.o sbmips.o sbpci.o hnddma.o
1764 diff -Nur linux-2.6.12.5/arch/mips/bcm947xx/broadcom/bcmsrom.c linux-2.6.12.5-brcm/arch/mips/bcm947xx/broadcom/bcmsrom.c
1765 --- linux-2.6.12.5/arch/mips/bcm947xx/broadcom/bcmsrom.c 1970-01-01 01:00:00.000000000 +0100
1766 +++ linux-2.6.12.5-brcm/arch/mips/bcm947xx/broadcom/bcmsrom.c 2005-08-28 11:12:20.408862496 +0200
1769 + * Misc useful routines to access NIC SROM
1771 + * Copyright 2001-2003, Broadcom Corporation
1772 + * All Rights Reserved.
1774 + * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
1775 + * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
1776 + * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
1777 + * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
1778 + * $Id: bcmsrom.c,v 1.1 2005/02/28 13:33:32 jolt Exp $
1781 +#include <typedefs.h>
1783 +#include <bcmutils.h>
1784 +#include <bcmsrom.h>
1785 +#include <bcmdevs.h>
1786 +#include <bcmendian.h>
1787 +#include <sbpcmcia.h>
1788 +#include <pcicfg.h>
1790 +#include <proto/ethernet.h> /* for sprom content groking */
1792 +#define VARS_MAX 4096 /* should be reduced */
1794 +static int initvars_srom_pci(void *curmap, char **vars, int *count);
1795 +static int initvars_cis_pcmcia(void *osh, char **vars, int *count);
1796 +static int sprom_cmd_pcmcia(void *osh, uint8 cmd);
1797 +static int sprom_read_pcmcia(void *osh, uint16 addr, uint16 *data);
1798 +static int sprom_write_pcmcia(void *osh, uint16 addr, uint16 data);
1799 +static int sprom_read_pci(uint16 *sprom, uint byteoff, uint16 *buf, uint nbytes, bool check_crc);
1802 + * Initialize the vars from the right source for this platform.
1803 + * Return 0 on success, nonzero on error.
1806 +srom_var_init(uint bus, void *curmap, void *osh, char **vars, int *count)
1813 + /* These two could be asserts ... */
1819 + ASSERT(curmap); /* can not be NULL */
1820 + return(initvars_srom_pci(curmap, vars, count));
1823 + return(initvars_cis_pcmcia(osh, vars, count));
1833 +/* support only 16-bit word read from srom */
1835 +srom_read(uint bus, void *curmap, void *osh, uint byteoff, uint nbytes, uint16 *buf)
1840 + /* check input - 16-bit access only */
1841 + if (byteoff & 1 || nbytes & 1 || (byteoff + nbytes) > (SPROM_SIZE * 2))
1844 + if (bus == PCI_BUS) {
1847 + srom = (void *)((uint)curmap + PCI_BAR0_SPROM_OFFSET);
1848 + if (sprom_read_pci(srom, byteoff, buf, nbytes, FALSE))
1850 + } else if (bus == PCMCIA_BUS) {
1851 + off = byteoff / 2;
1853 + for (i = 0; i < nw; i++) {
1854 + if (sprom_read_pcmcia(osh, (uint16)(off + i), (uint16*)(buf + i)))
1864 +/* support only 16-bit word write into srom */
1866 +srom_write(uint bus, void *curmap, void *osh, uint byteoff, uint nbytes, uint16 *buf)
1869 + uint i, off, nw, crc_range;
1870 + uint16 image[SPROM_SIZE], *p;
1872 + volatile uint32 val32;
1874 + /* check input - 16-bit access only */
1875 + if (byteoff & 1 || nbytes & 1 || (byteoff + nbytes) > (SPROM_SIZE * 2))
1878 + crc_range = ((bus == PCMCIA_BUS) ? SPROM_SIZE : SPROM_CRC_RANGE) * 2;
1880 + /* if changes made inside crc cover range */
1881 + if (byteoff < crc_range) {
1882 + nw = (((byteoff + nbytes) > crc_range) ? byteoff + nbytes : crc_range) / 2;
1883 + /* read data including entire first 64 words from srom */
1884 + if (srom_read(bus, curmap, osh, 0, nw * 2, image))
1886 + /* make changes */
1887 + bcopy((void*)buf, (void*)&image[byteoff / 2], nbytes);
1888 + /* calculate crc */
1889 + htol16_buf(image, crc_range);
1890 + crc = ~crc8((uint8 *)image, crc_range - 1, CRC8_INIT_VALUE);
1891 + ltoh16_buf(image, crc_range);
1892 + image[(crc_range / 2) - 1] = (crc << 8) | (image[(crc_range / 2) - 1] & 0xff);
1897 + off = byteoff / 2;
1901 + if (bus == PCI_BUS) {
1902 + srom = (uint16*)((uint)curmap + PCI_BAR0_SPROM_OFFSET);
1903 + /* enable writes to the SPROM */
1904 + val32 = OSL_PCI_READ_CONFIG(osh, PCI_SPROM_CONTROL, sizeof(uint32));
1905 + val32 |= SPROM_WRITEEN;
1906 + OSL_PCI_WRITE_CONFIG(osh, PCI_SPROM_CONTROL, sizeof(uint32), val32);
1909 + for (i = 0; i < nw; i++) {
1910 + W_REG(&srom[off + i], p[i]);
1913 + /* disable writes to the SPROM */
1914 + OSL_PCI_WRITE_CONFIG(osh, PCI_SPROM_CONTROL, sizeof(uint32), val32 & ~SPROM_WRITEEN);
1915 + } else if (bus == PCMCIA_BUS) {
1916 + /* enable writes to the SPROM */
1917 + if (sprom_cmd_pcmcia(osh, SROM_WEN))
1921 + for (i = 0; i < nw; i++) {
1922 + sprom_write_pcmcia(osh, (uint16)(off + i), p[i]);
1925 + /* disable writes to the SPROM */
1926 + if (sprom_cmd_pcmcia(osh, SROM_WDS))
1938 +srom_parsecis(uint8 *cis, char **vars, int *count)
1942 + uint8 tup, tlen, sromrev = 1;
1945 + bool ag_init = FALSE;
1951 + base = vp = MALLOC(VARS_MAX);
1960 + case CISTPL_MANFID:
1961 + vp += sprintf(vp, "manfid=%d", (cis[i + 1] << 8) + cis[i]);
1963 + vp += sprintf(vp, "prodid=%d", (cis[i + 3] << 8) + cis[i + 2]);
1967 + case CISTPL_FUNCE:
1968 + if (cis[i] == LAN_NID) {
1969 + ASSERT(cis[i + 1] == ETHER_ADDR_LEN);
1970 + bcm_ether_ntoa((uchar*)&cis[i + 2], eabuf);
1971 + vp += sprintf(vp, "il0macaddr=%s", eabuf);
1976 + case CISTPL_CFTABLE:
1977 + vp += sprintf(vp, "regwindowsz=%d", (cis[i + 7] << 8) | cis[i + 6]);
1981 + case CISTPL_BRCM_HNBU:
1984 + vp += sprintf(vp, "vendid=%d", (cis[i + 2] << 8) + cis[i + 1]);
1986 + vp += sprintf(vp, "devid=%d", (cis[i + 4] << 8) + cis[i + 3]);
1989 + vp += sprintf(vp, "chiprev=%d", (cis[i + 6] << 8) + cis[i + 5]);
1994 + case HNBU_BOARDREV:
1995 + vp += sprintf(vp, "boardrev=%d", cis[i + 1]);
2000 + vp += sprintf(vp, "aa0=%d", cis[i + 1]);
2005 + vp += sprintf(vp, "ag0=%d", cis[i + 1]);
2011 + vp += sprintf(vp, "cc=%d", cis[i + 1]);
2015 + case HNBU_PAPARMS:
2016 + vp += sprintf(vp, "pa0maxpwr=%d", cis[i + tlen - 1]);
2020 + for (j = 0; j < 3; j++) {
2021 + vp += sprintf(vp, "pa0b%d=%d", j,
2022 + (cis[i + (j * 2) + 2] << 8) + cis[i + (j * 2) + 1]);
2025 + vp += sprintf(vp, "pa0itssit=%d", cis[i + 7]);
2031 + vp += sprintf(vp, "oem=%02x%02x%02x%02x%02x%02x%02x%02x",
2032 + cis[i + 1], cis[i + 2], cis[i + 3], cis[i + 4],
2033 + cis[i + 5], cis[i + 6], cis[i + 7], cis[i + 8]);
2036 + case HNBU_BOARDFLAGS:
2037 + w = (cis[i + 2] << 8) + cis[i + 1];
2038 + if (w == 0xffff) w = 0;
2039 + vp += sprintf(vp, "boardflags=%d", w);
2043 + if (cis[i + 1] != 0xff) {
2044 + vp += sprintf(vp, "wl0gpio0=%d", cis[i + 1]);
2047 + if (cis[i + 2] != 0xff) {
2048 + vp += sprintf(vp, "wl0gpio1=%d", cis[i + 2]);
2051 + if (cis[i + 3] != 0xff) {
2052 + vp += sprintf(vp, "wl0gpio2=%d", cis[i + 3]);
2055 + if (cis[i + 4] != 0xff) {
2056 + vp += sprintf(vp, "wl0gpio3=%d", cis[i + 4]);
2065 + } while (tup != 0xff);
2067 + /* Set the srom version */
2068 + vp += sprintf(vp, "sromrev=%d", sromrev);
2071 + /* For now just set boardflags2 to zero */
2072 + vp += sprintf(vp, "boardflags2=0");
2075 + /* if there is no antenna gain field, set default */
2076 + if (ag_init == FALSE) {
2077 + vp += sprintf(vp, "ag0=%d", 0xff);
2081 + /* final nullbyte terminator */
2083 + varsize = (uint)vp - (uint)base;
2085 + ASSERT(varsize < VARS_MAX);
2087 + if (varsize == VARS_MAX) {
2090 + vp = MALLOC(varsize);
2092 + bcopy(base, vp, varsize);
2093 + MFREE(base, VARS_MAX);
2102 +/* set PCMCIA sprom command register */
2104 +sprom_cmd_pcmcia(void *osh, uint8 cmd)
2107 + uint wait_cnt = 1000;
2109 + /* write sprom command register */
2110 + OSL_PCMCIA_WRITE_ATTR(osh, SROM_CS, &cmd, 1);
2113 + while (wait_cnt--) {
2114 + OSL_PCMCIA_READ_ATTR(osh, SROM_CS, &status, 1);
2115 + if (status & SROM_DONE)
2121 +/* read a word from the PCMCIA srom */
2123 +sprom_read_pcmcia(void *osh, uint16 addr, uint16 *data)
2125 + uint8 addr_l, addr_h, data_l, data_h;
2127 + addr_l = (uint8)((addr * 2) & 0xff);
2128 + addr_h = (uint8)(((addr * 2) >> 8) & 0xff);
2131 + OSL_PCMCIA_WRITE_ATTR(osh, SROM_ADDRH, &addr_h, 1);
2132 + OSL_PCMCIA_WRITE_ATTR(osh, SROM_ADDRL, &addr_l, 1);
2135 + if (sprom_cmd_pcmcia(osh, SROM_READ))
2139 + OSL_PCMCIA_READ_ATTR(osh, SROM_DATAH, &data_h, 1);
2140 + OSL_PCMCIA_READ_ATTR(osh, SROM_DATAL, &data_l, 1);
2142 + *data = (data_h << 8) | data_l;
2146 +/* write a word to the PCMCIA srom */
2148 +sprom_write_pcmcia(void *osh, uint16 addr, uint16 data)
2150 + uint8 addr_l, addr_h, data_l, data_h;
2152 + addr_l = (uint8)((addr * 2) & 0xff);
2153 + addr_h = (uint8)(((addr * 2) >> 8) & 0xff);
2154 + data_l = (uint8)(data & 0xff);
2155 + data_h = (uint8)((data >> 8) & 0xff);
2158 + OSL_PCMCIA_WRITE_ATTR(osh, SROM_ADDRH, &addr_h, 1);
2159 + OSL_PCMCIA_WRITE_ATTR(osh, SROM_ADDRL, &addr_l, 1);
2162 + OSL_PCMCIA_WRITE_ATTR(osh, SROM_DATAH, &data_h, 1);
2163 + OSL_PCMCIA_WRITE_ATTR(osh, SROM_DATAL, &data_l, 1);
2166 + return sprom_cmd_pcmcia(osh, SROM_WRITE);
2170 + * Read in and validate sprom.
2171 + * Return 0 on success, nonzero on error.
2174 +sprom_read_pci(uint16 *sprom, uint byteoff, uint16 *buf, uint nbytes, bool check_crc)
2180 + off = byteoff / 2;
2181 + nw = ROUNDUP(nbytes, 2) / 2;
2183 + /* read the sprom */
2184 + for (i = 0; i < nw; i++)
2185 + buf[i] = R_REG(&sprom[off + i]);
2188 + /* fixup the endianness so crc8 will pass */
2189 + htol16_buf(buf, nw * 2);
2190 + if ((chk8 = crc8((uchar*)buf, nbytes, CRC8_INIT_VALUE)) != CRC8_GOOD_VALUE)
2192 + /* now correct the endianness of the byte array */
2193 + ltoh16_buf(buf, nw * 2);
2200 + * Initialize nonvolatile variable table from sprom.
2201 + * Return 0 on success, nonzero on error.
2205 +initvars_srom_pci(void *curmap, char **vars, int *count)
2209 + struct ether_addr ea;
2214 + if (sprom_read_pci((void *)((uint)curmap + PCI_BAR0_SPROM_OFFSET), 0, b, sizeof (b), TRUE))
2217 + /* top word of sprom contains version and crc8 */
2218 + sromrev = b[63] & 0xff;
2219 + if ((sromrev != 1) && (sromrev != 2)) {
2226 + base = vp = MALLOC(VARS_MAX);
2229 + vp += sprintf(vp, "sromrev=%d", sromrev);
2232 + if (sromrev >= 2) {
2233 + /* New section takes over the 4th hardware function space */
2235 + /* Word 28 is boardflags2 */
2236 + vp += sprintf(vp, "boardflags2=%d", b[28]);
2239 + /* Word 29 is max power 11a high/low */
2241 + vp += sprintf(vp, "pa1himaxpwr=%d", w & 0xff);
2243 + vp += sprintf(vp, "pa1lomaxpwr=%d", (w >> 8) & 0xff);
2246 + /* Words 30-32 set the 11alow pa settings,
2247 + * 33-35 are the 11ahigh ones.
2249 + for (i = 0; i < 3; i++) {
2250 + vp += sprintf(vp, "pa1lob%d=%d", i, b[30 + i]);
2252 + vp += sprintf(vp, "pa1hib%d=%d", i, b[33 + i]);
2257 + vp += sprintf(vp, "ccode=");
2259 + vp += sprintf(vp, "ccode=%c%c", (w >> 8), (w & 0xff));
2264 + /* parameter section of sprom starts at byte offset 72 */
2267 + /* first 6 bytes are il0macaddr */
2268 + ea.octet[0] = (b[woff] >> 8) & 0xff;
2269 + ea.octet[1] = b[woff] & 0xff;
2270 + ea.octet[2] = (b[woff+1] >> 8) & 0xff;
2271 + ea.octet[3] = b[woff+1] & 0xff;
2272 + ea.octet[4] = (b[woff+2] >> 8) & 0xff;
2273 + ea.octet[5] = b[woff+2] & 0xff;
2274 + woff += ETHER_ADDR_LEN/2 ;
2275 + bcm_ether_ntoa((uchar*)&ea, eabuf);
2276 + vp += sprintf(vp, "il0macaddr=%s", eabuf);
2279 + /* next 6 bytes are et0macaddr */
2280 + ea.octet[0] = (b[woff] >> 8) & 0xff;
2281 + ea.octet[1] = b[woff] & 0xff;
2282 + ea.octet[2] = (b[woff+1] >> 8) & 0xff;
2283 + ea.octet[3] = b[woff+1] & 0xff;
2284 + ea.octet[4] = (b[woff+2] >> 8) & 0xff;
2285 + ea.octet[5] = b[woff+2] & 0xff;
2286 + woff += ETHER_ADDR_LEN/2 ;
2287 + bcm_ether_ntoa((uchar*)&ea, eabuf);
2288 + vp += sprintf(vp, "et0macaddr=%s", eabuf);
2291 + /* next 6 bytes are et1macaddr */
2292 + ea.octet[0] = (b[woff] >> 8) & 0xff;
2293 + ea.octet[1] = b[woff] & 0xff;
2294 + ea.octet[2] = (b[woff+1] >> 8) & 0xff;
2295 + ea.octet[3] = b[woff+1] & 0xff;
2296 + ea.octet[4] = (b[woff+2] >> 8) & 0xff;
2297 + ea.octet[5] = b[woff+2] & 0xff;
2298 + woff += ETHER_ADDR_LEN/2 ;
2299 + bcm_ether_ntoa((uchar*)&ea, eabuf);
2300 + vp += sprintf(vp, "et1macaddr=%s", eabuf);
2304 + * Enet phy settings one or two singles or a dual
2305 + * Bits 4-0 : MII address for enet0 (0x1f for not there)
2306 + * Bits 9-5 : MII address for enet1 (0x1f for not there)
2307 + * Bit 14 : Mdio for enet0
2308 + * Bit 15 : Mdio for enet1
2311 + vp += sprintf(vp, "et0phyaddr=%d", (w & 0x1f));
2313 + vp += sprintf(vp, "et1phyaddr=%d", ((w >> 5) & 0x1f));
2315 + vp += sprintf(vp, "et0mdcport=%d", ((w >> 14) & 0x1));
2317 + vp += sprintf(vp, "et1mdcport=%d", ((w >> 15) & 0x1));
2320 + /* Word 46 has board rev, antennas 0/1 & Country code/control */
2322 + vp += sprintf(vp, "boardrev=%d", w & 0xff);
2326 + vp += sprintf(vp, "cctl=%d", (w >> 8) & 0xf);
2328 + vp += sprintf(vp, "cc=%d", (w >> 8) & 0xf);
2331 + vp += sprintf(vp, "aa0=%d", (w >> 12) & 0x3);
2334 + vp += sprintf(vp, "aa1=%d", (w >> 14) & 0x3);
2337 + /* Words 47-49 set the (wl) pa settings */
2340 + for (i = 0; i < 3; i++) {
2341 + vp += sprintf(vp, "pa0b%d=%d", i, b[woff+i]);
2343 + vp += sprintf(vp, "pa1b%d=%d", i, b[woff+i+6]);
2348 + * Words 50-51 set the customer-configured wl led behavior.
2349 + * 8 bits/gpio pin. High bit: activehi=0, activelo=1;
2350 + * LED behavior values defined in wlioctl.h .
2353 + if ((w != 0) && (w != 0xffff)) {
2355 + vp += sprintf(vp, "wl0gpio0=%d", (w & 0xff));
2359 + vp += sprintf(vp, "wl0gpio1=%d", (w >> 8) & 0xff);
2363 + if ((w != 0) && (w != 0xffff)) {
2365 + vp += sprintf(vp, "wl0gpio2=%d", w & 0xff);
2369 + vp += sprintf(vp, "wl0gpio3=%d", (w >> 8) & 0xff);
2373 + /* Word 52 is max power 0/1 */
2375 + vp += sprintf(vp, "pa0maxpwr=%d", w & 0xff);
2377 + vp += sprintf(vp, "pa1maxpwr=%d", (w >> 8) & 0xff);
2380 + /* Word 56 is idle tssi target 0/1 */
2382 + vp += sprintf(vp, "pa0itssit=%d", w & 0xff);
2384 + vp += sprintf(vp, "pa1itssit=%d", (w >> 8) & 0xff);
2387 + /* Word 57 is boardflags, if not programmed make it zero */
2389 + if (w == 0xffff) w = 0;
2390 + vp += sprintf(vp, "boardflags=%d", w);
2393 + /* Word 58 is antenna gain 0/1 */
2395 + vp += sprintf(vp, "ag0=%d", w & 0xff);
2398 + vp += sprintf(vp, "ag1=%d", (w >> 8) & 0xff);
2401 + if (sromrev == 1) {
2402 + /* set the oem string */
2403 + vp += sprintf(vp, "oem=%02x%02x%02x%02x%02x%02x%02x%02x",
2404 + ((b[59] >> 8) & 0xff), (b[59] & 0xff),
2405 + ((b[60] >> 8) & 0xff), (b[60] & 0xff),
2406 + ((b[61] >> 8) & 0xff), (b[61] & 0xff),
2407 + ((b[62] >> 8) & 0xff), (b[62] & 0xff));
2411 + /* final nullbyte terminator */
2415 + ASSERT(c <= VARS_MAX);
2417 + if (c == VARS_MAX) {
2422 + bcopy(base, vp, c);
2423 + MFREE(base, VARS_MAX);
2432 + * Read the cis and call parsecis to initialize the vars.
2433 + * Return 0 on success, nonzero on error.
2436 +initvars_cis_pcmcia(void *osh, char **vars, int *count)
2438 + uint8 *cis = NULL;
2441 + if ((cis = MALLOC(CIS_SIZE)) == NULL)
2444 + OSL_PCMCIA_READ_ATTR(osh, 0, cis, CIS_SIZE);
2446 + rc = srom_parsecis(cis, vars, count);
2448 + MFREE(cis, CIS_SIZE);
2453 diff -Nur linux-2.6.12.5/arch/mips/bcm947xx/broadcom/bcmutils.c linux-2.6.12.5-brcm/arch/mips/bcm947xx/broadcom/bcmutils.c
2454 --- linux-2.6.12.5/arch/mips/bcm947xx/broadcom/bcmutils.c 1970-01-01 01:00:00.000000000 +0100
2455 +++ linux-2.6.12.5-brcm/arch/mips/bcm947xx/broadcom/bcmutils.c 2005-08-28 11:12:20.428859456 +0200
2458 + * Misc useful OS-independent routines.
2460 + * Copyright 2001-2003, Broadcom Corporation
2461 + * All Rights Reserved.
2463 + * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
2464 + * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
2465 + * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
2466 + * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
2467 + * $Id: bcmutils.c,v 1.1 2005/02/28 13:33:32 jolt Exp $
2470 +#include <typedefs.h>
2472 +#include <bcmutils.h>
2473 +#include <bcmendian.h>
2474 +#include <bcmnvram.h>
2476 +unsigned char bcm_ctype[] = {
2477 + _BCM_C,_BCM_C,_BCM_C,_BCM_C,_BCM_C,_BCM_C,_BCM_C,_BCM_C, /* 0-7 */
2478 + _BCM_C,_BCM_C|_BCM_S,_BCM_C|_BCM_S,_BCM_C|_BCM_S,_BCM_C|_BCM_S,_BCM_C|_BCM_S,_BCM_C,_BCM_C, /* 8-15 */
2479 + _BCM_C,_BCM_C,_BCM_C,_BCM_C,_BCM_C,_BCM_C,_BCM_C,_BCM_C, /* 16-23 */
2480 + _BCM_C,_BCM_C,_BCM_C,_BCM_C,_BCM_C,_BCM_C,_BCM_C,_BCM_C, /* 24-31 */
2481 + _BCM_S|_BCM_SP,_BCM_P,_BCM_P,_BCM_P,_BCM_P,_BCM_P,_BCM_P,_BCM_P, /* 32-39 */
2482 + _BCM_P,_BCM_P,_BCM_P,_BCM_P,_BCM_P,_BCM_P,_BCM_P,_BCM_P, /* 40-47 */
2483 + _BCM_D,_BCM_D,_BCM_D,_BCM_D,_BCM_D,_BCM_D,_BCM_D,_BCM_D, /* 48-55 */
2484 + _BCM_D,_BCM_D,_BCM_P,_BCM_P,_BCM_P,_BCM_P,_BCM_P,_BCM_P, /* 56-63 */
2485 + _BCM_P,_BCM_U|_BCM_X,_BCM_U|_BCM_X,_BCM_U|_BCM_X,_BCM_U|_BCM_X,_BCM_U|_BCM_X,_BCM_U|_BCM_X,_BCM_U, /* 64-71 */
2486 + _BCM_U,_BCM_U,_BCM_U,_BCM_U,_BCM_U,_BCM_U,_BCM_U,_BCM_U, /* 72-79 */
2487 + _BCM_U,_BCM_U,_BCM_U,_BCM_U,_BCM_U,_BCM_U,_BCM_U,_BCM_U, /* 80-87 */
2488 + _BCM_U,_BCM_U,_BCM_U,_BCM_P,_BCM_P,_BCM_P,_BCM_P,_BCM_P, /* 88-95 */
2489 + _BCM_P,_BCM_L|_BCM_X,_BCM_L|_BCM_X,_BCM_L|_BCM_X,_BCM_L|_BCM_X,_BCM_L|_BCM_X,_BCM_L|_BCM_X,_BCM_L, /* 96-103 */
2490 + _BCM_L,_BCM_L,_BCM_L,_BCM_L,_BCM_L,_BCM_L,_BCM_L,_BCM_L, /* 104-111 */
2491 + _BCM_L,_BCM_L,_BCM_L,_BCM_L,_BCM_L,_BCM_L,_BCM_L,_BCM_L, /* 112-119 */
2492 + _BCM_L,_BCM_L,_BCM_L,_BCM_P,_BCM_P,_BCM_P,_BCM_P,_BCM_C, /* 120-127 */
2493 + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 128-143 */
2494 + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 144-159 */
2495 + _BCM_S|_BCM_SP,_BCM_P,_BCM_P,_BCM_P,_BCM_P,_BCM_P,_BCM_P,_BCM_P,_BCM_P,_BCM_P,_BCM_P,_BCM_P,_BCM_P,_BCM_P,_BCM_P,_BCM_P, /* 160-175 */
2496 + _BCM_P,_BCM_P,_BCM_P,_BCM_P,_BCM_P,_BCM_P,_BCM_P,_BCM_P,_BCM_P,_BCM_P,_BCM_P,_BCM_P,_BCM_P,_BCM_P,_BCM_P,_BCM_P, /* 176-191 */
2497 + _BCM_U,_BCM_U,_BCM_U,_BCM_U,_BCM_U,_BCM_U,_BCM_U,_BCM_U,_BCM_U,_BCM_U,_BCM_U,_BCM_U,_BCM_U,_BCM_U,_BCM_U,_BCM_U, /* 192-207 */
2498 + _BCM_U,_BCM_U,_BCM_U,_BCM_U,_BCM_U,_BCM_U,_BCM_U,_BCM_P,_BCM_U,_BCM_U,_BCM_U,_BCM_U,_BCM_U,_BCM_U,_BCM_U,_BCM_L, /* 208-223 */
2499 + _BCM_L,_BCM_L,_BCM_L,_BCM_L,_BCM_L,_BCM_L,_BCM_L,_BCM_L,_BCM_L,_BCM_L,_BCM_L,_BCM_L,_BCM_L,_BCM_L,_BCM_L,_BCM_L, /* 224-239 */
2500 + _BCM_L,_BCM_L,_BCM_L,_BCM_L,_BCM_L,_BCM_L,_BCM_L,_BCM_P,_BCM_L,_BCM_L,_BCM_L,_BCM_L,_BCM_L,_BCM_L,_BCM_L,_BCM_L /* 240-255 */
2504 +bcm_toupper(uchar c)
2506 + if (bcm_islower(c))
2512 +bcm_strtoul(char *cp, char **endp, uint base)
2514 + ulong result, value;
2519 + while (bcm_isspace(*cp))
2524 + else if (cp[0] == '-') {
2530 + if (cp[0] == '0') {
2531 + if ((cp[1] == 'x') || (cp[1] == 'X')) {
2540 + } else if (base == 16 && (cp[0] == '0') && ((cp[1] == 'x') || (cp[1] == 'X'))) {
2546 + while (bcm_isxdigit(*cp) &&
2547 + (value = bcm_isdigit(*cp) ? *cp-'0' : bcm_toupper(*cp)-'A'+10) < base) {
2548 + result = result*base + value;
2553 + result = (ulong)(result * -1);
2556 + *endp = (char *)cp;
2568 + while (bcm_isdigit(*s))
2569 + n = (n * 10) + *s++ - '0';
2574 +deadbeef(char *p, uint len)
2576 + static uchar meat[] = { 0xde, 0xad, 0xbe, 0xef };
2578 + while (len-- > 0) {
2579 + *p = meat[((uint)p) & 3];
2584 +/* pretty hex print a contiguous buffer */
2586 +prhex(char *msg, uchar *buf, uint nbytes)
2592 + if (msg && (msg[0] != '\0'))
2593 + printf("%s: ", msg);
2596 + for (i = 0; i < nbytes; i++) {
2597 + if (i % 16 == 0) {
2598 + p += sprintf(p, "%04d: ", i); /* line prefix */
2600 + p += sprintf(p, "%02x ", buf[i]);
2601 + if (i % 16 == 15) {
2602 + printf("%s\n", line); /* flush line */
2607 + /* flush last partial line */
2609 + printf("%s\n", line);
2612 +/* pretty hex print a pkt buffer chain */
2614 +prpkt(char *msg, void *drv, void *p0)
2618 + if (msg && (msg[0] != '\0'))
2619 + printf("%s: ", msg);
2621 + for (p = p0; p; p = PKTNEXT(drv, p))
2622 + prhex(NULL, PKTDATA(drv, p), PKTLEN(drv, p));
2625 +/* copy a pkt buffer chain into a buffer */
2627 +pktcopy(void *drv, void *p, uint offset, int len, uchar *buf)
2632 + len = 4096; /* "infinite" */
2634 + /* skip 'offset' bytes */
2635 + for (; p && offset; p = PKTNEXT(drv, p)) {
2636 + if (offset < (uint)PKTLEN(drv, p))
2638 + offset -= PKTLEN(drv, p);
2644 + /* copy the data */
2645 + for (; p && len; p = PKTNEXT(drv, p)) {
2646 + n = MIN((uint)PKTLEN(drv, p) - offset, (uint)len);
2647 + bcopy(PKTDATA(drv, p) + offset, buf, n);
2657 +/* return total length of buffer chain */
2659 +pkttotlen(void *drv, void *p)
2664 + for (; p; p = PKTNEXT(drv, p))
2665 + total += PKTLEN(drv, p);
2671 +bcm_ether_ntoa(char *ea, char *buf)
2673 + sprintf(buf,"%02x:%02x:%02x:%02x:%02x:%02x",
2674 + (uchar)ea[0]&0xff, (uchar)ea[1]&0xff, (uchar)ea[2]&0xff,
2675 + (uchar)ea[3]&0xff, (uchar)ea[4]&0xff, (uchar)ea[5]&0xff);
2679 +/* parse a xx:xx:xx:xx:xx:xx format ethernet address */
2681 +bcm_ether_atoe(char *p, char *ea)
2686 + ea[i++] = (char) bcm_strtoul(p, &p, 16);
2687 + if (!*p++ || i == 6)
2695 + * Traverse a string of 1-byte tag/1-byte length/variable-length value
2696 + * triples, returning a pointer to the substring whose first element
2697 + * matches tag. Stop parsing when we see an element whose ID is greater
2698 + * than the target key.
2701 +bcm_parse_ordered_tlvs(void *buf, int buflen, uint key)
2706 + elt = (bcm_tlv_t*)buf;
2709 + /* find tagged parameter */
2710 + while (totlen >= 2) {
2711 + uint id = elt->id;
2712 + int len = elt->len;
2714 + /* Punt if we start seeing IDs > than target key */
2718 + /* validate remaining totlen */
2719 + if ((id == key) && (totlen >= (len + 2)))
2722 + elt = (bcm_tlv_t*)((uint8*)elt + (len + 2));
2723 + totlen -= (len + 2);
2730 + * Traverse a string of 1-byte tag/1-byte length/variable-length value
2731 + * triples, returning a pointer to the substring whose first element
2735 +bcm_parse_tlvs(void *buf, int buflen, uint key)
2740 + elt = (bcm_tlv_t*)buf;
2743 + /* find tagged parameter */
2744 + while (totlen >= 2) {
2745 + int len = elt->len;
2747 + /* validate remaining totlen */
2748 + if ((elt->id == key) && (totlen >= (len + 2)))
2751 + elt = (bcm_tlv_t*)((uint8*)elt + (len + 2));
2752 + totlen -= (len + 2);
2759 +pktqinit(struct pktq *q, int maxlen)
2761 + q->head = q->tail = NULL;
2762 + q->maxlen = maxlen;
2767 +pktenq(struct pktq *q, void *p, bool lifo)
2769 + ASSERT(PKTLINK(p) == NULL);
2771 + PKTSETLINK(p, NULL);
2773 + if (q->tail == NULL) {
2774 + ASSERT(q->head == NULL);
2775 + q->head = q->tail = p;
2779 + ASSERT(PKTLINK(q->tail) == NULL);
2781 + PKTSETLINK(p, q->head);
2784 + PKTSETLINK(q->tail, p);
2792 +pktdeq(struct pktq *q)
2796 + if ((p = q->head)) {
2798 + q->head = PKTLINK(p);
2799 + PKTSETLINK(p, NULL);
2801 + if (q->head == NULL)
2805 + ASSERT(q->tail == NULL);
2811 +/*******************************************************************************
2814 + * Computes a crc8 over the input data using the polynomial:
2816 + * x^8 + x^7 +x^6 + x^4 + x^2 + 1
2818 + * The caller provides the initial value (either CRC8_INIT_VALUE
2819 + * or the previous returned value) to allow for processing of
2820 + * discontiguous blocks of data. When generating the CRC the
2821 + * caller is responsible for complementing the final return value
2822 + * and inserting it into the byte stream. When checking, a final
2823 + * return value of CRC8_GOOD_VALUE indicates a valid CRC.
2825 + * Reference: Dallas Semiconductor Application Note 27
2826 + * Williams, Ross N., "A Painless Guide to CRC Error Detection Algorithms",
2827 + * ver 3, Aug 1993, ross@guest.adelaide.edu.au, Rocksoft Pty Ltd.,
2828 + * ftp://ftp.rocksoft.com/clients/rocksoft/papers/crc_v3.txt
2830 + ******************************************************************************/
2832 +static uint8 crc8_table[256] = {
2833 + 0x00, 0xF7, 0xB9, 0x4E, 0x25, 0xD2, 0x9C, 0x6B,
2834 + 0x4A, 0xBD, 0xF3, 0x04, 0x6F, 0x98, 0xD6, 0x21,
2835 + 0x94, 0x63, 0x2D, 0xDA, 0xB1, 0x46, 0x08, 0xFF,
2836 + 0xDE, 0x29, 0x67, 0x90, 0xFB, 0x0C, 0x42, 0xB5,
2837 + 0x7F, 0x88, 0xC6, 0x31, 0x5A, 0xAD, 0xE3, 0x14,
2838 + 0x35, 0xC2, 0x8C, 0x7B, 0x10, 0xE7, 0xA9, 0x5E,
2839 + 0xEB, 0x1C, 0x52, 0xA5, 0xCE, 0x39, 0x77, 0x80,
2840 + 0xA1, 0x56, 0x18, 0xEF, 0x84, 0x73, 0x3D, 0xCA,
2841 + 0xFE, 0x09, 0x47, 0xB0, 0xDB, 0x2C, 0x62, 0x95,
2842 + 0xB4, 0x43, 0x0D, 0xFA, 0x91, 0x66, 0x28, 0xDF,
2843 + 0x6A, 0x9D, 0xD3, 0x24, 0x4F, 0xB8, 0xF6, 0x01,
2844 + 0x20, 0xD7, 0x99, 0x6E, 0x05, 0xF2, 0xBC, 0x4B,
2845 + 0x81, 0x76, 0x38, 0xCF, 0xA4, 0x53, 0x1D, 0xEA,
2846 + 0xCB, 0x3C, 0x72, 0x85, 0xEE, 0x19, 0x57, 0xA0,
2847 + 0x15, 0xE2, 0xAC, 0x5B, 0x30, 0xC7, 0x89, 0x7E,
2848 + 0x5F, 0xA8, 0xE6, 0x11, 0x7A, 0x8D, 0xC3, 0x34,
2849 + 0xAB, 0x5C, 0x12, 0xE5, 0x8E, 0x79, 0x37, 0xC0,
2850 + 0xE1, 0x16, 0x58, 0xAF, 0xC4, 0x33, 0x7D, 0x8A,
2851 + 0x3F, 0xC8, 0x86, 0x71, 0x1A, 0xED, 0xA3, 0x54,
2852 + 0x75, 0x82, 0xCC, 0x3B, 0x50, 0xA7, 0xE9, 0x1E,
2853 + 0xD4, 0x23, 0x6D, 0x9A, 0xF1, 0x06, 0x48, 0xBF,
2854 + 0x9E, 0x69, 0x27, 0xD0, 0xBB, 0x4C, 0x02, 0xF5,
2855 + 0x40, 0xB7, 0xF9, 0x0E, 0x65, 0x92, 0xDC, 0x2B,
2856 + 0x0A, 0xFD, 0xB3, 0x44, 0x2F, 0xD8, 0x96, 0x61,
2857 + 0x55, 0xA2, 0xEC, 0x1B, 0x70, 0x87, 0xC9, 0x3E,
2858 + 0x1F, 0xE8, 0xA6, 0x51, 0x3A, 0xCD, 0x83, 0x74,
2859 + 0xC1, 0x36, 0x78, 0x8F, 0xE4, 0x13, 0x5D, 0xAA,
2860 + 0x8B, 0x7C, 0x32, 0xC5, 0xAE, 0x59, 0x17, 0xE0,
2861 + 0x2A, 0xDD, 0x93, 0x64, 0x0F, 0xF8, 0xB6, 0x41,
2862 + 0x60, 0x97, 0xD9, 0x2E, 0x45, 0xB2, 0xFC, 0x0B,
2863 + 0xBE, 0x49, 0x07, 0xF0, 0x9B, 0x6C, 0x22, 0xD5,
2864 + 0xF4, 0x03, 0x4D, 0xBA, 0xD1, 0x26, 0x68, 0x9F
2868 + * Search the name=value vars for a specific one and return its value.
2869 + * Returns NULL if not found.
2872 +getvar(char *vars, char *name)
2877 + len = strlen(name);
2879 + /* first look in vars[] */
2880 + for (s = vars; s && *s; ) {
2881 + if ((bcmp(s, name, len) == 0) && (s[len] == '='))
2882 + return (&s[len+1]);
2888 + /* then query nvram */
2889 + return (nvram_get(name));
2893 + * Search the vars for a specific one and return its value as
2894 + * an integer. Returns 0 if not found.
2897 +getintvar(char *vars, char *name)
2901 + if ((val = getvar(vars, name)) == NULL)
2904 + return (bcm_strtoul(val, NULL, 0));
2908 +bcm_mdelay(uint ms)
2912 + for (i = 0; i < ms; i++) {
2917 +#define CRC_INNER_LOOP(n, c, x) \
2918 + (c) = ((c) >> 8) ^ crc##n##_table[((c) ^ (x)) & 0xff]
2922 + uint8 *pdata, /* pointer to array of data to process */
2923 + uint nbytes, /* number of input data bytes to process */
2924 + uint8 crc /* either CRC8_INIT_VALUE or previous return value */
2927 + /* hard code the crc loop instead of using CRC_INNER_LOOP macro
2928 + * to avoid the undefined and unnecessary (uint8 >> 8) operation. */
2929 + while (nbytes-- > 0)
2930 + crc = crc8_table[(crc ^ *pdata++) & 0xff];
2935 +/*******************************************************************************
2938 + * Computes a crc16 over the input data using the polynomial:
2940 + * x^16 + x^12 +x^5 + 1
2942 + * The caller provides the initial value (either CRC16_INIT_VALUE
2943 + * or the previous returned value) to allow for processing of
2944 + * discontiguous blocks of data. When generating the CRC the
2945 + * caller is responsible for complementing the final return value
2946 + * and inserting it into the byte stream. When checking, a final
2947 + * return value of CRC16_GOOD_VALUE indicates a valid CRC.
2949 + * Reference: Dallas Semiconductor Application Note 27
2950 + * Williams, Ross N., "A Painless Guide to CRC Error Detection Algorithms",
2951 + * ver 3, Aug 1993, ross@guest.adelaide.edu.au, Rocksoft Pty Ltd.,
2952 + * ftp://ftp.rocksoft.com/clients/rocksoft/papers/crc_v3.txt
2954 + ******************************************************************************/
2956 +static uint16 crc16_table[256] = {
2957 + 0x0000, 0x1189, 0x2312, 0x329B, 0x4624, 0x57AD, 0x6536, 0x74BF,
2958 + 0x8C48, 0x9DC1, 0xAF5A, 0xBED3, 0xCA6C, 0xDBE5, 0xE97E, 0xF8F7,
2959 + 0x1081, 0x0108, 0x3393, 0x221A, 0x56A5, 0x472C, 0x75B7, 0x643E,
2960 + 0x9CC9, 0x8D40, 0xBFDB, 0xAE52, 0xDAED, 0xCB64, 0xF9FF, 0xE876,
2961 + 0x2102, 0x308B, 0x0210, 0x1399, 0x6726, 0x76AF, 0x4434, 0x55BD,
2962 + 0xAD4A, 0xBCC3, 0x8E58, 0x9FD1, 0xEB6E, 0xFAE7, 0xC87C, 0xD9F5,
2963 + 0x3183, 0x200A, 0x1291, 0x0318, 0x77A7, 0x662E, 0x54B5, 0x453C,
2964 + 0xBDCB, 0xAC42, 0x9ED9, 0x8F50, 0xFBEF, 0xEA66, 0xD8FD, 0xC974,
2965 + 0x4204, 0x538D, 0x6116, 0x709F, 0x0420, 0x15A9, 0x2732, 0x36BB,
2966 + 0xCE4C, 0xDFC5, 0xED5E, 0xFCD7, 0x8868, 0x99E1, 0xAB7A, 0xBAF3,
2967 + 0x5285, 0x430C, 0x7197, 0x601E, 0x14A1, 0x0528, 0x37B3, 0x263A,
2968 + 0xDECD, 0xCF44, 0xFDDF, 0xEC56, 0x98E9, 0x8960, 0xBBFB, 0xAA72,
2969 + 0x6306, 0x728F, 0x4014, 0x519D, 0x2522, 0x34AB, 0x0630, 0x17B9,
2970 + 0xEF4E, 0xFEC7, 0xCC5C, 0xDDD5, 0xA96A, 0xB8E3, 0x8A78, 0x9BF1,
2971 + 0x7387, 0x620E, 0x5095, 0x411C, 0x35A3, 0x242A, 0x16B1, 0x0738,
2972 + 0xFFCF, 0xEE46, 0xDCDD, 0xCD54, 0xB9EB, 0xA862, 0x9AF9, 0x8B70,
2973 + 0x8408, 0x9581, 0xA71A, 0xB693, 0xC22C, 0xD3A5, 0xE13E, 0xF0B7,
2974 + 0x0840, 0x19C9, 0x2B52, 0x3ADB, 0x4E64, 0x5FED, 0x6D76, 0x7CFF,
2975 + 0x9489, 0x8500, 0xB79B, 0xA612, 0xD2AD, 0xC324, 0xF1BF, 0xE036,
2976 + 0x18C1, 0x0948, 0x3BD3, 0x2A5A, 0x5EE5, 0x4F6C, 0x7DF7, 0x6C7E,
2977 + 0xA50A, 0xB483, 0x8618, 0x9791, 0xE32E, 0xF2A7, 0xC03C, 0xD1B5,
2978 + 0x2942, 0x38CB, 0x0A50, 0x1BD9, 0x6F66, 0x7EEF, 0x4C74, 0x5DFD,
2979 + 0xB58B, 0xA402, 0x9699, 0x8710, 0xF3AF, 0xE226, 0xD0BD, 0xC134,
2980 + 0x39C3, 0x284A, 0x1AD1, 0x0B58, 0x7FE7, 0x6E6E, 0x5CF5, 0x4D7C,
2981 + 0xC60C, 0xD785, 0xE51E, 0xF497, 0x8028, 0x91A1, 0xA33A, 0xB2B3,
2982 + 0x4A44, 0x5BCD, 0x6956, 0x78DF, 0x0C60, 0x1DE9, 0x2F72, 0x3EFB,
2983 + 0xD68D, 0xC704, 0xF59F, 0xE416, 0x90A9, 0x8120, 0xB3BB, 0xA232,
2984 + 0x5AC5, 0x4B4C, 0x79D7, 0x685E, 0x1CE1, 0x0D68, 0x3FF3, 0x2E7A,
2985 + 0xE70E, 0xF687, 0xC41C, 0xD595, 0xA12A, 0xB0A3, 0x8238, 0x93B1,
2986 + 0x6B46, 0x7ACF, 0x4854, 0x59DD, 0x2D62, 0x3CEB, 0x0E70, 0x1FF9,
2987 + 0xF78F, 0xE606, 0xD49D, 0xC514, 0xB1AB, 0xA022, 0x92B9, 0x8330,
2988 + 0x7BC7, 0x6A4E, 0x58D5, 0x495C, 0x3DE3, 0x2C6A, 0x1EF1, 0x0F78
2993 + uint8 *pdata, /* pointer to array of data to process */
2994 + uint nbytes, /* number of input data bytes to process */
2995 + uint16 crc /* either CRC16_INIT_VALUE or previous return value */
2998 + while (nbytes-- > 0)
2999 + CRC_INNER_LOOP(16, crc, *pdata++);
3003 +static uint32 crc32_table[256] = {
3004 + 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA,
3005 + 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3,
3006 + 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988,
3007 + 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91,
3008 + 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE,
3009 + 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7,
3010 + 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC,
3011 + 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5,
3012 + 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172,
3013 + 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B,
3014 + 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940,
3015 + 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59,
3016 + 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116,
3017 + 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F,
3018 + 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924,
3019 + 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D,
3020 + 0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A,
3021 + 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433,
3022 + 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818,
3023 + 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01,
3024 + 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E,
3025 + 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457,
3026 + 0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C,
3027 + 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65,
3028 + 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2,
3029 + 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB,
3030 + 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0,
3031 + 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9,
3032 + 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086,
3033 + 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F,
3034 + 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4,
3035 + 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD,
3036 + 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A,
3037 + 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683,
3038 + 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8,
3039 + 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1,
3040 + 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE,
3041 + 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7,
3042 + 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC,
3043 + 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5,
3044 + 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252,
3045 + 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B,
3046 + 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60,
3047 + 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79,
3048 + 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236,
3049 + 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F,
3050 + 0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04,
3051 + 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D,
3052 + 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A,
3053 + 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713,
3054 + 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38,
3055 + 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21,
3056 + 0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E,
3057 + 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777,
3058 + 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C,
3059 + 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45,
3060 + 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2,
3061 + 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB,
3062 + 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0,
3063 + 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9,
3064 + 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6,
3065 + 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF,
3066 + 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94,
3067 + 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D
3072 + uint8 *pdata, /* pointer to array of data to process */
3073 + uint nbytes, /* number of input data bytes to process */
3074 + uint32 crc /* either CRC32_INIT_VALUE or previous return value */
3080 + ulong *tptr = (ulong *)tmp;
3082 + /* in case the beginning of the buffer isn't aligned */
3083 + pend = (uint8 *)((uint)(pdata + 3) & 0xfffffffc);
3084 + nbytes -= (pend - pdata);
3085 + while (pdata < pend)
3086 + CRC_INNER_LOOP(32, crc, *pdata++);
3088 + /* handle bulk of data as 32-bit words */
3089 + pend = pdata + (nbytes & 0xfffffffc);
3090 + while (pdata < pend) {
3091 + *tptr = *((ulong *)pdata)++;
3092 + CRC_INNER_LOOP(32, crc, tmp[0]);
3093 + CRC_INNER_LOOP(32, crc, tmp[1]);
3094 + CRC_INNER_LOOP(32, crc, tmp[2]);
3095 + CRC_INNER_LOOP(32, crc, tmp[3]);
3098 + /* 1-3 bytes at end of buffer */
3099 + pend = pdata + (nbytes & 0x03);
3100 + while (pdata < pend)
3101 + CRC_INNER_LOOP(32, crc, *pdata++);
3103 + pend = pdata + nbytes;
3104 + while (pdata < pend)
3105 + CRC_INNER_LOOP(32, crc, *pdata++);
3113 +#define CBUFSIZ (CLEN+4)
3116 +void testcrc32(void)
3122 + uint32 crc32tv[CNBUFS] =
3123 + {0xd2cb1faa, 0xd385c8fa, 0xf5b4f3f3, 0x55789e20, 0x00343110};
3125 + ASSERT((buf = MALLOC(CBUFSIZ*CNBUFS)) != NULL);
3127 + /* step through all possible alignments */
3128 + for (l=0;l<=4;l++) {
3129 + for (j=0; j<CNBUFS; j++) {
3131 + for (k=0; k<len[j]; k++)
3132 + *(buf + j*CBUFSIZ + (k+l)) = (j+k) & 0xff;
3135 + for (j=0; j<CNBUFS; j++) {
3136 + crcr = crc32(buf + j*CBUFSIZ + l, len[j], CRC32_INIT_VALUE);
3137 + ASSERT(crcr == crc32tv[j]);
3141 + MFREE(buf, CBUFSIZ*CNBUFS);
3148 diff -Nur linux-2.6.12.5/arch/mips/bcm947xx/broadcom/hnddma.c linux-2.6.12.5-brcm/arch/mips/bcm947xx/broadcom/hnddma.c
3149 --- linux-2.6.12.5/arch/mips/bcm947xx/broadcom/hnddma.c 1970-01-01 01:00:00.000000000 +0100
3150 +++ linux-2.6.12.5-brcm/arch/mips/bcm947xx/broadcom/hnddma.c 2005-08-28 11:12:20.430859152 +0200
3153 + * Generic Broadcom Home Networking Division (HND) DMA module.
3154 + * This supports the following chips: BCM42xx, 44xx, 47xx .
3156 + * Copyright 2001-2003, Broadcom Corporation
3157 + * All Rights Reserved.
3159 + * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
3160 + * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
3161 + * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
3162 + * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
3164 + * $Id: hnddma.c,v 1.1 2005/02/28 13:33:32 jolt Exp $
3167 +#include <typedefs.h>
3169 +#include <bcmendian.h>
3170 +#include <bcmutils.h>
3172 +struct dma_info; /* forward declaration */
3173 +#define di_t struct dma_info
3174 +#include <hnddma.h>
3177 +#define DMA_ERROR(args)
3178 +#define DMA_TRACE(args)
3180 +/* default dma message level(if input msg_level pointer is null in dma_attach()) */
3181 +static uint dma_msg_level = 0;
3184 +#define MAXDD (DMAMAXRINGSZ / sizeof (dmadd_t))
3186 +/* dma engine software state */
3187 +typedef struct dma_info {
3188 + hnddma_t hnddma; /* exported structure */
3189 + uint *msg_level; /* message level pointer */
3191 + char name[MAXNAMEL]; /* callers name for diag msgs */
3192 + void *drv; /* driver handle */
3193 + void *dev; /* device handle */
3194 + dmaregs_t *regs; /* dma engine registers */
3196 + dmadd_t *txd; /* pointer to chip-specific tx descriptor ring */
3197 + uint txin; /* index of next descriptor to reclaim */
3198 + uint txout; /* index of next descriptor to post */
3199 + uint txavail; /* # free tx descriptors */
3200 + void *txp[MAXDD]; /* parallel array of pointers to packets */
3201 + ulong txdpa; /* physical address of descriptor ring */
3202 + uint txdalign; /* #bytes added to alloc'd mem to align txd */
3204 + dmadd_t *rxd; /* pointer to chip-specific rx descriptor ring */
3205 + uint rxin; /* index of next descriptor to reclaim */
3206 + uint rxout; /* index of next descriptor to post */
3207 + void *rxp[MAXDD]; /* parallel array of pointers to packets */
3208 + ulong rxdpa; /* physical address of descriptor ring */
3209 + uint rxdalign; /* #bytes added to alloc'd mem to align rxd */
3212 + uint ntxd; /* # tx descriptors */
3213 + uint nrxd; /* # rx descriptors */
3214 + uint rxbufsize; /* rx buffer size in bytes */
3215 + uint nrxpost; /* # rx buffers to keep posted */
3216 + uint rxoffset; /* rxcontrol offset */
3217 + uint ddoffset; /* add to get dma address of descriptor ring */
3218 + uint dataoffset; /* add to get dma address of data buffer */
3221 +/* descriptor bumping macros */
3222 +#define NEXTTXD(i) ((i + 1) & (di->ntxd - 1))
3223 +#define PREVTXD(i) ((i - 1) & (di->ntxd - 1))
3224 +#define NEXTRXD(i) ((i + 1) & (di->nrxd - 1))
3225 +#define NTXDACTIVE(h, t) ((t - h) & (di->ntxd - 1))
3226 +#define NRXDACTIVE(h, t) ((t - h) & (di->nrxd - 1))
3228 +/* macros to convert between byte offsets and indexes */
3229 +#define B2I(bytes) ((bytes) / sizeof (dmadd_t))
3230 +#define I2B(index) ((index) * sizeof (dmadd_t))
3233 +dma_attach(void *drv, void *dev, char *name, dmaregs_t *regs, uint ntxd, uint nrxd,
3234 + uint rxbufsize, uint nrxpost, uint rxoffset, uint ddoffset, uint dataoffset, uint *msg_level)
3239 + ASSERT(ntxd <= MAXDD);
3240 + ASSERT(nrxd <= MAXDD);
3242 + /* allocate private info structure */
3243 + if ((di = MALLOC(sizeof (dma_info_t))) == NULL)
3245 + bzero((char*)di, sizeof (dma_info_t));
3247 + /* set message level */
3248 + di->msg_level = msg_level ? msg_level : &dma_msg_level;
3250 + DMA_TRACE(("%s: dma_attach: drv 0x%x dev 0x%x regs 0x%x ntxd %d nrxd %d rxbufsize %d nrxpost %d rxoffset %d ddoffset 0x%x dataoffset 0x%x\n", name, (uint)drv, (uint)dev, (uint)regs, ntxd, nrxd, rxbufsize, nrxpost, rxoffset, ddoffset, dataoffset));
3252 + /* make a private copy of our callers name */
3253 + strncpy(di->name, name, MAXNAMEL);
3254 + di->name[MAXNAMEL-1] = '\0';
3260 + /* allocate transmit descriptor ring */
3262 + if ((va = DMA_ALLOC_CONSISTENT(dev, (DMAMAXRINGSZ + DMARINGALIGN), &di->txdpa)) == NULL)
3264 + di->txd = (dmadd_t*) ROUNDUP(va, DMARINGALIGN);
3265 + di->txdalign = ((uint)di->txd - (uint)va);
3266 + di->txdpa = di->txdpa + di->txdalign;
3267 + ASSERT(ISALIGNED(di->txd, DMARINGALIGN));
3270 + /* allocate receive descriptor ring */
3272 + if ((va = DMA_ALLOC_CONSISTENT(dev, (DMAMAXRINGSZ + DMARINGALIGN), &di->rxdpa)) == NULL)
3274 + di->rxd = (dmadd_t*) ROUNDUP(va, DMARINGALIGN);
3275 + di->rxdalign = ((uint)di->rxd - (uint)va);
3276 + di->rxdpa = di->rxdpa + di->rxdalign;
3277 + ASSERT(ISALIGNED(di->rxd, DMARINGALIGN));
3280 + /* save tunables */
3283 + di->rxbufsize = rxbufsize;
3284 + di->nrxpost = nrxpost;
3285 + di->rxoffset = rxoffset;
3286 + di->ddoffset = ddoffset;
3287 + di->dataoffset = dataoffset;
3289 + return ((void*)di);
3292 + dma_detach((void*)di);
3296 +/* may be called with core in reset */
3298 +dma_detach(dma_info_t *di)
3303 + DMA_TRACE(("%s: dma_detach\n", di->name));
3305 + /* shouldn't be here if descriptors are unreclaimed */
3306 + ASSERT(di->txin == di->txout);
3307 + ASSERT(di->rxin == di->rxout);
3309 + /* free dma descriptor rings */
3311 + DMA_FREE_CONSISTENT(di->dev, (void *)((uint)di->txd - di->txdalign), (DMAMAXRINGSZ + DMARINGALIGN), di->txdpa);
3313 + DMA_FREE_CONSISTENT(di->dev, (void *)((uint)di->rxd - di->rxdalign), (DMAMAXRINGSZ + DMARINGALIGN), di->rxdpa);
3315 + /* free our private info structure */
3316 + MFREE((void*)di, sizeof (dma_info_t));
3321 +dma_txreset(dma_info_t *di)
3325 + DMA_TRACE(("%s: dma_txreset\n", di->name));
3327 + /* suspend tx DMA first */
3328 + W_REG(&di->regs->xmtcontrol, XC_SE);
3329 + SPINWAIT((status = (R_REG(&di->regs->xmtstatus) & XS_XS_MASK)) != XS_XS_DISABLED &&
3330 + status != XS_XS_IDLE &&
3331 + status != XS_XS_STOPPED,
3334 + W_REG(&di->regs->xmtcontrol, 0);
3335 + SPINWAIT((status = (R_REG(&di->regs->xmtstatus) & XS_XS_MASK)) != XS_XS_DISABLED,
3338 + if (status != XS_XS_DISABLED) {
3339 + DMA_ERROR(("%s: dma_txreset: dma cannot be stopped\n", di->name));
3342 + /* wait for the last transaction to complete */
3347 +dma_rxreset(dma_info_t *di)
3351 + DMA_TRACE(("%s: dma_rxreset\n", di->name));
3353 + W_REG(&di->regs->rcvcontrol, 0);
3354 + SPINWAIT((status = (R_REG(&di->regs->rcvstatus) & RS_RS_MASK)) != RS_RS_DISABLED,
3357 + if (status != RS_RS_DISABLED) {
3358 + DMA_ERROR(("%s: dma_rxreset: dma cannot be stopped\n", di->name));
3363 +dma_txinit(dma_info_t *di)
3365 + DMA_TRACE(("%s: dma_txinit\n", di->name));
3367 + di->txin = di->txout = 0;
3368 + di->txavail = di->ntxd - 1;
3370 + /* clear tx descriptor ring */
3371 + BZERO_SM((void*)di->txd, (di->ntxd * sizeof (dmadd_t)));
3373 + W_REG(&di->regs->xmtcontrol, XC_XE);
3374 + W_REG(&di->regs->xmtaddr, (di->txdpa + di->ddoffset));
3378 +dma_txenabled(dma_info_t *di)
3382 + /* If the chip is dead, it is not enabled :-) */
3383 + xc = R_REG(&di->regs->xmtcontrol);
3384 + return ((xc != 0xffffffff) && (xc & XC_XE));
3388 +dma_txsuspend(dma_info_t *di)
3390 + DMA_TRACE(("%s: dma_txsuspend\n", di->name));
3391 + OR_REG(&di->regs->xmtcontrol, XC_SE);
3395 +dma_txresume(dma_info_t *di)
3397 + DMA_TRACE(("%s: dma_txresume\n", di->name));
3398 + AND_REG(&di->regs->xmtcontrol, ~XC_SE);
3402 +dma_txsuspended(dma_info_t *di)
3407 + xc = R_REG(&di->regs->xmtcontrol);
3409 + xs = R_REG(&di->regs->xmtstatus);
3410 + return ((xs & XS_XS_MASK) == XS_XS_IDLE);
3416 +dma_txstopped(dma_info_t *di)
3418 + return ((R_REG(&di->regs->xmtstatus) & XS_XS_MASK) == XS_XS_STOPPED);
3422 +dma_rxstopped(dma_info_t *di)
3424 + return ((R_REG(&di->regs->rcvstatus) & RS_RS_MASK) == RS_RS_STOPPED);
3428 +dma_fifoloopbackenable(dma_info_t *di)
3430 + DMA_TRACE(("%s: dma_fifoloopbackenable\n", di->name));
3431 + OR_REG(&di->regs->xmtcontrol, XC_LE);
3435 +dma_rxinit(dma_info_t *di)
3437 + DMA_TRACE(("%s: dma_rxinit\n", di->name));
3439 + di->rxin = di->rxout = 0;
3441 + /* clear rx descriptor ring */
3442 + BZERO_SM((void*)di->rxd, (di->nrxd * sizeof (dmadd_t)));
3445 + W_REG(&di->regs->rcvaddr, (di->rxdpa + di->ddoffset));
3449 +dma_rxenable(dma_info_t *di)
3451 + DMA_TRACE(("%s: dma_rxenable\n", di->name));
3452 + W_REG(&di->regs->rcvcontrol, ((di->rxoffset << RC_RO_SHIFT) | RC_RE));
3456 +dma_rxenabled(dma_info_t *di)
3460 + rc = R_REG(&di->regs->rcvcontrol);
3461 + return ((rc != 0xffffffff) && (rc & RC_RE));
3465 + * The BCM47XX family supports full 32bit dma engine buffer addressing so
3466 + * dma buffers can cross 4 Kbyte page boundaries.
3469 +dma_txfast(dma_info_t *di, void *p0, uint32 coreflags)
3478 + DMA_TRACE(("%s: dma_txfast\n", di->name));
3480 + txout = di->txout;
3484 + * Walk the chain of packet buffers
3485 + * allocating and initializing transmit descriptor entries.
3487 + for (p = p0; p; p = next) {
3488 + data = PKTDATA(di->drv, p);
3489 + len = PKTLEN(di->drv, p);
3490 + next = PKTNEXT(di->drv, p);
3492 + /* return nonzero if out of tx descriptors */
3493 + if (NEXTTXD(txout) == di->txin)
3499 + /* get physical address of buffer start */
3500 + pa = (uint32) DMA_MAP(di->dev, data, len, DMA_TX, p);
3502 + /* build the descriptor control value */
3503 + ctrl = len & CTRL_BC_MASK;
3505 + ctrl |= coreflags;
3510 + ctrl |= (CTRL_IOC | CTRL_EOF);
3511 + if (txout == (di->ntxd - 1))
3514 + /* init the tx descriptor */
3515 + W_SM(&di->txd[txout].ctrl, BUS_SWAP32(ctrl));
3516 + W_SM(&di->txd[txout].addr, BUS_SWAP32(pa + di->dataoffset));
3518 + ASSERT(di->txp[txout] == NULL);
3520 + txout = NEXTTXD(txout);
3523 + /* if last txd eof not set, fix it */
3524 + if (!(ctrl & CTRL_EOF))
3525 + W_SM(&di->txd[PREVTXD(txout)].ctrl, BUS_SWAP32(ctrl | CTRL_IOC | CTRL_EOF));
3527 + /* save the packet */
3528 + di->txp[PREVTXD(txout)] = p0;
3530 + /* bump the tx descriptor index */
3531 + di->txout = txout;
3533 + /* kick the chip */
3534 + W_REG(&di->regs->xmtptr, I2B(txout));
3536 + /* tx flow control */
3537 + di->txavail = di->ntxd - NTXDACTIVE(di->txin, di->txout) - 1;
3542 + DMA_ERROR(("%s: dma_txfast: out of txds\n", di->name));
3543 + PKTFREE(di->drv, p0, TRUE);
3545 + di->hnddma.txnobuf++;
3549 +#define PAGESZ 4096
3550 +#define PAGEBASE(x) ((uint)(x) & ~4095)
3553 + * Just like above except go through the extra effort of splitting
3554 + * buffers that cross 4Kbyte boundaries into multiple tx descriptors.
3557 +dma_tx(dma_info_t *di, void *p0, uint32 coreflags)
3562 + uchar *page, *start, *end;
3567 + DMA_TRACE(("%s: dma_tx\n", di->name));
3569 + txout = di->txout;
3573 + * Walk the chain of packet buffers
3574 + * splitting those that cross 4 Kbyte boundaries
3575 + * allocating and initializing transmit descriptor entries.
3577 + for (p = p0; p; p = next) {
3578 + data = PKTDATA(di->drv, p);
3579 + plen = PKTLEN(di->drv, p);
3580 + next = PKTNEXT(di->drv, p);
3585 + for (page = (uchar*)PAGEBASE(data);
3586 + page <= (uchar*)PAGEBASE(data + plen - 1);
3589 + /* return nonzero if out of tx descriptors */
3590 + if (NEXTTXD(txout) == di->txin)
3593 + start = (page == (uchar*)PAGEBASE(data))? data: page;
3594 + end = (page == (uchar*)PAGEBASE(data + plen))?
3595 + (data + plen): (page + PAGESZ);
3596 + len = end - start;
3598 + /* build the descriptor control value */
3599 + ctrl = len & CTRL_BC_MASK;
3601 + ctrl |= coreflags;
3603 + if ((p == p0) && (start == data))
3605 + if ((next == NULL) && (end == (data + plen)))
3606 + ctrl |= (CTRL_IOC | CTRL_EOF);
3607 + if (txout == (di->ntxd - 1))
3610 + /* get physical address of buffer start */
3611 + pa = (uint32) DMA_MAP(di->dev, start, len, DMA_TX, p);
3613 + /* init the tx descriptor */
3614 + W_SM(&di->txd[txout].ctrl, BUS_SWAP32(ctrl));
3615 + W_SM(&di->txd[txout].addr, BUS_SWAP32(pa + di->dataoffset));
3617 + ASSERT(di->txp[txout] == NULL);
3619 + txout = NEXTTXD(txout);
3623 + /* if last txd eof not set, fix it */
3624 + if (!(ctrl & CTRL_EOF))
3625 + W_SM(&di->txd[PREVTXD(txout)].ctrl, BUS_SWAP32(ctrl | CTRL_IOC | CTRL_EOF));
3627 + /* save the packet */
3628 + di->txp[PREVTXD(txout)] = p0;
3630 + /* bump the tx descriptor index */
3631 + di->txout = txout;
3633 + /* kick the chip */
3634 + W_REG(&di->regs->xmtptr, I2B(txout));
3636 + /* tx flow control */
3637 + di->txavail = di->ntxd - NTXDACTIVE(di->txin, di->txout) - 1;
3642 + DMA_ERROR(("%s: dma_tx: out of txds\n", di->name));
3643 + PKTFREE(di->drv, p0, TRUE);
3645 + di->hnddma.txnobuf++;
3649 +/* returns a pointer to the next frame received, or NULL if there are no more */
3651 +dma_rx(dma_info_t *di)
3657 + while ((p = dma_getnextrxp(di, FALSE))) {
3658 + /* skip giant packets which span multiple rx descriptors */
3659 + if (skiplen > 0) {
3660 + skiplen -= di->rxbufsize;
3663 + PKTFREE(di->drv, p, FALSE);
3667 + len = ltoh16(*(uint16*)(PKTDATA(di->drv, p)));
3668 + DMA_TRACE(("%s: dma_rx len %d\n", di->name, len));
3670 + /* bad frame length check */
3671 + if (len > (di->rxbufsize - di->rxoffset)) {
3672 + DMA_ERROR(("%s: dma_rx: bad frame length (%d)\n", di->name, len));
3674 + skiplen = len - (di->rxbufsize - di->rxoffset);
3675 + PKTFREE(di->drv, p, FALSE);
3676 + di->hnddma.rxgiants++;
3680 + /* set actual length */
3681 + PKTSETLEN(di->drv, p, (di->rxoffset + len));
3689 +/* post receive buffers */
3691 +dma_rxfill(dma_info_t *di)
3702 + * Determine how many receive buffers we're lacking
3703 + * from the full complement, allocate, initialize,
3704 + * and post them, then update the chip rx lastdscr.
3708 + rxout = di->rxout;
3709 + rxbufsize = di->rxbufsize;
3711 + n = di->nrxpost - NRXDACTIVE(rxin, rxout);
3713 + DMA_TRACE(("%s: dma_rxfill: post %d\n", di->name, n));
3715 + for (i = 0; i < n; i++) {
3716 + if ((p = PKTGET(di->drv, rxbufsize, FALSE)) == NULL) {
3717 + DMA_ERROR(("%s: dma_rxfill: out of rxbufs\n", di->name));
3718 + di->hnddma.rxnobuf++;
3722 + *(uint32*)(OSL_UNCACHED(PKTDATA(di->drv, p))) = 0;
3724 + pa = (uint32) DMA_MAP(di->dev, PKTDATA(di->drv, p), rxbufsize, DMA_RX, p);
3725 + ASSERT(ISALIGNED(pa, 4));
3727 + /* save the free packet pointer */
3728 + ASSERT(di->rxp[rxout] == NULL);
3729 + di->rxp[rxout] = p;
3731 + /* prep the descriptor control value */
3733 + if (rxout == (di->nrxd - 1))
3736 + /* init the rx descriptor */
3737 + W_SM(&di->rxd[rxout].ctrl, BUS_SWAP32(ctrl));
3738 + W_SM(&di->rxd[rxout].addr, BUS_SWAP32(pa + di->dataoffset));
3740 + rxout = NEXTRXD(rxout);
3743 + di->rxout = rxout;
3745 + /* update the chip lastdscr pointer */
3746 + W_REG(&di->regs->rcvptr, I2B(rxout));
3750 +dma_txreclaim(dma_info_t *di, bool forceall)
3754 + DMA_TRACE(("%s: dma_txreclaim %s\n", di->name, forceall ? "all" : ""));
3756 + while ((p = dma_getnexttxp(di, forceall)))
3757 + PKTFREE(di->drv, p, TRUE);
3761 + * Reclaim next completed txd (txds if using chained buffers) and
3762 + * return associated packet.
3763 + * If 'force' is true, reclaim txd(s) and return associated packet
3764 + * regardless of the value of the hardware "curr" pointer.
3767 +dma_getnexttxp(dma_info_t *di, bool forceall)
3769 + uint start, end, i;
3772 + DMA_TRACE(("%s: dma_getnexttxp %s\n", di->name, forceall ? "all" : ""));
3780 + end = B2I(R_REG(&di->regs->xmtstatus) & XS_CD_MASK);
3782 + if ((start == 0) && (end > di->txout))
3785 + for (i = start; i != end && !txp; i = NEXTTXD(i)) {
3786 + DMA_UNMAP(di->dev, (BUS_SWAP32(R_SM(&di->txd[i].addr)) - di->dataoffset),
3787 + (BUS_SWAP32(R_SM(&di->txd[i].ctrl)) & CTRL_BC_MASK), DMA_TX, di->txp[i]);
3788 + W_SM(&di->txd[i].addr, 0xdeadbeef);
3790 + di->txp[i] = NULL;
3795 + /* tx flow control */
3796 + di->txavail = di->ntxd - NTXDACTIVE(di->txin, di->txout) - 1;
3802 + DMA_ERROR(("dma_getnexttxp: bogus curr: start %d end %d txout %d force %d\n",
3803 + start, end, di->txout, forceall));
3809 +dma_rxreclaim(dma_info_t *di)
3813 + DMA_TRACE(("%s: dma_rxreclaim\n", di->name));
3815 + while ((p = dma_getnextrxp(di, TRUE)))
3816 + PKTFREE(di->drv, p, FALSE);
3820 +dma_getnextrxp(dma_info_t *di, bool forceall)
3825 + /* if forcing, dma engine must be disabled */
3826 + ASSERT(!forceall || !dma_rxenabled(di));
3830 + /* return if no packets posted */
3831 + if (i == di->rxout)
3834 + /* ignore curr if forceall */
3835 + if (!forceall && (i == B2I(R_REG(&di->regs->rcvstatus) & RS_CD_MASK)))
3838 + /* get the packet pointer that corresponds to the rx descriptor */
3841 + di->rxp[i] = NULL;
3843 + /* clear this packet from the descriptor ring */
3844 + DMA_UNMAP(di->dev, (BUS_SWAP32(R_SM(&di->rxd[i].addr)) - di->dataoffset),
3845 + di->rxbufsize, DMA_RX, rxp);
3846 + W_SM(&di->rxd[i].addr, 0xdeadbeef);
3848 + di->rxin = NEXTRXD(i);
3854 +dma_dumptx(dma_info_t *di, char *buf)
3856 + buf += sprintf(buf, "txd 0x%lx txdpa 0x%lx txp 0x%lx txin %d txout %d txavail %d\n",
3857 + (ulong)di->txd, di->txdpa, (ulong)di->txp, di->txin, di->txout, di->txavail);
3858 + buf += sprintf(buf, "xmtcontrol 0x%x xmtaddr 0x%x xmtptr 0x%x xmtstatus 0x%x\n",
3859 + R_REG(&di->regs->xmtcontrol),
3860 + R_REG(&di->regs->xmtaddr),
3861 + R_REG(&di->regs->xmtptr),
3862 + R_REG(&di->regs->xmtstatus));
3867 +dma_dumprx(dma_info_t *di, char *buf)
3869 + buf += sprintf(buf, "rxd 0x%lx rxdpa 0x%lx rxp 0x%lx rxin %d rxout %d\n",
3870 + (ulong)di->rxd, di->rxdpa, (ulong)di->rxp, di->rxin, di->rxout);
3871 + buf += sprintf(buf, "rcvcontrol 0x%x rcvaddr 0x%x rcvptr 0x%x rcvstatus 0x%x\n",
3872 + R_REG(&di->regs->rcvcontrol),
3873 + R_REG(&di->regs->rcvaddr),
3874 + R_REG(&di->regs->rcvptr),
3875 + R_REG(&di->regs->rcvstatus));
3880 +dma_dump(dma_info_t *di, char *buf)
3882 + buf = dma_dumptx(di, buf);
3883 + buf = dma_dumprx(di, buf);
3888 +dma_getvar(dma_info_t *di, char *name)
3890 + if (!strcmp(name, "&txavail"))
3891 + return ((uint) &di->txavail);
3899 +dma_txblock(dma_info_t *di)
3905 +dma_txunblock(dma_info_t *di)
3907 + di->txavail = di->ntxd - NTXDACTIVE(di->txin, di->txout) - 1;
3911 +dma_txactive(dma_info_t *di)
3913 + return (NTXDACTIVE(di->txin, di->txout));
3915 diff -Nur linux-2.6.12.5/arch/mips/bcm947xx/broadcom/linux_osl.c linux-2.6.12.5-brcm/arch/mips/bcm947xx/broadcom/linux_osl.c
3916 --- linux-2.6.12.5/arch/mips/bcm947xx/broadcom/linux_osl.c 1970-01-01 01:00:00.000000000 +0100
3917 +++ linux-2.6.12.5-brcm/arch/mips/bcm947xx/broadcom/linux_osl.c 2005-08-28 11:12:20.476852160 +0200
3920 + * Linux OS Independent Layer
3922 + * Copyright 2001-2003, Broadcom Corporation
3923 + * All Rights Reserved.
3925 + * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
3926 + * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
3927 + * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
3928 + * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
3930 + * $Id: linux_osl.c,v 1.2 2005/02/28 13:34:25 jolt Exp $
3935 +#include <typedefs.h>
3936 +#include <bcmendian.h>
3937 +#include <linuxver.h>
3938 +#include <linux_osl.h>
3939 +#include <bcmutils.h>
3940 +#include <linux/delay.h>
3942 +#include <asm/paccess.h>
3944 +#include <pcicfg.h>
3946 +#define PCI_CFG_RETRY 10
3949 +osl_pktget(void *drv, uint len, bool send)
3951 + struct sk_buff *skb;
3953 + if ((skb = dev_alloc_skb(len)) == NULL)
3956 + skb_put(skb, len);
3958 + /* ensure the cookie field is cleared */
3959 + PKTSETCOOKIE(skb, NULL);
3961 + return ((void*) skb);
3965 +osl_pktfree(void *p)
3967 + struct sk_buff *skb, *nskb;
3969 + skb = (struct sk_buff*) p;
3971 + /* perversion: we use skb->next to chain multi-skb packets */
3975 + if (skb->destructor) {
3976 + /* cannot kfree_skb() on hard IRQ (net/core/skbuff.c) if destructor exists */
3977 + dev_kfree_skb_any(skb);
3979 + /* can free immediately (even in_irq()) if destructor does not exist */
3980 + dev_kfree_skb(skb);
3987 +osl_pci_read_config(void *loc, uint offset, uint size)
3989 + struct pci_dev *pdev;
3991 + uint retry=PCI_CFG_RETRY;
3993 + /* only 4byte access supported */
3994 + ASSERT(size == 4);
3996 + pdev = (struct pci_dev*)loc;
3998 + pci_read_config_dword(pdev, offset, &val);
3999 + if (val != 0xffffffff)
4001 + } while (retry--);
4008 +osl_pci_write_config(void *loc, uint offset, uint size, uint val)
4010 + struct pci_dev *pdev;
4011 + uint retry=PCI_CFG_RETRY;
4013 + /* only 4byte access supported */
4014 + ASSERT(size == 4);
4016 + pdev = (struct pci_dev*)loc;
4019 + pci_write_config_dword(pdev, offset, val);
4020 + if (offset!=PCI_BAR0_WIN)
4022 + if (osl_pci_read_config(loc,offset,size) == val)
4024 + } while (retry--);
4029 +osl_pcmcia_read_attr(void *osh, uint offset, void *buf, int size)
4035 +osl_pcmcia_write_attr(void *osh, uint offset, void *buf, int size)
4041 +osl_assert(char *exp, char *file, int line)
4043 + char tempbuf[255];
4045 + sprintf(tempbuf, "assertion \"%s\" failed: file \"%s\", line %d\n", exp, file, line);
4050 + * BINOSL selects the slightly slower function-call-based binary compatible osl.
4055 +osl_printf(const char *format, ...)
4061 + /* sprintf into a local buffer because there *is* no "vprintk()".. */
4062 + va_start(args, format);
4063 + len = vsprintf(buf, format, args);
4066 + if (len > sizeof (buf)) {
4067 + printk("osl_printf: buffer overrun\n");
4071 + return (printk(buf));
4075 +osl_sprintf(char *buf, const char *format, ...)
4080 + va_start(args, format);
4081 + rc = vsprintf(buf, format, args);
4087 +osl_strcmp(const char *s1, const char *s2)
4089 + return (strcmp(s1, s2));
4093 +osl_strncmp(const char *s1, const char *s2, uint n)
4095 + return (strncmp(s1, s2, n));
4099 +osl_strlen(char *s)
4101 + return (strlen(s));
4105 +osl_strcpy(char *d, const char *s)
4107 + return (strcpy(d, s));
4111 +osl_strncpy(char *d, const char *s, uint n)
4113 + return (strncpy(d, s, n));
4117 +bcopy(const void *src, void *dst, int len)
4119 + memcpy(dst, src, len);
4123 +bcmp(const void *b1, const void *b2, int len)
4125 + return (memcmp(b1, b2, len));
4129 +bzero(void *b, int len)
4131 + memset(b, '\0', len);
4135 +osl_malloc(uint size)
4137 + return (kmalloc(size, GFP_ATOMIC));
4141 +osl_mfree(void *addr, uint size)
4147 +osl_readl(volatile uint32 *r)
4149 + return (readl(r));
4153 +osl_readw(volatile uint16 *r)
4155 + return (readw(r));
4159 +osl_readb(volatile uint8 *r)
4161 + return (readb(r));
4165 +osl_writel(uint32 v, volatile uint32 *r)
4171 +osl_writew(uint16 v, volatile uint16 *r)
4177 +osl_writeb(uint8 v, volatile uint8 *r)
4183 +osl_uncached(void *va)
4186 + return ((void*)KSEG1ADDR(va));
4188 + return ((void*)va);
4193 +osl_getcycles(void)
4198 + cycles = read_c0_count() * 2;
4199 +#elif defined(__i386__)
4208 +osl_reg_map(uint32 pa, uint size)
4210 + return (ioremap_nocache((unsigned long)pa, (unsigned long)size));
4214 +osl_reg_unmap(void *va)
4220 +osl_busprobe(uint32 *val, uint32 addr)
4223 + return get_dbe(*val, (uint32*)addr);
4225 + *val = readl(addr);
4231 +osl_dma_alloc_consistent(void *dev, uint size, ulong *pap)
4233 + return (pci_alloc_consistent((struct pci_dev*)dev, size, (dma_addr_t*)pap));
4237 +osl_dma_free_consistent(void *dev, void *va, uint size, ulong pa)
4239 + pci_free_consistent((struct pci_dev*)dev, size, va, (dma_addr_t)pa);
4243 +osl_dma_map(void *dev, void *va, uint size, int direction)
4247 + dir = (direction == DMA_TX)? PCI_DMA_TODEVICE: PCI_DMA_FROMDEVICE;
4248 + return (pci_map_single(dev, va, size, dir));
4252 +osl_dma_unmap(void *dev, uint pa, uint size, int direction)
4256 + dir = (direction == DMA_TX)? PCI_DMA_TODEVICE: PCI_DMA_FROMDEVICE;
4257 + pci_unmap_single(dev, (uint32)pa, size, dir);
4261 +osl_delay(uint usec)
4267 +osl_pktdata(void *drv, void *skb)
4269 + return (((struct sk_buff*)skb)->data);
4273 +osl_pktlen(void *drv, void *skb)
4275 + return (((struct sk_buff*)skb)->len);
4279 +osl_pktnext(void *drv, void *skb)
4281 + return (((struct sk_buff*)skb)->next);
4285 +osl_pktsetnext(void *skb, void *x)
4287 + ((struct sk_buff*)skb)->next = (struct sk_buff*)x;
4291 +osl_pktsetlen(void *drv, void *skb, uint len)
4293 + __skb_trim((struct sk_buff*)skb, len);
4297 +osl_pktpush(void *drv, void *skb, int bytes)
4299 + return (skb_push((struct sk_buff*)skb, bytes));
4303 +osl_pktpull(void *drv, void *skb, int bytes)
4305 + return (skb_pull((struct sk_buff*)skb, bytes));
4309 +osl_pktdup(void *drv, void *skb)
4311 + return (skb_clone((struct sk_buff*)skb, GFP_ATOMIC));
4315 +osl_pktcookie(void *skb)
4317 + return ((void*)((struct sk_buff*)skb)->csum);
4321 +osl_pktsetcookie(void *skb, void *x)
4323 + ((struct sk_buff*)skb)->csum = (uint)x;
4327 +osl_pktlink(void *skb)
4329 + return (((struct sk_buff*)skb)->prev);
4333 +osl_pktsetlink(void *skb, void *x)
4335 + ((struct sk_buff*)skb)->prev = (struct sk_buff*)x;
4339 diff -Nur linux-2.6.12.5/arch/mips/bcm947xx/broadcom/sbmips.c linux-2.6.12.5-brcm/arch/mips/bcm947xx/broadcom/sbmips.c
4340 --- linux-2.6.12.5/arch/mips/bcm947xx/broadcom/sbmips.c 1970-01-01 01:00:00.000000000 +0100
4341 +++ linux-2.6.12.5-brcm/arch/mips/bcm947xx/broadcom/sbmips.c 2005-08-28 11:12:20.478851856 +0200
4344 + * BCM47XX Sonics SiliconBackplane MIPS core routines
4346 + * Copyright 2001-2003, Broadcom Corporation
4347 + * All Rights Reserved.
4349 + * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
4350 + * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
4351 + * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
4352 + * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
4354 + * $Id: sbmips.c,v 1.1 2005/02/28 13:33:32 jolt Exp $
4357 +#include <typedefs.h>
4359 +#include <sbutils.h>
4360 +#include <bcmdevs.h>
4361 +#include <bcmnvram.h>
4362 +#include <bcmutils.h>
4363 +#include <hndmips.h>
4364 +#include <sbconfig.h>
4365 +#include <sbextif.h>
4366 +#include <sbchipc.h>
4367 +#include <sbmemc.h>
4370 + * Memory segments (32bit kernel mode addresses)
4377 +#define KUSEG 0x00000000
4378 +#define KSEG0 0x80000000
4379 +#define KSEG1 0xa0000000
4380 +#define KSEG2 0xc0000000
4381 +#define KSEG3 0xe0000000
4384 + * Map an address to a certain kernel segment
4390 +#define KSEG0ADDR(a) (((a) & 0x1fffffff) | KSEG0)
4391 +#define KSEG1ADDR(a) (((a) & 0x1fffffff) | KSEG1)
4392 +#define KSEG2ADDR(a) (((a) & 0x1fffffff) | KSEG2)
4393 +#define KSEG3ADDR(a) (((a) & 0x1fffffff) | KSEG3)
4396 + * The following macros are especially useful for __asm__
4397 + * inline assembler.
4400 +#define __STR(x) #x
4403 +#define STR(x) __STR(x)
4406 +/* *********************************************************************
4408 + ********************************************************************* */
4410 +#define C0_INX 0 /* CP0: TLB Index */
4411 +#define C0_RAND 1 /* CP0: TLB Random */
4412 +#define C0_TLBLO0 2 /* CP0: TLB EntryLo0 */
4413 +#define C0_TLBLO C0_TLBLO0 /* CP0: TLB EntryLo0 */
4414 +#define C0_TLBLO1 3 /* CP0: TLB EntryLo1 */
4415 +#define C0_CTEXT 4 /* CP0: Context */
4416 +#define C0_PGMASK 5 /* CP0: TLB PageMask */
4417 +#define C0_WIRED 6 /* CP0: TLB Wired */
4418 +#define C0_BADVADDR 8 /* CP0: Bad Virtual Address */
4419 +#define C0_COUNT 9 /* CP0: Count */
4420 +#define C0_TLBHI 10 /* CP0: TLB EntryHi */
4421 +#define C0_COMPARE 11 /* CP0: Compare */
4422 +#define C0_SR 12 /* CP0: Processor Status */
4423 +#define C0_STATUS C0_SR /* CP0: Processor Status */
4424 +#define C0_CAUSE 13 /* CP0: Exception Cause */
4425 +#define C0_EPC 14 /* CP0: Exception PC */
4426 +#define C0_PRID 15 /* CP0: Processor Revision Indentifier */
4427 +#define C0_CONFIG 16 /* CP0: Config */
4428 +#define C0_LLADDR 17 /* CP0: LLAddr */
4429 +#define C0_WATCHLO 18 /* CP0: WatchpointLo */
4430 +#define C0_WATCHHI 19 /* CP0: WatchpointHi */
4431 +#define C0_XCTEXT 20 /* CP0: XContext */
4432 +#define C0_DIAGNOSTIC 22 /* CP0: Diagnostic */
4433 +#define C0_BROADCOM C0_DIAGNOSTIC /* CP0: Broadcom Register */
4434 +#define C0_ECC 26 /* CP0: ECC */
4435 +#define C0_CACHEERR 27 /* CP0: CacheErr */
4436 +#define C0_TAGLO 28 /* CP0: TagLo */
4437 +#define C0_TAGHI 29 /* CP0: TagHi */
4438 +#define C0_ERREPC 30 /* CP0: ErrorEPC */
4441 + * Macros to access the system control coprocessor
4444 +#define MFC0(source, sel) \
4447 + __asm__ __volatile__( \
4448 + ".set\tnoreorder\n\t" \
4449 + ".set\tnoat\n\t" \
4450 + ".word\t"STR(0x40010000 | ((source)<<11) | (sel))"\n\t" \
4451 + "move\t%0,$1\n\t" \
4460 +#define MTC0(source, sel, value) \
4462 + __asm__ __volatile__( \
4463 + ".set\tnoreorder\n\t" \
4464 + ".set\tnoat\n\t" \
4465 + "move\t$1,%z0\n\t" \
4466 + ".word\t"STR(0x40810000 | ((source)<<11) | (sel))"\n\t" \
4475 + * R4x00 interrupt enable / cause bits
4485 +#define IE_SW0 (1<< 8)
4486 +#define IE_SW1 (1<< 9)
4487 +#define IE_IRQ0 (1<<10)
4488 +#define IE_IRQ1 (1<<11)
4489 +#define IE_IRQ2 (1<<12)
4490 +#define IE_IRQ3 (1<<13)
4491 +#define IE_IRQ4 (1<<14)
4492 +#define IE_IRQ5 (1<<15)
4495 + * Bitfields in the R4xx0 cp0 status register
4497 +#define ST0_IE 0x00000001
4498 +#define ST0_EXL 0x00000002
4499 +#define ST0_ERL 0x00000004
4500 +#define ST0_KSU 0x00000018
4501 +# define KSU_USER 0x00000010
4502 +# define KSU_SUPERVISOR 0x00000008
4503 +# define KSU_KERNEL 0x00000000
4504 +#define ST0_UX 0x00000020
4505 +#define ST0_SX 0x00000040
4506 +#define ST0_KX 0x00000080
4507 +#define ST0_DE 0x00010000
4508 +#define ST0_CE 0x00020000
4511 + * Status register bits available in all MIPS CPUs.
4513 +#define ST0_IM 0x0000ff00
4514 +#define ST0_CH 0x00040000
4515 +#define ST0_SR 0x00100000
4516 +#define ST0_TS 0x00200000
4517 +#define ST0_BEV 0x00400000
4518 +#define ST0_RE 0x02000000
4519 +#define ST0_FR 0x04000000
4520 +#define ST0_CU 0xf0000000
4521 +#define ST0_CU0 0x10000000
4522 +#define ST0_CU1 0x20000000
4523 +#define ST0_CU2 0x40000000
4524 +#define ST0_CU3 0x80000000
4525 +#define ST0_XX 0x80000000 /* MIPS IV naming */
4528 + * Cache Operations
4532 +#define Fill_I 0x14
4535 +#define cache_unroll(base,op) \
4536 + __asm__ __volatile__(" \
4547 + * These are the UART port assignments, expressed as offsets from the base
4548 + * register. These assignments should hold for any serial port based on
4549 + * a 8250, 16450, or 16550(A).
4552 +#define UART_MCR 4 /* Out: Modem Control Register */
4553 +#define UART_MSR 6 /* In: Modem Status Register */
4554 +#define UART_MCR_LOOP 0x10 /* Enable loopback test mode */
4557 + * Returns TRUE if an external UART exists at the given base
4561 +serial_exists(uint8 *regs)
4563 + uint8 save_mcr, status1;
4565 + save_mcr = R_REG(®s[UART_MCR]);
4566 + W_REG(®s[UART_MCR], UART_MCR_LOOP | 0x0a);
4567 + status1 = R_REG(®s[UART_MSR]) & 0xf0;
4568 + W_REG(®s[UART_MCR], save_mcr);
4570 + return (status1 == 0x90);
4574 + * Initializes UART access. The callback function will be called once
4578 +sb_serial_init(void *sbh, void (*add)(void *regs, uint irq, uint baud_base, uint reg_shift))
4585 + if ((regs = sb_setcore(sbh, SB_EXTIF, 0))) {
4586 + extifregs_t *eir = (extifregs_t *) regs;
4589 + /* Determine external UART register base */
4590 + sb = (sbconfig_t *)((ulong) eir + SBCONFIGOFF);
4591 + base = EXTIF_CFGIF_BASE(sb_base(R_REG(&sb->sbadmatch1)));
4593 + /* Determine IRQ */
4594 + irq = sb_irq(sbh);
4596 + /* Disable GPIO interrupt initially */
4597 + W_REG(&eir->gpiointpolarity, 0);
4598 + W_REG(&eir->gpiointmask, 0);
4600 + /* Search for external UARTs */
4602 + for (i = 0; i < 2; i++) {
4603 + regs = (void *) REG_MAP(base + (i * 8), 8);
4604 + if (serial_exists(regs)) {
4605 + /* Set GPIO 1 to be the external UART IRQ */
4606 + W_REG(&eir->gpiointmask, 2);
4608 + add(regs, irq, 13500000, 0);
4612 + /* Add internal UART if enabled */
4613 + if (R_REG(&eir->corecontrol) & CC_UE)
4615 + add((void *) &eir->uartdata, irq, sb_clock(sbh), 2);
4616 + } else if ((regs = sb_setcore(sbh, SB_CC, 0))) {
4617 + chipcregs_t *cc = (chipcregs_t *) regs;
4618 + uint32 rev, cap, pll, baud_base, div;
4620 + /* Determine core revision and capabilities */
4621 + rev = sb_corerev(sbh);
4622 + cap = R_REG(&cc->capabilities);
4623 + pll = cap & CAP_PLL_MASK;
4625 + /* Determine IRQ */
4626 + irq = sb_irq(sbh);
4628 + if (pll == PLL_TYPE1) {
4630 + baud_base = sb_clock_rate(pll,
4631 + R_REG(&cc->clockcontrol_n),
4632 + R_REG(&cc->clockcontrol_m2));
4634 + } else if (rev >= 3) {
4635 + /* Internal backplane clock */
4636 + baud_base = sb_clock_rate(pll,
4637 + R_REG(&cc->clockcontrol_n),
4638 + R_REG(&cc->clockcontrol_sb));
4639 + div = 2; /* Minimum divisor */
4640 + W_REG(&cc->uart_clkdiv, div);
4642 + /* Fixed internal backplane clock */
4643 + baud_base = 88000000;
4647 + /* Clock source depends on strapping if UartClkOverride is unset */
4648 + if ((rev > 0) && ((R_REG(&cc->corecontrol) & CC_UARTCLKO) == 0)) {
4649 + if ((cap & CAP_UCLKSEL) == CAP_UINTCLK) {
4650 + /* Internal divided backplane clock */
4653 + /* Assume external clock of 1.8432 MHz */
4654 + baud_base = 1843200;
4658 + /* Add internal UARTs */
4659 + n = cap & CAP_UARTS_MASK;
4660 + for (i = 0; i < n; i++) {
4661 + /* Register offset changed after revision 0 */
4663 + regs = (void *)((ulong) &cc->uart0data + (i * 256));
4665 + regs = (void *)((ulong) &cc->uart0data + (i * 8));
4668 + add(regs, irq, baud_base, 0);
4673 +/* Returns the SB interrupt flag of the current core. */
4680 + regs = sb_coreregs(sbh);
4681 + sb = (sbconfig_t *)((ulong) regs + SBCONFIGOFF);
4683 + return (R_REG(&sb->sbtpsflag) & SBTPS_NUM0_MASK);
4686 +static const uint32 sbips_int_mask[] = {
4694 +static const uint32 sbips_int_shift[] = {
4703 + * Returns the MIPS IRQ assignment of the current core. If unassigned,
4712 + uint32 flag, sbipsflag;
4715 + flag = sb_flag(sbh);
4717 + idx = sb_coreidx(sbh);
4719 + if ((regs = sb_setcore(sbh, SB_MIPS, 0)) ||
4720 + (regs = sb_setcore(sbh, SB_MIPS33, 0))) {
4721 + sb = (sbconfig_t *)((ulong) regs + SBCONFIGOFF);
4723 + /* sbipsflag specifies which core is routed to interrupts 1 to 4 */
4724 + sbipsflag = R_REG(&sb->sbipsflag);
4725 + for (irq = 1; irq <= 4; irq++) {
4726 + if (((sbipsflag & sbips_int_mask[irq]) >> sbips_int_shift[irq]) == flag)
4733 + sb_setcoreidx(sbh, idx);
4738 +/* Clears the specified MIPS IRQ. */
4740 +sb_clearirq(void *sbh, uint irq)
4745 + if (!(regs = sb_setcore(sbh, SB_MIPS, 0)) &&
4746 + !(regs = sb_setcore(sbh, SB_MIPS33, 0)))
4748 + sb = (sbconfig_t *)((ulong) regs + SBCONFIGOFF);
4751 + W_REG(&sb->sbintvec, 0);
4753 + OR_REG(&sb->sbipsflag, sbips_int_mask[irq]);
4757 + * Assigns the specified MIPS IRQ to the specified core. Shared MIPS
4758 + * IRQ 0 may be assigned more than once.
4761 +sb_setirq(void *sbh, uint irq, uint coreid, uint coreunit)
4767 + regs = sb_setcore(sbh, coreid, coreunit);
4769 + flag = sb_flag(sbh);
4771 + if (!(regs = sb_setcore(sbh, SB_MIPS, 0)) &&
4772 + !(regs = sb_setcore(sbh, SB_MIPS33, 0)))
4774 + sb = (sbconfig_t *)((ulong) regs + SBCONFIGOFF);
4777 + OR_REG(&sb->sbintvec, 1 << flag);
4779 + flag <<= sbips_int_shift[irq];
4780 + ASSERT(!(flag & ~sbips_int_mask[irq]));
4781 + flag |= R_REG(&sb->sbipsflag) & ~sbips_int_mask[irq];
4782 + W_REG(&sb->sbipsflag, flag);
4787 + * Initializes clocks and interrupts. SB and NVRAM access must be
4788 + * initialized prior to calling.
4791 +sb_mips_init(void *sbh)
4793 + ulong hz, ns, tmp;
4799 + /* Figure out current SB clock speed */
4800 + if ((hz = sb_clock(sbh)) == 0)
4802 + ns = 1000000000 / hz;
4804 + /* Setup external interface timing */
4805 + if ((eir = sb_setcore(sbh, SB_EXTIF, 0))) {
4806 + /* Initialize extif so we can get to the LEDs and external UART */
4807 + W_REG(&eir->prog_config, CF_EN);
4809 + /* Set timing for the flash */
4810 + tmp = CEIL(10, ns) << FW_W3_SHIFT; /* W3 = 10nS */
4811 + tmp = tmp | (CEIL(40, ns) << FW_W1_SHIFT); /* W1 = 40nS */
4812 + tmp = tmp | CEIL(120, ns); /* W0 = 120nS */
4813 + W_REG(&eir->prog_waitcount, tmp); /* 0x01020a0c for a 100Mhz clock */
4815 + /* Set programmable interface timing for external uart */
4816 + tmp = CEIL(10, ns) << FW_W3_SHIFT; /* W3 = 10nS */
4817 + tmp = tmp | (CEIL(20, ns) << FW_W2_SHIFT); /* W2 = 20nS */
4818 + tmp = tmp | (CEIL(100, ns) << FW_W1_SHIFT); /* W1 = 100nS */
4819 + tmp = tmp | CEIL(120, ns); /* W0 = 120nS */
4820 + W_REG(&eir->prog_waitcount, tmp); /* 0x01020a0c for a 100Mhz clock */
4821 + } else if ((cc = sb_setcore(sbh, SB_CC, 0))) {
4822 + /* Set timing for the flash */
4823 + tmp = CEIL(10, ns) << FW_W3_SHIFT; /* W3 = 10nS */
4824 + tmp |= CEIL(10, ns) << FW_W1_SHIFT; /* W1 = 10nS */
4825 + tmp |= CEIL(120, ns); /* W0 = 120nS */
4826 + W_REG(&cc->parallelflashwaitcnt, tmp);
4828 + W_REG(&cc->cs01memwaitcnt, tmp);
4831 + /* Chip specific initialization */
4832 + switch (sb_chip(sbh)) {
4833 + case BCM4710_DEVICE_ID:
4834 + /* Clear interrupt map */
4835 + for (irq = 0; irq <= 4; irq++)
4836 + sb_clearirq(sbh, irq);
4837 + sb_setirq(sbh, 0, SB_CODEC, 0);
4838 + sb_setirq(sbh, 0, SB_EXTIF, 0);
4839 + sb_setirq(sbh, 2, SB_ENET, 1);
4840 + sb_setirq(sbh, 3, SB_ILINE20, 0);
4841 + sb_setirq(sbh, 4, SB_PCI, 0);
4843 + value = nvram_get("et0phyaddr");
4844 + if (value && !strcmp(value, "31")) {
4845 + /* Enable internal UART */
4846 + W_REG(&eir->corecontrol, CC_UE);
4847 + /* Give USB its own interrupt */
4848 + sb_setirq(sbh, 1, SB_USB, 0);
4850 + /* Disable internal UART */
4851 + W_REG(&eir->corecontrol, 0);
4852 + /* Give Ethernet its own interrupt */
4853 + sb_setirq(sbh, 1, SB_ENET, 0);
4854 + sb_setirq(sbh, 0, SB_USB, 0);
4857 + case BCM4310_DEVICE_ID:
4858 + MTC0(C0_BROADCOM, 0, MFC0(C0_BROADCOM, 0) & ~(1 << 22));
4864 +sb_mips_clock(void *sbh)
4870 + uint32 pll_type, rate = 0;
4872 + /* get index of the current core */
4873 + idx = sb_coreidx(sbh);
4874 + pll_type = PLL_TYPE1;
4876 + /* switch to extif or chipc core */
4877 + if ((eir = (extifregs_t *) sb_setcore(sbh, SB_EXTIF, 0))) {
4878 + n = R_REG(&eir->clockcontrol_n);
4879 + m = R_REG(&eir->clockcontrol_sb);
4880 + } else if ((cc = (chipcregs_t *) sb_setcore(sbh, SB_CC, 0))) {
4881 + pll_type = R_REG(&cc->capabilities) & CAP_PLL_MASK;
4882 + n = R_REG(&cc->clockcontrol_n);
4883 + if ((pll_type == PLL_TYPE2) || (pll_type == PLL_TYPE4))
4884 + m = R_REG(&cc->clockcontrol_mips);
4885 + else if (pll_type == PLL_TYPE3) {
4889 + m = R_REG(&cc->clockcontrol_sb);
4893 + /* calculate rate */
4894 + rate = sb_clock_rate(pll_type, n, m);
4897 + /* switch back to previous core */
4898 + sb_setcoreidx(sbh, idx);
4904 +icache_probe(int *size, int *lsize)
4909 + config1 = MFC0(C0_CONFIG, 1);
4911 + /* Instruction Cache Size = Associativity * Line Size * Sets Per Way */
4912 + if ((*lsize = ((config1 >> 19) & 7)))
4913 + *lsize = 2 << *lsize;
4914 + sets = 64 << ((config1 >> 22) & 7);
4915 + ways = 1 + ((config1 >> 16) & 7);
4916 + *size = *lsize * sets * ways;
4919 +#define ALLINTS (IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3 | IE_IRQ4)
4926 + ".set\tmips32\n\t"
4929 + /* Disable interrupts */
4930 + /* MTC0(C0_STATUS, 0, MFC0(C0_STATUS, 0) & ~(ALLINTS | STO_IE)); */
4931 + "mfc0 $15, $12\n\t"
4932 + "and $15, $15, -31746\n\t"
4933 + "mtc0 $15, $12\n\t"
4941 +/* The following MUST come right after handler() */
4948 + * Set the MIPS, backplane and PCI clocks as closely as possible.
4951 +sb_mips_setclock(void *sbh, uint32 mipsclock, uint32 sbclock, uint32 pciclock)
4953 + extifregs_t *eir = NULL;
4954 + chipcregs_t *cc = NULL;
4955 + mipsregs_t *mipsr = NULL;
4956 + volatile uint32 *clockcontrol_n, *clockcontrol_sb, *clockcontrol_pci;
4957 + uint32 orig_n, orig_sb, orig_pci, orig_m2, orig_mips, orig_ratio_parm, new_ratio;
4958 + uint32 pll_type, sync_mode;
4966 + } type1_table[] = {
4967 + { 96000000, 0x0303, 0x04020011, 0x11030011, 0x11050011 }, /* 96.000 32.000 24.000 */
4968 + { 100000000, 0x0009, 0x04020011, 0x11030011, 0x11050011 }, /* 100.000 33.333 25.000 */
4969 + { 104000000, 0x0802, 0x04020011, 0x11050009, 0x11090009 }, /* 104.000 31.200 24.960 */
4970 + { 108000000, 0x0403, 0x04020011, 0x11050009, 0x02000802 }, /* 108.000 32.400 24.923 */
4971 + { 112000000, 0x0205, 0x04020011, 0x11030021, 0x02000403 }, /* 112.000 32.000 24.889 */
4972 + { 115200000, 0x0303, 0x04020009, 0x11030011, 0x11050011 }, /* 115.200 32.000 24.000 */
4973 + { 120000000, 0x0011, 0x04020011, 0x11050011, 0x11090011 }, /* 120.000 30.000 24.000 */
4974 + { 124800000, 0x0802, 0x04020009, 0x11050009, 0x11090009 }, /* 124.800 31.200 24.960 */
4975 + { 128000000, 0x0305, 0x04020011, 0x11050011, 0x02000305 }, /* 128.000 32.000 24.000 */
4976 + { 132000000, 0x0603, 0x04020011, 0x11050011, 0x02000305 }, /* 132.000 33.000 24.750 */
4977 + { 136000000, 0x0c02, 0x04020011, 0x11090009, 0x02000603 }, /* 136.000 32.640 24.727 */
4978 + { 140000000, 0x0021, 0x04020011, 0x11050021, 0x02000c02 }, /* 140.000 30.000 24.706 */
4979 + { 144000000, 0x0405, 0x04020011, 0x01020202, 0x11090021 }, /* 144.000 30.857 24.686 */
4980 + { 150857142, 0x0605, 0x04020021, 0x02000305, 0x02000605 }, /* 150.857 33.000 24.000 */
4981 + { 152000000, 0x0e02, 0x04020011, 0x11050021, 0x02000e02 }, /* 152.000 32.571 24.000 */
4982 + { 156000000, 0x0802, 0x04020005, 0x11050009, 0x11090009 }, /* 156.000 31.200 24.960 */
4983 + { 160000000, 0x0309, 0x04020011, 0x11090011, 0x02000309 }, /* 160.000 32.000 24.000 */
4984 + { 163200000, 0x0c02, 0x04020009, 0x11090009, 0x02000603 }, /* 163.200 32.640 24.727 */
4985 + { 168000000, 0x0205, 0x04020005, 0x11030021, 0x02000403 }, /* 168.000 32.000 24.889 */
4986 + { 176000000, 0x0602, 0x04020003, 0x11050005, 0x02000602 }, /* 176.000 33.000 24.000 */
4997 + uint32 ratio_parm;
5000 + n4m_table_t type2_table[] = {
5001 + { 180000000, 80000000, 0x0403, 0x01010000, 0x01020300, 0x01020600, 0x05000100, 0x94, 0x012a0115 },
5002 + { 180000000, 90000000, 0x0403, 0x01000100, 0x01020300, 0x01000100, 0x05000100, 0x21, 0x0aaa0555 },
5003 + { 200000000, 100000000, 0x0303, 0x01000000, 0x01000600, 0x01000000, 0x05000000, 0x21, 0x0aaa0555 },
5004 + { 211200000, 105600000, 0x0902, 0x01000200, 0x01030400, 0x01000200, 0x05000200, 0x21, 0x0aaa0555 },
5005 + { 220800000, 110400000, 0x1500, 0x01000200, 0x01030400, 0x01000200, 0x05000200, 0x21, 0x0aaa0555 },
5006 + { 230400000, 115200000, 0x0604, 0x01000200, 0x01020600, 0x01000200, 0x05000200, 0x21, 0x0aaa0555 },
5007 + { 234000000, 104000000, 0x0b01, 0x01010000, 0x01010700, 0x01020600, 0x05000100, 0x94, 0x012a0115 },
5008 + { 240000000, 120000000, 0x0803, 0x01000200, 0x01020600, 0x01000200, 0x05000200, 0x21, 0x0aaa0555 },
5009 + { 252000000, 126000000, 0x0504, 0x01000100, 0x01020500, 0x01000100, 0x05000100, 0x21, 0x0aaa0555 },
5010 + { 264000000, 132000000, 0x0903, 0x01000200, 0x01020700, 0x01000200, 0x05000200, 0x21, 0x0aaa0555 },
5011 + { 270000000, 120000000, 0x0703, 0x01010000, 0x01030400, 0x01020600, 0x05000100, 0x94, 0x012a0115 },
5012 + { 276000000, 122666666, 0x1500, 0x01010000, 0x01030400, 0x01020600, 0x05000100, 0x94, 0x012a0115 },
5013 + { 280000000, 140000000, 0x0503, 0x01000000, 0x01010600, 0x01000000, 0x05000000, 0x21, 0x0aaa0555 },
5014 + { 288000000, 128000000, 0x0604, 0x01010000, 0x01030400, 0x01020600, 0x05000100, 0x94, 0x012a0115 },
5015 + { 288000000, 144000000, 0x0404, 0x01000000, 0x01010600, 0x01000000, 0x05000000, 0x21, 0x0aaa0555 },
5016 + { 300000000, 133333333, 0x0803, 0x01010000, 0x01020600, 0x01020600, 0x05000100, 0x94, 0x012a0115 },
5017 + { 300000000, 150000000, 0x0803, 0x01000100, 0x01020600, 0x01000100, 0x05000100, 0x21, 0x0aaa0555 }
5020 + n4m_table_t type4_table[] = {
5021 + { 192000000, 96000000, 0x0702, 0x04020011, 0x11030011, 0x04020011, 0x04020003, 0x21, 0x0aaa0555 },
5022 + { 200000000, 100000000, 0x0009, 0x04020011, 0x11030011, 0x04020011, 0x04020003, 0x21, 0x0aaa0555 },
5023 + { 216000000, 108000000, 0x0211, 0x11020005, 0x11030303, 0x11020005, 0x04000005, 0x21, 0x0aaa0555 },
5024 + { 228000000, 101333333, 0x0e02, 0x11030003, 0x11210005, 0x11030305, 0x04000005, 0x94, 0x012a00a9 },
5025 + { 228000000, 114000000, 0x0e02, 0x11020005, 0x11210005, 0x11020005, 0x04000005, 0x21, 0x0aaa0555 },
5026 + { 240000000, 120000000, 0x0109, 0x11030002, 0x01050203, 0x11030002, 0x04000003, 0x21, 0x0aaa0555 },
5027 + { 252000000, 126000000, 0x0203, 0x04000005, 0x11050005, 0x04000005, 0x04000002, 0x21, 0x0aaa0555 },
5028 + { 264000000, 132000000, 0x0602, 0x04000005, 0x11050005, 0x04000005, 0x04000002, 0x21, 0x0aaa0555 },
5029 + { 272000000, 116571428, 0x0c02, 0x04000021, 0x02000909, 0x02000221, 0x04000003, 0x73, 0x254a14a9 },
5030 + { 280000000, 120000000, 0x0209, 0x04000021, 0x01030303, 0x02000221, 0x04000003, 0x73, 0x254a14a9 },
5031 + { 288000000, 123428571, 0x0111, 0x04000021, 0x01030303, 0x02000221, 0x04000003, 0x73, 0x254a14a9 },
5032 + { 300000000, 120000000, 0x0009, 0x04000009, 0x01030203, 0x02000902, 0x04000002, 0x52, 0x02520129 }
5034 + uint icache_size, ic_lsize;
5035 + ulong start, end, dst;
5038 + /* get index of the current core */
5039 + idx = sb_coreidx(sbh);
5041 + /* switch to extif or chipc core */
5042 + if ((eir = (extifregs_t *) sb_setcore(sbh, SB_EXTIF, 0))) {
5043 + pll_type = PLL_TYPE1;
5044 + clockcontrol_n = &eir->clockcontrol_n;
5045 + clockcontrol_sb = &eir->clockcontrol_sb;
5046 + clockcontrol_pci = &eir->clockcontrol_pci;
5047 + } else if ((cc = (chipcregs_t *) sb_setcore(sbh, SB_CC, 0))) {
5048 + pll_type = R_REG(&cc->capabilities) & CAP_PLL_MASK;
5049 + clockcontrol_n = &cc->clockcontrol_n;
5050 + clockcontrol_sb = &cc->clockcontrol_sb;
5051 + clockcontrol_pci = &cc->clockcontrol_pci;
5055 + /* Store the current clock register values */
5056 + orig_n = R_REG(clockcontrol_n);
5057 + orig_sb = R_REG(clockcontrol_sb);
5058 + orig_pci = R_REG(clockcontrol_pci);
5060 + if (pll_type == PLL_TYPE1) {
5061 + /* Keep the current PCI clock if not specified */
5062 + if (pciclock == 0) {
5063 + pciclock = sb_clock_rate(pll_type, R_REG(clockcontrol_n), R_REG(clockcontrol_pci));
5064 + pciclock = (pciclock <= 25000000) ? 25000000 : 33000000;
5067 + /* Search for the closest MIPS clock less than or equal to a preferred value */
5068 + for (i = 0; i < ARRAYSIZE(type1_table); i++) {
5069 + ASSERT(type1_table[i].mipsclock ==
5070 + sb_clock_rate(pll_type, type1_table[i].n, type1_table[i].sb));
5071 + if (type1_table[i].mipsclock > mipsclock)
5081 + ASSERT(type1_table[i].mipsclock <= mipsclock);
5083 + /* No PLL change */
5084 + if ((orig_n == type1_table[i].n) &&
5085 + (orig_sb == type1_table[i].sb) &&
5086 + (orig_pci == type1_table[i].pci33))
5089 + /* Set the PLL controls */
5090 + W_REG(clockcontrol_n, type1_table[i].n);
5091 + W_REG(clockcontrol_sb, type1_table[i].sb);
5092 + if (pciclock == 25000000)
5093 + W_REG(clockcontrol_pci, type1_table[i].pci25);
5095 + W_REG(clockcontrol_pci, type1_table[i].pci33);
5098 + sb_watchdog(sbh, 1);
5100 + } else if ((pll_type == PLL_TYPE2) || (pll_type == PLL_TYPE4)) {
5101 + n4m_table_t *table = (pll_type == PLL_TYPE2) ? type2_table : type4_table;
5102 + uint tabsz = (pll_type == PLL_TYPE2) ? ARRAYSIZE(type2_table) : ARRAYSIZE(type4_table);
5106 + /* Store the current clock register values */
5107 + orig_m2 = R_REG(&cc->clockcontrol_m2);
5108 + orig_mips = R_REG(&cc->clockcontrol_mips);
5109 + orig_ratio_parm = 0;
5111 + /* Look up current ratio */
5112 + for (i = 0; i < tabsz; i++) {
5113 + if ((orig_n == table[i].n) &&
5114 + (orig_sb == table[i].sb) &&
5115 + (orig_pci == table[i].pci33) &&
5116 + (orig_m2 == table[i].m2) &&
5117 + (orig_mips == table[i].m3)) {
5118 + orig_ratio_parm = table[i].ratio_parm;
5123 + /* Search for the closest MIPS clock greater or equal to a preferred value */
5124 + for (i = 0; i < tabsz; i++) {
5125 + ASSERT(table[i].mipsclock ==
5126 + sb_clock_rate(pll_type, table[i].n, table[i].m3));
5127 + if ((mipsclock <= table[i].mipsclock) &&
5128 + ((sbclock == 0) || (sbclock <= table[i].sbclock)))
5138 + /* No PLL change */
5139 + if ((orig_n == table[i].n) &&
5140 + (orig_sb == table[i].sb) &&
5141 + (orig_pci == table[i].pci33) &&
5142 + (orig_m2 == table[i].m2) &&
5143 + (orig_mips == table[i].m3))
5146 + /* Set the PLL controls */
5147 + W_REG(clockcontrol_n, table[i].n);
5148 + W_REG(clockcontrol_sb, table[i].sb);
5149 + W_REG(clockcontrol_pci, table[i].pci33);
5150 + W_REG(&cc->clockcontrol_m2, table[i].m2);
5151 + W_REG(&cc->clockcontrol_mips, table[i].m3);
5153 + /* No ratio change */
5154 + if (orig_ratio_parm == table[i].ratio_parm)
5157 + new_ratio = table[i].ratio_parm;
5159 + icache_probe(&icache_size, &ic_lsize);
5161 + /* Preload the code into the cache */
5162 + start = ((ulong) &&start_fill) & ~(ic_lsize - 1);
5163 + end = ((ulong) &&end_fill + (ic_lsize - 1)) & ~(ic_lsize - 1);
5164 + while (start < end) {
5165 + cache_unroll(start, Fill_I);
5166 + start += ic_lsize;
5169 + /* Copy the handler */
5170 + start = (ulong) &handler;
5171 + end = (ulong) &afterhandler;
5172 + dst = KSEG1ADDR(0x180);
5173 + for (i = 0; i < (end - start); i += 4)
5174 + *((ulong *)(dst + i)) = *((ulong *)(start + i));
5176 + /* Preload handler into the cache one line at a time */
5177 + for (i = 0; i < (end - start); i += 4)
5178 + cache_unroll(dst + i, Fill_I);
5180 + /* Clear BEV bit */
5181 + MTC0(C0_STATUS, 0, MFC0(C0_STATUS, 0) & ~ST0_BEV);
5183 + /* Enable interrupts */
5184 + MTC0(C0_STATUS, 0, MFC0(C0_STATUS, 0) | (ALLINTS | ST0_IE));
5186 + /* Enable MIPS timer interrupt */
5187 + if (!(mipsr = sb_setcore(sbh, SB_MIPS, 0)) &&
5188 + !(mipsr = sb_setcore(sbh, SB_MIPS33, 0)))
5190 + W_REG(&mipsr->intmask, 1);
5193 + /* step 1, set clock ratios */
5194 + MTC0(C0_BROADCOM, 3, new_ratio);
5195 + MTC0(C0_BROADCOM, 1, 8);
5197 + /* step 2: program timer intr */
5198 + W_REG(&mipsr->timer, 100);
5199 + (void) R_REG(&mipsr->timer);
5201 + /* step 3, switch to async */
5202 + sync_mode = MFC0(C0_BROADCOM, 4);
5203 + MTC0(C0_BROADCOM, 4, 1 << 22);
5205 + /* step 4, set cfg active */
5206 + MTC0(C0_BROADCOM, 2, 0x9);
5210 + __asm__ __volatile__ (
5216 + /* step 7, clear cfg_active */
5217 + MTC0(C0_BROADCOM, 2, 0);
5219 + /* Additional Step: set back to orig sync mode */
5220 + MTC0(C0_BROADCOM, 4, sync_mode);
5222 + /* step 8, fake soft reset */
5223 + MTC0(C0_BROADCOM, 5, MFC0(C0_BROADCOM, 5) | 4);
5226 + /* step 9 set watchdog timer */
5227 + sb_watchdog(sbh, 20);
5228 + (void) R_REG(&cc->chipid);
5231 + __asm__ __volatile__ (
5241 + /* switch back to previous core */
5242 + sb_setcoreidx(sbh, idx);
5248 +/* returns the ncdl value to be programmed into sdram_ncdl for calibration */
5250 +sb_memc_get_ncdl(void *sbh)
5252 + sbmemcregs_t *memc;
5254 + uint32 config, rd, wr, misc, dqsg, cd, sm, sd;
5257 + idx = sb_coreidx(sbh);
5259 + memc = (sbmemcregs_t *)sb_setcore(sbh, SB_MEMC, 0);
5263 + rev = sb_corerev(sbh);
5265 + config = R_REG(&memc->config);
5266 + wr = R_REG(&memc->wrncdlcor);
5267 + rd = R_REG(&memc->rdncdlcor);
5268 + misc = R_REG(&memc->miscdlyctl);
5269 + dqsg = R_REG(&memc->dqsgatencdl);
5271 + rd &= MEMC_RDNCDLCOR_RD_MASK;
5272 + wr &= MEMC_WRNCDLCOR_WR_MASK;
5273 + dqsg &= MEMC_DQSGATENCDL_G_MASK;
5275 + if (config & MEMC_CONFIG_DDR) {
5276 + ret = (wr << 16) | (rd << 8) | dqsg;
5281 + cd = (rd == MEMC_CD_THRESHOLD) ? rd : (wr + MEMC_CD_THRESHOLD);
5282 + sm = (misc & MEMC_MISC_SM_MASK) >> MEMC_MISC_SM_SHIFT;
5283 + sd = (misc & MEMC_MISC_SD_MASK) >> MEMC_MISC_SD_SHIFT;
5284 + ret = (sm << 16) | (sd << 8) | cd;
5288 + /* switch back to previous core */
5289 + sb_setcoreidx(sbh, idx);
5293 diff -Nur linux-2.6.12.5/arch/mips/bcm947xx/broadcom/sbpci.c linux-2.6.12.5-brcm/arch/mips/bcm947xx/broadcom/sbpci.c
5294 --- linux-2.6.12.5/arch/mips/bcm947xx/broadcom/sbpci.c 1970-01-01 01:00:00.000000000 +0100
5295 +++ linux-2.6.12.5-brcm/arch/mips/bcm947xx/broadcom/sbpci.c 2005-08-28 11:12:20.479851704 +0200
5298 + * Low-Level PCI and SB support for BCM47xx
5300 + * Copyright 2001-2003, Broadcom Corporation
5301 + * All Rights Reserved.
5303 + * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
5304 + * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
5305 + * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
5306 + * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
5308 + * $Id: sbpci.c,v 1.2 2005/02/28 13:34:25 jolt Exp $
5311 +#include <typedefs.h>
5312 +#include <pcicfg.h>
5313 +#include <bcmdevs.h>
5314 +#include <sbconfig.h>
5317 +#include <bcmendian.h>
5318 +#include <bcmutils.h>
5319 +#include <sbutils.h>
5320 +#include <bcmnvram.h>
5321 +#include <hndmips.h>
5323 +/* Can free sbpci_init() memory after boot */
5328 +/* Emulated configuration space */
5329 +static pci_config_regs sb_config_regs[SB_MAXCORES];
5332 +static uint16 pci_ban[32] = { 0 };
5333 +static uint pci_banned = 0;
5336 +static bool cardbus = FALSE;
5339 + * Functions for accessing external PCI configuration space
5342 +/* Assume one-hot slot wiring */
5343 +#define PCI_SLOT_MAX 16
5346 +config_cmd(void *sbh, uint bus, uint dev, uint func, uint off)
5349 + sbpciregs_t *regs;
5352 + /* CardBusMode supports only one device */
5353 + if (cardbus && dev > 1)
5356 + coreidx = sb_coreidx(sbh);
5357 + regs = (sbpciregs_t *) sb_setcore(sbh, SB_PCI, 0);
5359 + /* Type 0 transaction */
5361 + /* Skip unwired slots */
5362 + if (dev < PCI_SLOT_MAX) {
5363 + /* Slide the PCI window to the appropriate slot */
5364 + W_REG(®s->sbtopci1, SBTOPCI_CFG0 | ((1 << (dev + 16)) & SBTOPCI1_MASK));
5365 + addr = SB_PCI_CFG | ((1 << (dev + 16)) & ~SBTOPCI1_MASK) |
5366 + (func << 8) | (off & ~3);
5370 + /* Type 1 transaction */
5372 + W_REG(®s->sbtopci1, SBTOPCI_CFG1);
5373 + addr = SB_PCI_CFG | (bus << 16) | (dev << 11) | (func << 8) | (off & ~3);
5376 + sb_setcoreidx(sbh, coreidx);
5382 +extpci_read_config(void *sbh, uint bus, uint dev, uint func, uint off, void *buf, int len)
5384 + uint32 addr, *reg = NULL, val;
5387 + if (!(addr = config_cmd(sbh, bus, dev, func, off)) ||
5388 + !(reg = (uint32 *) REG_MAP(addr, len)) ||
5389 + BUSPROBE(val, reg))
5392 + val >>= 8 * (off & 3);
5394 + *((uint32 *) buf) = val;
5395 + else if (len == 2)
5396 + *((uint16 *) buf) = (uint16) val;
5397 + else if (len == 1)
5398 + *((uint8 *) buf) = (uint8) val;
5409 +extpci_write_config(void *sbh, uint bus, uint dev, uint func, uint off, void *buf, int len)
5411 + uint32 addr, *reg = NULL, val;
5414 + if (!(addr = config_cmd(sbh, bus, dev, func, off)) ||
5415 + !(reg = (uint32 *) REG_MAP(addr, len)) ||
5416 + BUSPROBE(val, reg))
5420 + val = *((uint32 *) buf);
5421 + else if (len == 2) {
5422 + val &= ~(0xffff << (8 * (off & 3)));
5423 + val |= *((uint16 *) buf) << (8 * (off & 3));
5424 + } else if (len == 1) {
5425 + val &= ~(0xff << (8 * (off & 3)));
5426 + val |= *((uint8 *) buf) << (8 * (off & 3));
5440 + * Functions for accessing translated SB configuration space
5444 +sb_read_config(void *sbh, uint bus, uint dev, uint func, uint off, void *buf, int len)
5446 + pci_config_regs *cfg;
5448 + if (dev >= SB_MAXCORES || (off + len) > sizeof(pci_config_regs))
5450 + cfg = &sb_config_regs[dev];
5452 + ASSERT(ISALIGNED(off, len));
5453 + ASSERT(ISALIGNED(buf, len));
5456 + *((uint32 *) buf) = ltoh32(*((uint32 *)((ulong) cfg + off)));
5457 + else if (len == 2)
5458 + *((uint16 *) buf) = ltoh16(*((uint16 *)((ulong) cfg + off)));
5459 + else if (len == 1)
5460 + *((uint8 *) buf) = *((uint8 *)((ulong) cfg + off));
5468 +sb_write_config(void *sbh, uint bus, uint dev, uint func, uint off, void *buf, int len)
5473 + pci_config_regs *cfg;
5475 + if (dev >= SB_MAXCORES || (off + len) > sizeof(pci_config_regs))
5477 + cfg = &sb_config_regs[dev];
5479 + ASSERT(ISALIGNED(off, len));
5480 + ASSERT(ISALIGNED(buf, len));
5482 + /* Emulate BAR sizing */
5483 + if (off >= OFFSETOF(pci_config_regs, base[0]) && off <= OFFSETOF(pci_config_regs, base[3]) &&
5484 + len == 4 && *((uint32 *) buf) == ~0) {
5485 + coreidx = sb_coreidx(sbh);
5486 + if ((regs = sb_setcoreidx(sbh, dev))) {
5487 + sb = (sbconfig_t *)((ulong) regs + SBCONFIGOFF);
5488 + /* Highest numbered address match register */
5489 + n = (R_REG(&sb->sbidlow) & SBIDL_AR_MASK) >> SBIDL_AR_SHIFT;
5490 + if (off == OFFSETOF(pci_config_regs, base[0]))
5491 + cfg->base[0] = ~(sb_size(R_REG(&sb->sbadmatch0)) - 1);
5492 + /*else if (off == OFFSETOF(pci_config_regs, base[1]) && n >= 1)
5493 + cfg->base[1] = ~(sb_size(R_REG(&sb->sbadmatch1)) - 1);
5494 + else if (off == OFFSETOF(pci_config_regs, base[2]) && n >= 2)
5495 + cfg->base[2] = ~(sb_size(R_REG(&sb->sbadmatch2)) - 1);
5496 + else if (off == OFFSETOF(pci_config_regs, base[3]) && n >= 3)
5497 + cfg->base[3] = ~(sb_size(R_REG(&sb->sbadmatch3)) - 1);*/
5499 + sb_setcoreidx(sbh, coreidx);
5504 + *((uint32 *)((ulong) cfg + off)) = htol32(*((uint32 *) buf));
5505 + else if (len == 2)
5506 + *((uint16 *)((ulong) cfg + off)) = htol16(*((uint16 *) buf));
5507 + else if (len == 1)
5508 + *((uint8 *)((ulong) cfg + off)) = *((uint8 *) buf);
5516 +sbpci_read_config(void *sbh, uint bus, uint dev, uint func, uint off, void *buf, int len)
5519 + return sb_read_config(sbh, bus, dev, func, off, buf, len);
5521 + return extpci_read_config(sbh, bus, dev, func, off, buf, len);
5525 +sbpci_write_config(void *sbh, uint bus, uint dev, uint func, uint off, void *buf, int len)
5528 + return sb_write_config(sbh, bus, dev, func, off, buf, len);
5530 + return extpci_write_config(sbh, bus, dev, func, off, buf, len);
5534 +sbpci_ban(uint16 core)
5536 + if (pci_banned < ARRAYSIZE(pci_ban))
5537 + pci_ban[pci_banned++] = core;
5541 +sbpci_init(void *sbh)
5543 + uint chip, chiprev, chippkg, coreidx, host, i;
5546 + pci_config_regs *cfg;
5550 + uint16 vendor, core;
5551 + uint8 class, subclass, progif;
5553 + uint32 sbips_int_mask[] = { 0, SBIPS_INT1_MASK, SBIPS_INT2_MASK, SBIPS_INT3_MASK, SBIPS_INT4_MASK };
5554 + uint32 sbips_int_shift[] = { 0, 0, SBIPS_INT2_SHIFT, SBIPS_INT3_SHIFT, SBIPS_INT4_SHIFT };
5556 + chip = sb_chip(sbh);
5557 + chiprev = sb_chiprev(sbh);
5558 + chippkg = sb_chippkg(sbh);
5559 + coreidx = sb_coreidx(sbh);
5561 + if (!(pci = (sbpciregs_t *) sb_setcore(sbh, SB_PCI, 0)))
5563 + sb_core_reset(sbh, 0);
5565 + if (((chip == BCM4310_DEVICE_ID) && (chiprev == 0)) ||
5566 + ((chip == BCM4712_DEVICE_ID) && (chippkg == BCM4712SMALL_PKG_ID)))
5569 + host = !BUSPROBE(val, &pci->control);
5572 + /* Disable PCI interrupts in client mode */
5573 + sb = (sbconfig_t *)((ulong) pci + SBCONFIGOFF);
5574 + W_REG(&sb->sbintvec, 0);
5576 + /* Disable the PCI bridge in client mode */
5577 + sbpci_ban(SB_PCI);
5578 + printf("PCI: Disabled\n");
5580 + /* Reset the external PCI bus and enable the clock */
5581 + W_REG(&pci->control, 0x5); /* enable the tristate drivers */
5582 + W_REG(&pci->control, 0xd); /* enable the PCI clock */
5583 + OSL_DELAY(100); /* delay 100 us */
5584 + W_REG(&pci->control, 0xf); /* deassert PCI reset */
5585 + W_REG(&pci->arbcontrol, PCI_INT_ARB); /* use internal arbiter */
5586 + OSL_DELAY(1); /* delay 1 us */
5588 + /* Enable CardBusMode */
5589 + cardbus = nvram_match("cardbus", "1");
5591 + printf("PCI: Enabling CardBus\n");
5592 + /* GPIO 1 resets the CardBus device on bcm94710ap */
5593 + sb_gpioout(sbh, 1, 1);
5594 + sb_gpioouten(sbh, 1, 1);
5595 + W_REG(&pci->sprom[0], R_REG(&pci->sprom[0]) | 0x400);
5598 + /* 64 MB I/O access window */
5599 + W_REG(&pci->sbtopci0, SBTOPCI_IO);
5600 + /* 64 MB configuration access window */
5601 + W_REG(&pci->sbtopci1, SBTOPCI_CFG0);
5602 + /* 1 GB memory access window */
5603 + W_REG(&pci->sbtopci2, SBTOPCI_MEM | SB_PCI_DMA);
5605 + /* Enable PCI bridge BAR0 prefetch and burst */
5607 + sbpci_write_config(sbh, 1, 0, 0, PCI_CFG_CMD, &val, sizeof(val));
5609 + /* Enable PCI interrupts */
5610 + W_REG(&pci->intmask, PCI_INTA);
5613 + /* Scan the SB bus */
5614 + bzero(sb_config_regs, sizeof(sb_config_regs));
5615 + for (cfg = sb_config_regs; cfg < &sb_config_regs[SB_MAXCORES]; cfg++) {
5616 + cfg->vendor = 0xffff;
5617 + if (!(regs = sb_setcoreidx(sbh, cfg - sb_config_regs)))
5619 + sb = (sbconfig_t *)((ulong) regs + SBCONFIGOFF);
5621 + /* Read ID register and parse vendor and core */
5622 + val = R_REG(&sb->sbidhigh);
5623 + vendor = (val & SBIDH_VC_MASK) >> SBIDH_VC_SHIFT;
5624 + core = (val & SBIDH_CC_MASK) >> SBIDH_CC_SHIFT;
5627 + /* Check if this core is banned */
5628 + for (i = 0; i < pci_banned; i++)
5629 + if (core == pci_ban[i])
5631 + if (i < pci_banned)
5634 + /* Known vendor translations */
5637 + vendor = VENDOR_BROADCOM;
5641 + /* Determine class based on known core codes */
5644 + class = PCI_CLASS_NET;
5645 + subclass = PCI_NET_ETHER;
5646 + core = BCM47XX_ILINE_ID;
5649 + class = PCI_CLASS_NET;
5650 + subclass = PCI_NET_ETHER;
5651 + core = BCM4610_ILINE_ID;
5654 + class = PCI_CLASS_NET;
5655 + subclass = PCI_NET_ETHER;
5656 + core = BCM47XX_ENET_ID;
5660 + class = PCI_CLASS_MEMORY;
5661 + subclass = PCI_MEMORY_RAM;
5664 + class = PCI_CLASS_BRIDGE;
5665 + subclass = PCI_BRIDGE_PCI;
5669 + class = PCI_CLASS_CPU;
5670 + subclass = PCI_CPU_MIPS;
5673 + class = PCI_CLASS_COMM;
5674 + subclass = PCI_COMM_MODEM;
5675 + core = BCM47XX_V90_ID;
5678 + class = PCI_CLASS_SERIAL;
5679 + subclass = PCI_SERIAL_USB;
5680 + progif = 0x10; /* OHCI */
5681 + core = BCM47XX_USB_ID;
5684 + class = PCI_CLASS_SERIAL;
5685 + subclass = PCI_SERIAL_USB;
5686 + progif = 0x10; /* OHCI */
5687 + core = BCM47XX_USBH_ID;
5690 + class = PCI_CLASS_SERIAL;
5691 + subclass = PCI_SERIAL_USB;
5692 + core = BCM47XX_USBD_ID;
5695 + class = PCI_CLASS_CRYPT;
5696 + subclass = PCI_CRYPT_NETWORK;
5697 + core = BCM47XX_IPSEC_ID;
5701 + class = PCI_CLASS_MEMORY;
5702 + subclass = PCI_MEMORY_FLASH;
5705 + class = PCI_CLASS_NET;
5706 + subclass = PCI_NET_OTHER;
5707 + /* Let an nvram variable override this */
5708 + sprintf(varname, "wl%did", wlidx);
5710 + if ((core = getintvar(NULL, varname)) == 0) {
5711 + if (chip == BCM4712_DEVICE_ID) {
5712 + if (chippkg == BCM4712SMALL_PKG_ID)
5713 + core = BCM4306_D11G_ID;
5715 + core = BCM4306_D11DUAL_ID;
5718 + core = BCM4310_D11B_ID;
5724 + class = subclass = progif = 0xff;
5728 + /* Supported translations */
5729 + cfg->vendor = htol16(vendor);
5730 + cfg->device = htol16(core);
5731 + cfg->rev_id = chiprev;
5732 + cfg->prog_if = progif;
5733 + cfg->sub_class = subclass;
5734 + cfg->base_class = class;
5735 + cfg->base[0] = htol32(sb_base(R_REG(&sb->sbadmatch0)));
5736 + cfg->base[1] = 0/*htol32(sb_base(R_REG(&sb->sbadmatch1)))*/;
5737 + cfg->base[2] = 0/*htol32(sb_base(R_REG(&sb->sbadmatch2)))*/;
5738 + cfg->base[3] = 0/*htol32(sb_base(R_REG(&sb->sbadmatch3)))*/;
5741 + if (class == PCI_CLASS_BRIDGE && subclass == PCI_BRIDGE_PCI)
5742 + cfg->header_type = PCI_HEADER_BRIDGE;
5744 + cfg->header_type = PCI_HEADER_NORMAL;
5745 + /* Save core interrupt flag */
5746 + cfg->int_pin = R_REG(&sb->sbtpsflag) & SBTPS_NUM0_MASK;
5747 + /* Default to MIPS shared interrupt 0 */
5748 + cfg->int_line = 0;
5749 + /* MIPS sbipsflag maps core interrupt flags to interrupts 1 through 4 */
5750 + if ((regs = sb_setcore(sbh, SB_MIPS, 0)) ||
5751 + (regs = sb_setcore(sbh, SB_MIPS33, 0))) {
5752 + sb = (sbconfig_t *)((ulong) regs + SBCONFIGOFF);
5753 + val = R_REG(&sb->sbipsflag);
5754 + for (cfg->int_line = 1; cfg->int_line <= 4; cfg->int_line++) {
5755 + if (((val & sbips_int_mask[cfg->int_line]) >> sbips_int_shift[cfg->int_line]) == cfg->int_pin)
5758 + if (cfg->int_line > 4)
5759 + cfg->int_line = 0;
5761 + /* Emulated core */
5762 + *((uint32 *) &cfg->sprom_control) = 0xffffffff;
5765 + sb_setcoreidx(sbh, coreidx);
5770 +sbpci_check(void *sbh)
5775 + uint32 buf[64], *ptr, i;
5779 + coreidx = sb_coreidx(sbh);
5780 + pci = (sbpciregs_t *) sb_setcore(sbh, SB_PCI, 0);
5782 + /* Clear the test array */
5783 + pa = (ulong) DMA_MAP(NULL, buf, sizeof(buf), DMA_RX, NULL);
5784 + ptr = (uint32 *) OSL_UNCACHED(&buf[0]);
5785 + memset(ptr, 0, sizeof(buf));
5787 + /* Point PCI window 1 to memory */
5788 + sbtopci1 = R_REG(&pci->sbtopci1);
5789 + W_REG(&pci->sbtopci1, SBTOPCI_MEM | (pa & SBTOPCI1_MASK));
5791 + /* Fill the test array via PCI window 1 */
5792 + ptr = (uint32 *) REG_MAP(SB_PCI_CFG + (pa & ~SBTOPCI1_MASK), sizeof(buf));
5793 + for (i = 0; i < ARRAYSIZE(buf); i++) {
5794 + for (j = 0; j < 2; j++);
5795 + W_REG(&ptr[i], i);
5799 + /* Restore PCI window 1 */
5800 + W_REG(&pci->sbtopci1, sbtopci1);
5802 + /* Check the test array */
5803 + DMA_UNMAP(NULL, pa, sizeof(buf), DMA_RX, NULL);
5804 + ptr = (uint32 *) OSL_UNCACHED(&buf[0]);
5805 + for (i = 0; i < ARRAYSIZE(buf); i++) {
5810 + /* Change the clock if the test fails */
5811 + if (i < ARRAYSIZE(buf)) {
5814 + cur = sb_clock(sbh);
5815 + printf("PCI: Test failed at %d MHz\n", (cur + 500000) / 1000000);
5816 + for (req = 104000000; req < 176000000; req += 4000000) {
5817 + printf("PCI: Resetting to %d MHz\n", (req + 500000) / 1000000);
5818 + /* This will only reset if the clocks are valid and have changed */
5819 + sb_mips_setclock(sbh, req, 0, 0);
5821 + /* Should not reach here */
5825 + sb_setcoreidx(sbh, coreidx);
5827 diff -Nur linux-2.6.12.5/arch/mips/bcm947xx/broadcom/sbutils.c linux-2.6.12.5-brcm/arch/mips/bcm947xx/broadcom/sbutils.c
5828 --- linux-2.6.12.5/arch/mips/bcm947xx/broadcom/sbutils.c 1970-01-01 01:00:00.000000000 +0100
5829 +++ linux-2.6.12.5-brcm/arch/mips/bcm947xx/broadcom/sbutils.c 2005-08-28 11:12:20.482851248 +0200
5832 + * Misc utility routines for accessing chip-specific features
5833 + * of the SiliconBackplane-based Broadcom chips.
5835 + * Copyright 2001-2003, Broadcom Corporation
5836 + * All Rights Reserved.
5838 + * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
5839 + * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
5840 + * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
5841 + * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
5843 + * $Id: sbutils.c,v 1.1 2005/02/28 13:33:32 jolt Exp $
5846 +#include <typedefs.h>
5848 +#include <bcmutils.h>
5849 +#include <bcmdevs.h>
5850 +#include <sbconfig.h>
5851 +#include <sbchipc.h>
5853 +#include <pcicfg.h>
5854 +#include <sbpcmcia.h>
5855 +#include <sbextif.h>
5856 +#include <sbutils.h>
5857 +#include <bcmsrom.h>
5860 +#define SB_ERROR(args)
5862 +typedef uint32 (*sb_intrsoff_t)(void *intr_arg);
5863 +typedef void (*sb_intrsrestore_t)(void *intr_arg, uint32 arg);
5865 +/* misc sb info needed by some of the routines */
5866 +typedef struct sb_info {
5867 + uint chip; /* chip number */
5868 + uint chiprev; /* chip revision */
5869 + uint chippkg; /* chip package option */
5870 + uint boardtype; /* board type */
5871 + uint boardvendor; /* board vendor id */
5872 + uint bus; /* what bus type we are going through */
5874 + void *osh; /* osl os handle */
5875 + void *sdh; /* bcmsdh handle */
5877 + void *curmap; /* current regs va */
5878 + void *regs[SB_MAXCORES]; /* other regs va */
5880 + uint curidx; /* current core index */
5881 + uint dev_coreid; /* the core provides driver functions */
5882 + uint pciidx; /* pci core index */
5883 + uint pcirev; /* pci core rev */
5885 + uint pcmciaidx; /* pcmcia core index */
5886 + uint pcmciarev; /* pcmcia core rev */
5887 + bool memseg; /* flag to toggle MEM_SEG register */
5889 + uint ccrev; /* chipc core rev */
5891 + uint gpioidx; /* gpio control core index */
5892 + uint gpioid; /* gpio control coretype */
5894 + uint numcores; /* # discovered cores */
5895 + uint coreid[SB_MAXCORES]; /* id of each core */
5897 + void *intr_arg; /* interrupt callback function arg */
5898 + sb_intrsoff_t intrsoff_fn; /* function turns chip interrupts off */
5899 + sb_intrsrestore_t intrsrestore_fn; /* function restore chip interrupts */
5902 +/* local prototypes */
5903 +static void* sb_doattach(sb_info_t *si, uint devid, void *osh, void *regs, uint bustype, void *sdh, char **vars, int *varsz);
5904 +static void sb_scan(sb_info_t *si);
5905 +static uint sb_corereg(void *sbh, uint coreidx, uint regoff, uint mask, uint val);
5906 +static uint _sb_coreidx(void *sbh);
5907 +static uint sb_findcoreidx(void *sbh, uint coreid, uint coreunit);
5908 +static uint sb_pcidev2chip(uint pcidev);
5909 +static uint sb_chip2numcores(uint chip);
5911 +#define SB_INFO(sbh) (sb_info_t*)sbh
5912 +#define SET_SBREG(sbh, r, mask, val) W_SBREG((sbh), (r), ((R_SBREG((sbh), (r)) & ~(mask)) | (val)))
5913 +#define GOODCOREADDR(x) (((x) >= SB_ENUM_BASE) && ((x) <= SB_ENUM_LIM) \
5914 + && ISALIGNED((x), SB_CORE_SIZE))
5915 +#define GOODREGS(regs) (regs && ISALIGNED(regs, SB_CORE_SIZE))
5916 +#define REGS2SB(va) (sbconfig_t*) ((uint)(va) + SBCONFIGOFF)
5917 +#define GOODIDX(idx) (((uint)idx) < SB_MAXCORES)
5918 +#define BADIDX (SB_MAXCORES+1)
5920 +#define R_SBREG(sbh, sbr) sb_read_sbreg((sbh), (sbr))
5921 +#define W_SBREG(sbh, sbr, v) sb_write_sbreg((sbh), (sbr), (v))
5922 +#define AND_SBREG(sbh, sbr, v) W_SBREG((sbh), (sbr), (R_SBREG((sbh), (sbr)) & (v)))
5923 +#define OR_SBREG(sbh, sbr, v) W_SBREG((sbh), (sbr), (R_SBREG((sbh), (sbr)) | (v)))
5926 + * Macros to disable/restore function core(D11, ENET, ILINE20, etc) interrupts before/
5927 + * after core switching to avoid invalid register accesss inside ISR.
5929 +#define INTR_OFF(si, intr_val) \
5930 + if ((si)->intrsoff_fn && (si)->coreid[(si)->curidx] == (si)->dev_coreid) { \
5931 + intr_val = (*(si)->intrsoff_fn)((si)->intr_arg); }
5932 +#define INTR_RESTORE(si, intr_val) \
5933 + if ((si)->intrsrestore_fn && (si)->coreid[(si)->curidx] == (si)->dev_coreid) { \
5934 + (*(si)->intrsrestore_fn)((si)->intr_arg, intr_val); }
5936 +/* power control defines */
5937 +#define PLL_DELAY 150 /* 150us pll on delay */
5938 +#define FREF_DELAY 15 /* 15us fref change delay */
5939 +#define LPOMINFREQ 25000 /* low power oscillator min */
5940 +#define LPOMAXFREQ 43000 /* low power oscillator max */
5941 +#define XTALMINFREQ 19800000 /* 20mhz - 1% */
5942 +#define XTALMAXFREQ 20200000 /* 20mhz + 1% */
5943 +#define PCIMINFREQ 25000000 /* 25mhz */
5944 +#define PCIMAXFREQ 34000000 /* 33mhz + fudge */
5946 +#define SCC_LOW2FAST_LIMIT 5000 /* turn on fast clock time, in unit of ms */
5950 +sb_read_sbreg(void *sbh, volatile uint32 *sbr)
5954 + uint32 val, intr_val = 0;
5956 + si = SB_INFO(sbh);
5959 + * compact flash only has 11 bits address, while we needs 12 bits address.
5960 + * MEM_SEG will be OR'd with other 11 bits address in hardware,
5961 + * so we program MEM_SEG with 12th bit when necessary(access sb regsiters).
5962 + * For normal PCMCIA bus(CFTable_regwinsz > 2k), do nothing special
5965 + INTR_OFF(si, intr_val);
5967 + OSL_PCMCIA_WRITE_ATTR(si->osh, MEM_SEG, &tmp, 1);
5968 + (uint32)sbr &= ~(1 << 11); /* mask out bit 11*/
5975 + OSL_PCMCIA_WRITE_ATTR(si->osh, MEM_SEG, &tmp, 1);
5976 + INTR_RESTORE(si, intr_val);
5983 +sb_write_sbreg(void *sbh, volatile uint32 *sbr, uint32 v)
5987 + volatile uint32 dummy;
5988 + uint32 intr_val = 0;
5990 + si = SB_INFO(sbh);
5993 + * compact flash only has 11 bits address, while we needs 12 bits address.
5994 + * MEM_SEG will be OR'd with other 11 bits address in hardware,
5995 + * so we program MEM_SEG with 12th bit when necessary(access sb regsiters).
5996 + * For normal PCMCIA bus(CFTable_regwinsz > 2k), do nothing special
5999 + INTR_OFF(si, intr_val);
6001 + OSL_PCMCIA_WRITE_ATTR(si->osh, MEM_SEG, &tmp, 1);
6002 + (uint32)sbr &= ~(1 << 11); /* mask out bit 11 */
6005 + if ((si->bus == PCMCIA_BUS) || (si->bus == PCI_BUS)) {
6006 +#ifdef IL_BIGENDIAN
6007 + dummy = R_REG(sbr);
6008 + W_REG((volatile uint16 *)((uint32)sbr + 2), (uint16)((v >> 16) & 0xffff));
6009 + dummy = R_REG(sbr);
6010 + W_REG((volatile uint16 *)sbr, (uint16)(v & 0xffff));
6012 + dummy = R_REG(sbr);
6013 + W_REG((volatile uint16 *)sbr, (uint16)(v & 0xffff));
6014 + dummy = R_REG(sbr);
6015 + W_REG((volatile uint16 *)((uint32)sbr + 2), (uint16)((v >> 16) & 0xffff));
6022 + OSL_PCMCIA_WRITE_ATTR(si->osh, MEM_SEG, &tmp, 1);
6023 + INTR_RESTORE(si, intr_val);
6028 + * Allocate a sb handle.
6029 + * devid - pci device id (used to determine chip#)
6030 + * osh - opaque OS handle
6031 + * regs - virtual address of initial core registers
6032 + * bustype - pci/pcmcia/sb/sdio/etc
6033 + * vars - pointer to a pointer area for "environment" variables
6034 + * varsz - pointer to int to return the size of the vars
6037 +sb_attach(uint devid, void *osh, void *regs, uint bustype, void *sdh, char **vars, int *varsz)
6041 + /* alloc sb_info_t */
6042 + if ((si = MALLOC(sizeof (sb_info_t))) == NULL) {
6043 + SB_ERROR(("sb_attach: malloc failed!\n"));
6047 + return (sb_doattach(si, devid, osh, regs, bustype, sdh, vars, varsz));
6050 +/* global kernel resource */
6051 +static sb_info_t ksi;
6053 +/* generic kernel variant of sb_attach() */
6061 + if (ksi.curmap == NULL) {
6063 + regs = (uint32 *)REG_MAP(SB_ENUM_BASE, SB_CORE_SIZE);
6064 + cid = R_REG((uint32 *)regs);
6065 + if ((cid == 0x08104712) || (cid == 0x08114712)) {
6068 + scc = (uint32 *)((uint32)regs + OFFSETOF(chipcregs_t, slow_clk_ctl));
6070 + SB_ERROR((" initial scc = 0x%x\n", val));
6071 + val |= SCC_SS_XTAL;
6075 + sb_doattach(&ksi, BCM4710_DEVICE_ID, NULL, (void*)regs,
6076 + SB_BUS, NULL, &unused, &varsz);
6083 +sb_doattach(sb_info_t *si, uint devid, void *osh, void *regs, uint bustype, void *sdh, char **vars, int *varsz)
6089 + ASSERT(GOODREGS(regs));
6091 + bzero((uchar*)si, sizeof (sb_info_t));
6093 + si->pciidx = si->gpioidx = BADIDX;
6096 + si->curmap = regs;
6099 + /* 4317A0 PCMCIA is no longer supported */
6100 + if ((bustype == PCMCIA_BUS) && (R_REG((uint32 *)regs) == 0x04104317))
6103 + /* check to see if we are a sb core mimic'ing a pci core */
6104 + if (bustype == PCI_BUS) {
6105 + if (OSL_PCI_READ_CONFIG(osh, PCI_SPROM_CONTROL, sizeof (uint32)) == 0xffffffff)
6108 + bustype = PCI_BUS;
6111 + si->bus = bustype;
6113 + /* kludge to enable the clock on the 4306 which lacks a slowclock */
6114 + if (si->bus == PCI_BUS)
6115 + sb_pwrctl_xtal((void*)si, XTAL|PLL, ON);
6117 + /* clear any previous epidiag-induced target abort */
6118 + sb_taclear((void*)si);
6120 + /* initialize current core index value */
6121 + si->curidx = _sb_coreidx((void*)si);
6123 + /* keep and reuse the initial register mapping */
6124 + origidx = si->curidx;
6125 + if (si->bus == SB_BUS)
6126 + si->regs[origidx] = regs;
6128 + /* initialize the vars */
6129 + if (srom_var_init(si->bus, si->curmap, osh, vars, varsz)) {
6130 + SB_ERROR(("sb_attach: srom_var_init failed\n"));
6134 + if (si->bus == PCMCIA_BUS) {
6135 + w = getintvar(*vars, "regwindowsz");
6136 + si->memseg = (w <= CFTABLE_REGWIN_2K) ? TRUE : FALSE;
6139 + /* is core-0 a chipcommon core? */
6141 + cc = (chipcregs_t*) sb_setcoreidx((void*)si, 0);
6142 + if (sb_coreid((void*)si) != SB_CC)
6145 + /* determine chip id and rev */
6147 + /* chip common core found! */
6148 + si->chip = R_REG(&cc->chipid) & CID_ID_MASK;
6149 + si->chiprev = (R_REG(&cc->chipid) & CID_REV_MASK) >> CID_REV_SHIFT;
6150 + si->chippkg = (R_REG(&cc->chipid) & CID_PKG_MASK) >> CID_PKG_SHIFT;
6152 + /* without chip common core, get devid for PCMCIA */
6153 + if (si->bus == PCMCIA_BUS)
6154 + devid = getintvar(*vars, "devid");
6156 + /* no chip common core -- must convert device id to chip id */
6157 + if ((si->chip = sb_pcidev2chip(devid)) == 0) {
6158 + SB_ERROR(("sb_attach: unrecognized device id 0x%04x\n", devid));
6163 + * The chip revision number is hardwired into all
6164 + * of the pci function config rev fields and is
6165 + * independent from the individual core revision numbers.
6166 + * For example, the "A0" silicon of each chip is chip rev 0.
6167 + * For PCMCIA we get it from the CIS instead.
6169 + if (si->bus == PCMCIA_BUS) {
6171 + si->chiprev = getintvar(*vars, "chiprev");
6172 + } else if (si->bus == PCI_BUS) {
6173 + w = OSL_PCI_READ_CONFIG(osh, PCI_CFG_REV, sizeof (uint32));
6174 + si->chiprev = w & 0xff;
6179 + /* get chipcommon rev */
6180 + si->ccrev = cc? sb_corerev((void*)si) : 0;
6182 + /* determine numcores */
6183 + if ((si->ccrev == 4) || (si->ccrev >= 6))
6184 + si->numcores = (R_REG(&cc->chipid) & CID_CC_MASK) >> CID_CC_SHIFT;
6186 + si->numcores = sb_chip2numcores(si->chip);
6188 + /* return to original core */
6189 + sb_setcoreidx((void*)si, origidx);
6191 + /* sanity checks */
6193 + /* 4704A1 is chiprev 8 :-( */
6194 + ASSERT((si->chiprev < 8) ||
6195 + ((si->chip == BCM4704_DEVICE_ID) && ((si->chiprev == 8))));
6197 + /* scan for cores */
6200 + /* pci core is required */
6201 + if (!GOODIDX(si->pciidx)) {
6202 + SB_ERROR(("sb_attach: pci core not found\n"));
6206 + /* gpio control core is required */
6207 + if (!GOODIDX(si->gpioidx)) {
6208 + SB_ERROR(("sb_attach: gpio control core not found\n"));
6212 + /* get boardtype and boardrev */
6213 + switch (si->bus) {
6215 + /* do a pci config read to get subsystem id and subvendor id */
6216 + w = OSL_PCI_READ_CONFIG(osh, PCI_CFG_SVID, sizeof (uint32));
6217 + si->boardvendor = w & 0xffff;
6218 + si->boardtype = (w >> 16) & 0xffff;
6223 + si->boardvendor = getintvar(*vars, "manfid");
6224 + si->boardtype = getintvar(*vars, "prodid");
6228 + si->boardvendor = VENDOR_BROADCOM;
6229 + si->boardtype = 0xffff;
6233 + if (si->boardtype == 0) {
6234 + SB_ERROR(("sb_attach: unknown board type\n"));
6235 + ASSERT(si->boardtype);
6238 + return ((void*)si);
6241 + MFREE(si, sizeof (sb_info_t));
6246 +sb_coreid(void *sbh)
6251 + si = SB_INFO(sbh);
6252 + sb = REGS2SB(si->curmap);
6254 + return ((R_SBREG(sbh, &(sb)->sbidhigh) & SBIDH_CC_MASK) >> SBIDH_CC_SHIFT);
6258 +sb_coreidx(void *sbh)
6262 + si = SB_INFO(sbh);
6263 + return (si->curidx);
6266 +/* return current index of core */
6268 +_sb_coreidx(void *sbh)
6272 + uint32 sbaddr = 0;
6274 + si = SB_INFO(sbh);
6277 + switch (si->bus) {
6279 + sb = REGS2SB(si->curmap);
6280 + sbaddr = sb_base(R_SBREG(sbh, &sb->sbadmatch0));
6284 + sbaddr = OSL_PCI_READ_CONFIG(si->osh, PCI_BAR0_WIN, sizeof (uint32));
6287 + case PCMCIA_BUS: {
6290 + OSL_PCMCIA_READ_ATTR(si->osh, PCMCIA_ADDR0, &tmp, 1);
6291 + sbaddr = (uint)tmp << 12;
6292 + OSL_PCMCIA_READ_ATTR(si->osh, PCMCIA_ADDR1, &tmp, 1);
6293 + sbaddr |= (uint)tmp << 16;
6294 + OSL_PCMCIA_READ_ATTR(si->osh, PCMCIA_ADDR2, &tmp, 1);
6295 + sbaddr |= (uint)tmp << 24;
6302 + ASSERT(GOODCOREADDR(sbaddr));
6303 + return ((sbaddr - SB_ENUM_BASE)/SB_CORE_SIZE);
6307 +sb_corevendor(void *sbh)
6312 + si = SB_INFO(sbh);
6313 + sb = REGS2SB(si->curmap);
6315 + return ((R_SBREG(sbh, &(sb)->sbidhigh) & SBIDH_VC_MASK) >> SBIDH_VC_SHIFT);
6319 +sb_corerev(void *sbh)
6324 + si = SB_INFO(sbh);
6325 + sb = REGS2SB(si->curmap);
6327 + return (R_SBREG(sbh, &(sb)->sbidhigh) & SBIDH_RC_MASK);
6330 +#define SBTML_ALLOW (SBTML_PE | SBTML_FGC | SBTML_FL_MASK)
6332 +/* set/clear sbtmstatelow core-specific flags */
6334 +sb_coreflags(void *sbh, uint32 mask, uint32 val)
6340 + si = SB_INFO(sbh);
6341 + sb = REGS2SB(si->curmap);
6343 + ASSERT((val & ~mask) == 0);
6344 + ASSERT((mask & ~SBTML_ALLOW) == 0);
6346 + /* mask and set */
6347 + if (mask || val) {
6348 + w = (R_SBREG(sbh, &sb->sbtmstatelow) & ~mask) | val;
6349 + W_SBREG(sbh, &sb->sbtmstatelow, w);
6352 + /* return the new value */
6353 + return (R_SBREG(sbh, &sb->sbtmstatelow) & SBTML_ALLOW);
6356 +/* set/clear sbtmstatehigh core-specific flags */
6358 +sb_coreflagshi(void *sbh, uint32 mask, uint32 val)
6364 + si = SB_INFO(sbh);
6365 + sb = REGS2SB(si->curmap);
6367 + ASSERT((val & ~mask) == 0);
6368 + ASSERT((mask & ~SBTMH_FL_MASK) == 0);
6370 + /* mask and set */
6371 + if (mask || val) {
6372 + w = (R_SBREG(sbh, &sb->sbtmstatehigh) & ~mask) | val;
6373 + W_SBREG(sbh, &sb->sbtmstatehigh, w);
6376 + /* return the new value */
6377 + return (R_SBREG(sbh, &sb->sbtmstatehigh) & SBTMH_FL_MASK);
6381 +sb_iscoreup(void *sbh)
6386 + si = SB_INFO(sbh);
6387 + sb = REGS2SB(si->curmap);
6389 + return ((R_SBREG(sbh, &(sb)->sbtmstatelow) & (SBTML_RESET | SBTML_REJ | SBTML_CLK)) == SBTML_CLK);
6393 + * Switch to 'coreidx', issue a single arbitrary 32bit register mask&set operation,
6394 + * switch back to the original core, and return the new value.
6397 +sb_corereg(void *sbh, uint coreidx, uint regoff, uint mask, uint val)
6403 + uint intr_val = 0;
6405 + ASSERT(GOODIDX(coreidx));
6406 + ASSERT(regoff < SB_CORE_SIZE);
6407 + ASSERT((val & ~mask) == 0);
6409 + si = SB_INFO(sbh);
6411 + /* save current core index */
6412 + origidx = sb_coreidx(sbh);
6415 + INTR_OFF(si, intr_val);
6416 + r = (uint32*) ((uint) sb_setcoreidx(sbh, coreidx) + regoff);
6418 + /* mask and set */
6419 + if (mask || val) {
6420 + if (regoff >= SBCONFIGOFF) {
6421 + w = (R_SBREG(sbh, r) & ~mask) | val;
6422 + W_SBREG(sbh, r, w);
6424 + w = (R_REG(r) & ~mask) | val;
6430 + w = R_SBREG(sbh, r);
6432 + /* restore core index */
6433 + if (origidx != coreidx)
6434 + sb_setcoreidx(sbh, origidx);
6436 + INTR_RESTORE(si, intr_val);
6440 +/* scan the sb enumerated space to identify all cores */
6442 +sb_scan(sb_info_t *si)
6450 + /* numcores should already be set */
6451 + ASSERT((si->numcores > 0) && (si->numcores <= SB_MAXCORES));
6453 + /* save current core index */
6454 + origidx = sb_coreidx(sbh);
6456 + si->pciidx = si->gpioidx = BADIDX;
6458 + for (i = 0; i < si->numcores; i++) {
6459 + sb_setcoreidx(sbh, i);
6460 + si->coreid[i] = sb_coreid(sbh);
6462 + if (si->coreid[i] == SB_CC)
6463 + si->ccrev = sb_corerev(sbh);
6465 + else if (si->coreid[i] == SB_PCI) {
6467 + si->pcirev = sb_corerev(sbh);
6469 + }else if (si->coreid[i] == SB_PCMCIA){
6470 + si->pcmciaidx = i;
6471 + si->pcmciarev = sb_corerev(sbh);
6476 + * Find the gpio "controlling core" type and index.
6478 + * - if there's a chip common core - use that
6479 + * - else if there's a pci core (rev >= 2) - use that
6480 + * - else there had better be an extif core (4710 only)
6482 + if (GOODIDX(sb_findcoreidx(sbh, SB_CC, 0))) {
6483 + si->gpioidx = sb_findcoreidx(sbh, SB_CC, 0);
6484 + si->gpioid = SB_CC;
6485 + } else if (GOODIDX(si->pciidx) && (si->pcirev >= 2)) {
6486 + si->gpioidx = si->pciidx;
6487 + si->gpioid = SB_PCI;
6488 + } else if (sb_findcoreidx(sbh, SB_EXTIF, 0)) {
6489 + si->gpioidx = sb_findcoreidx(sbh, SB_EXTIF, 0);
6490 + si->gpioid = SB_EXTIF;
6493 + /* return to original core index */
6494 + sb_setcoreidx(sbh, origidx);
6497 +/* may be called with core in reset */
6499 +sb_detach(void *sbh)
6504 + si = SB_INFO(sbh);
6509 + if (si->bus == SB_BUS)
6510 + for (idx = 0; idx < SB_MAXCORES; idx++)
6511 + if (si->regs[idx]) {
6512 + REG_UNMAP(si->regs[idx]);
6513 + si->regs[idx] = NULL;
6516 + MFREE(si, sizeof (sb_info_t));
6519 +/* use pci dev id to determine chip id for chips not having a chipcommon core */
6521 +sb_pcidev2chip(uint pcidev)
6523 + if ((pcidev >= BCM4710_DEVICE_ID) && (pcidev <= BCM47XX_USB_ID))
6524 + return (BCM4710_DEVICE_ID);
6525 + if ((pcidev >= BCM4610_DEVICE_ID) && (pcidev <= BCM4610_USB_ID))
6526 + return (BCM4610_DEVICE_ID);
6527 + if ((pcidev >= BCM4402_DEVICE_ID) && (pcidev <= BCM4402_V90_ID))
6528 + return (BCM4402_DEVICE_ID);
6529 + if ((pcidev >= BCM4307_V90_ID) && (pcidev <= BCM4307_D11B_ID))
6530 + return (BCM4307_DEVICE_ID);
6531 + if (pcidev == BCM4301_DEVICE_ID)
6532 + return (BCM4301_DEVICE_ID);
6537 +/* convert chip number to number of i/o cores */
6539 +sb_chip2numcores(uint chip)
6541 + if (chip == 0x4710)
6543 + if (chip == 0x4610)
6545 + if (chip == 0x4402)
6547 + if ((chip == 0x4307) || (chip == 0x4301))
6549 + if (chip == 0x4310)
6551 + if (chip == 0x4306) /* < 4306c0 */
6553 + if (chip == 0x4704)
6555 + if (chip == 0x5365)
6558 + SB_ERROR(("sb_chip2numcores: unsupported chip 0x%x\n", chip));
6563 +/* return index of coreid or BADIDX if not found */
6565 +sb_findcoreidx(void *sbh, uint coreid, uint coreunit)
6571 + si = SB_INFO(sbh);
6574 + for (i = 0; i < si->numcores; i++)
6575 + if (si->coreid[i] == coreid) {
6576 + if (found == coreunit)
6584 +/* change logical "focus" to the indiciated core */
6586 +sb_setcoreidx(void *sbh, uint coreidx)
6592 + si = SB_INFO(sbh);
6594 + if (coreidx >= si->numcores)
6598 + * If the user has provided an interrupt mask enabled function,
6599 + * then assert interrupts are disabled before switching the core.
6601 + ASSERT((si->imf == NULL) || !(*si->imf)(si->imfarg));
6603 + sbaddr = SB_ENUM_BASE + (coreidx * SB_CORE_SIZE);
6605 + switch (si->bus) {
6608 + if (!si->regs[coreidx]) {
6609 + si->regs[coreidx] = (void*)REG_MAP(sbaddr, SB_CORE_SIZE);
6610 + ASSERT(GOODREGS(si->regs[coreidx]));
6612 + si->curmap = si->regs[coreidx];
6616 + /* point bar0 window */
6617 + OSL_PCI_WRITE_CONFIG(si->osh, PCI_BAR0_WIN, 4, sbaddr);
6621 + tmp = (sbaddr >> 12) & 0x0f;
6622 + OSL_PCMCIA_WRITE_ATTR(si->osh, PCMCIA_ADDR0, &tmp, 1);
6623 + tmp = (sbaddr >> 16) & 0xff;
6624 + OSL_PCMCIA_WRITE_ATTR(si->osh, PCMCIA_ADDR1, &tmp, 1);
6625 + tmp = (sbaddr >> 24) & 0xff;
6626 + OSL_PCMCIA_WRITE_ATTR(si->osh, PCMCIA_ADDR2, &tmp, 1);
6630 + si->curidx = coreidx;
6632 + return (si->curmap);
6635 +/* change logical "focus" to the indicated core */
6637 +sb_setcore(void *sbh, uint coreid, uint coreunit)
6642 + si = SB_INFO(sbh);
6644 + idx = sb_findcoreidx(sbh, coreid, coreunit);
6645 + if (!GOODIDX(idx))
6648 + return (sb_setcoreidx(sbh, idx));
6651 +/* return chip number */
6657 + si = SB_INFO(sbh);
6658 + return (si->chip);
6661 +/* return chip revision number */
6663 +sb_chiprev(void *sbh)
6667 + si = SB_INFO(sbh);
6668 + return (si->chiprev);
6671 +/* return chip package option */
6673 +sb_chippkg(void *sbh)
6677 + si = SB_INFO(sbh);
6678 + return (si->chippkg);
6681 +/* return board vendor id */
6683 +sb_boardvendor(void *sbh)
6687 + si = SB_INFO(sbh);
6688 + return (si->boardvendor);
6691 +/* return boardtype */
6693 +sb_boardtype(void *sbh)
6698 + si = SB_INFO(sbh);
6700 + if (si->bus == SB_BUS && si->boardtype == 0xffff) {
6701 + /* boardtype format is a hex string */
6702 + si->boardtype = getintvar(NULL, "boardtype");
6704 + /* backward compatibility for older boardtype string format */
6705 + if ((si->boardtype == 0) && (var = getvar(NULL, "boardtype"))) {
6706 + if (!strcmp(var, "bcm94710dev"))
6707 + si->boardtype = BCM94710D_BOARD;
6708 + else if (!strcmp(var, "bcm94710ap"))
6709 + si->boardtype = BCM94710AP_BOARD;
6710 + else if (!strcmp(var, "bcm94310u"))
6711 + si->boardtype = BCM94310U_BOARD;
6712 + else if (!strcmp(var, "bu4711"))
6713 + si->boardtype = BU4711_BOARD;
6714 + else if (!strcmp(var, "bu4710"))
6715 + si->boardtype = BU4710_BOARD;
6716 + else if (!strcmp(var, "bcm94702mn"))
6717 + si->boardtype = BCM94702MN_BOARD;
6718 + else if (!strcmp(var, "bcm94710r1"))
6719 + si->boardtype = BCM94710R1_BOARD;
6720 + else if (!strcmp(var, "bcm94710r4"))
6721 + si->boardtype = BCM94710R4_BOARD;
6722 + else if (!strcmp(var, "bcm94702cpci"))
6723 + si->boardtype = BCM94702CPCI_BOARD;
6724 + else if (!strcmp(var, "bcm95380_rr"))
6725 + si->boardtype = BCM95380RR_BOARD;
6729 + return (si->boardtype);
6732 +/* return board bus style */
6734 +sb_boardstyle(void *sbh)
6739 + si = SB_INFO(sbh);
6741 + if (si->bus == PCMCIA_BUS)
6742 + return (BOARDSTYLE_PCMCIA);
6744 + if (si->bus == SB_BUS)
6745 + return (BOARDSTYLE_SOC);
6749 + if (OSL_PCI_READ_CONFIG(si->osh, PCI_CFG_CIS, sizeof (uint32)) != 0)
6750 + return (BOARDSTYLE_CARDBUS);
6752 + if ((srom_read(si->bus, si->curmap, si->osh, (SPROM_SIZE - 1) * 2, 2, &w) == 0) &&
6754 + return (BOARDSTYLE_CARDBUS);
6756 + return (BOARDSTYLE_PCI);
6759 +/* return boolean if sbh device is in pci hostmode or client mode */
6765 + si = SB_INFO(sbh);
6769 +/* return list of found cores */
6771 +sb_corelist(void *sbh, uint coreid[])
6775 + si = SB_INFO(sbh);
6777 + bcopy((uchar*)si->coreid, (uchar*)coreid, (si->numcores * sizeof (uint)));
6778 + return (si->numcores);
6781 +/* return current register mapping */
6783 +sb_coreregs(void *sbh)
6787 + si = SB_INFO(sbh);
6788 + ASSERT(GOODREGS(si->curmap));
6790 + return (si->curmap);
6793 +/* Check if a target abort has happened and clear it */
6795 +sb_taclear(void *sbh)
6801 + si = SB_INFO(sbh);
6802 + sb = REGS2SB(si->curmap);
6804 + if (si->bus == PCI_BUS) {
6807 + stcmd = OSL_PCI_READ_CONFIG(si->osh, PCI_CFG_CMD, sizeof(stcmd));
6808 + rc = (stcmd & 0x08000000) != 0;
6811 + /* Target abort bit is set, clear it */
6812 + OSL_PCI_WRITE_CONFIG(si->osh, PCI_CFG_CMD, sizeof(stcmd), stcmd);
6814 + } else if (si->bus == PCMCIA_BUS) {
6817 + else if (si->bus == SDIO_BUS) {
6818 + /* due to 4317 A0 HW bug, sdio core wedged on target abort,
6819 + just clear SBSErr bit blindly */
6820 + if (0x0 != R_SBREG(sbh, &sb->sbtmerrlog)) {
6821 + SB_ERROR(("SDIO target abort, clean it"));
6822 + W_SBREG(sbh, &sb->sbtmstatehigh, 0);
6830 +/* do buffered registers update */
6832 +sb_commit(void *sbh)
6835 + sbpciregs_t *pciregs;
6837 + uint intr_val = 0;
6839 + si = SB_INFO(sbh);
6841 + origidx = si->curidx;
6842 + ASSERT(GOODIDX(origidx));
6844 + INTR_OFF(si, intr_val);
6845 + /* switch over to pci core */
6846 + pciregs = (sbpciregs_t*) sb_setcore(sbh, SB_PCI, 0);
6848 + /* do the buffer registers update */
6849 + W_REG(&pciregs->bcastaddr, SB_COMMIT);
6850 + W_REG(&pciregs->bcastdata, 0x0);
6852 + /* restore core index */
6853 + sb_setcoreidx(sbh, origidx);
6854 + INTR_RESTORE(si, intr_val);
6857 +/* reset and re-enable a core */
6859 +sb_core_reset(void *sbh, uint32 bits)
6863 + volatile uint32 dummy;
6865 + si = SB_INFO(sbh);
6866 + ASSERT(GOODREGS(si->curmap));
6867 + sb = REGS2SB(si->curmap);
6870 + * Must do the disable sequence first to work for arbitrary current core state.
6872 + sb_core_disable(sbh, bits);
6875 + * Now do the initialization sequence.
6878 + /* set reset while enabling the clock and forcing them on throughout the core */
6879 + W_SBREG(sbh, &sb->sbtmstatelow, (SBTML_FGC | SBTML_CLK | SBTML_RESET | bits));
6880 + dummy = R_SBREG(sbh, &sb->sbtmstatelow);
6882 + if (sb_coreid(sbh) == SB_ILINE100) {
6888 + if (R_SBREG(sbh, &sb->sbtmstatehigh) & SBTMH_SERR) {
6889 + W_SBREG(sbh, &sb->sbtmstatehigh, 0);
6891 + if ((dummy = R_SBREG(sbh, &sb->sbimstate)) & (SBIM_IBE | SBIM_TO)) {
6892 + AND_SBREG(sbh, &sb->sbimstate, ~(SBIM_IBE | SBIM_TO));
6895 + /* clear reset and allow it to propagate throughout the core */
6896 + W_SBREG(sbh, &sb->sbtmstatelow, (SBTML_FGC | SBTML_CLK | bits));
6897 + dummy = R_SBREG(sbh, &sb->sbtmstatelow);
6900 + /* leave clock enabled */
6901 + W_SBREG(sbh, &sb->sbtmstatelow, (SBTML_CLK | bits));
6902 + dummy = R_SBREG(sbh, &sb->sbtmstatelow);
6907 +sb_core_tofixup(void *sbh)
6912 + si = SB_INFO(sbh);
6914 + if (si->pcirev >= 5)
6917 + ASSERT(GOODREGS(si->curmap));
6918 + sb = REGS2SB(si->curmap);
6920 + if (si->bus == SB_BUS) {
6921 + SET_SBREG(sbh, &sb->sbimconfiglow,
6922 + SBIMCL_RTO_MASK | SBIMCL_STO_MASK,
6923 + (0x5 << SBIMCL_RTO_SHIFT) | 0x3);
6925 + if (sb_coreid(sbh) == SB_PCI) {
6926 + SET_SBREG(sbh, &sb->sbimconfiglow,
6927 + SBIMCL_RTO_MASK | SBIMCL_STO_MASK,
6928 + (0x3 << SBIMCL_RTO_SHIFT) | 0x2);
6930 + SET_SBREG(sbh, &sb->sbimconfiglow, (SBIMCL_RTO_MASK | SBIMCL_STO_MASK), 0);
6938 +sb_core_disable(void *sbh, uint32 bits)
6941 + volatile uint32 dummy;
6944 + si = SB_INFO(sbh);
6946 + ASSERT(GOODREGS(si->curmap));
6947 + sb = REGS2SB(si->curmap);
6949 + /* must return if core is already in reset */
6950 + if (R_SBREG(sbh, &sb->sbtmstatelow) & SBTML_RESET)
6953 + /* put into reset and return if clocks are not enabled */
6954 + if ((R_SBREG(sbh, &sb->sbtmstatelow) & SBTML_CLK) == 0)
6957 + /* set the reject bit */
6958 + W_SBREG(sbh, &sb->sbtmstatelow, (SBTML_CLK | SBTML_REJ));
6960 + /* spin until reject is set */
6961 + while ((R_SBREG(sbh, &sb->sbtmstatelow) & SBTML_REJ) == 0)
6964 + /* spin until sbtmstatehigh.busy is clear */
6965 + while (R_SBREG(sbh, &sb->sbtmstatehigh) & SBTMH_BUSY)
6968 + /* set reset and reject while enabling the clocks */
6969 + W_SBREG(sbh, &sb->sbtmstatelow, (bits | SBTML_FGC | SBTML_CLK | SBTML_REJ | SBTML_RESET));
6970 + dummy = R_SBREG(sbh, &sb->sbtmstatelow);
6974 + /* leave reset and reject asserted */
6975 + W_SBREG(sbh, &sb->sbtmstatelow, (bits | SBTML_REJ | SBTML_RESET));
6980 +sb_watchdog(void *sbh, uint ticks)
6982 + sb_info_t *si = SB_INFO(sbh);
6985 + switch (si->gpioid) {
6987 + sb_corereg(sbh, si->gpioidx, OFFSETOF(chipcregs_t, watchdog), ~0, ticks);
6990 + sb_corereg(sbh, si->gpioidx, OFFSETOF(extifregs_t, watchdog), ~0, ticks);
6995 +/* initialize the pcmcia core */
6997 +sb_pcmcia_init(void *sbh)
7002 + si = SB_INFO(sbh);
7004 + /* enable d11 mac interrupts */
7005 + if (si->chip == BCM4301_DEVICE_ID) {
7006 + /* Have to use FCR2 in 4301 */
7007 + OSL_PCMCIA_READ_ATTR(si->osh, PCMCIA_FCR2 + PCMCIA_COR, &cor, 1);
7008 + cor |= COR_IRQEN | COR_FUNEN;
7009 + OSL_PCMCIA_WRITE_ATTR(si->osh, PCMCIA_FCR2 + PCMCIA_COR, &cor, 1);
7011 + OSL_PCMCIA_READ_ATTR(si->osh, PCMCIA_FCR0 + PCMCIA_COR, &cor, 1);
7012 + cor |= COR_IRQEN | COR_FUNEN;
7013 + OSL_PCMCIA_WRITE_ATTR(si->osh, PCMCIA_FCR0 + PCMCIA_COR, &cor, 1);
7020 + * Configure the pci core for pci client (NIC) action
7021 + * and get appropriate dma offset value.
7022 + * coremask is the bitvec of cores by index to be enabled.
7025 +sb_pci_setup(void *sbh, uint32 *dmaoffset, uint coremask)
7029 + sbpciregs_t *pciregs;
7034 + si = SB_INFO(sbh);
7039 + /* if not pci bus, we're done */
7040 + if (si->bus != PCI_BUS)
7043 + ASSERT(si->pciidx);
7045 + /* get current core index */
7048 + /* we interrupt on this backplane flag number */
7049 + ASSERT(GOODREGS(si->curmap));
7050 + sb = REGS2SB(si->curmap);
7051 + sbflag = R_SBREG(sbh, &sb->sbtpsflag) & SBTPS_NUM0_MASK;
7053 + /* switch over to pci core */
7054 + pciregs = (sbpciregs_t*) sb_setcoreidx(sbh, si->pciidx);
7055 + sb = REGS2SB(pciregs);
7058 + * Enable sb->pci interrupts. Assume
7059 + * PCI rev 2.3 support was added in pci core rev 6 and things changed..
7061 + if (si->pcirev < 6) {
7062 + /* set sbintvec bit for our flag number */
7063 + OR_SBREG(sbh, &sb->sbintvec, (1 << sbflag));
7065 + /* pci config write to set this core bit in PCIIntMask */
7066 + w = OSL_PCI_READ_CONFIG(si->osh, PCI_INT_MASK, sizeof(uint32));
7067 + w |= (coremask << PCI_SBIM_SHIFT);
7068 + OSL_PCI_WRITE_CONFIG(si->osh, PCI_INT_MASK, sizeof(uint32), w);
7071 + /* enable prefetch and bursts for sonics-to-pci translation 2 */
7072 + OR_REG(&pciregs->sbtopci2, (SBTOPCI_PREF|SBTOPCI_BURST));
7074 + if (si->pcirev < 5) {
7075 + SET_SBREG(sbh, &sb->sbimconfiglow, SBIMCL_RTO_MASK | SBIMCL_STO_MASK,
7076 + (0x3 << SBIMCL_RTO_SHIFT) | 0x2);
7080 + /* switch back to previous core */
7081 + sb_setcoreidx(sbh, idx);
7083 + /* use large sb pci dma window */
7085 + *dmaoffset = SB_PCI_DMA;
7089 +sb_base(uint32 admatch)
7094 + type = admatch & SBAM_TYPE_MASK;
7100 + base = admatch & SBAM_BASE0_MASK;
7101 + } else if (type == 1) {
7102 + ASSERT(!(admatch & SBAM_ADNEG)); /* neg not supported */
7103 + base = admatch & SBAM_BASE1_MASK;
7104 + } else if (type == 2) {
7105 + ASSERT(!(admatch & SBAM_ADNEG)); /* neg not supported */
7106 + base = admatch & SBAM_BASE2_MASK;
7113 +sb_size(uint32 admatch)
7118 + type = admatch & SBAM_TYPE_MASK;
7124 + size = 1 << (((admatch & SBAM_ADINT0_MASK) >> SBAM_ADINT0_SHIFT) + 1);
7125 + } else if (type == 1) {
7126 + ASSERT(!(admatch & SBAM_ADNEG)); /* neg not supported */
7127 + size = 1 << (((admatch & SBAM_ADINT1_MASK) >> SBAM_ADINT1_SHIFT) + 1);
7128 + } else if (type == 2) {
7129 + ASSERT(!(admatch & SBAM_ADNEG)); /* neg not supported */
7130 + size = 1 << (((admatch & SBAM_ADINT2_MASK) >> SBAM_ADINT2_SHIFT) + 1);
7136 +/* return the core-type instantiation # of the current core */
7138 +sb_coreunit(void *sbh)
7146 + si = SB_INFO(sbh);
7151 + ASSERT(GOODREGS(si->curmap));
7152 + coreid = sb_coreid(sbh);
7154 + /* count the cores of our type */
7155 + for (i = 0; i < idx; i++)
7156 + if (si->coreid[i] == coreid)
7159 + return (coreunit);
7162 +static INLINE uint32
7166 + case CC_F6_2: return 2;
7167 + case CC_F6_3: return 3;
7168 + case CC_F6_4: return 4;
7169 + case CC_F6_5: return 5;
7170 + case CC_F6_6: return 6;
7171 + case CC_F6_7: return 7;
7172 + default: return 0;
7176 +/* calculate the speed the SB would run at given a set of clockcontrol values */
7178 +sb_clock_rate(uint32 pll_type, uint32 n, uint32 m)
7180 + uint32 n1, n2, clock, m1, m2, m3, mc;
7182 + n1 = n & CN_N1_MASK;
7183 + n2 = (n & CN_N2_MASK) >> CN_N2_SHIFT;
7185 + if ((pll_type == PLL_TYPE1) || (pll_type == PLL_TYPE4)) {
7188 + } else if (pll_type == PLL_TYPE2) {
7191 + ASSERT((n1 >= 2) && (n1 <= 7));
7192 + ASSERT((n2 >= 5) && (n2 <= 23));
7193 + } else if (pll_type == PLL_TYPE3) {
7194 + return (100000000);
7196 + ASSERT((pll_type >= PLL_TYPE1) && (pll_type <= PLL_TYPE4));
7198 + clock = CC_CLOCK_BASE * n1 * n2;
7203 + m1 = m & CC_M1_MASK;
7204 + m2 = (m & CC_M2_MASK) >> CC_M2_SHIFT;
7205 + m3 = (m & CC_M3_MASK) >> CC_M3_SHIFT;
7206 + mc = (m & CC_MC_MASK) >> CC_MC_SHIFT;
7208 + if ((pll_type == PLL_TYPE1) || (pll_type == PLL_TYPE4)) {
7210 + if (pll_type == PLL_TYPE1)
7217 + case CC_MC_BYPASS: return (clock);
7218 + case CC_MC_M1: return (clock / m1);
7219 + case CC_MC_M1M2: return (clock / (m1 * m2));
7220 + case CC_MC_M1M2M3: return (clock / (m1 * m2 * m3));
7221 + case CC_MC_M1M3: return (clock / (m1 * m3));
7222 + default: return (0);
7225 + ASSERT(pll_type == PLL_TYPE2);
7228 + m2 += CC_T2M2_BIAS;
7230 + ASSERT((m1 >= 2) && (m1 <= 7));
7231 + ASSERT((m2 >= 3) && (m2 <= 10));
7232 + ASSERT((m3 >= 2) && (m3 <= 7));
7234 + if ((mc & CC_T2MC_M1BYP) == 0)
7236 + if ((mc & CC_T2MC_M2BYP) == 0)
7238 + if ((mc & CC_T2MC_M3BYP) == 0)
7245 +/* returns the current speed the SB is running at */
7247 +sb_clock(void *sbh)
7254 + uint32 pll_type, rate;
7255 + uint intr_val = 0;
7257 + si = SB_INFO(sbh);
7259 + pll_type = PLL_TYPE1;
7261 + INTR_OFF(si, intr_val);
7263 + /* switch to extif or chipc core */
7264 + if ((eir = (extifregs_t *) sb_setcore(sbh, SB_EXTIF, 0))) {
7265 + n = R_REG(&eir->clockcontrol_n);
7266 + m = R_REG(&eir->clockcontrol_sb);
7267 + } else if ((cc = (chipcregs_t *) sb_setcore(sbh, SB_CC, 0))) {
7268 + pll_type = R_REG(&cc->capabilities) & CAP_PLL_MASK;
7269 + n = R_REG(&cc->clockcontrol_n);
7270 + m = R_REG(&cc->clockcontrol_sb);
7272 + INTR_RESTORE(si, intr_val);
7276 + /* calculate rate */
7277 + rate = sb_clock_rate(pll_type, n, m);
7279 + /* switch back to previous core */
7280 + sb_setcoreidx(sbh, idx);
7282 + INTR_RESTORE(si, intr_val);
7287 +/* change logical "focus" to the gpio core for optimized access */
7289 +sb_gpiosetcore(void *sbh)
7293 + si = SB_INFO(sbh);
7295 + return (sb_setcoreidx(sbh, si->gpioidx));
7298 +/* mask&set gpiocontrol bits */
7300 +sb_gpiocontrol(void *sbh, uint32 mask, uint32 val)
7305 + si = SB_INFO(sbh);
7308 + switch (si->gpioid) {
7310 + regoff = OFFSETOF(chipcregs_t, gpiocontrol);
7314 + regoff = OFFSETOF(sbpciregs_t, gpiocontrol);
7321 + return (sb_corereg(sbh, si->gpioidx, regoff, mask, val));
7324 +/* mask&set gpio output enable bits */
7326 +sb_gpioouten(void *sbh, uint32 mask, uint32 val)
7331 + si = SB_INFO(sbh);
7334 + switch (si->gpioid) {
7336 + regoff = OFFSETOF(chipcregs_t, gpioouten);
7340 + regoff = OFFSETOF(sbpciregs_t, gpioouten);
7344 + regoff = OFFSETOF(extifregs_t, gpio[0].outen);
7348 + return (sb_corereg(sbh, si->gpioidx, regoff, mask, val));
7351 +/* mask&set gpio output bits */
7353 +sb_gpioout(void *sbh, uint32 mask, uint32 val)
7358 + si = SB_INFO(sbh);
7361 + switch (si->gpioid) {
7363 + regoff = OFFSETOF(chipcregs_t, gpioout);
7367 + regoff = OFFSETOF(sbpciregs_t, gpioout);
7371 + regoff = OFFSETOF(extifregs_t, gpio[0].out);
7375 + return (sb_corereg(sbh, si->gpioidx, regoff, mask, val));
7378 +/* return the current gpioin register value */
7380 +sb_gpioin(void *sbh)
7385 + si = SB_INFO(sbh);
7388 + switch (si->gpioid) {
7390 + regoff = OFFSETOF(chipcregs_t, gpioin);
7394 + regoff = OFFSETOF(sbpciregs_t, gpioin);
7398 + regoff = OFFSETOF(extifregs_t, gpioin);
7402 + return (sb_corereg(sbh, si->gpioidx, regoff, 0, 0));
7405 +/* mask&set gpio interrupt polarity bits */
7407 +sb_gpiointpolarity(void *sbh, uint32 mask, uint32 val)
7412 + si = SB_INFO(sbh);
7415 + switch (si->gpioid) {
7417 + regoff = OFFSETOF(chipcregs_t, gpiointpolarity);
7421 + /* pci gpio implementation does not support interrupt polarity */
7426 + regoff = OFFSETOF(extifregs_t, gpiointpolarity);
7430 + return (sb_corereg(sbh, si->gpioidx, regoff, mask, val));
7433 +/* mask&set gpio interrupt mask bits */
7435 +sb_gpiointmask(void *sbh, uint32 mask, uint32 val)
7440 + si = SB_INFO(sbh);
7443 + switch (si->gpioid) {
7445 + regoff = OFFSETOF(chipcregs_t, gpiointmask);
7449 + /* pci gpio implementation does not support interrupt mask */
7454 + regoff = OFFSETOF(extifregs_t, gpiointmask);
7458 + return (sb_corereg(sbh, si->gpioidx, regoff, mask, val));
7463 + * Return the slowclock min or max frequency.
7464 + * Three sources of SLOW CLOCK:
7465 + * 1. On Chip LPO - 32khz or 160khz
7466 + * 2. On Chip Xtal OSC - 20mhz/4*(divider+1)
7467 + * 3. External PCI clock - 66mhz/4*(divider+1)
7470 +slowfreq(void *sbh, bool max)
7477 + si = SB_INFO(sbh);
7479 + ASSERT(sb_coreid(sbh) == SB_CC);
7481 + cc = (chipcregs_t*) sb_setcoreidx(sbh, si->curidx);
7483 + /* shouldn't be here unless we've established the chip has dynamic power control */
7484 + ASSERT(R_REG(&cc->capabilities) & CAP_PWR_CTL);
7486 + if (si->ccrev < 6) {
7487 + v = OSL_PCI_READ_CONFIG(si->osh, PCI_GPIO_OUT, sizeof (uint32));
7489 + if (v & PCI_CFG_GPIO_SCS)
7490 + return (max? (PCIMAXFREQ/64) : (PCIMINFREQ/64));
7492 + return (max? (XTALMAXFREQ/32) : (XTALMINFREQ/32));
7494 + v = R_REG(&cc->slow_clk_ctl) & SCC_SS_MASK;
7495 + div = 4 * (((R_REG(&cc->slow_clk_ctl) & SCC_CD_MASK) >> SCC_CD_SHF) + 1);
7496 + if (v == SCC_SS_LPO)
7497 + return (max? LPOMAXFREQ : LPOMINFREQ);
7498 + else if (v == SCC_SS_XTAL)
7499 + return (max? (XTALMAXFREQ/div) : (XTALMINFREQ/div));
7500 + else if (v == SCC_SS_PCI)
7501 + return (max? (PCIMAXFREQ/div) : (PCIMINFREQ/div));
7508 +/* initialize power control delay registers */
7510 +sb_pwrctl_init(void *sbh)
7516 + uint pll_on_delay, fref_sel_delay;
7518 + si = SB_INFO(sbh);
7520 + if (si->bus == SB_BUS)
7523 + origidx = si->curidx;
7525 + if ((cc = (chipcregs_t*) sb_setcore(sbh, SB_CC, 0)) == NULL)
7528 + if (!(R_REG(&cc->capabilities) & CAP_PWR_CTL))
7531 + slowmaxfreq = slowfreq(sbh, TRUE);
7532 + pll_on_delay = ((slowmaxfreq * PLL_DELAY) + 999999) / 1000000;
7533 + fref_sel_delay = ((slowmaxfreq * FREF_DELAY) + 999999) / 1000000;
7535 + W_REG(&cc->pll_on_delay, pll_on_delay);
7536 + W_REG(&cc->fref_sel_delay, fref_sel_delay);
7538 + /* 4317pc does not work with SlowClock less than 5Mhz */
7539 + if (si->bus == PCMCIA_BUS)
7540 + SET_REG(&cc->slow_clk_ctl, SCC_CD_MASK, (0 << SCC_CD_SHF));
7543 + sb_setcoreidx(sbh, origidx);
7546 +/* return the value suitable for writing to the dot11 core FAST_PWRUP_DELAY register */
7548 +sb_pwrctl_fast_pwrup_delay(void *sbh)
7555 + uint intr_val = 0;
7557 + si = SB_INFO(sbh);
7559 + origidx = si->curidx;
7561 + if (si->bus == SB_BUS)
7564 + INTR_OFF(si, intr_val);
7566 + if ((cc = (chipcregs_t*) sb_setcore(sbh, SB_CC, 0)) == NULL)
7569 + if (!(R_REG(&cc->capabilities) & CAP_PWR_CTL))
7572 + slowminfreq = slowfreq(sbh, FALSE);
7573 + fpdelay = (((R_REG(&cc->pll_on_delay) + 2) * 1000000) + (slowminfreq - 1)) / slowminfreq;
7576 + sb_setcoreidx(sbh, origidx);
7577 + INTR_RESTORE(si, intr_val);
7581 +/* turn primary xtal and/or pll off/on */
7583 +sb_pwrctl_xtal(void *sbh, uint what, bool on)
7586 + uint32 in, out, outen;
7588 + si = SB_INFO(sbh);
7591 + if (si->bus == PCMCIA_BUS) {
7595 + if (si->bus != PCI_BUS)
7598 + in = OSL_PCI_READ_CONFIG(si->osh, PCI_GPIO_IN, sizeof (uint32));
7599 + out = OSL_PCI_READ_CONFIG(si->osh, PCI_GPIO_OUT, sizeof (uint32));
7600 + outen = OSL_PCI_READ_CONFIG(si->osh, PCI_GPIO_OUTEN, sizeof (uint32));
7603 + * We can't actually read the state of the PLLPD so we infer it
7604 + * by the value of XTAL_PU which *is* readable via gpioin.
7606 + if (on && (in & PCI_CFG_GPIO_XTAL))
7610 + outen |= PCI_CFG_GPIO_XTAL;
7612 + outen |= PCI_CFG_GPIO_PLL;
7615 + /* turn primary xtal on */
7616 + if (what & XTAL) {
7617 + out |= PCI_CFG_GPIO_XTAL;
7619 + out |= PCI_CFG_GPIO_PLL;
7620 + OSL_PCI_WRITE_CONFIG(si->osh, PCI_GPIO_OUT, sizeof (uint32), out);
7621 + OSL_PCI_WRITE_CONFIG(si->osh, PCI_GPIO_OUTEN, sizeof (uint32), outen);
7627 + out &= ~PCI_CFG_GPIO_PLL;
7628 + OSL_PCI_WRITE_CONFIG(si->osh, PCI_GPIO_OUT, sizeof (uint32), out);
7633 + out &= ~PCI_CFG_GPIO_XTAL;
7635 + out |= PCI_CFG_GPIO_PLL;
7636 + OSL_PCI_WRITE_CONFIG(si->osh, PCI_GPIO_OUT, sizeof (uint32), out);
7637 + OSL_PCI_WRITE_CONFIG(si->osh, PCI_GPIO_OUTEN, sizeof (uint32), outen);
7643 +/* set dynamic power control mode (forceslow, forcefast, dynamic) */
7644 +/* returns true if ignore pll off is set and false if it is not */
7646 +sb_pwrctl_clk(void *sbh, uint mode)
7652 + bool forcefastclk=FALSE;
7653 + uint intr_val = 0;
7655 + si = SB_INFO(sbh);
7657 + /* chipcommon cores prior to rev6 don't support slowclkcontrol */
7658 + if (si->ccrev < 6)
7661 + INTR_OFF(si, intr_val);
7663 + origidx = si->curidx;
7665 + cc = (chipcregs_t*) sb_setcore(sbh, SB_CC, 0);
7666 + ASSERT(cc != NULL);
7668 + if (!(R_REG(&cc->capabilities) & CAP_PWR_CTL))
7672 + case CLK_FAST: /* force fast (pll) clock */
7673 + /* don't forget to force xtal back on before we clear SCC_DYN_XTAL.. */
7674 + sb_pwrctl_xtal(sbh, XTAL, ON);
7676 + SET_REG(&cc->slow_clk_ctl, (SCC_XC | SCC_FS | SCC_IP), SCC_IP);
7679 + case CLK_SLOW: /* force slow clock */
7680 + if ((si->bus == SDIO_BUS) || (si->bus == PCMCIA_BUS))
7683 + if (si->ccrev >= 6)
7684 + OR_REG(&cc->slow_clk_ctl, SCC_FS);
7687 + case CLK_DYNAMIC: /* enable dynamic power control */
7688 + scc = R_REG(&cc->slow_clk_ctl);
7689 + scc &= ~(SCC_FS | SCC_IP | SCC_XC);
7690 + if ((scc & SCC_SS_MASK) != SCC_SS_XTAL)
7692 + W_REG(&cc->slow_clk_ctl, scc);
7694 + /* for dynamic control, we have to release our xtal_pu "force on" */
7696 + sb_pwrctl_xtal(sbh, XTAL, OFF);
7700 + /* Is the h/w forcing the use of the fast clk */
7701 + forcefastclk = (bool)((R_REG(&cc->slow_clk_ctl) & SCC_IP) == SCC_IP);
7704 + sb_setcoreidx(sbh, origidx);
7705 + INTR_RESTORE(si, intr_val);
7706 + return (forcefastclk);
7709 +/* register driver interrupt disabling and restoring callback functions */
7711 +sb_register_intr_callback(void *sbh, void *intrsoff_fn, void *intrsrestore_fn, void *intr_arg)
7715 + si = SB_INFO(sbh);
7716 + si->intr_arg = intr_arg;
7717 + si->intrsoff_fn = (sb_intrsoff_t)intrsoff_fn;
7718 + si->intrsrestore_fn = (sb_intrsrestore_t)intrsrestore_fn;
7719 + /* save current core id. when this function called, the current core
7720 + * must be the core which provides driver functions(il, et, wl, etc.)
7722 + si->dev_coreid = si->coreid[si->curidx];
7726 diff -Nur linux-2.6.12.5/arch/mips/bcm947xx/include/bcm4710.h linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/bcm4710.h
7727 --- linux-2.6.12.5/arch/mips/bcm947xx/include/bcm4710.h 1970-01-01 01:00:00.000000000 +0100
7728 +++ linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/bcm4710.h 2005-08-28 11:12:20.430859152 +0200
7731 + * BCM4710 address space map and definitions
7732 + * Think twice before adding to this file, this is not the kitchen sink
7733 + * These definitions are not guaranteed for all 47xx chips, only the 4710
7735 + * Copyright 2001-2003, Broadcom Corporation
7736 + * All Rights Reserved.
7738 + * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
7739 + * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
7740 + * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
7741 + * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
7745 +#ifndef _bcm4710_h_
7746 +#define _bcm4710_h_
7749 +#define BCM4710_SDRAM 0x00000000 /* Physical SDRAM */
7750 +#define BCM4710_PCI_MEM 0x08000000 /* Host Mode PCI memory access space (64 MB) */
7751 +#define BCM4710_PCI_CFG 0x0c000000 /* Host Mode PCI configuration space (64 MB) */
7752 +#define BCM4710_PCI_DMA 0x40000000 /* Client Mode PCI memory access space (1 GB) */
7753 +#define BCM4710_SDRAM_SWAPPED 0x10000000 /* Byteswapped Physical SDRAM */
7754 +#define BCM4710_ENUM 0x18000000 /* Beginning of core enumeration space */
7756 +/* Core register space */
7757 +#define BCM4710_REG_SDRAM 0x18000000 /* SDRAM core registers */
7758 +#define BCM4710_REG_ILINE20 0x18001000 /* InsideLine20 core registers */
7759 +#define BCM4710_REG_EMAC0 0x18002000 /* Ethernet MAC 0 core registers */
7760 +#define BCM4710_REG_CODEC 0x18003000 /* Codec core registers */
7761 +#define BCM4710_REG_USB 0x18004000 /* USB core registers */
7762 +#define BCM4710_REG_PCI 0x18005000 /* PCI core registers */
7763 +#define BCM4710_REG_MIPS 0x18006000 /* MIPS core registers */
7764 +#define BCM4710_REG_EXTIF 0x18007000 /* External Interface core registers */
7765 +#define BCM4710_REG_EMAC1 0x18008000 /* Ethernet MAC 1 core registers */
7767 +#define BCM4710_EXTIF 0x1f000000 /* External Interface base address */
7768 +#define BCM4710_PCMCIA_MEM 0x1f000000 /* External Interface PCMCIA memory access */
7769 +#define BCM4710_PCMCIA_IO 0x1f100000 /* PCMCIA I/O access */
7770 +#define BCM4710_PCMCIA_CONF 0x1f200000 /* PCMCIA configuration */
7771 +#define BCM4710_PROG 0x1f800000 /* Programable interface */
7772 +#define BCM4710_FLASH 0x1fc00000 /* Flash */
7774 +#define BCM4710_EJTAG 0xff200000 /* MIPS EJTAG space (2M) */
7776 +#define BCM4710_UART (BCM4710_REG_EXTIF + 0x00000300)
7778 +#define BCM4710_EUART (BCM4710_EXTIF + 0x00800000)
7779 +#define BCM4710_LED (BCM4710_EXTIF + 0x00900000)
7781 +#define SBFLAG_PCI 0
7782 +#define SBFLAG_ENET0 1
7783 +#define SBFLAG_ILINE20 2
7784 +#define SBFLAG_CODEC 3
7785 +#define SBFLAG_USB 4
7786 +#define SBFLAG_EXTIF 5
7787 +#define SBFLAG_ENET1 6
7789 +#ifdef CONFIG_HWSIM
7790 +#define BCM4710_TRACE(trval) do { *((int *)0xa0000f18) = (trval); } while (0)
7792 +#define BCM4710_TRACE(trval)
7796 +/* BCM94702 CPCI -ExtIF used for LocalBus devs */
7798 +#define BCM94702_CPCI_RESET_ADDR BCM4710_EXTIF
7799 +#define BCM94702_CPCI_BOARDID_ADDR (BCM4710_EXTIF | 0x4000)
7800 +#define BCM94702_CPCI_DOC_ADDR (BCM4710_EXTIF | 0x6000)
7801 +#define BCM94702_DOC_ADDR BCM94702_CPCI_DOC_ADDR
7802 +#define BCM94702_CPCI_LED_ADDR (BCM4710_EXTIF | 0xc000)
7803 +#define BCM94702_CPCI_NVRAM_ADDR (BCM4710_EXTIF | 0xe000)
7804 +#define BCM94702_CPCI_NVRAM_SIZE 0x1ff0 /* 8K NVRAM : DS1743/STM48txx*/
7805 +#define BCM94702_CPCI_TOD_REG_BASE (BCM94702_CPCI_NVRAM_ADDR | 0x1ff0)
7807 +#define LED_REG(x) \
7808 + (*(volatile unsigned char *) (KSEG1ADDR(BCM94702_CPCI_LED_ADDR) + (x)))
7811 + * Reset function implemented in PLD. Read or write should trigger hard reset
7813 +#define SYS_HARD_RESET() \
7815 + *( (volatile unsigned char *)\
7816 + KSEG1ADDR(BCM94702_CPCI_RESET_ADDR) ) = 0x80; \
7819 +#endif /* _bcm4710_h_ */
7820 diff -Nur linux-2.6.12.5/arch/mips/bcm947xx/include/bcmdevs.h linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/bcmdevs.h
7821 --- linux-2.6.12.5/arch/mips/bcm947xx/include/bcmdevs.h 1970-01-01 01:00:00.000000000 +0100
7822 +++ linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/bcmdevs.h 2005-08-28 11:12:20.431859000 +0200
7825 + * Broadcom device-specific manifest constants.
7828 + * Copyright 2001-2003, Broadcom Corporation
7829 + * All Rights Reserved.
7831 + * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
7832 + * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
7833 + * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
7834 + * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
7841 +/* Known PCI vendor Id's */
7842 +#define VENDOR_EPIGRAM 0xfeda
7843 +#define VENDOR_BROADCOM 0x14e4
7844 +#define VENDOR_3COM 0x10b7
7845 +#define VENDOR_NETGEAR 0x1385
7846 +#define VENDOR_DIAMOND 0x1092
7847 +#define VENDOR_DELL 0x1028
7848 +#define VENDOR_HP 0x0e11
7849 +#define VENDOR_APPLE 0x106b
7851 +/* PCI Device Id's */
7852 +#define BCM4210_DEVICE_ID 0x1072 /* never used */
7853 +#define BCM4211_DEVICE_ID 0x4211
7854 +#define BCM4230_DEVICE_ID 0x1086 /* never used */
7855 +#define BCM4231_DEVICE_ID 0x4231
7857 +#define BCM4410_DEVICE_ID 0x4410 /* bcm44xx family pci iline */
7858 +#define BCM4430_DEVICE_ID 0x4430 /* bcm44xx family cardbus iline */
7859 +#define BCM4412_DEVICE_ID 0x4412 /* bcm44xx family pci enet */
7860 +#define BCM4432_DEVICE_ID 0x4432 /* bcm44xx family cardbus enet */
7862 +#define BCM3352_DEVICE_ID 0x3352 /* bcm3352 device id */
7863 +#define BCM3360_DEVICE_ID 0x3360 /* bcm3360 device id */
7865 +#define EPI41210_DEVICE_ID 0xa0fa /* bcm4210 */
7866 +#define EPI41230_DEVICE_ID 0xa10e /* bcm4230 */
7868 +#define BCM47XX_ILINE_ID 0x4711 /* 47xx iline20 */
7869 +#define BCM47XX_V90_ID 0x4712 /* 47xx v90 codec */
7870 +#define BCM47XX_ENET_ID 0x4713 /* 47xx enet */
7871 +#define BCM47XX_EXT_ID 0x4714 /* 47xx external i/f */
7872 +#define BCM47XX_USB_ID 0x4715 /* 47xx usb */
7873 +#define BCM47XX_USBH_ID 0x4716 /* 47xx usb host */
7874 +#define BCM47XX_USBD_ID 0x4717 /* 47xx usb device */
7875 +#define BCM47XX_IPSEC_ID 0x4718 /* 47xx ipsec */
7877 +#define BCM4710_DEVICE_ID 0x4710 /* 4710 primary function 0 */
7879 +#define BCM4610_DEVICE_ID 0x4610 /* 4610 primary function 0 */
7880 +#define BCM4610_ILINE_ID 0x4611 /* 4610 iline100 */
7881 +#define BCM4610_V90_ID 0x4612 /* 4610 v90 codec */
7882 +#define BCM4610_ENET_ID 0x4613 /* 4610 enet */
7883 +#define BCM4610_EXT_ID 0x4614 /* 4610 external i/f */
7884 +#define BCM4610_USB_ID 0x4615 /* 4610 usb */
7886 +#define BCM4402_DEVICE_ID 0x4402 /* 4402 primary function 0 */
7887 +#define BCM4402_ENET_ID 0x4402 /* 4402 enet */
7888 +#define BCM4402_V90_ID 0x4403 /* 4402 v90 codec */
7890 +#define BCM4301_DEVICE_ID 0x4301 /* 4301 primary function 0 */
7891 +#define BCM4301_D11B_ID 0x4301 /* 4301 802.11b */
7893 +#define BCM4307_DEVICE_ID 0x4307 /* 4307 primary function 0 */
7894 +#define BCM4307_V90_ID 0x4305 /* 4307 v90 codec */
7895 +#define BCM4307_ENET_ID 0x4306 /* 4307 enet */
7896 +#define BCM4307_D11B_ID 0x4307 /* 4307 802.11b */
7898 +#define BCM4306_DEVICE_ID 0x4306 /* 4306 chipcommon chipid */
7899 +#define BCM4306_D11G_ID 0x4320 /* 4306 802.11g */
7900 +#define BCM4306_D11G_ID2 0x4325
7901 +#define BCM4306_D11A_ID 0x4321 /* 4306 802.11a */
7902 +#define BCM4306_UART_ID 0x4322 /* 4306 uart */
7903 +#define BCM4306_V90_ID 0x4323 /* 4306 v90 codec */
7904 +#define BCM4306_D11DUAL_ID 0x4324 /* 4306 dual A+B */
7906 +#define BCM4309_PKG_ID 1 /* 4309 package id */
7908 +#define BCM4303_D11B_ID 0x4303 /* 4303 802.11b */
7909 +#define BCM4303_PKG_ID 2 /* 4303 package id */
7911 +#define BCM4310_DEVICE_ID 0x4310 /* 4310 chipcommon chipid */
7912 +#define BCM4310_D11B_ID 0x4311 /* 4310 802.11b */
7913 +#define BCM4310_UART_ID 0x4312 /* 4310 uart */
7914 +#define BCM4310_ENET_ID 0x4313 /* 4310 enet */
7915 +#define BCM4310_USB_ID 0x4315 /* 4310 usb */
7917 +#define BCM4704_DEVICE_ID 0x4704 /* 4704 chipcommon chipid */
7918 +#define BCM4704_ENET_ID 0x4706 /* 4704 enet (Use 47XX_ENET_ID instead!) */
7920 +#define BCM4317_DEVICE_ID 0x4317 /* 4317 chip common chipid */
7922 +#define BCM4712_DEVICE_ID 0x4712 /* 4712 chipcommon chipid */
7923 +#define BCM4712_MIPS_ID 0x4720 /* 4712 base devid */
7924 +#define BCM4712SMALL_PKG_ID 1 /* 200pin 4712 package id */
7926 +#define SDIOH_FPGA_ID 0x4380 /* sdio host fpga */
7928 +#define BCM5365_DEVICE_ID 0x5365 /* 5365 chipcommon chipid */
7931 +/* PCMCIA vendor Id's */
7933 +#define VENDOR_BROADCOM_PCMCIA 0x02d0
7935 +/* SDIO vendor Id's */
7936 +#define VENDOR_BROADCOM_SDIO 0x00BF
7940 +#define BFL_BTCOEXIST 0x0001 /* This board implements Bluetooth coexistance */
7941 +#define BFL_PACTRL 0x0002 /* This board has gpio 9 controlling the PA */
7942 +#define BFL_AIRLINEMODE 0x0004 /* This board implements gpio13 radio disable indication */
7943 +#define BFL_ENETSPI 0x0010 /* This board has ephy roboswitch spi */
7944 +#define BFL_CCKHIPWR 0x0040 /* Can do high-power CCK transmission */
7945 +#define BFL_ENETADM 0x0080 /* This board has ADMtek switch */
7946 +#define BFL_ENETVLAN 0x0100 /* This board can do vlan */
7948 +/* board specific GPIO assignment, gpio 0-3 are also customer-configurable led */
7949 +#define BOARD_GPIO_HWRAD_B 0x010 /* bit 4 is HWRAD input on 4301 */
7950 +#define BOARD_GPIO_BTC_IN 0x080 /* bit 7 is BT Coexistance Input */
7951 +#define BOARD_GPIO_BTC_OUT 0x100 /* bit 8 is BT Coexistance Out */
7952 +#define BOARD_GPIO_PACTRL 0x200 /* bit 9 controls the PA on new 4306 boards */
7953 +#define PCI_CFG_GPIO_SCS 0x10 /* PCI config space bit 4 for 4306c0 slow clock source */
7954 +#define PCI_CFG_GPIO_HWRAD 0x20 /* PCI config space GPIO 13 for hw radio disable */
7955 +#define PCI_CFG_GPIO_XTAL 0x40 /* PCI config space GPIO 14 for Xtal powerup */
7956 +#define PCI_CFG_GPIO_PLL 0x80 /* PCI config space GPIO 15 for PLL powerdown */
7959 +#define SB_BUS 0 /* Silicon Backplane */
7960 +#define PCI_BUS 1 /* PCI target */
7961 +#define PCMCIA_BUS 2 /* PCMCIA target */
7962 +#define SDIO_BUS 3 /* SDIO target */
7964 +/* Reference Board Types */
7966 +#define BU4710_BOARD 0x0400
7967 +#define VSIM4710_BOARD 0x0401
7968 +#define QT4710_BOARD 0x0402
7970 +#define BU4610_BOARD 0x0403
7971 +#define VSIM4610_BOARD 0x0404
7973 +#define BU4307_BOARD 0x0405
7974 +#define BCM94301CB_BOARD 0x0406
7975 +#define BCM94301PC_BOARD 0x0406 /* Pcmcia 5v card */
7976 +#define BCM94301MP_BOARD 0x0407
7977 +#define BCM94307MP_BOARD 0x0408
7978 +#define BCMAP4307_BOARD 0x0409
7980 +#define BU4309_BOARD 0x040a
7981 +#define BCM94309CB_BOARD 0x040b
7982 +#define BCM94309MP_BOARD 0x040c
7983 +#define BCM4309AP_BOARD 0x040d
7985 +#define BCM94302MP_BOARD 0x040e
7987 +#define VSIM4310_BOARD 0x040f
7988 +#define BU4711_BOARD 0x0410
7989 +#define BCM94310U_BOARD 0x0411
7990 +#define BCM94310AP_BOARD 0x0412
7991 +#define BCM94310MP_BOARD 0x0414
7993 +#define BU4306_BOARD 0x0416
7994 +#define BCM94306CB_BOARD 0x0417
7995 +#define BCM94306MP_BOARD 0x0418
7997 +#define BCM94710D_BOARD 0x041a
7998 +#define BCM94710R1_BOARD 0x041b
7999 +#define BCM94710R4_BOARD 0x041c
8000 +#define BCM94710AP_BOARD 0x041d
8003 +#define BU2050_BOARD 0x041f
8006 +#define BCM94309G_BOARD 0x0421
8008 +#define BCM94301PC3_BOARD 0x0422 /* Pcmcia 3.3v card */
8010 +#define BU4704_BOARD 0x0423
8011 +#define BU4702_BOARD 0x0424
8013 +#define BCM94306PC_BOARD 0x0425 /* pcmcia 3.3v 4306 card */
8015 +#define BU4317_BOARD 0x0426
8018 +#define BCM94702MN_BOARD 0x0428
8020 +/* BCM4702 1U CompactPCI Board */
8021 +#define BCM94702CPCI_BOARD 0x0429
8023 +/* BCM4702 with BCM95380 VLAN Router */
8024 +#define BCM95380RR_BOARD 0x042a
8026 +/* cb4306 with SiGe PA */
8027 +#define BCM94306CBSG_BOARD 0x042b
8029 +/* mp4301 with 2050 radio */
8030 +#define BCM94301MPL_BOARD 0x042c
8032 +/* cb4306 with SiGe PA */
8033 +#define PCSG94306_BOARD 0x042d
8035 +/* bu4704 with sdram */
8036 +#define BU4704SD_BOARD 0x042e
8038 +/* Dual 11a/11g Router */
8039 +#define BCM94704AGR_BOARD 0x042f
8041 +/* 11a-only minipci */
8042 +#define BCM94308MP_BOARD 0x0430
8046 +/* BCM94317 boards */
8047 +#define BCM94317CB_BOARD 0x0440
8048 +#define BCM94317MP_BOARD 0x0441
8049 +#define BCM94317PCMCIA_BOARD 0x0442
8050 +#define BCM94317SDIO_BOARD 0x0443
8052 +#define BU4712_BOARD 0x0444
8054 +/* BCM4712 boards */
8055 +#define BCM94712AGR_BOARD 0x0445
8056 +#define BCM94712AP_BOARD 0x0446
8058 +/* BCM4702 boards */
8059 +#define CT4702AP_BOARD 0x0447
8061 +#endif /* _BCMDEVS_H */
8062 diff -Nur linux-2.6.12.5/arch/mips/bcm947xx/include/bcmendian.h linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/bcmendian.h
8063 --- linux-2.6.12.5/arch/mips/bcm947xx/include/bcmendian.h 1970-01-01 01:00:00.000000000 +0100
8064 +++ linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/bcmendian.h 2005-08-28 11:12:20.431859000 +0200
8066 +/*******************************************************************************
8068 + * Copyright 2001-2003, Broadcom Corporation
8069 + * All Rights Reserved.
8071 + * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
8072 + * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
8073 + * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
8074 + * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
8075 + * local version of endian.h - byte order defines
8076 + ******************************************************************************/
8078 +#ifndef _BCMENDIAN_H_
8079 +#define _BCMENDIAN_H_
8081 +#include <typedefs.h>
8083 +/* Byte swap a 16 bit value */
8084 +#define BCMSWAP16(val) \
8086 + (((uint16)(val) & (uint16)0x00ffU) << 8) | \
8087 + (((uint16)(val) & (uint16)0xff00U) >> 8) ))
8089 +/* Byte swap a 32 bit value */
8090 +#define BCMSWAP32(val) \
8092 + (((uint32)(val) & (uint32)0x000000ffUL) << 24) | \
8093 + (((uint32)(val) & (uint32)0x0000ff00UL) << 8) | \
8094 + (((uint32)(val) & (uint32)0x00ff0000UL) >> 8) | \
8095 + (((uint32)(val) & (uint32)0xff000000UL) >> 24) ))
8097 +static INLINE uint16
8098 +bcmswap16(uint16 val)
8100 + return BCMSWAP16(val);
8103 +static INLINE uint32
8104 +bcmswap32(uint32 val)
8106 + return BCMSWAP32(val);
8109 +/* buf - start of buffer of shorts to swap */
8110 +/* len - byte length of buffer */
8112 +bcmswap16_buf(uint16 *buf, uint len)
8117 + *buf = bcmswap16(*buf);
8123 +#ifndef IL_BIGENDIAN
8124 +#define HTON16(i) BCMSWAP16(i)
8125 +#define hton16(i) bcmswap16(i)
8126 +#define hton32(i) bcmswap32(i)
8127 +#define ntoh16(i) bcmswap16(i)
8128 +#define ntoh32(i) bcmswap32(i)
8129 +#define ltoh16(i) (i)
8130 +#define ltoh32(i) (i)
8131 +#define htol16(i) (i)
8132 +#define htol32(i) (i)
8134 +#define HTON16(i) (i)
8135 +#define hton16(i) (i)
8136 +#define hton32(i) (i)
8137 +#define ntoh16(i) (i)
8138 +#define ntoh32(i) (i)
8139 +#define ltoh16(i) bcmswap16(i)
8140 +#define ltoh32(i) bcmswap32(i)
8141 +#define htol16(i) bcmswap16(i)
8142 +#define htol32(i) bcmswap32(i)
8146 +#ifndef IL_BIGENDIAN
8147 +#define ltoh16_buf(buf, i)
8148 +#define htol16_buf(buf, i)
8150 +#define ltoh16_buf(buf, i) bcmswap16_buf((uint16*)buf, i)
8151 +#define htol16_buf(buf, i) bcmswap16_buf((uint16*)buf, i)
8155 +* load 16-bit value from unaligned little endian byte array.
8157 +static INLINE uint16
8158 +ltoh16_ua(uint8 *bytes)
8160 + return (bytes[1]<<8)+bytes[0];
8164 +* load 32-bit value from unaligned little endian byte array.
8166 +static INLINE uint32
8167 +ltoh32_ua(uint8 *bytes)
8169 + return (bytes[3]<<24)+(bytes[2]<<16)+(bytes[1]<<8)+bytes[0];
8173 +* load 16-bit value from unaligned big(network) endian byte array.
8175 +static INLINE uint16
8176 +ntoh16_ua(uint8 *bytes)
8178 + return (bytes[0]<<8)+bytes[1];
8182 +* load 32-bit value from unaligned big(network) endian byte array.
8184 +static INLINE uint32
8185 +ntoh32_ua(uint8 *bytes)
8187 + return (bytes[0]<<24)+(bytes[1]<<16)+(bytes[2]<<8)+bytes[3];
8190 +#endif /* _BCMENDIAN_H_ */
8191 diff -Nur linux-2.6.12.5/arch/mips/bcm947xx/include/bcmenet47xx.h linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/bcmenet47xx.h
8192 --- linux-2.6.12.5/arch/mips/bcm947xx/include/bcmenet47xx.h 1970-01-01 01:00:00.000000000 +0100
8193 +++ linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/bcmenet47xx.h 2005-08-28 11:12:20.432858848 +0200
8196 + * Hardware-specific definitions for
8197 + * Broadcom BCM47XX 10/100 Mbps Ethernet cores.
8199 + * Copyright 2001-2003, Broadcom Corporation
8200 + * All Rights Reserved.
8202 + * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
8203 + * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
8204 + * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
8205 + * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
8209 +#ifndef _bcmenet_47xx_h_
8210 +#define _bcmenet_47xx_h_
8212 +#include <bcmdevs.h>
8213 +#include <hnddma.h>
8215 +#define BCMENET_NFILTERS 64 /* # ethernet address filter entries */
8216 +#define BCMENET_MCHASHBASE 0x200 /* multicast hash filter base address */
8217 +#define BCMENET_MCHASHSIZE 256 /* multicast hash filter size in bytes */
8218 +#define BCMENET_MAX_DMA 4096 /* chip has 12 bits of DMA addressing */
8220 +/* power management event wakeup pattern constants */
8221 +#define BCMENET_NPMP 4 /* chip supports 4 wakeup patterns */
8222 +#define BCMENET_PMPBASE 0x400 /* wakeup pattern base address */
8223 +#define BCMENET_PMPSIZE 0x80 /* 128bytes each pattern */
8224 +#define BCMENET_PMMBASE 0x600 /* wakeup mask base address */
8225 +#define BCMENET_PMMSIZE 0x10 /* 128bits each mask */
8227 +/* cpp contortions to concatenate w/arg prescan */
8229 +#define _PADLINE(line) pad ## line
8230 +#define _XSTR(line) _PADLINE(line)
8231 +#define PAD _XSTR(__LINE__)
8234 +/* sometimes you just need the enet mib definitions */
8235 +#include <bcmenetmib.h>
8238 + * Host Interface Registers
8240 +typedef volatile struct _bcmenettregs {
8241 + /* Device and Power Control */
8242 + uint32 devcontrol;
8244 + uint32 biststatus;
8245 + uint32 wakeuplength;
8248 + /* Interrupt Control */
8254 + /* Ethernet MAC Address Filtering Control */
8256 + uint32 enetftaddr;
8257 + uint32 enetftdata;
8260 + /* Ethernet MAC Control */
8261 + uint32 emactxmaxburstlen;
8262 + uint32 emacrxmaxburstlen;
8263 + uint32 emaccontrol;
8264 + uint32 emacflowcontrol;
8268 + /* DMA Lazy Interrupt Control */
8269 + uint32 intrecvlazy;
8273 + dmaregs_t dmaregs;
8274 + dmafifo_t dmafifo;
8277 + /* EMAC Registers */
8279 + uint32 rxmaxlength;
8280 + uint32 txmaxlength;
8282 + uint32 mdiocontrol;
8284 + uint32 emacintmask;
8285 + uint32 emacintstatus;
8288 + uint32 camcontrol;
8289 + uint32 enetcontrol;
8291 + uint32 txwatermark;
8292 + uint32 mibcontrol;
8295 + /* EMAC MIB counters */
8300 + /* Sonics SiliconBackplane config registers */
8301 + sbconfig_t sbconfig;
8304 +/* device control */
8305 +#define DC_PM ((uint32)1 << 7) /* pattern filtering enable */
8306 +#define DC_IP ((uint32)1 << 10) /* internal ephy present (rev >= 1) */
8307 +#define DC_ER ((uint32)1 << 15) /* ephy reset */
8308 +#define DC_MP ((uint32)1 << 16) /* mii phy mode enable */
8309 +#define DC_CO ((uint32)1 << 17) /* mii phy mode: enable clocks */
8310 +#define DC_PA_MASK 0x7c0000 /* mii phy mode: mdc/mdio phy address */
8311 +#define DC_PA_SHIFT 18
8313 +/* wakeup length */
8314 +#define WL_P0_MASK 0x7f /* pattern 0 */
8315 +#define WL_D0 ((uint32)1 << 7)
8316 +#define WL_P1_MASK 0x7f00 /* pattern 1 */
8317 +#define WL_P1_SHIFT 8
8318 +#define WL_D1 ((uint32)1 << 15)
8319 +#define WL_P2_MASK 0x7f0000 /* pattern 2 */
8320 +#define WL_P2_SHIFT 16
8321 +#define WL_D2 ((uint32)1 << 23)
8322 +#define WL_P3_MASK 0x7f000000 /* pattern 3 */
8323 +#define WL_P3_SHIFT 24
8324 +#define WL_D3 ((uint32)1 << 31)
8326 +/* intstatus and intmask */
8327 +#define I_PME ((uint32)1 << 6) /* power management event */
8328 +#define I_TO ((uint32)1 << 7) /* general purpose timeout */
8329 +#define I_PC ((uint32)1 << 10) /* descriptor error */
8330 +#define I_PD ((uint32)1 << 11) /* data error */
8331 +#define I_DE ((uint32)1 << 12) /* descriptor protocol error */
8332 +#define I_RU ((uint32)1 << 13) /* receive descriptor underflow */
8333 +#define I_RO ((uint32)1 << 14) /* receive fifo overflow */
8334 +#define I_XU ((uint32)1 << 15) /* transmit fifo underflow */
8335 +#define I_RI ((uint32)1 << 16) /* receive interrupt */
8336 +#define I_XI ((uint32)1 << 24) /* transmit interrupt */
8337 +#define I_EM ((uint32)1 << 26) /* emac interrupt */
8338 +#define I_MW ((uint32)1 << 27) /* mii write */
8339 +#define I_MR ((uint32)1 << 28) /* mii read */
8342 +#define EMC_CG ((uint32)1 << 0) /* crc32 generation enable */
8343 +#define EMC_EP ((uint32)1 << 2) /* onchip ephy: powerdown (rev >= 1) */
8344 +#define EMC_ED ((uint32)1 << 3) /* onchip ephy: energy detected (rev >= 1) */
8345 +#define EMC_LC_MASK 0xe0 /* onchip ephy: led control (rev >= 1) */
8346 +#define EMC_LC_SHIFT 5
8348 +/* emacflowcontrol */
8349 +#define EMF_RFH_MASK 0xff /* rx fifo hi water mark */
8350 +#define EMF_PG ((uint32)1 << 15) /* enable pause frame generation */
8352 +/* interrupt receive lazy */
8353 +#define IRL_TO_MASK 0x00ffffff /* timeout */
8354 +#define IRL_FC_MASK 0xff000000 /* frame count */
8355 +#define IRL_FC_SHIFT 24 /* frame count */
8357 +/* emac receive config */
8358 +#define ERC_DB ((uint32)1 << 0) /* disable broadcast */
8359 +#define ERC_AM ((uint32)1 << 1) /* accept all multicast */
8360 +#define ERC_RDT ((uint32)1 << 2) /* receive disable while transmitting */
8361 +#define ERC_PE ((uint32)1 << 3) /* promiscuous enable */
8362 +#define ERC_LE ((uint32)1 << 4) /* loopback enable */
8363 +#define ERC_FE ((uint32)1 << 5) /* enable flow control */
8364 +#define ERC_UF ((uint32)1 << 6) /* accept unicast flow control frame */
8365 +#define ERC_RF ((uint32)1 << 7) /* reject filter */
8367 +/* emac mdio control */
8368 +#define MC_MF_MASK 0x7f /* mdc frequency */
8369 +#define MC_PE ((uint32)1 << 7) /* mii preamble enable */
8371 +/* emac mdio data */
8372 +#define MD_DATA_MASK 0xffff /* r/w data */
8373 +#define MD_TA_MASK 0x30000 /* turnaround value */
8374 +#define MD_TA_SHIFT 16
8375 +#define MD_TA_VALID (2 << MD_TA_SHIFT) /* valid ta */
8376 +#define MD_RA_MASK 0x7c0000 /* register address */
8377 +#define MD_RA_SHIFT 18
8378 +#define MD_PMD_MASK 0xf800000 /* physical media device */
8379 +#define MD_PMD_SHIFT 23
8380 +#define MD_OP_MASK 0x30000000 /* opcode */
8381 +#define MD_OP_SHIFT 28
8382 +#define MD_OP_WRITE (1 << MD_OP_SHIFT) /* write op */
8383 +#define MD_OP_READ (2 << MD_OP_SHIFT) /* read op */
8384 +#define MD_SB_MASK 0xc0000000 /* start bits */
8385 +#define MD_SB_SHIFT 30
8386 +#define MD_SB_START (0x1 << MD_SB_SHIFT) /* start of frame */
8388 +/* emac intstatus and intmask */
8389 +#define EI_MII ((uint32)1 << 0) /* mii mdio interrupt */
8390 +#define EI_MIB ((uint32)1 << 1) /* mib interrupt */
8391 +#define EI_FLOW ((uint32)1 << 2) /* flow control interrupt */
8393 +/* emac cam data high */
8394 +#define CD_V ((uint32)1 << 16) /* valid bit */
8396 +/* emac cam control */
8397 +#define CC_CE ((uint32)1 << 0) /* cam enable */
8398 +#define CC_MS ((uint32)1 << 1) /* mask select */
8399 +#define CC_RD ((uint32)1 << 2) /* read */
8400 +#define CC_WR ((uint32)1 << 3) /* write */
8401 +#define CC_INDEX_MASK 0x3f0000 /* index */
8402 +#define CC_INDEX_SHIFT 16
8403 +#define CC_CB ((uint32)1 << 31) /* cam busy */
8405 +/* emac ethernet control */
8406 +#define EC_EE ((uint32)1 << 0) /* emac enable */
8407 +#define EC_ED ((uint32)1 << 1) /* emac disable */
8408 +#define EC_ES ((uint32)1 << 2) /* emac soft reset */
8409 +#define EC_EP ((uint32)1 << 3) /* external phy select */
8411 +/* emac transmit control */
8412 +#define EXC_FD ((uint32)1 << 0) /* full duplex */
8413 +#define EXC_FM ((uint32)1 << 1) /* flowmode */
8414 +#define EXC_SB ((uint32)1 << 2) /* single backoff enable */
8415 +#define EXC_SS ((uint32)1 << 3) /* small slottime */
8417 +/* emac mib control */
8418 +#define EMC_RZ ((uint32)1 << 0) /* autoclear on read */
8420 +/* sometimes you just need the enet rxheader definitions */
8421 +#include <bcmenetrxh.h>
8423 +#endif /* _bcmenet_47xx_h_ */
8424 diff -Nur linux-2.6.12.5/arch/mips/bcm947xx/include/bcmenetmib.h linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/bcmenetmib.h
8425 --- linux-2.6.12.5/arch/mips/bcm947xx/include/bcmenetmib.h 1970-01-01 01:00:00.000000000 +0100
8426 +++ linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/bcmenetmib.h 2005-08-28 11:12:20.432858848 +0200
8429 + * Hardware-specific MIB definition for
8430 + * Broadcom Home Networking Division
8431 + * BCM44XX and BCM47XX 10/100 Mbps Ethernet cores.
8433 + * Copyright 2001-2003, Broadcom Corporation
8434 + * All Rights Reserved.
8436 + * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
8437 + * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
8438 + * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
8439 + * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
8443 +#ifndef _bcmenetmib_h_
8444 +#define _bcmenetmib_h_
8446 +/* cpp contortions to concatenate w/arg prescan */
8448 +#define _PADLINE(line) pad ## line
8449 +#define _XSTR(line) _PADLINE(line)
8450 +#define PAD _XSTR(__LINE__)
8454 + * EMAC MIB Registers
8456 +typedef volatile struct {
8457 + uint32 tx_good_octets;
8458 + uint32 tx_good_pkts;
8461 + uint32 tx_broadcast_pkts;
8462 + uint32 tx_multicast_pkts;
8464 + uint32 tx_len_65_to_127;
8465 + uint32 tx_len_128_to_255;
8466 + uint32 tx_len_256_to_511;
8467 + uint32 tx_len_512_to_1023;
8468 + uint32 tx_len_1024_to_max;
8469 + uint32 tx_jabber_pkts;
8470 + uint32 tx_oversize_pkts;
8471 + uint32 tx_fragment_pkts;
8472 + uint32 tx_underruns;
8473 + uint32 tx_total_cols;
8474 + uint32 tx_single_cols;
8475 + uint32 tx_multiple_cols;
8476 + uint32 tx_excessive_cols;
8477 + uint32 tx_late_cols;
8478 + uint32 tx_defered;
8479 + uint32 tx_carrier_lost;
8480 + uint32 tx_pause_pkts;
8483 + uint32 rx_good_octets;
8484 + uint32 rx_good_pkts;
8487 + uint32 rx_broadcast_pkts;
8488 + uint32 rx_multicast_pkts;
8490 + uint32 rx_len_65_to_127;
8491 + uint32 rx_len_128_to_255;
8492 + uint32 rx_len_256_to_511;
8493 + uint32 rx_len_512_to_1023;
8494 + uint32 rx_len_1024_to_max;
8495 + uint32 rx_jabber_pkts;
8496 + uint32 rx_oversize_pkts;
8497 + uint32 rx_fragment_pkts;
8498 + uint32 rx_missed_pkts;
8499 + uint32 rx_crc_align_errs;
8500 + uint32 rx_undersize;
8501 + uint32 rx_crc_errs;
8502 + uint32 rx_align_errs;
8503 + uint32 rx_symbol_errs;
8504 + uint32 rx_pause_pkts;
8505 + uint32 rx_nonpause_pkts;
8508 +#endif /* _bcmenetmib_h_ */
8509 diff -Nur linux-2.6.12.5/arch/mips/bcm947xx/include/bcmenetrxh.h linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/bcmenetrxh.h
8510 --- linux-2.6.12.5/arch/mips/bcm947xx/include/bcmenetrxh.h 1970-01-01 01:00:00.000000000 +0100
8511 +++ linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/bcmenetrxh.h 2005-08-28 11:12:20.433858696 +0200
8514 + * Hardware-specific Receive Data Header for the
8515 + * Broadcom Home Networking Division
8516 + * BCM44XX and BCM47XX 10/100 Mbps Ethernet cores.
8518 + * Copyright 2001-2003, Broadcom Corporation
8519 + * All Rights Reserved.
8521 + * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
8522 + * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
8523 + * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
8524 + * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
8528 +#ifndef _bcmenetrxh_h_
8529 +#define _bcmenetrxh_h_
8532 + * The Ethernet MAC core returns an 8-byte Receive Frame Data Header
8533 + * with every frame consisting of
8534 + * 16bits of frame length, followed by
8535 + * 16bits of EMAC rx descriptor info, followed by 32bits of undefined.
8537 +typedef volatile struct {
8543 +#define RXHDR_LEN 28
8545 +#define RXF_L ((uint16)1 << 11) /* last buffer in a frame */
8546 +#define RXF_MISS ((uint16)1 << 7) /* received due to promisc mode */
8547 +#define RXF_BRDCAST ((uint16)1 << 6) /* dest is broadcast address */
8548 +#define RXF_MULT ((uint16)1 << 5) /* dest is multicast address */
8549 +#define RXF_LG ((uint16)1 << 4) /* frame length > rxmaxlength */
8550 +#define RXF_NO ((uint16)1 << 3) /* odd number of nibbles */
8551 +#define RXF_RXER ((uint16)1 << 2) /* receive symbol error */
8552 +#define RXF_CRC ((uint16)1 << 1) /* crc error */
8553 +#define RXF_OV ((uint16)1 << 0) /* fifo overflow */
8555 +#endif /* _bcmenetrxh_h_ */
8556 diff -Nur linux-2.6.12.5/arch/mips/bcm947xx/include/bcmnvram.h linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/bcmnvram.h
8557 --- linux-2.6.12.5/arch/mips/bcm947xx/include/bcmnvram.h 1970-01-01 01:00:00.000000000 +0100
8558 +++ linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/bcmnvram.h 2005-08-28 11:12:20.433858696 +0200
8561 + * NVRAM variable manipulation
8563 + * $Copyright Open Broadcom Corporation$
8565 + * $Id: bcmnvram.h,v 1.1.1.1 2004/01/21 03:50:44 gigis Exp $
8568 +#ifndef _bcmnvram_h_
8569 +#define _bcmnvram_h_
8571 +#ifndef _LANGUAGE_ASSEMBLY
8573 +#include <typedefs.h>
8575 +struct nvram_header {
8578 + uint32 crc_ver_init; /* 0:7 crc, 8:15 ver, 16:27 init, mem. test 28, 29-31 reserved */
8579 + uint32 config_refresh; /* 0:15 config, 16:31 refresh */
8580 + uint32 config_ncdl; /* ncdl values for memc */
8583 +struct nvram_tuple {
8586 + struct nvram_tuple *next;
8590 + * Initialize NVRAM access. May be unnecessary or undefined on certain
8593 +extern int nvram_init(void *sbh);
8596 + * Disable NVRAM access. May be unnecessary or undefined on certain
8599 +extern void nvram_exit(void);
8602 + * Get the value of an NVRAM variable. The pointer returned may be
8603 + * invalid after a set.
8604 + * @param name name of variable to get
8605 + * @return value of variable or NULL if undefined
8607 +extern char * nvram_get(const char *name);
8610 + * Get the value of an NVRAM variable.
8611 + * @param name name of variable to get
8612 + * @return value of variable or NUL if undefined
8614 +#define nvram_safe_get(name) (nvram_get(name) ? : "")
8617 + * Match an NVRAM variable.
8618 + * @param name name of variable to match
8619 + * @param match value to compare against value of variable
8620 + * @return TRUE if variable is defined and its value is string equal
8621 + * to match or FALSE otherwise
8624 +nvram_match(char *name, char *match) {
8625 + const char *value = nvram_get(name);
8626 + return (value && !strcmp(value, match));
8630 + * Inversely match an NVRAM variable.
8631 + * @param name name of variable to match
8632 + * @param match value to compare against value of variable
8633 + * @return TRUE if variable is defined and its value is not string
8634 + * equal to invmatch or FALSE otherwise
8637 +nvram_invmatch(char *name, char *invmatch) {
8638 + const char *value = nvram_get(name);
8639 + return (value && strcmp(value, invmatch));
8643 + * Set the value of an NVRAM variable. The name and value strings are
8644 + * copied into private storage. Pointers to previously set values
8645 + * may become invalid. The new value may be immediately
8646 + * retrieved but will not be permanently stored until a commit.
8647 + * @param name name of variable to set
8648 + * @param value value of variable
8649 + * @return 0 on success and errno on failure
8651 +extern int nvram_set(const char *name, const char *value);
8654 + * Unset an NVRAM variable. Pointers to previously set values
8655 + * remain valid until a set.
8656 + * @param name name of variable to unset
8657 + * @return 0 on success and errno on failure
8658 + * NOTE: use nvram_commit to commit this change to flash.
8660 +extern int nvram_unset(const char *name);
8663 + * Commit NVRAM variables to permanent storage. All pointers to values
8664 + * may be invalid after a commit.
8665 + * NVRAM values are undefined after a commit.
8666 + * @return 0 on success and errno on failure
8668 +extern int nvram_commit(void);
8671 + * Get all NVRAM variables (format name=value\0 ... \0\0).
8672 + * @param buf buffer to store variables
8673 + * @param count size of buffer in bytes
8674 + * @return 0 on success and errno on failure
8676 +extern int nvram_getall(char *buf, int count);
8678 +extern int kernel_write(unsigned char *buffer, int offset, int length);
8680 +#endif /* _LANGUAGE_ASSEMBLY */
8682 +#define NVRAM_MAGIC 0x48534C46 /* 'FLSH' */
8683 +#define NVRAM_VERSION 1
8684 +#define NVRAM_HEADER_SIZE 20
8685 +#define NVRAM_LOC_GAP 0x100000
8686 +#define NVRAM_SPACE 0x2000
8687 +#define NVRAM_FIRST_LOC (0xbfd00000 - NVRAM_SPACE)
8688 +#define NVRAM_LAST_LOC (0xc0000000 - NVRAM_SPACE)
8690 +#endif /* _bcmnvram_h_ */
8691 diff -Nur linux-2.6.12.5/arch/mips/bcm947xx/include/bcmsrom.h linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/bcmsrom.h
8692 --- linux-2.6.12.5/arch/mips/bcm947xx/include/bcmsrom.h 1970-01-01 01:00:00.000000000 +0100
8693 +++ linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/bcmsrom.h 2005-08-28 11:12:20.433858696 +0200
8696 + * Misc useful routines to access NIC srom
8698 + * Copyright 2001-2003, Broadcom Corporation
8699 + * All Rights Reserved.
8701 + * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
8702 + * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
8703 + * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
8704 + * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
8709 +#ifndef _bcmsrom_h_
8710 +#define _bcmsrom_h_
8712 +extern int srom_var_init(uint bus, void *curmap, void *osh, char **vars, int *count);
8714 +extern int srom_read(uint bus, void *curmap, void *osh, uint byteoff, uint nbytes, uint16 *buf);
8715 +extern int srom_write(uint bus, void *curmap, void *osh, uint byteoff, uint nbytes, uint16 *buf);
8716 +extern int srom_parsecis(uint8 *cis, char **vars, int *count);
8718 +#endif /* _bcmsrom_h_ */
8719 diff -Nur linux-2.6.12.5/arch/mips/bcm947xx/include/bcmutils.h linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/bcmutils.h
8720 --- linux-2.6.12.5/arch/mips/bcm947xx/include/bcmutils.h 1970-01-01 01:00:00.000000000 +0100
8721 +++ linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/bcmutils.h 2005-08-28 11:12:20.435858392 +0200
8724 + * Misc useful os-independent macros and functions.
8726 + * Copyright 2001-2003, Broadcom Corporation
8727 + * All Rights Reserved.
8729 + * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
8730 + * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
8731 + * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
8732 + * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
8736 +#ifndef _bcmutils_h_
8737 +#define _bcmutils_h_
8740 +#define MIN(a, b) (((a)<(b))?(a):(b))
8744 +#define MAX(a, b) (((a)>(b))?(a):(b))
8747 +#define CEIL(x, y) (((x) + ((y)-1)) / (y))
8748 +#define ROUNDUP(x, y) ((((ulong)(x)+((y)-1))/(y))*(y))
8749 +#define ISALIGNED(a, x) (((uint)(a) & ((x)-1)) == 0)
8750 +#define ISPOWEROF2(x) ((((x)-1)&(x))==0)
8751 +#define OFFSETOF(type, member) ((uint) &((type *)0)->member)
8752 +#define ARRAYSIZE(a) (sizeof(a)/sizeof(a[0]))
8754 +/* bit map related macros */
8756 +#define NBBY 8 /* 8 bits per byte */
8757 +#define setbit(a,i) ((a)[(i)/NBBY] |= 1<<((i)%NBBY))
8758 +#define clrbit(a,i) ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY)))
8759 +#define isset(a,i) ((a)[(i)/NBBY] & (1<<((i)%NBBY)))
8760 +#define isclr(a,i) (((a)[(i)/NBBY] & (1<<((i)%NBBY))) == 0)
8763 +#define NBITS(type) (sizeof (type) * 8)
8765 +#define _BCM_U 0x01 /* upper */
8766 +#define _BCM_L 0x02 /* lower */
8767 +#define _BCM_D 0x04 /* digit */
8768 +#define _BCM_C 0x08 /* cntrl */
8769 +#define _BCM_P 0x10 /* punct */
8770 +#define _BCM_S 0x20 /* white space (space/lf/tab) */
8771 +#define _BCM_X 0x40 /* hex digit */
8772 +#define _BCM_SP 0x80 /* hard space (0x20) */
8774 +extern unsigned char bcm_ctype[];
8775 +#define bcm_ismask(x) (bcm_ctype[(int)(unsigned char)(x)])
8777 +#define bcm_isalnum(c) ((bcm_ismask(c)&(_BCM_U|_BCM_L|_BCM_D)) != 0)
8778 +#define bcm_isalpha(c) ((bcm_ismask(c)&(_BCM_U|_BCM_L)) != 0)
8779 +#define bcm_iscntrl(c) ((bcm_ismask(c)&(_BCM_C)) != 0)
8780 +#define bcm_isdigit(c) ((bcm_ismask(c)&(_BCM_D)) != 0)
8781 +#define bcm_isgraph(c) ((bcm_ismask(c)&(_BCM_P|_BCM_U|_BCM_L|_BCM_D)) != 0)
8782 +#define bcm_islower(c) ((bcm_ismask(c)&(_BCM_L)) != 0)
8783 +#define bcm_isprint(c) ((bcm_ismask(c)&(_BCM_P|_BCM_U|_BCM_L|_BCM_D|_BCM_SP)) != 0)
8784 +#define bcm_ispunct(c) ((bcm_ismask(c)&(_BCM_P)) != 0)
8785 +#define bcm_isspace(c) ((bcm_ismask(c)&(_BCM_S)) != 0)
8786 +#define bcm_isupper(c) ((bcm_ismask(c)&(_BCM_U)) != 0)
8787 +#define bcm_isxdigit(c) ((bcm_ismask(c)&(_BCM_D|_BCM_X)) != 0)
8790 + * Spin at most 'us' microseconds while 'exp' is true.
8791 + * Caller should explicitly test 'exp' when this completes
8792 + * and take appropriate error action if 'exp' is still true.
8794 +#define SPINWAIT(exp, us) { \
8795 + uint countdown = (us) + 9; \
8796 + while ((exp) && (countdown >= 10)) {\
8798 + countdown -= 10; \
8802 +/* generic osl packet queue */
8809 +#define DEFAULT_QLEN 128
8811 +#define pktq_len(q) ((q)->len)
8812 +#define pktq_avail(q) ((q)->maxlen - (q)->len)
8813 +#define pktq_head(q) ((q)->head)
8814 +#define pktq_full(q) ((q)->len >= (q)->maxlen)
8817 +#define CRC8_INIT_VALUE 0xff /* Initial CRC8 checksum value */
8818 +#define CRC8_GOOD_VALUE 0x9f /* Good final CRC8 checksum value */
8819 +#define CRC16_INIT_VALUE 0xffff /* Initial CRC16 checksum value */
8820 +#define CRC16_GOOD_VALUE 0xf0b8 /* Good final CRC16 checksum value */
8821 +#define CRC32_INIT_VALUE 0xffffffff /* Initial CRC32 checksum value */
8822 +#define CRC32_GOOD_VALUE 0xdebb20e3 /* Good final CRC32 checksum value */
8824 +/* tag_ID/length/value_buffer tuple */
8825 +typedef struct bcm_tlv {
8832 +extern uint bcm_atoi(char *s);
8833 +extern uchar bcm_toupper(uchar c);
8834 +extern ulong bcm_strtoul(char *cp, char **endp, uint base);
8835 +extern void deadbeef(char *p, uint len);
8836 +extern void prhex(char *msg, uchar *buf, uint len);
8837 +extern void prpkt(char *msg, void *drv, void *p0);
8838 +extern uint pktcopy(void *drv, void *p, uint offset, int len, uchar *buf);
8839 +extern uint pkttotlen(void *drv, void *);
8840 +extern uchar *bcm_ether_ntoa(char *ea, char *buf);
8841 +extern int bcm_ether_atoe(char *p, char *ea);
8842 +extern void bcm_mdelay(uint ms);
8843 +extern char *getvar(char *vars, char *name);
8844 +extern int getintvar(char *vars, char *name);
8846 +extern uint8 crc8(uint8 *p, uint nbytes, uint8 crc);
8847 +extern uint16 crc16(uint8 *p, uint nbytes, uint16 crc);
8848 +extern uint32 crc32(uint8 *p, uint nbytes, uint32 crc);
8849 +extern bcm_tlv_t *bcm_parse_tlvs(void *buf, int buflen, uint key);
8850 +extern bcm_tlv_t *bcm_parse_ordered_tlvs(void *buf, int buflen, uint key);
8851 +extern void pktqinit(struct pktq *q, int maxlen);
8852 +extern void pktenq(struct pktq *q, void *p, bool lifo);
8853 +extern void *pktdeq(struct pktq *q);
8855 +#define bcmlog(fmt, a1, a2)
8856 +#define bcmdumplog(buf, size) *buf = '\0'
8858 +#endif /* _bcmutils_h_ */
8859 diff -Nur linux-2.6.12.5/arch/mips/bcm947xx/include/bitfuncs.h linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/bitfuncs.h
8860 --- linux-2.6.12.5/arch/mips/bcm947xx/include/bitfuncs.h 1970-01-01 01:00:00.000000000 +0100
8861 +++ linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/bitfuncs.h 2005-08-28 11:12:20.435858392 +0200
8864 + * bit manipulation utility functions
8866 + * Copyright 2001-2003, Broadcom Corporation
8867 + * All Rights Reserved.
8869 + * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
8870 + * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
8871 + * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
8872 + * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
8876 +#ifndef _BITFUNCS_H
8877 +#define _BITFUNCS_H
8879 +#include <typedefs.h>
8881 +/* local prototypes */
8882 +static INLINE uint32 find_msbit(uint32 x);
8886 + * find_msbit: returns index of most significant set bit in x, with index
8887 + * range defined as 0-31. NOTE: returns zero if input is zero.
8890 +#if defined(USE_PENTIUM_BSR) && defined(__GNUC__)
8893 + * Implementation for Pentium processors and gcc. Note that this
8894 + * instruction is actually very slow on some processors (e.g., family 5,
8895 + * model 2, stepping 12, "Pentium 75 - 200"), so we use the generic
8896 + * implementation instead.
8898 +static INLINE uint32 find_msbit(uint32 x)
8901 + __asm__("bsrl %1,%0"
8910 + * Generic Implementation
8913 +#define DB_POW_MASK16 0xffff0000
8914 +#define DB_POW_MASK8 0x0000ff00
8915 +#define DB_POW_MASK4 0x000000f0
8916 +#define DB_POW_MASK2 0x0000000c
8917 +#define DB_POW_MASK1 0x00000002
8919 +static INLINE uint32 find_msbit(uint32 x)
8921 + uint32 temp_x = x;
8923 + if (temp_x & DB_POW_MASK16) {
8927 + if (temp_x & DB_POW_MASK8) {
8931 + if (temp_x & DB_POW_MASK4) {
8935 + if (temp_x & DB_POW_MASK2) {
8939 + if (temp_x & DB_POW_MASK1) {
8947 +#endif /* _BITFUNCS_H */
8948 diff -Nur linux-2.6.12.5/arch/mips/bcm947xx/include/epivers.h linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/epivers.h
8949 --- linux-2.6.12.5/arch/mips/bcm947xx/include/epivers.h 1970-01-01 01:00:00.000000000 +0100
8950 +++ linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/epivers.h 2005-08-28 11:12:20.435858392 +0200
8953 + * Copyright 2001-2003, Broadcom Corporation
8954 + * All Rights Reserved.
8956 + * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
8957 + * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
8958 + * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
8959 + * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
8965 +#ifndef _epivers_h_
8966 +#define _epivers_h_
8969 +#include <linux/config.h>
8972 +/* Vendor Name, ASCII, 32 chars max */
8974 +#define HPNA_VENDOR COMPANYNAME
8976 +#define HPNA_VENDOR "Broadcom Corporation"
8979 +/* Driver Date, ASCII, 32 chars max */
8980 +#define HPNA_DRV_BUILD_DATE __DATE__
8982 +/* Hardware Manufacture Date, ASCII, 32 chars max */
8983 +#define HPNA_HW_MFG_DATE "Not Specified"
8985 +/* See documentation for Device Type values, 32 values max */
8986 +#ifndef HPNA_DEV_TYPE
8988 +#if defined(CONFIG_BRCM_VJ)
8989 +#define HPNA_DEV_TYPE { CDCF_V0_DEVICE_DISPLAY }
8991 +#elif defined(CONFIG_BCRM_93725)
8992 +#define HPNA_DEV_TYPE { CDCF_V0_DEVICE_CM_BRIDGE, CDCF_V0_DEVICE_DISPLAY }
8995 +#define HPNA_DEV_TYPE { CDCF_V0_DEVICE_PCINIC }
8999 +#endif /* !HPNA_DEV_TYPE */
9002 +#define EPI_MAJOR_VERSION 1
9004 +#define EPI_MINOR_VERSION 1
9006 +#define EPI_RC_NUMBER 2
9008 +#define EPI_INCREMENTAL_NUMBER 0
9010 +#define EPI_BUILD_NUMBER 0
9012 +#define EPI_VERSION 1,1,2,0
9014 +#define EPI_VERSION_NUM 0x01010200
9016 +/* Driver Version String, ASCII, 32 chars max */
9017 +#define EPI_VERSION_STR "1.1.2.0"
9018 +#define EPI_ROUTER_VERSION_STR "1.1.2.0"
9020 +#endif /* _epivers_h_ */
9021 diff -Nur linux-2.6.12.5/arch/mips/bcm947xx/include/epivers.h.in linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/epivers.h.in
9022 --- linux-2.6.12.5/arch/mips/bcm947xx/include/epivers.h.in 1970-01-01 01:00:00.000000000 +0100
9023 +++ linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/epivers.h.in 2005-08-28 11:12:20.436858240 +0200
9026 + * Copyright 2001-2003, Broadcom Corporation
9027 + * All Rights Reserved.
9029 + * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
9030 + * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
9031 + * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
9032 + * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
9038 +#ifndef _epivers_h_
9039 +#define _epivers_h_
9042 +#include <linux/config.h>
9045 +/* Vendor Name, ASCII, 32 chars max */
9047 +#define HPNA_VENDOR COMPANYNAME
9049 +#define HPNA_VENDOR "Broadcom Corporation"
9052 +/* Driver Date, ASCII, 32 chars max */
9053 +#define HPNA_DRV_BUILD_DATE __DATE__
9055 +/* Hardware Manufacture Date, ASCII, 32 chars max */
9056 +#define HPNA_HW_MFG_DATE "Not Specified"
9058 +/* See documentation for Device Type values, 32 values max */
9059 +#ifndef HPNA_DEV_TYPE
9061 +#if defined(CONFIG_BRCM_VJ)
9062 +#define HPNA_DEV_TYPE { CDCF_V0_DEVICE_DISPLAY }
9064 +#elif defined(CONFIG_BCRM_93725)
9065 +#define HPNA_DEV_TYPE { CDCF_V0_DEVICE_CM_BRIDGE, CDCF_V0_DEVICE_DISPLAY }
9068 +#define HPNA_DEV_TYPE { CDCF_V0_DEVICE_PCINIC }
9072 +#endif /* !HPNA_DEV_TYPE */
9075 +#define EPI_MAJOR_VERSION @EPI_MAJOR_VERSION@
9077 +#define EPI_MINOR_VERSION @EPI_MINOR_VERSION@
9079 +#define EPI_RC_NUMBER @EPI_RC_NUMBER@
9081 +#define EPI_INCREMENTAL_NUMBER @EPI_INCREMENTAL_NUMBER@
9083 +#define EPI_BUILD_NUMBER @EPI_BUILD_NUMBER@
9085 +#define EPI_VERSION @EPI_VERSION@
9087 +#define EPI_VERSION_NUM @EPI_VERSION_NUM@
9089 +/* Driver Version String, ASCII, 32 chars max */
9090 +#define EPI_VERSION_STR "@EPI_VERSION_STR@"
9091 +#define EPI_ROUTER_VERSION_STR "@EPI_ROUTER_VERSION_STR@"
9093 +#endif /* _epivers_h_ */
9094 diff -Nur linux-2.6.12.5/arch/mips/bcm947xx/include/etsockio.h linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/etsockio.h
9095 --- linux-2.6.12.5/arch/mips/bcm947xx/include/etsockio.h 1970-01-01 01:00:00.000000000 +0100
9096 +++ linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/etsockio.h 2005-08-28 11:12:20.436858240 +0200
9099 + * Driver-specific socket ioctls
9100 + * used by BSD, Linux, and PSOS
9101 + * Broadcom BCM44XX 10/100Mbps Ethernet Device Driver
9103 + * Copyright 2001-2003, Broadcom Corporation
9104 + * All Rights Reserved.
9106 + * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
9107 + * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
9108 + * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
9109 + * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
9114 +#ifndef _etsockio_h_
9115 +#define _etsockio_h_
9117 +/* THESE MUST BE CONTIGUOUS AND CONSISTENT WITH VALUES IN ETC.H */
9121 +#define SIOCSETCUP (SIOCDEVPRIVATE + 0)
9122 +#define SIOCSETCDOWN (SIOCDEVPRIVATE + 1)
9123 +#define SIOCSETCLOOP (SIOCDEVPRIVATE + 2)
9124 +#define SIOCGETCDUMP (SIOCDEVPRIVATE + 3)
9125 +#define SIOCSETCSETMSGLEVEL (SIOCDEVPRIVATE + 4)
9126 +#define SIOCSETCPROMISC (SIOCDEVPRIVATE + 5)
9127 +#define SIOCSETCTXDOWN (SIOCDEVPRIVATE + 6) /* obsolete */
9128 +#define SIOCSETCSPEED (SIOCDEVPRIVATE + 7)
9129 +#define SIOCTXGEN (SIOCDEVPRIVATE + 8)
9130 +#define SIOCGETCPHYRD (SIOCDEVPRIVATE + 9)
9131 +#define SIOCSETCPHYWR (SIOCDEVPRIVATE + 10)
9132 +#define SIOCPERF (SIOCDEVPRIVATE + 11)
9133 +#define SIOCPERFDMA (SIOCDEVPRIVATE + 12)
9137 +#define SIOCSETCUP _IOWR('e', 130 + 0, struct ifreq)
9138 +#define SIOCSETCDOWN _IOWR('e', 130 + 1, struct ifreq)
9139 +#define SIOCSETCLOOP _IOWR('e', 130 + 2, struct ifreq)
9140 +#define SIOCGETCDUMP _IOWR('e', 130 + 3, struct ifreq)
9141 +#define SIOCSETCSETMSGLEVEL _IOWR('e', 130 + 4, struct ifreq)
9142 +#define SIOCSETCPROMISC _IOWR('e', 130 + 5, struct ifreq)
9143 +#define SIOCSETCTXDOWN _IOWR('e', 130 + 6, struct ifreq) /* obsolete */
9144 +#define SIOCSETCSPEED _IOWR('e', 130 + 7, struct ifreq)
9145 +#define SIOCTXGEN _IOWR('e', 130 + 8, struct ifreq)
9149 +/* arg to SIOCTXGEN */
9151 + uint32 num; /* number of frames to send */
9152 + uint32 delay; /* delay in microseconds between sending each */
9153 + uint32 size; /* size of ether frame to send */
9154 + uchar buf[1514]; /* starting ether frame data */
9158 diff -Nur linux-2.6.12.5/arch/mips/bcm947xx/include/flash.h linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/flash.h
9159 --- linux-2.6.12.5/arch/mips/bcm947xx/include/flash.h 1970-01-01 01:00:00.000000000 +0100
9160 +++ linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/flash.h 2005-08-28 11:12:20.437858088 +0200
9163 + * flash.h: Common definitions for flash access.
9165 + * Copyright 2001-2003, Broadcom Corporation
9166 + * All Rights Reserved.
9168 + * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
9169 + * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
9170 + * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
9171 + * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
9176 +/* Types of flashes we know about */
9177 +typedef enum _flash_type {OLD, BSC, SCS, AMD, SST} flash_type_t;
9179 +/* Commands to write/erase the flases */
9180 +typedef struct _flash_cmds{
9181 + flash_type_t type;
9184 + uint16 erase_block;
9185 + uint16 erase_chip;
9186 + uint16 write_word;
9192 + uint16 read_array;
9195 +#define UNLOCK_CMD_WORDS 2
9197 +typedef struct _unlock_cmd {
9198 + uint addr[UNLOCK_CMD_WORDS];
9199 + uint16 cmd[UNLOCK_CMD_WORDS];
9202 +/* Flash descriptors */
9203 +typedef struct _flash_desc {
9204 + uint16 mfgid; /* Manufacturer Id */
9205 + uint16 devid; /* Device Id */
9206 + uint size; /* Total size in bytes */
9207 + uint width; /* Device width in bytes */
9208 + flash_type_t type; /* Device type old, S, J */
9209 + uint bsize; /* Block size */
9210 + uint nb; /* Number of blocks */
9211 + uint ff; /* First full block */
9212 + uint lf; /* Last full block */
9213 + uint nsub; /* Number of subblocks */
9214 + uint *subblocks; /* Offsets for subblocks */
9215 + char *desc; /* Description */
9219 +#ifdef DECLARE_FLASHES
9221 +flash_cmds_t flash_cmds[] = {
9222 +/* type needu preera eraseb erasech write wbuf clcsr rdcsr rdid confrm read */
9223 + { BSC, 0, 0x00, 0x20, 0x00, 0x40, 0x00, 0x50, 0x70, 0x90, 0xd0, 0xff },
9224 + { SCS, 0, 0x00, 0x20, 0x00, 0x40, 0xe8, 0x50, 0x70, 0x90, 0xd0, 0xff },
9225 + { AMD, 1, 0x80, 0x30, 0x10, 0xa0, 0x00, 0x00, 0x00, 0x90, 0x00, 0xf0 },
9226 + { SST, 1, 0x80, 0x50, 0x10, 0xa0, 0x00, 0x00, 0x00, 0x90, 0x00, 0xf0 },
9230 +unlock_cmd_t unlock_cmd_amd = {
9232 +/* addr: */ { 0x0aa8, 0x0556},
9234 +/* addr: */ { 0x0aaa, 0x0554},
9236 +/* data: */ { 0xaa, 0x55}
9239 +unlock_cmd_t unlock_cmd_sst = {
9241 +/* addr: */ { 0xaaa8, 0x5556},
9243 +/* addr: */ { 0xaaaa, 0x5554},
9245 +/* data: */ { 0xaa, 0x55}
9248 +#define AMD_CMD 0xaaa
9249 +#define SST_CMD 0xaaaa
9251 +/* intel unlock block cmds */
9252 +#define INTEL_UNLOCK1 0x60
9253 +#define INTEL_UNLOCK2 0xD0
9255 +/* Just eight blocks of 8KB byte each */
9257 +uint blk8x8k[] = { 0x00000000,
9268 +/* Funky AMD arrangement for 29xx800's */
9269 +uint amd800[] = { 0x00000000, /* 16KB */
9270 + 0x00004000, /* 32KB */
9271 + 0x0000c000, /* 8KB */
9272 + 0x0000e000, /* 8KB */
9273 + 0x00010000, /* 8KB */
9274 + 0x00012000, /* 8KB */
9275 + 0x00014000, /* 32KB */
9276 + 0x0001c000, /* 16KB */
9280 +/* AMD arrangement for 29xx160's */
9281 +uint amd4112[] = { 0x00000000, /* 32KB */
9282 + 0x00008000, /* 8KB */
9283 + 0x0000a000, /* 8KB */
9284 + 0x0000c000, /* 16KB */
9287 +uint amd2114[] = { 0x00000000, /* 16KB */
9288 + 0x00004000, /* 8KB */
9289 + 0x00006000, /* 8KB */
9290 + 0x00008000, /* 32KB */
9296 +flash_desc_t flashes[] = {
9297 + { 0x00b0, 0x00d0, 0x0200000, 2, SCS, 0x10000, 32, 0, 31, 0, NULL, "Intel 28F160S3/5 1Mx16" },
9298 + { 0x00b0, 0x00d4, 0x0400000, 2, SCS, 0x10000, 64, 0, 63, 0, NULL, "Intel 28F320S3/5 2Mx16" },
9299 + { 0x0089, 0x8890, 0x0200000, 2, BSC, 0x10000, 32, 0, 30, 8, blk8x8k, "Intel 28F160B3 1Mx16 TopB" },
9300 + { 0x0089, 0x8891, 0x0200000, 2, BSC, 0x10000, 32, 1, 31, 8, blk8x8k, "Intel 28F160B3 1Mx16 BotB" },
9301 + { 0x0089, 0x8896, 0x0400000, 2, BSC, 0x10000, 64, 0, 62, 8, blk8x8k, "Intel 28F320B3 2Mx16 TopB" },
9302 + { 0x0089, 0x8897, 0x0400000, 2, BSC, 0x10000, 64, 1, 63, 8, blk8x8k, "Intel 28F320B3 2Mx16 BotB" },
9303 + { 0x0089, 0x8898, 0x0800000, 2, BSC, 0x10000, 128, 0, 126, 8, blk8x8k, "Intel 28F640B3 4Mx16 TopB" },
9304 + { 0x0089, 0x8899, 0x0800000, 2, BSC, 0x10000, 128, 1, 127, 8, blk8x8k, "Intel 28F640B3 4Mx16 BotB" },
9305 + { 0x0089, 0x88C2, 0x0200000, 2, BSC, 0x10000, 32, 0, 30, 8, blk8x8k, "Intel 28F160C3 1Mx16 TopB" },
9306 + { 0x0089, 0x88C3, 0x0200000, 2, BSC, 0x10000, 32, 1, 31, 8, blk8x8k, "Intel 28F160C3 1Mx16 BotB" },
9307 + { 0x0089, 0x88C4, 0x0400000, 2, BSC, 0x10000, 64, 0, 62, 8, blk8x8k, "Intel 28F320C3 2Mx16 TopB" },
9308 + { 0x0089, 0x88C5, 0x0400000, 2, BSC, 0x10000, 64, 1, 63, 8, blk8x8k, "Intel 28F320C3 2Mx16 BotB" },
9309 + { 0x0089, 0x88CC, 0x0800000, 2, BSC, 0x10000, 128, 0, 126, 8, blk8x8k, "Intel 28F640C3 4Mx16 TopB" },
9310 + { 0x0089, 0x88CD, 0x0800000, 2, BSC, 0x10000, 128, 1, 127, 8, blk8x8k, "Intel 28F640C3 4Mx16 BotB" },
9311 + { 0x0089, 0x0014, 0x0400000, 2, SCS, 0x20000, 32, 0, 31, 0, NULL, "Intel 28F320J5 2Mx16" },
9312 + { 0x0089, 0x0015, 0x0800000, 2, SCS, 0x20000, 64, 0, 63, 0, NULL, "Intel 28F640J5 4Mx16" },
9313 + { 0x0089, 0x0016, 0x0400000, 2, SCS, 0x20000, 32, 0, 31, 0, NULL, "Intel 28F320J3 2Mx16" },
9314 + { 0x0089, 0x0017, 0x0800000, 2, SCS, 0x20000, 64, 0, 63, 0, NULL, "Intel 28F640J3 4Mx16" },
9315 + { 0x0089, 0x0018, 0x1000000, 2, SCS, 0x20000, 128, 0, 127, 0, NULL, "Intel 28F128J3 8Mx16" },
9316 + { 0x00b0, 0x00e3, 0x0400000, 2, BSC, 0x10000, 64, 1, 63, 8, blk8x8k, "Sharp 28F320BJE 2Mx16 BotB" },
9317 + { 0x0001, 0x224a, 0x0100000, 2, AMD, 0x10000, 16, 0, 13, 8, amd800, "AMD 29DL800BT 512Kx16 TopB" },
9318 + { 0x0001, 0x22cb, 0x0100000, 2, AMD, 0x10000, 16, 2, 15, 8, amd800, "AMD 29DL800BB 512Kx16 BotB" },
9319 + { 0x0001, 0x22c4, 0x0200000, 2, AMD, 0x10000, 32, 0, 30, 4, amd2114, "AMD 29lv160DT 1Mx16 TopB" },
9320 + { 0x0001, 0x2249, 0x0200000, 2, AMD, 0x10000, 32, 1, 31, 4, amd4112, "AMD 29lv160DB 1Mx16 BotB" },
9321 + { 0x0001, 0x22f6, 0x0400000, 2, AMD, 0x10000, 64, 0, 62, 8, blk8x8k, "AMD 29lv320DT 2Mx16 TopB" },
9322 + { 0x0001, 0x22f9, 0x0400000, 2, AMD, 0x10000, 64, 1, 63, 8, blk8x8k, "AMD 29lv320DB 2Mx16 BotB" },
9323 + { 0x0001, 0x2201, 0x0400000, 2, AMD, 0x10000, 64, 0, 62, 8, blk8x8k, "AMD 29lv320MT 2Mx16 TopB" },
9324 + { 0x0001, 0x2200, 0x0400000, 2, AMD, 0x10000, 64, 1, 63, 8, blk8x8k, "AMD 29lv320MB 2Mx16 BotB" },
9325 + { 0x0020, 0x22CA, 0x0400000, 2, AMD, 0x10000, 64, 0, 62, 4, amd4112, "ST 29w320DT 2Mx16 TopB" },
9326 + { 0x0020, 0x22CB, 0x0400000, 2, AMD, 0x10000, 64, 1, 63, 4, amd2114, "ST 29w320DB 2Mx16 BotB" },
9327 + { 0x00C2, 0x00A7, 0x0400000, 2, AMD, 0x10000, 64, 0, 62, 4, amd4112, "MX29LV320T 2Mx16 TopB" },
9328 + { 0x00C2, 0x00A8, 0x0400000, 2, AMD, 0x10000, 64, 1, 63, 4, amd2114, "MX29LV320B 2Mx16 BotB" },
9329 + { 0x0004, 0x22F6, 0x0400000, 2, AMD, 0x10000, 64, 0, 62, 4, amd4112, "MBM29LV320TE 2Mx16 TopB" },
9330 + { 0x0004, 0x22F9, 0x0400000, 2, AMD, 0x10000, 64, 1, 63, 4, amd2114, "MBM29LV320BE 2Mx16 BotB" },
9331 + { 0x0098, 0x009A, 0x0400000, 2, AMD, 0x10000, 64, 0, 62, 4, amd4112, "TC58FVT321 2Mx16 TopB" },
9332 + { 0x0098, 0x009C, 0x0400000, 2, AMD, 0x10000, 64, 1, 63, 4, amd2114, "TC58FVB321 2Mx16 BotB" },
9333 + { 0x00C2, 0x22A7, 0x0400000, 2, AMD, 0x10000, 64, 0, 62, 4, amd4112, "MX29LV320T 2Mx16 TopB" },
9334 + { 0x00C2, 0x22A8, 0x0400000, 2, AMD, 0x10000, 64, 1, 63, 4, amd2114, "MX29LV320B 2Mx16 BotB" },
9335 + { 0x00BF, 0x2783, 0x0400000, 2, SST, 0x10000, 64, 0, 63, 0, NULL, "SST39VF320 2Mx16" },
9336 + { 0, 0, 0, 0, OLD, 0, 0, 0, 0, 0, NULL, NULL },
9341 +extern flash_cmds_t flash_cmds[];
9342 +extern unlock_cmd_t unlock_cmd;
9343 +extern flash_desc_t flashes[];
9346 diff -Nur linux-2.6.12.5/arch/mips/bcm947xx/include/flashutl.h linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/flashutl.h
9347 --- linux-2.6.12.5/arch/mips/bcm947xx/include/flashutl.h 1970-01-01 01:00:00.000000000 +0100
9348 +++ linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/flashutl.h 2005-08-28 11:12:20.437858088 +0200
9351 + * BCM47XX FLASH driver interface
9353 + * Copyright 2001-2003, Broadcom Corporation
9354 + * All Rights Reserved.
9356 + * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
9357 + * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
9358 + * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
9359 + * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
9363 +#ifndef _flashutl_h_
9364 +#define _flashutl_h_
9366 +#define FLASH_BASE 0xbfc00000 /* BCM4710 */
9368 +int flash_init(void* base_addr, char *flash_str);
9369 +int flash_erase(void);
9370 +int flash_eraseblk(unsigned long off);
9371 +int flash_write(unsigned long off, uint16 *src, uint nbytes);
9372 +unsigned long flash_block_base(unsigned long off);
9373 +unsigned long flash_block_lim(unsigned long off);
9374 +int FlashWriteRange(unsigned short* dst, unsigned short* src, unsigned int numbytes);
9376 +void nvWrite(unsigned short *data, unsigned int len);
9379 +extern char* flashutl_base;
9380 +extern flash_desc_t* flashutl_desc;
9381 +extern flash_cmds_t* flashutl_cmd;
9383 +#endif /* _flashutl_h_ */
9384 diff -Nur linux-2.6.12.5/arch/mips/bcm947xx/include/hnddma.h linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/hnddma.h
9385 --- linux-2.6.12.5/arch/mips/bcm947xx/include/hnddma.h 1970-01-01 01:00:00.000000000 +0100
9386 +++ linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/hnddma.h 2005-08-28 11:12:20.438857936 +0200
9389 + * Generic Broadcom Home Networking Division (HND) DMA engine definitions.
9390 + * This supports the following chips: BCM42xx, 44xx, 47xx .
9393 + * Copyright 2001-2003, Broadcom Corporation
9394 + * All Rights Reserved.
9396 + * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
9397 + * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
9398 + * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
9399 + * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
9406 + * Each DMA processor consists of a transmit channel and a receive channel.
9408 +typedef volatile struct {
9409 + /* transmit channel */
9410 + uint32 xmtcontrol; /* enable, et al */
9411 + uint32 xmtaddr; /* descriptor ring base address (4K aligned) */
9412 + uint32 xmtptr; /* last descriptor posted to chip */
9413 + uint32 xmtstatus; /* current active descriptor, et al */
9415 + /* receive channel */
9416 + uint32 rcvcontrol; /* enable, et al */
9417 + uint32 rcvaddr; /* descriptor ring base address (4K aligned) */
9418 + uint32 rcvptr; /* last descriptor posted to chip */
9419 + uint32 rcvstatus; /* current active descriptor, et al */
9422 +typedef volatile struct {
9424 + uint32 fifoaddr; /* diag address */
9425 + uint32 fifodatalow; /* low 32bits of data */
9426 + uint32 fifodatahigh; /* high 32bits of data */
9427 + uint32 pad; /* reserved */
9430 +/* transmit channel control */
9431 +#define XC_XE ((uint32)1 << 0) /* transmit enable */
9432 +#define XC_SE ((uint32)1 << 1) /* transmit suspend request */
9433 +#define XC_LE ((uint32)1 << 2) /* loopback enable */
9434 +#define XC_FL ((uint32)1 << 4) /* flush request */
9436 +/* transmit descriptor table pointer */
9437 +#define XP_LD_MASK 0xfff /* last valid descriptor */
9439 +/* transmit channel status */
9440 +#define XS_CD_MASK 0x0fff /* current descriptor pointer */
9441 +#define XS_XS_MASK 0xf000 /* transmit state */
9442 +#define XS_XS_SHIFT 12
9443 +#define XS_XS_DISABLED 0x0000 /* disabled */
9444 +#define XS_XS_ACTIVE 0x1000 /* active */
9445 +#define XS_XS_IDLE 0x2000 /* idle wait */
9446 +#define XS_XS_STOPPED 0x3000 /* stopped */
9447 +#define XS_XS_SUSP 0x4000 /* suspend pending */
9448 +#define XS_XE_MASK 0xf0000 /* transmit errors */
9449 +#define XS_XE_SHIFT 16
9450 +#define XS_XE_NOERR 0x00000 /* no error */
9451 +#define XS_XE_DPE 0x10000 /* descriptor protocol error */
9452 +#define XS_XE_DFU 0x20000 /* data fifo underrun */
9453 +#define XS_XE_BEBR 0x30000 /* bus error on buffer read */
9454 +#define XS_XE_BEDA 0x40000 /* bus error on descriptor access */
9455 +#define XS_FL ((uint32)1 << 20) /* flushed */
9457 +/* receive channel control */
9458 +#define RC_RE ((uint32)1 << 0) /* receive enable */
9459 +#define RC_RO_MASK 0xfe /* receive frame offset */
9460 +#define RC_RO_SHIFT 1
9461 +#define RC_FM ((uint32)1 << 8) /* direct fifo receive (pio) mode */
9463 +/* receive descriptor table pointer */
9464 +#define RP_LD_MASK 0xfff /* last valid descriptor */
9466 +/* receive channel status */
9467 +#define RS_CD_MASK 0x0fff /* current descriptor pointer */
9468 +#define RS_RS_MASK 0xf000 /* receive state */
9469 +#define RS_RS_SHIFT 12
9470 +#define RS_RS_DISABLED 0x0000 /* disabled */
9471 +#define RS_RS_ACTIVE 0x1000 /* active */
9472 +#define RS_RS_IDLE 0x2000 /* idle wait */
9473 +#define RS_RS_STOPPED 0x3000 /* reserved */
9474 +#define RS_RE_MASK 0xf0000 /* receive errors */
9475 +#define RS_RE_SHIFT 16
9476 +#define RS_RE_NOERR 0x00000 /* no error */
9477 +#define RS_RE_DPE 0x10000 /* descriptor protocol error */
9478 +#define RS_RE_DFO 0x20000 /* data fifo overflow */
9479 +#define RS_RE_BEBW 0x30000 /* bus error on buffer write */
9480 +#define RS_RE_BEDA 0x40000 /* bus error on descriptor access */
9483 +#define FA_OFF_MASK 0xffff /* offset */
9484 +#define FA_SEL_MASK 0xf0000 /* select */
9485 +#define FA_SEL_SHIFT 16
9486 +#define FA_SEL_XDD 0x00000 /* transmit dma data */
9487 +#define FA_SEL_XDP 0x10000 /* transmit dma pointers */
9488 +#define FA_SEL_RDD 0x40000 /* receive dma data */
9489 +#define FA_SEL_RDP 0x50000 /* receive dma pointers */
9490 +#define FA_SEL_XFD 0x80000 /* transmit fifo data */
9491 +#define FA_SEL_XFP 0x90000 /* transmit fifo pointers */
9492 +#define FA_SEL_RFD 0xc0000 /* receive fifo data */
9493 +#define FA_SEL_RFP 0xd0000 /* receive fifo pointers */
9497 + * Descriptors are only read by the hardware, never written back.
9499 +typedef volatile struct {
9500 + uint32 ctrl; /* misc control bits & bufcount */
9501 + uint32 addr; /* data buffer address */
9505 + * Each descriptor ring must be 4096byte aligned
9506 + * and fit within a single 4096byte page.
9508 +#define DMAMAXRINGSZ 4096
9509 +#define DMARINGALIGN 4096
9511 +/* control flags */
9512 +#define CTRL_BC_MASK 0x1fff /* buffer byte count */
9513 +#define CTRL_EOT ((uint32)1 << 28) /* end of descriptor table */
9514 +#define CTRL_IOC ((uint32)1 << 29) /* interrupt on completion */
9515 +#define CTRL_EOF ((uint32)1 << 30) /* end of frame */
9516 +#define CTRL_SOF ((uint32)1 << 31) /* start of frame */
9518 +/* control flags in the range [27:20] are core-specific and not defined here */
9519 +#define CTRL_CORE_MASK 0x0ff00000
9521 +/* export structure */
9522 +typedef volatile struct {
9523 + /* rx error counters */
9524 + uint rxgiants; /* rx giant frames */
9525 + uint rxnobuf; /* rx out of dma descriptors */
9526 + /* tx error counters */
9527 + uint txnobuf; /* tx out of dma descriptors */
9535 +extern void *dma_attach(void *drv, void *dev, char *name, dmaregs_t *dmaregs,
9536 + uint ntxd, uint nrxd, uint rxbufsize, uint nrxpost, uint rxoffset,
9537 + uint ddoffset, uint dataoffset, uint *msg_level);
9538 +extern void dma_detach(di_t *di);
9539 +extern void dma_txreset(di_t *di);
9540 +extern void dma_rxreset(di_t *di);
9541 +extern void dma_txinit(di_t *di);
9542 +extern bool dma_txenabled(di_t *di);
9543 +extern void dma_rxinit(di_t *di);
9544 +extern void dma_rxenable(di_t *di);
9545 +extern bool dma_rxenabled(di_t *di);
9546 +extern void dma_txsuspend(di_t *di);
9547 +extern void dma_txresume(di_t *di);
9548 +extern bool dma_txsuspended(di_t *di);
9549 +extern bool dma_txstopped(di_t *di);
9550 +extern bool dma_rxstopped(di_t *di);
9551 +extern int dma_txfast(di_t *di, void *p, uint32 coreflags);
9552 +extern int dma_tx(di_t *di, void *p, uint32 coreflags);
9553 +extern void dma_fifoloopbackenable(di_t *di);
9554 +extern void *dma_rx(di_t *di);
9555 +extern void dma_rxfill(di_t *di);
9556 +extern void dma_txreclaim(di_t *di, bool forceall);
9557 +extern void dma_rxreclaim(di_t *di);
9558 +extern char *dma_dump(di_t *di, char *buf);
9559 +extern char *dma_dumptx(di_t *di, char *buf);
9560 +extern char *dma_dumprx(di_t *di, char *buf);
9561 +extern uint dma_getvar(di_t *di, char *name);
9562 +extern void *dma_getnexttxp(di_t *di, bool forceall);
9563 +extern void *dma_getnextrxp(di_t *di, bool forceall);
9564 +extern void dma_txblock(di_t *di);
9565 +extern void dma_txunblock(di_t *di);
9566 +extern uint dma_txactive(di_t *di);
9568 +#endif /* _hnddma_h_ */
9569 diff -Nur linux-2.6.12.5/arch/mips/bcm947xx/include/hndmips.h linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/hndmips.h
9570 --- linux-2.6.12.5/arch/mips/bcm947xx/include/hndmips.h 1970-01-01 01:00:00.000000000 +0100
9571 +++ linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/hndmips.h 2005-08-28 11:12:20.439857784 +0200
9574 + * Alternate include file for HND sbmips.h since CFE also ships with
9577 + * Copyright 2001-2003, Broadcom Corporation
9578 + * All Rights Reserved.
9580 + * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
9581 + * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
9582 + * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
9583 + * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
9588 +#include "sbmips.h"
9589 diff -Nur linux-2.6.12.5/arch/mips/bcm947xx/include/linux_osl.h linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/linux_osl.h
9590 --- linux-2.6.12.5/arch/mips/bcm947xx/include/linux_osl.h 1970-01-01 01:00:00.000000000 +0100
9591 +++ linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/linux_osl.h 2005-08-28 11:12:20.440857632 +0200
9594 + * Linux OS Independent Layer
9596 + * Copyright 2001-2003, Broadcom Corporation
9597 + * All Rights Reserved.
9599 + * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
9600 + * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
9601 + * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
9602 + * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
9607 +#ifndef _linux_osl_h_
9608 +#define _linux_osl_h_
9610 +#include <typedefs.h>
9612 +/* use current 2.4.x calling conventions */
9613 +#include <linuxver.h>
9615 +/* assert and panic */
9616 +#define ASSERT(exp) do {} while (0)
9618 +/* PCMCIA attribute space access macros */
9619 +#define OSL_PCMCIA_READ_ATTR(osh, offset, buf, size) \
9620 + osl_pcmcia_read_attr((osh), (offset), (buf), (size))
9621 +#define OSL_PCMCIA_WRITE_ATTR(osh, offset, buf, size) \
9622 + osl_pcmcia_write_attr((osh), (offset), (buf), (size))
9623 +extern void osl_pcmcia_read_attr(void *osh, uint offset, void *buf, int size);
9624 +extern void osl_pcmcia_write_attr(void *osh, uint offset, void *buf, int size);
9626 +/* PCI configuration space access macros */
9627 +#define OSL_PCI_READ_CONFIG(loc, offset, size) \
9628 + osl_pci_read_config((loc), (offset), (size))
9629 +#define OSL_PCI_WRITE_CONFIG(loc, offset, size, val) \
9630 + osl_pci_write_config((loc), (offset), (size), (val))
9631 +extern uint32 osl_pci_read_config(void *loc, uint size, uint offset);
9632 +extern void osl_pci_write_config(void *loc, uint offset, uint size, uint val);
9634 +/* OSL initialization */
9635 +#define osl_init() do {} while (0)
9637 +/* host/bus architecture-specific byte swap */
9638 +#define BUS_SWAP32(v) (v)
9641 + * BINOSL selects the slightly slower function-call-based binary compatible osl.
9642 + * Macros expand to calls to functions defined in linux_osl.c .
9646 +/* string library, kernel mode */
9647 +#define printf(fmt, args...) printk(fmt, ## args)
9648 +#include <linux/kernel.h>
9649 +#include <linux/string.h>
9651 +/* register access macros */
9652 +#define R_REG(r) ({ \
9653 + __typeof(*(r)) __osl_v; \
9654 + switch (sizeof(*(r))) { \
9655 + case sizeof(uint8): __osl_v = readb((volatile uint8*)(r)); break; \
9656 + case sizeof(uint16): __osl_v = readw((volatile uint16*)(r)); break; \
9657 + case sizeof(uint32): __osl_v = readl((volatile uint32*)(r)); break; \
9661 +#define W_REG(r, v) do { \
9662 + switch (sizeof(*(r))) { \
9663 + case sizeof(uint8): writeb((uint8)(v), (volatile uint8*)(r)); break; \
9664 + case sizeof(uint16): writew((uint16)(v), (volatile uint16*)(r)); break; \
9665 + case sizeof(uint32): writel((uint32)(v), (volatile uint32*)(r)); break; \
9669 +#define AND_REG(r, v) W_REG((r), R_REG(r) & (v))
9670 +#define OR_REG(r, v) W_REG((r), R_REG(r) | (v))
9672 +/* bcopy, bcmp, and bzero */
9673 +#define bcopy(src, dst, len) memcpy((dst), (src), (len))
9674 +#define bcmp(b1, b2, len) memcmp((b1), (b2), (len))
9675 +#define bzero(b, len) memset((b), '\0', (len))
9677 +/* general purpose memory allocation */
9678 +#define MALLOC(size) kmalloc((size), GFP_ATOMIC)
9679 +#define MFREE(addr, size) kfree((addr))
9681 +/* uncached virtual address */
9683 +#define OSL_UNCACHED(va) KSEG1ADDR((va))
9684 +#include <asm/addrspace.h>
9686 +#define OSL_UNCACHED(va) (va)
9689 +/* get processor cycle count */
9691 +#define OSL_GETCYCLES(x) ((x) = read_c0_count() * 2)
9692 +#elif defined(__i386__)
9693 +#define OSL_GETCYCLES(x) rdtscl((x))
9695 +#define OSL_GETCYCLES(x) ((x) = 0)
9698 +/* dereference an address that may cause a bus exception */
9700 +#if defined(MODULE) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,17))
9701 +#define BUSPROBE(val, addr) panic("get_dbe() will not fixup a bus exception when compiled into a module")
9703 +#define BUSPROBE(val, addr) get_dbe((val), (addr))
9704 +#include <asm/paccess.h>
9707 +#define BUSPROBE(val, addr) ({ (val) = R_REG((addr)); 0; })
9710 +/* map/unmap physical to virtual I/O */
9711 +#define REG_MAP(pa, size) ioremap_nocache((unsigned long)(pa), (unsigned long)(size))
9712 +#define REG_UNMAP(va) iounmap((void *)(va))
9714 +/* allocate/free shared (dma-able) consistent (uncached) memory */
9715 +#define DMA_ALLOC_CONSISTENT(dev, size, pap) \
9716 + pci_alloc_consistent((dev), (size), (dma_addr_t*)(pap))
9717 +#define DMA_FREE_CONSISTENT(dev, va, size, pa) \
9718 + pci_free_consistent((dev), (size), (va), (dma_addr_t)(pa))
9720 +/* map/unmap direction */
9721 +#define DMA_TX PCI_DMA_TODEVICE
9722 +#define DMA_RX PCI_DMA_FROMDEVICE
9724 +/* map/unmap shared (dma-able) memory */
9725 +#define DMA_MAP(dev, va, size, direction, p) \
9726 + pci_map_single((dev), (va), (size), (direction))
9727 +#define DMA_UNMAP(dev, pa, size, direction, p) \
9728 + pci_unmap_single((dev), (dma_addr_t)(pa), (size), (direction))
9730 +/* microsecond delay */
9731 +#define OSL_DELAY(usec) udelay(usec)
9732 +#include <linux/delay.h>
9733 +#define OSL_SLEEP(usec) set_current_state(TASK_INTERRUPTIBLE); \
9734 + schedule_timeout((usec*HZ)/1000000);
9735 +#define OSL_IN_INTERRUPT() in_interrupt()
9737 +/* shared (dma-able) memory access macros */
9738 +#define R_SM(r) *(r)
9739 +#define W_SM(r, v) (*(r) = (v))
9740 +#define BZERO_SM(r, len) memset((r), '\0', (len))
9742 +/* packet primitives */
9743 +#define PKTGET(drv, len, send) osl_pktget((drv), (len), (send))
9744 +#define PKTFREE(drv, skb, send) osl_pktfree((skb))
9745 +#define PKTDATA(drv, skb) (((struct sk_buff*)(skb))->data)
9746 +#define PKTLEN(drv, skb) (((struct sk_buff*)(skb))->len)
9747 +#define PKTHEADROOM(drv, skb) (PKTDATA(drv,skb)-(((struct sk_buff*)(skb))->head))
9748 +#define PKTTAILROOM(drv, skb) ((((struct sk_buff*)(skb))->end)-(((struct sk_buff*)(skb))->tail))
9749 +#define PKTNEXT(drv, skb) (((struct sk_buff*)(skb))->next)
9750 +#define PKTSETNEXT(skb, x) (((struct sk_buff*)(skb))->next = (struct sk_buff*)(x))
9751 +#define PKTSETLEN(drv, skb, len) __skb_trim((struct sk_buff*)(skb), (len))
9752 +#define PKTPUSH(drv, skb, bytes) skb_push((struct sk_buff*)(skb), (bytes))
9753 +#define PKTPULL(drv, skb, bytes) skb_pull((struct sk_buff*)(skb), (bytes))
9754 +#define PKTDUP(drv, skb) skb_clone((struct sk_buff*)(skb), GFP_ATOMIC)
9755 +#define PKTCOOKIE(skb) ((void*)((struct sk_buff*)(skb))->csum)
9756 +#define PKTSETCOOKIE(skb, x) (((struct sk_buff*)(skb))->csum = (uint)(x))
9757 +#define PKTLINK(skb) (((struct sk_buff*)(skb))->prev)
9758 +#define PKTSETLINK(skb, x) (((struct sk_buff*)(skb))->prev = (struct sk_buff*)(x))
9759 +extern void *osl_pktget(void *drv, uint len, bool send);
9760 +extern void osl_pktfree(void *skb);
9764 +/* string library */
9767 +#define printf(fmt, args...) osl_printf((fmt), ## args)
9769 +#define sprintf(buf, fmt, args...) osl_sprintf((buf), (fmt), ## args)
9771 +#define strcmp(s1, s2) osl_strcmp((s1), (s2))
9773 +#define strncmp(s1, s2, n) osl_strncmp((s1), (s2), (n))
9775 +#define strlen(s) osl_strlen((s))
9777 +#define strcpy(d, s) osl_strcpy((d), (s))
9779 +#define strncpy(d, s, n) osl_strncpy((d), (s), (n))
9781 +extern int osl_printf(const char *format, ...);
9782 +extern int osl_sprintf(char *buf, const char *format, ...);
9783 +extern int osl_strcmp(const char *s1, const char *s2);
9784 +extern int osl_strncmp(const char *s1, const char *s2, uint n);
9785 +extern int osl_strlen(char *s);
9786 +extern char* osl_strcpy(char *d, const char *s);
9787 +extern char* osl_strncpy(char *d, const char *s, uint n);
9789 +/* register access macros */
9790 +#define R_REG(r) ({ \
9791 + __typeof(*(r)) __osl_v; \
9792 + switch (sizeof(*(r))) { \
9793 + case sizeof(uint8): __osl_v = osl_readb((volatile uint8*)(r)); break; \
9794 + case sizeof(uint16): __osl_v = osl_readw((volatile uint16*)(r)); break; \
9795 + case sizeof(uint32): __osl_v = osl_readl((volatile uint32*)(r)); break; \
9799 +#define W_REG(r, v) do { \
9800 + switch (sizeof(*(r))) { \
9801 + case sizeof(uint8): osl_writeb((uint8)(v), (volatile uint8*)(r)); break; \
9802 + case sizeof(uint16): osl_writew((uint16)(v), (volatile uint16*)(r)); break; \
9803 + case sizeof(uint32): osl_writel((uint32)(v), (volatile uint32*)(r)); break; \
9806 +#define AND_REG(r, v) W_REG((r), R_REG(r) & (v))
9807 +#define OR_REG(r, v) W_REG((r), R_REG(r) | (v))
9808 +extern uint8 osl_readb(volatile uint8 *r);
9809 +extern uint16 osl_readw(volatile uint16 *r);
9810 +extern uint32 osl_readl(volatile uint32 *r);
9811 +extern void osl_writeb(uint8 v, volatile uint8 *r);
9812 +extern void osl_writew(uint16 v, volatile uint16 *r);
9813 +extern void osl_writel(uint32 v, volatile uint32 *r);
9815 +/* bcopy, bcmp, and bzero */
9816 +extern void bcopy(const void *src, void *dst, int len);
9817 +extern int bcmp(const void *b1, const void *b2, int len);
9818 +extern void bzero(void *b, int len);
9820 +/* general purpose memory allocation */
9821 +#define MALLOC(size) osl_malloc((size))
9822 +#define MFREE(addr, size) osl_mfree((char*)(addr), (size))
9823 +extern void *osl_malloc(uint size);
9824 +extern void osl_mfree(void *addr, uint size);
9826 +/* uncached virtual address */
9827 +#define OSL_UNCACHED(va) osl_uncached((va))
9828 +extern void *osl_uncached(void *va);
9830 +/* get processor cycle count */
9831 +#define OSL_GETCYCLES(x) ((x) = osl_getcycles())
9832 +extern uint osl_getcycles(void);
9834 +/* dereference an address that may target abort */
9835 +#define BUSPROBE(val, addr) osl_busprobe(&(val), (addr))
9836 +extern int osl_busprobe(uint32 *val, uint32 addr);
9838 +/* map/unmap physical to virtual */
9839 +#define REG_MAP(pa, size) osl_reg_map((pa), (size))
9840 +#define REG_UNMAP(va) osl_reg_unmap((va))
9841 +extern void *osl_reg_map(uint32 pa, uint size);
9842 +extern void osl_reg_unmap(void *va);
9844 +/* allocate/free shared (dma-able) consistent (uncached) memory */
9845 +#define DMA_ALLOC_CONSISTENT(dev, size, pap) \
9846 + osl_dma_alloc_consistent((dev), (size), (pap))
9847 +#define DMA_FREE_CONSISTENT(dev, va, size, pa) \
9848 + osl_dma_free_consistent((dev), (void*)(va), (size), (pa))
9849 +extern void *osl_dma_alloc_consistent(void *dev, uint size, ulong *pap);
9850 +extern void osl_dma_free_consistent(void *dev, void *va, uint size, ulong pa);
9852 +/* map/unmap direction */
9856 +/* map/unmap shared (dma-able) memory */
9857 +#define DMA_MAP(dev, va, size, direction, p) \
9858 + osl_dma_map((dev), (va), (size), (direction))
9859 +#define DMA_UNMAP(dev, pa, size, direction, p) \
9860 + osl_dma_unmap((dev), (pa), (size), (direction))
9861 +extern uint osl_dma_map(void *dev, void *va, uint size, int direction);
9862 +extern void osl_dma_unmap(void *dev, uint pa, uint size, int direction);
9864 +/* microsecond delay */
9865 +#define OSL_DELAY(usec) osl_delay((usec))
9866 +extern void osl_delay(uint usec);
9868 +/* shared (dma-able) memory access macros */
9869 +#define R_SM(r) *(r)
9870 +#define W_SM(r, v) (*(r) = (v))
9871 +#define BZERO_SM(r, len) bzero((r), (len))
9873 +/* packet primitives */
9874 +#define PKTGET(drv, len, send) osl_pktget((drv), (len), (send))
9875 +#define PKTFREE(drv, skb, send) osl_pktfree((skb))
9876 +#define PKTDATA(drv, skb) osl_pktdata((drv), (skb))
9877 +#define PKTLEN(drv, skb) osl_pktlen((drv), (skb))
9878 +#define PKTNEXT(drv, skb) osl_pktnext((drv), (skb))
9879 +#define PKTSETNEXT(skb, x) osl_pktsetnext((skb), (x))
9880 +#define PKTSETLEN(drv, skb, len) osl_pktsetlen((drv), (skb), (len))
9881 +#define PKTPUSH(drv, skb, bytes) osl_pktpush((drv), (skb), (bytes))
9882 +#define PKTPULL(drv, skb, bytes) osl_pktpull((drv), (skb), (bytes))
9883 +#define PKTDUP(drv, skb) osl_pktdup((drv), (skb))
9884 +#define PKTCOOKIE(skb) osl_pktcookie((skb))
9885 +#define PKTSETCOOKIE(skb, x) osl_pktsetcookie((skb), (x))
9886 +#define PKTLINK(skb) osl_pktlink((skb))
9887 +#define PKTSETLINK(skb, x) osl_pktsetlink((skb), (x))
9888 +extern void *osl_pktget(void *drv, uint len, bool send);
9889 +extern void osl_pktfree(void *skb);
9890 +extern uchar *osl_pktdata(void *drv, void *skb);
9891 +extern uint osl_pktlen(void *drv, void *skb);
9892 +extern void *osl_pktnext(void *drv, void *skb);
9893 +extern void osl_pktsetnext(void *skb, void *x);
9894 +extern void osl_pktsetlen(void *drv, void *skb, uint len);
9895 +extern uchar *osl_pktpush(void *drv, void *skb, int bytes);
9896 +extern uchar *osl_pktpull(void *drv, void *skb, int bytes);
9897 +extern void *osl_pktdup(void *drv, void *skb);
9898 +extern void *osl_pktcookie(void *skb);
9899 +extern void osl_pktsetcookie(void *skb, void *x);
9900 +extern void *osl_pktlink(void *skb);
9901 +extern void osl_pktsetlink(void *skb, void *x);
9903 +#endif /* BINOSL */
9905 +#endif /* _linux_osl_h_ */
9906 diff -Nur linux-2.6.12.5/arch/mips/bcm947xx/include/linuxver.h linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/linuxver.h
9907 --- linux-2.6.12.5/arch/mips/bcm947xx/include/linuxver.h 1970-01-01 01:00:00.000000000 +0100
9908 +++ linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/linuxver.h 2005-08-28 11:12:20.441857480 +0200
9911 + * Linux-specific abstractions to gain some independence from linux kernel versions.
9912 + * Pave over some 2.2 versus 2.4 kernel differences.
9914 + * Copyright 2001-2003, Broadcom Corporation
9915 + * All Rights Reserved.
9917 + * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
9918 + * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
9919 + * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
9920 + * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
9924 +#ifndef _linuxver_h_
9925 +#define _linuxver_h_
9927 +#include <linux/config.h>
9928 +#include <linux/version.h>
9930 +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0))
9931 +/* __NO_VERSION__ must be defined for all linkables except one in 2.2 */
9932 +#ifdef __UNDEF_NO_VERSION__
9933 +#undef __NO_VERSION__
9935 +#define __NO_VERSION__
9939 +#if defined(MODULE) && defined(MODVERSIONS)
9940 +#include <linux/modversions.h>
9943 +/* linux/malloc.h is deprecated, use linux/slab.h instead. */
9944 +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,9))
9945 +#include <linux/malloc.h>
9947 +#include <linux/slab.h>
9950 +#include <linux/types.h>
9951 +#include <linux/init.h>
9952 +#include <linux/module.h>
9953 +#include <linux/mm.h>
9954 +#include <linux/string.h>
9955 +#include <linux/pci.h>
9956 +#include <linux/interrupt.h>
9957 +#include <linux/netdevice.h>
9958 +#include <asm/io.h>
9967 +#define __devinit __init
9969 +#ifndef __devinitdata
9970 +#define __devinitdata
9972 +#ifndef __devexit_p
9973 +#define __devexit_p(x) x
9976 +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0))
9978 +#define pci_get_drvdata(dev) (dev)->sysdata
9979 +#define pci_set_drvdata(dev, value) (dev)->sysdata=(value)
9982 + * New-style (2.4.x) PCI/hot-pluggable PCI/CardBus registration
9985 +struct pci_device_id {
9986 + unsigned int vendor, device; /* Vendor and device ID or PCI_ANY_ID */
9987 + unsigned int subvendor, subdevice; /* Subsystem ID's or PCI_ANY_ID */
9988 + unsigned int class, class_mask; /* (class,subclass,prog-if) triplet */
9989 + unsigned long driver_data; /* Data private to the driver */
9992 +struct pci_driver {
9993 + struct list_head node;
9995 + const struct pci_device_id *id_table; /* NULL if wants all devices */
9996 + int (*probe)(struct pci_dev *dev, const struct pci_device_id *id); /* New device inserted */
9997 + void (*remove)(struct pci_dev *dev); /* Device removed (NULL if not a hot-plug capable driver) */
9998 + void (*suspend)(struct pci_dev *dev); /* Device suspended */
9999 + void (*resume)(struct pci_dev *dev); /* Device woken up */
10002 +#define MODULE_DEVICE_TABLE(type, name)
10003 +#define PCI_ANY_ID (~0)
10006 +#define pci_module_init pci_register_driver
10007 +extern int pci_register_driver(struct pci_driver *drv);
10008 +extern void pci_unregister_driver(struct pci_driver *drv);
10010 +#endif /* PCI registration */
10012 +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18))
10014 +#define module_init(x) int init_module(void) { return x(); }
10015 +#define module_exit(x) void cleanup_module(void) { x(); }
10017 +#define module_init(x) __initcall(x);
10018 +#define module_exit(x) __exitcall(x);
10022 +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,48))
10023 +#define list_for_each(pos, head) \
10024 + for (pos = (head)->next; pos != (head); pos = pos->next)
10027 +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,13))
10028 +#define pci_resource_start(dev, bar) ((dev)->base_address[(bar)])
10029 +#elif (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,44))
10030 +#define pci_resource_start(dev, bar) ((dev)->resource[(bar)].start)
10033 +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,23))
10034 +#define pci_enable_device(dev) do { } while (0)
10037 +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,14))
10038 +#define net_device device
10041 +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,42))
10046 + * See linux/Documentation/DMA-mapping.txt
10049 +#ifndef PCI_DMA_TODEVICE
10050 +#define PCI_DMA_TODEVICE 1
10051 +#define PCI_DMA_FROMDEVICE 2
10054 +typedef u32 dma_addr_t;
10056 +/* Pure 2^n version of get_order */
10057 +static inline int get_order(unsigned long size)
10061 + size = (size-1) >> (PAGE_SHIFT-1);
10070 +static inline void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size,
10071 + dma_addr_t *dma_handle)
10074 + int gfp = GFP_ATOMIC | GFP_DMA;
10076 + ret = (void *)__get_free_pages(gfp, get_order(size));
10078 + if (ret != NULL) {
10079 + memset(ret, 0, size);
10080 + *dma_handle = virt_to_bus(ret);
10084 +static inline void pci_free_consistent(struct pci_dev *hwdev, size_t size,
10085 + void *vaddr, dma_addr_t dma_handle)
10087 + free_pages((unsigned long)vaddr, get_order(size));
10090 +extern uint pci_map_single(void *dev, void *va, uint size, int direction);
10091 +extern void pci_unmap_single(void *dev, uint pa, uint size, int direction);
10093 +#define pci_map_single(cookie, address, size, dir) virt_to_bus(address)
10094 +#define pci_unmap_single(cookie, address, size, dir)
10097 +#endif /* DMA mapping */
10099 +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,43))
10101 +#define dev_kfree_skb_any(a) dev_kfree_skb(a)
10102 +#define netif_down(dev) do { (dev)->start = 0; } while(0)
10104 +/* pcmcia-cs provides its own netdevice compatibility layer */
10105 +#ifndef _COMPAT_NETDEVICE_H
10110 + * For pre-softnet kernels we need to tell the upper layer not to
10111 + * re-enter start_xmit() while we are in there. However softnet
10112 + * guarantees not to enter while we are in there so there is no need
10113 + * to do the netif_stop_queue() dance unless the transmit queue really
10114 + * gets stuck. This should also improve performance according to tests
10115 + * done by Aman Singla.
10118 +#define dev_kfree_skb_irq(a) dev_kfree_skb(a)
10119 +#define netif_wake_queue(dev) do { clear_bit(0, &(dev)->tbusy); mark_bh(NET_BH); } while(0)
10120 +#define netif_stop_queue(dev) set_bit(0, &(dev)->tbusy)
10122 +static inline void netif_start_queue(struct net_device *dev)
10125 + dev->interrupt = 0;
10129 +#define netif_queue_stopped(dev) (dev)->tbusy
10130 +#define netif_running(dev) (dev)->start
10132 +#endif /* _COMPAT_NETDEVICE_H */
10134 +#define netif_device_attach(dev) netif_start_queue(dev)
10135 +#define netif_device_detach(dev) netif_stop_queue(dev)
10137 +/* 2.4.x renamed bottom halves to tasklets */
10138 +#define tasklet_struct tq_struct
10139 +static inline void tasklet_schedule(struct tasklet_struct *tasklet)
10141 + queue_task(tasklet, &tq_immediate);
10142 + mark_bh(IMMEDIATE_BH);
10145 +static inline void tasklet_init(struct tasklet_struct *tasklet,
10146 + void (*func)(unsigned long),
10147 + unsigned long data)
10149 + tasklet->next = NULL;
10150 + tasklet->sync = 0;
10151 + tasklet->routine = (void (*)(void *))func;
10152 + tasklet->data = (void *)data;
10154 +#define tasklet_kill(tasklet) {do{} while(0);}
10156 +/* 2.4.x introduced del_timer_sync() */
10157 +#define del_timer_sync(timer) del_timer(timer)
10161 +#define netif_down(dev)
10163 +#endif /* SoftNet */
10165 +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,3))
10168 + * Emit code to initialise a tq_struct's routine and data pointers
10170 +#define PREPARE_TQUEUE(_tq, _routine, _data) \
10172 + (_tq)->routine = _routine; \
10173 + (_tq)->data = _data; \
10177 + * Emit code to initialise all of a tq_struct
10179 +#define INIT_TQUEUE(_tq, _routine, _data) \
10181 + INIT_LIST_HEAD(&(_tq)->list); \
10182 + (_tq)->sync = 0; \
10183 + PREPARE_TQUEUE((_tq), (_routine), (_data)); \
10188 +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,6))
10190 +/* Power management related routines */
10193 +pci_save_state(struct pci_dev *dev, u32 *buffer)
10197 + for (i = 0; i < 16; i++)
10198 + pci_read_config_dword(dev, i * 4,&buffer[i]);
10204 +pci_restore_state(struct pci_dev *dev, u32 *buffer)
10209 + for (i = 0; i < 16; i++)
10210 + pci_write_config_dword(dev,i * 4, buffer[i]);
10213 + * otherwise, write the context information we know from bootup.
10214 + * This works around a problem where warm-booting from Windows
10215 + * combined with a D3(hot)->D0 transition causes PCI config
10216 + * header data to be forgotten.
10219 + for (i = 0; i < 6; i ++)
10220 + pci_write_config_dword(dev,
10221 + PCI_BASE_ADDRESS_0 + (i * 4),
10222 + pci_resource_start(dev, i));
10223 + pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq);
10228 +#endif /* PCI power management */
10230 +/* Old cp0 access macros deprecated in 2.4.19 */
10231 +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,19))
10232 +#define read_c0_count() read_32bit_cp0_register(CP0_COUNT)
10235 +#endif /* _linuxver_h_ */
10236 diff -Nur linux-2.6.12.5/arch/mips/bcm947xx/include/nvports.h linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/nvports.h
10237 --- linux-2.6.12.5/arch/mips/bcm947xx/include/nvports.h 1970-01-01 01:00:00.000000000 +0100
10238 +++ linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/nvports.h 2005-08-28 11:12:20.441857480 +0200
10241 + * Broadcom Home Gateway Reference Design
10242 + * Ports Web Page Configuration Support Routines
10244 + * Copyright 2001-2003, Broadcom Corporation
10245 + * All Rights Reserved.
10247 + * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
10248 + * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
10249 + * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
10250 + * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
10254 +#ifndef _nvports_h_
10255 +#define _nvports_h_
10257 +#define uint32 unsigned long
10258 +#define uint16 unsigned short
10259 +#define uint unsigned int
10260 +#define uint8 unsigned char
10261 +#define uint64 unsigned long long
10273 +typedef struct _PORT_ATTRIBS
10281 +nvExistsPortAttrib(char *attrib, uint portno);
10284 +nvExistsAnyForcePortAttrib(uint portno);
10287 +nvSetPortAttrib(char *attrib, uint portno);
10290 +nvUnsetPortAttrib(char *attrib, uint portno);
10293 +nvUnsetAllForcePortAttrib(uint portno);
10295 +extern PORT_ATTRIBS
10296 +nvGetSwitchPortAttribs(uint portno);
10298 +#endif /* _nvports_h_ */
10302 diff -Nur linux-2.6.12.5/arch/mips/bcm947xx/include/osl.h linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/osl.h
10303 --- linux-2.6.12.5/arch/mips/bcm947xx/include/osl.h 1970-01-01 01:00:00.000000000 +0100
10304 +++ linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/osl.h 2005-08-28 11:12:20.441857480 +0200
10307 + * OS Independent Layer
10309 + * Copyright 2001-2003, Broadcom Corporation
10310 + * All Rights Reserved.
10312 + * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
10313 + * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
10314 + * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
10315 + * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
10323 +#include <v2hal_osl.h>
10324 +#elif defined(linux)
10325 +#include <linux_osl.h>
10327 +#include <pmon_osl.h>
10328 +#elif defined(NDIS)
10329 +#include <ndis_osl.h>
10330 +#elif defined(_CFE_)
10331 +#include <cfe_osl.h>
10332 +#elif defined(MACOS9)
10333 +#include <macos9_osl.h>
10334 +#elif defined(MACOSX)
10335 +#include <macosx_osl.h>
10337 +#error "Unsupported OSL requested"
10341 +#define SET_REG(r, mask, val) W_REG((r), ((R_REG(r) & ~(mask)) | (val)))
10343 +#endif /* _osl_h_ */
10344 diff -Nur linux-2.6.12.5/arch/mips/bcm947xx/include/pcicfg.h linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/pcicfg.h
10345 --- linux-2.6.12.5/arch/mips/bcm947xx/include/pcicfg.h 1970-01-01 01:00:00.000000000 +0100
10346 +++ linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/pcicfg.h 2005-08-28 11:12:20.442857328 +0200
10349 + * pcicfg.h: PCI configuration constants and structures.
10351 + * Copyright 2001-2003, Broadcom Corporation
10352 + * All Rights Reserved.
10354 + * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
10355 + * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
10356 + * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
10357 + * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
10365 +/* The following inside ifndef's so we don't collide with NTDDK.H */
10366 +#ifndef PCI_MAX_BUS
10367 +#define PCI_MAX_BUS 0x100
10369 +#ifndef PCI_MAX_DEVICES
10370 +#define PCI_MAX_DEVICES 0x20
10372 +#ifndef PCI_MAX_FUNCTION
10373 +#define PCI_MAX_FUNCTION 0x8
10376 +#ifndef PCI_INVALID_VENDORID
10377 +#define PCI_INVALID_VENDORID 0xffff
10379 +#ifndef PCI_INVALID_DEVICEID
10380 +#define PCI_INVALID_DEVICEID 0xffff
10384 +/* Convert between bus-slot-function-register and config addresses */
10386 +#define PCICFG_BUS_SHIFT 16 /* Bus shift */
10387 +#define PCICFG_SLOT_SHIFT 11 /* Slot shift */
10388 +#define PCICFG_FUN_SHIFT 8 /* Function shift */
10389 +#define PCICFG_OFF_SHIFT 0 /* Bus shift */
10391 +#define PCICFG_BUS_MASK 0xff /* Bus mask */
10392 +#define PCICFG_SLOT_MASK 0x1f /* Slot mask */
10393 +#define PCICFG_FUN_MASK 7 /* Function mask */
10394 +#define PCICFG_OFF_MASK 0xff /* Bus mask */
10396 +#define PCI_CONFIG_ADDR(b, s, f, o) \
10397 + ((((b) & PCICFG_BUS_MASK) << PCICFG_BUS_SHIFT) \
10398 + | (((s) & PCICFG_SLOT_MASK) << PCICFG_SLOT_SHIFT) \
10399 + | (((f) & PCICFG_FUN_MASK) << PCICFG_FUN_SHIFT) \
10400 + | (((o) & PCICFG_OFF_MASK) << PCICFG_OFF_SHIFT))
10402 +#define PCI_CONFIG_BUS(a) (((a) >> PCICFG_BUS_SHIFT) & PCICFG_BUS_MASK)
10403 +#define PCI_CONFIG_SLOT(a) (((a) >> PCICFG_SLOT_SHIFT) & PCICFG_SLOT_MASK)
10404 +#define PCI_CONFIG_FUN(a) (((a) >> PCICFG_FUN_SHIFT) & PCICFG_FUN_MASK)
10405 +#define PCI_CONFIG_OFF(a) (((a) >> PCICFG_OFF_SHIFT) & PCICFG_OFF_MASK)
10408 +/* The actual config space */
10410 +#define PCI_BAR_MAX 6
10412 +#define PCI_ROM_BAR 8
10414 +#define PCR_RSVDA_MAX 2
10416 +typedef struct _pci_config_regs {
10417 + unsigned short vendor;
10418 + unsigned short device;
10419 + unsigned short command;
10420 + unsigned short status;
10421 + unsigned char rev_id;
10422 + unsigned char prog_if;
10423 + unsigned char sub_class;
10424 + unsigned char base_class;
10425 + unsigned char cache_line_size;
10426 + unsigned char latency_timer;
10427 + unsigned char header_type;
10428 + unsigned char bist;
10429 + unsigned long base[PCI_BAR_MAX];
10430 + unsigned long cardbus_cis;
10431 + unsigned short subsys_vendor;
10432 + unsigned short subsys_id;
10433 + unsigned long baserom;
10434 + unsigned long rsvd_a[PCR_RSVDA_MAX];
10435 + unsigned char int_line;
10436 + unsigned char int_pin;
10437 + unsigned char min_gnt;
10438 + unsigned char max_lat;
10439 + unsigned char dev_dep[192];
10440 +} pci_config_regs;
10442 +#define SZPCR (sizeof (pci_config_regs))
10443 +#define MINSZPCR 64 /* offsetof (dev_dep[0] */
10445 +/* A structure for the config registers is nice, but in most
10446 + * systems the config space is not memory mapped, so we need
10447 + * filed offsetts. :-(
10449 +#define PCI_CFG_VID 0
10450 +#define PCI_CFG_DID 2
10451 +#define PCI_CFG_CMD 4
10452 +#define PCI_CFG_STAT 6
10453 +#define PCI_CFG_REV 8
10454 +#define PCI_CFG_PROGIF 9
10455 +#define PCI_CFG_SUBCL 0xa
10456 +#define PCI_CFG_BASECL 0xb
10457 +#define PCI_CFG_CLSZ 0xc
10458 +#define PCI_CFG_LATTIM 0xd
10459 +#define PCI_CFG_HDR 0xe
10460 +#define PCI_CFG_BIST 0xf
10461 +#define PCI_CFG_BAR0 0x10
10462 +#define PCI_CFG_BAR1 0x14
10463 +#define PCI_CFG_BAR2 0x18
10464 +#define PCI_CFG_BAR3 0x1c
10465 +#define PCI_CFG_BAR4 0x20
10466 +#define PCI_CFG_BAR5 0x24
10467 +#define PCI_CFG_CIS 0x28
10468 +#define PCI_CFG_SVID 0x2c
10469 +#define PCI_CFG_SSID 0x2e
10470 +#define PCI_CFG_ROMBAR 0x30
10471 +#define PCI_CFG_INT 0x3c
10472 +#define PCI_CFG_PIN 0x3d
10473 +#define PCI_CFG_MINGNT 0x3e
10474 +#define PCI_CFG_MAXLAT 0x3f
10476 +/* Classes and subclasses */
10479 + PCI_CLASS_OLD = 0,
10482 + PCI_CLASS_DISPLAY,
10483 + PCI_CLASS_MMEDIA,
10484 + PCI_CLASS_MEMORY,
10485 + PCI_CLASS_BRIDGE,
10491 + PCI_CLASS_SERIAL,
10492 + PCI_CLASS_INTELLIGENT = 0xe,
10493 + PCI_CLASS_SATELLITE,
10502 + PCI_DASDI_FLOPPY,
10505 + PCI_DASDI_OTHER = 0x80
10506 +} pci_dasdi_subclasses;
10513 + PCI_NET_OTHER = 0x80
10514 +} pci_net_subclasses;
10520 + PCI_DISPLAY_OTHER = 0x80
10521 +} pci_display_subclasses;
10524 + PCI_MMEDIA_VIDEO,
10525 + PCI_MMEDIA_AUDIO,
10526 + PCI_MMEDIA_PHONE,
10527 + PCI_MEDIA_OTHER = 0x80
10528 +} pci_mmedia_subclasses;
10532 + PCI_MEMORY_FLASH,
10533 + PCI_MEMORY_OTHER = 0x80
10534 +} pci_memory_subclasses;
10542 + PCI_BRIDGE_PCMCIA,
10543 + PCI_BRIDGE_NUBUS,
10544 + PCI_BRIDGE_CARDBUS,
10545 + PCI_BRIDGE_RACEWAY,
10546 + PCI_BRIDGE_OTHER = 0x80
10547 +} pci_bridge_subclasses;
10551 + PCI_COMM_PARALLEL,
10552 + PCI_COMM_MULTIUART,
10554 + PCI_COMM_OTHER = 0x80
10555 +} pci_comm_subclasses;
10562 + PCI_BASE_PCI_HOTPLUG,
10563 + PCI_BASE_OTHER = 0x80
10564 +} pci_base_subclasses;
10570 + PCI_INPUT_SCANNER,
10571 + PCI_INPUT_GAMEPORT,
10572 + PCI_INPUT_OTHER = 0x80
10573 +} pci_input_subclasses;
10576 + PCI_DOCK_GENERIC,
10577 + PCI_DOCK_OTHER = 0x80
10578 +} pci_dock_subclasses;
10584 + PCI_CPU_ALPHA = 0x10,
10585 + PCI_CPU_POWERPC = 0x20,
10586 + PCI_CPU_MIPS = 0x30,
10587 + PCI_CPU_COPROC = 0x40,
10588 + PCI_CPU_OTHER = 0x80
10589 +} pci_cpu_subclasses;
10592 + PCI_SERIAL_IEEE1394,
10593 + PCI_SERIAL_ACCESS,
10596 + PCI_SERIAL_FIBER,
10597 + PCI_SERIAL_SMBUS,
10598 + PCI_SERIAL_OTHER = 0x80
10599 +} pci_serial_subclasses;
10602 + PCI_INTELLIGENT_I2O,
10603 +} pci_intelligent_subclasses;
10606 + PCI_SATELLITE_TV,
10607 + PCI_SATELLITE_AUDIO,
10608 + PCI_SATELLITE_VOICE,
10609 + PCI_SATELLITE_DATA,
10610 + PCI_SATELLITE_OTHER = 0x80
10611 +} pci_satellite_subclasses;
10614 + PCI_CRYPT_NETWORK,
10615 + PCI_CRYPT_ENTERTAINMENT,
10616 + PCI_CRYPT_OTHER = 0x80
10617 +} pci_crypt_subclasses;
10621 + PCI_DSP_OTHER = 0x80
10622 +} pci_dsp_subclasses;
10624 +/* Header types */
10626 + PCI_HEADER_NORMAL,
10627 + PCI_HEADER_BRIDGE,
10628 + PCI_HEADER_CARDBUS
10629 +} pci_header_types;
10632 +/* Overlay for a PCI-to-PCI bridge */
10634 +#define PPB_RSVDA_MAX 2
10635 +#define PPB_RSVDD_MAX 8
10637 +typedef struct _ppb_config_regs {
10638 + unsigned short vendor;
10639 + unsigned short device;
10640 + unsigned short command;
10641 + unsigned short status;
10642 + unsigned char rev_id;
10643 + unsigned char prog_if;
10644 + unsigned char sub_class;
10645 + unsigned char base_class;
10646 + unsigned char cache_line_size;
10647 + unsigned char latency_timer;
10648 + unsigned char header_type;
10649 + unsigned char bist;
10650 + unsigned long rsvd_a[PPB_RSVDA_MAX];
10651 + unsigned char prim_bus;
10652 + unsigned char sec_bus;
10653 + unsigned char sub_bus;
10654 + unsigned char sec_lat;
10655 + unsigned char io_base;
10656 + unsigned char io_lim;
10657 + unsigned short sec_status;
10658 + unsigned short mem_base;
10659 + unsigned short mem_lim;
10660 + unsigned short pf_mem_base;
10661 + unsigned short pf_mem_lim;
10662 + unsigned long pf_mem_base_hi;
10663 + unsigned long pf_mem_lim_hi;
10664 + unsigned short io_base_hi;
10665 + unsigned short io_lim_hi;
10666 + unsigned short subsys_vendor;
10667 + unsigned short subsys_id;
10668 + unsigned long rsvd_b;
10669 + unsigned char rsvd_c;
10670 + unsigned char int_pin;
10671 + unsigned short bridge_ctrl;
10672 + unsigned char chip_ctrl;
10673 + unsigned char diag_ctrl;
10674 + unsigned short arb_ctrl;
10675 + unsigned long rsvd_d[PPB_RSVDD_MAX];
10676 + unsigned char dev_dep[192];
10677 +} ppb_config_regs;
10679 +/* Eveything below is BRCM HND proprietary */
10681 +#define PCI_BAR0_WIN 0x80 /* backplane addres space accessed by BAR0 */
10682 +#define PCI_BAR1_WIN 0x84 /* backplane addres space accessed by BAR1 */
10683 +#define PCI_SPROM_CONTROL 0x88 /* sprom property control */
10684 +#define PCI_BAR1_CONTROL 0x8c /* BAR1 region burst control */
10685 +#define PCI_INT_STATUS 0x90 /* PCI and other cores interrupts */
10686 +#define PCI_INT_MASK 0x94 /* mask of PCI and other cores interrupts */
10687 +#define PCI_TO_SB_MB 0x98 /* signal backplane interrupts */
10688 +#define PCI_BACKPLANE_ADDR 0xA0 /* address an arbitrary location on the system backplane */
10689 +#define PCI_BACKPLANE_DATA 0xA4 /* data at the location specified by above address register */
10690 +#define PCI_GPIO_IN 0xb0 /* pci config space gpio input (>=rev3) */
10691 +#define PCI_GPIO_OUT 0xb4 /* pci config space gpio output (>=rev3) */
10692 +#define PCI_GPIO_OUTEN 0xb8 /* pci config space gpio output enable (>=rev3) */
10694 +#define PCI_BAR0_SPROM_OFFSET (4 * 1024) /* bar0 + 4K accesses external sprom */
10695 +#define PCI_BAR0_PCIREGS_OFFSET (6 * 1024) /* bar0 + 6K accesses pci core registers */
10697 +/* PCI_INT_MASK */
10698 +#define PCI_SBIM_SHIFT 8 /* backplane core interrupt mask bits offset */
10699 +#define PCI_SBIM_MASK 0xff00 /* backplane core interrupt mask */
10701 +/* PCI_SPROM_CONTROL */
10702 +#define SPROM_BLANK 0x04 /* indicating a blank sprom */
10703 +#define SPROM_WRITEEN 0x10 /* sprom write enable */
10704 +#define SPROM_BOOTROM_WE 0x20 /* external bootrom write enable */
10706 +#define SPROM_SIZE 256 /* sprom size in 16-bit */
10707 +#define SPROM_CRC_RANGE 64 /* crc cover range in 16-bit */
10710 diff -Nur linux-2.6.12.5/arch/mips/bcm947xx/include/proto/802.11.h linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/proto/802.11.h
10711 --- linux-2.6.12.5/arch/mips/bcm947xx/include/proto/802.11.h 1970-01-01 01:00:00.000000000 +0100
10712 +++ linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/proto/802.11.h 2005-08-28 11:12:20.450856112 +0200
10715 + * Copyright 2001-2003, Broadcom Corporation
10716 + * All Rights Reserved.
10718 + * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
10719 + * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
10720 + * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
10721 + * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
10723 + * Fundamental types and constants relating to 802.11
10728 +#ifndef _802_11_H_
10729 +#define _802_11_H_
10731 +#ifndef _TYPEDEFS_H_
10732 +#include <typedefs.h>
10735 +#ifndef _NET_ETHERNET_H_
10736 +#include <proto/ethernet.h>
10739 +/* enable structure packing */
10740 +#if !defined(__GNUC__)
10744 +/* some platforms require stronger medicine */
10745 +#if defined(__GNUC__)
10746 +#define PACKED __attribute__((packed))
10752 +#define DOT11_TU_TO_US 1024 /* 802.11 Time Unit is 1024 microseconds */
10754 +/* Generic 802.11 frame constants */
10755 +#define DOT11_A3_HDR_LEN 24
10756 +#define DOT11_A4_HDR_LEN 30
10757 +#define DOT11_MAC_HDR_LEN DOT11_A3_HDR_LEN
10758 +#define DOT11_FCS_LEN 4
10759 +#define DOT11_ICV_LEN 4
10760 +#define DOT11_ICV_AES_LEN 8
10763 +#define DOT11_KEY_INDEX_SHIFT 6
10764 +#define DOT11_IV_LEN 4
10765 +#define DOT11_IV_TKIP_LEN 8
10766 +#define DOT11_IV_AES_OCB_LEN 4
10767 +#define DOT11_IV_AES_CCM_LEN 8
10769 +#define DOT11_MAX_MPDU_BODY_LEN 2312
10770 +#define DOT11_MAX_MPDU_LEN 2346 /* body len + A4 hdr + FCS */
10771 +#define DOT11_MAX_SSID_LEN 32
10773 +/* dot11RTSThreshold */
10774 +#define DOT11_DEFAULT_RTS_LEN 2347
10775 +#define DOT11_MAX_RTS_LEN 2347
10777 +/* dot11FragmentationThreshold */
10778 +#define DOT11_MIN_FRAG_LEN 256
10779 +#define DOT11_MAX_FRAG_LEN 2346 /* Max frag is also limited by aMPDUMaxLength of the attached PHY */
10780 +#define DOT11_DEFAULT_FRAG_LEN 2346
10782 +/* dot11BeaconPeriod */
10783 +#define DOT11_MIN_BEACON_PERIOD 1
10784 +#define DOT11_MAX_BEACON_PERIOD 0xFFFF
10786 +/* dot11DTIMPeriod */
10787 +#define DOT11_MIN_DTIM_PERIOD 1
10788 +#define DOT11_MAX_DTIM_PERIOD 0xFF
10790 +/* 802.2 LLC/SNAP header used by 802.11 per 802.1H */
10791 +#define DOT11_LLC_SNAP_HDR_LEN 8
10792 +#define DOT11_OUI_LEN 3
10793 +struct dot11_llc_snap_header {
10794 + uint8 dsap; /* always 0xAA */
10795 + uint8 ssap; /* always 0xAA */
10796 + uint8 ctl; /* always 0x03 */
10797 + uint8 oui[DOT11_OUI_LEN]; /* RFC1042: 0x00 0x00 0x00
10798 + Bridge-Tunnel: 0x00 0x00 0xF8 */
10799 + uint16 type; /* ethertype */
10802 +/* RFC1042 header used by 802.11 per 802.1H */
10803 +#define RFC1042_HDR_LEN (ETHER_HDR_LEN + DOT11_LLC_SNAP_HDR_LEN)
10805 +/* Generic 802.11 MAC header */
10807 + * N.B.: This struct reflects the full 4 address 802.11 MAC header.
10808 + * The fields are defined such that the shorter 1, 2, and 3
10809 + * address headers just use the first k fields.
10811 +struct dot11_header {
10812 + uint16 fc; /* frame control */
10813 + uint16 durid; /* duration/ID */
10814 + struct ether_addr a1; /* address 1 */
10815 + struct ether_addr a2; /* address 2 */
10816 + struct ether_addr a3; /* address 3 */
10817 + uint16 seq; /* sequence control */
10818 + struct ether_addr a4; /* address 4 */
10821 +/* Control frames */
10823 +struct dot11_rts_frame {
10824 + uint16 fc; /* frame control */
10825 + uint16 durid; /* duration/ID */
10826 + struct ether_addr ra; /* receiver address */
10827 + struct ether_addr ta; /* transmitter address */
10829 +#define DOT11_RTS_LEN 16
10831 +struct dot11_cts_frame {
10832 + uint16 fc; /* frame control */
10833 + uint16 durid; /* duration/ID */
10834 + struct ether_addr ra; /* receiver address */
10836 +#define DOT11_CTS_LEN 10
10838 +struct dot11_ack_frame {
10839 + uint16 fc; /* frame control */
10840 + uint16 durid; /* duration/ID */
10841 + struct ether_addr ra; /* receiver address */
10843 +#define DOT11_ACK_LEN 10
10845 +struct dot11_ps_poll_frame {
10846 + uint16 fc; /* frame control */
10847 + uint16 durid; /* AID */
10848 + struct ether_addr bssid; /* receiver address, STA in AP */
10849 + struct ether_addr ta; /* transmitter address */
10851 +#define DOT11_PS_POLL_LEN 16
10853 +struct dot11_cf_end_frame {
10854 + uint16 fc; /* frame control */
10855 + uint16 durid; /* duration/ID */
10856 + struct ether_addr ra; /* receiver address */
10857 + struct ether_addr bssid; /* transmitter address, STA in AP */
10859 +#define DOT11_CS_END_LEN 16
10861 +/* Management frame header */
10862 +struct dot11_management_header {
10863 + uint16 fc; /* frame control */
10864 + uint16 durid; /* duration/ID */
10865 + struct ether_addr da; /* receiver address */
10866 + struct ether_addr sa; /* transmitter address */
10867 + struct ether_addr bssid; /* BSS ID */
10868 + uint16 seq; /* sequence control */
10870 +#define DOT11_MGMT_HDR_LEN 24
10872 +/* Management frame payloads */
10874 +struct dot11_bcn_prb {
10875 + uint32 timestamp[2];
10876 + uint16 beacon_interval;
10877 + uint16 capability;
10879 +#define DOT11_BCN_PRB_LEN 12
10881 +struct dot11_auth {
10882 + uint16 alg; /* algorithm */
10883 + uint16 seq; /* sequence control */
10884 + uint16 status; /* status code */
10886 +#define DOT11_AUTH_FIXED_LEN 6 /* length of auth frame without challenge info elt */
10888 +struct dot11_assoc_req {
10889 + uint16 capability; /* capability information */
10890 + uint16 listen; /* listen interval */
10893 +struct dot11_assoc_resp {
10894 + uint16 capability; /* capability information */
10895 + uint16 status; /* status code */
10896 + uint16 aid; /* association ID */
10899 +struct dot11_action_measure {
10905 +#define DOT11_ACTION_MEASURE_LEN 3
10908 + 802.11h related definitions.
10914 +} dot11_power_cnst_t;
10919 +} dot11_power_cap_t;
10926 +} dot11_tpc_rep_t;
10927 +#define DOT11_MNG_IE_TPC_REPORT_LEN 2 /* length of IE data, not including 2 byte header */
10932 + uint8 first_channel;
10933 + uint8 num_channels;
10934 +} dot11_supp_channels_t;
10936 +struct dot11_channel_switch {
10943 +typedef struct dot11_channel_switch dot11_channel_switch_t;
10945 +/* 802.11h Measurement Request/Report IEs */
10946 +/* Measurement Type field */
10947 +#define DOT11_MEASURE_TYPE_BASIC 0
10948 +#define DOT11_MEASURE_TYPE_CCA 1
10949 +#define DOT11_MEASURE_TYPE_RPI 2
10951 +/* Measurement Mode field */
10953 +/* Measurement Request Modes */
10954 +#define DOT11_MEASURE_MODE_ENABLE (1<<1)
10955 +#define DOT11_MEASURE_MODE_REQUEST (1<<2)
10956 +#define DOT11_MEASURE_MODE_REPORT (1<<3)
10957 +/* Measurement Report Modes */
10958 +#define DOT11_MEASURE_MODE_LATE (1<<0)
10959 +#define DOT11_MEASURE_MODE_INCAPABLE (1<<1)
10960 +#define DOT11_MEASURE_MODE_REFUSED (1<<2)
10961 +/* Basic Measurement Map bits */
10962 +#define DOT11_MEASURE_BASIC_MAP_BSS ((uint8)(1<<0))
10963 +#define DOT11_MEASURE_BASIC_MAP_OFDM ((uint8)(1<<1))
10964 +#define DOT11_MEASURE_BASIC_MAP_UKNOWN ((uint8)(1<<2))
10965 +#define DOT11_MEASURE_BASIC_MAP_RADAR ((uint8)(1<<3))
10966 +#define DOT11_MEASURE_BASIC_MAP_UNMEAS ((uint8)(1<<4))
10975 + uint8 start_time[8];
10977 +} dot11_meas_req_t;
10978 +#define DOT11_MNG_IE_MREQ_LEN 14
10979 +/* length of Measure Request IE data not including variable len */
10980 +#define DOT11_MNG_IE_MREQ_FIXED_LEN 3
10982 +struct dot11_meas_rep {
10992 + uint8 start_time[8];
10999 +typedef struct dot11_meas_rep dot11_meas_rep_t;
11001 +/* length of Measure Report IE data not including variable len */
11002 +#define DOT11_MNG_IE_MREP_FIXED_LEN 3
11004 +struct dot11_meas_rep_basic {
11006 + uint8 start_time[8];
11010 +typedef struct dot11_meas_rep_basic dot11_meas_rep_basic_t;
11011 +#define DOT11_MEASURE_BASIC_REP_LEN 12
11013 +struct dot11_quiet {
11016 + uint8 count; /* TBTTs until beacon interval in quiet starts */
11017 + uint8 period; /* Beacon intervals between periodic quiet periods ? */
11018 + uint16 duration;/* Length of quiet period, in TU's */
11019 + uint16 offset; /* TU's offset from TBTT in Count field */
11021 +typedef struct dot11_quiet dot11_quiet_t;
11026 +} chan_map_tuple_t;
11031 + uint8 eaddr[ETHER_ADDR_LEN];
11033 + chan_map_tuple_t map[1];
11034 +} dot11_ibss_dfs_t;
11037 +/* Macro to take a pointer to a beacon or probe response
11038 + * header and return the char* pointer to the SSID info element
11040 +#define BCN_PRB_SSID(hdr) ((char*)(hdr) + DOT11_MGMT_HDR_LEN + DOT11_BCN_PRB_LEN)
11042 +/* Authentication frame payload constants */
11043 +#define DOT11_OPEN_SYSTEM 0
11044 +#define DOT11_SHARED_KEY 1
11045 +#define DOT11_CHALLENGE_LEN 128
11047 +/* Frame control macros */
11048 +#define FC_PVER_MASK 0x3
11049 +#define FC_PVER_SHIFT 0
11050 +#define FC_TYPE_MASK 0xC
11051 +#define FC_TYPE_SHIFT 2
11052 +#define FC_SUBTYPE_MASK 0xF0
11053 +#define FC_SUBTYPE_SHIFT 4
11054 +#define FC_TODS 0x100
11055 +#define FC_TODS_SHIFT 8
11056 +#define FC_FROMDS 0x200
11057 +#define FC_FROMDS_SHIFT 9
11058 +#define FC_MOREFRAG 0x400
11059 +#define FC_MOREFRAG_SHIFT 10
11060 +#define FC_RETRY 0x800
11061 +#define FC_RETRY_SHIFT 11
11062 +#define FC_PM 0x1000
11063 +#define FC_PM_SHIFT 12
11064 +#define FC_MOREDATA 0x2000
11065 +#define FC_MOREDATA_SHIFT 13
11066 +#define FC_WEP 0x4000
11067 +#define FC_WEP_SHIFT 14
11068 +#define FC_ORDER 0x8000
11069 +#define FC_ORDER_SHIFT 15
11071 +/* sequence control macros */
11072 +#define SEQNUM_SHIFT 4
11073 +#define FRAGNUM_MASK 0xF
11075 +/* Frame Control type/subtype defs */
11078 +#define FC_TYPE_MNG 0
11079 +#define FC_TYPE_CTL 1
11080 +#define FC_TYPE_DATA 2
11082 +/* Management Subtypes */
11083 +#define FC_SUBTYPE_ASSOC_REQ 0
11084 +#define FC_SUBTYPE_ASSOC_RESP 1
11085 +#define FC_SUBTYPE_REASSOC_REQ 2
11086 +#define FC_SUBTYPE_REASSOC_RESP 3
11087 +#define FC_SUBTYPE_PROBE_REQ 4
11088 +#define FC_SUBTYPE_PROBE_RESP 5
11089 +#define FC_SUBTYPE_BEACON 8
11090 +#define FC_SUBTYPE_ATIM 9
11091 +#define FC_SUBTYPE_DISASSOC 10
11092 +#define FC_SUBTYPE_AUTH 11
11093 +#define FC_SUBTYPE_DEAUTH 12
11094 +#define FC_SUBTYPE_ACTION 13
11096 +/* Control Subtypes */
11097 +#define FC_SUBTYPE_PS_POLL 10
11098 +#define FC_SUBTYPE_RTS 11
11099 +#define FC_SUBTYPE_CTS 12
11100 +#define FC_SUBTYPE_ACK 13
11101 +#define FC_SUBTYPE_CF_END 14
11102 +#define FC_SUBTYPE_CF_END_ACK 15
11104 +/* Data Subtypes */
11105 +#define FC_SUBTYPE_DATA 0
11106 +#define FC_SUBTYPE_DATA_CF_ACK 1
11107 +#define FC_SUBTYPE_DATA_CF_POLL 2
11108 +#define FC_SUBTYPE_DATA_CF_ACK_POLL 3
11109 +#define FC_SUBTYPE_NULL 4
11110 +#define FC_SUBTYPE_CF_ACK 5
11111 +#define FC_SUBTYPE_CF_POLL 6
11112 +#define FC_SUBTYPE_CF_ACK_POLL 7
11114 +/* type-subtype combos */
11115 +#define FC_KIND_MASK (FC_TYPE_MASK | FC_SUBTYPE_MASK)
11117 +#define FC_KIND(t, s) (((t) << FC_TYPE_SHIFT) | ((s) << FC_SUBTYPE_SHIFT))
11119 +#define FC_ASSOC_REQ FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_ASSOC_REQ)
11120 +#define FC_ASSOC_RESP FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_ASSOC_RESP)
11121 +#define FC_REASSOC_REQ FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_REASSOC_REQ)
11122 +#define FC_REASSOC_RESP FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_REASSOC_RESP)
11123 +#define FC_PROBE_REQ FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_PROBE_REQ)
11124 +#define FC_PROBE_RESP FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_PROBE_RESP)
11125 +#define FC_BEACON FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_BEACON)
11126 +#define FC_DISASSOC FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_DISASSOC)
11127 +#define FC_AUTH FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_AUTH)
11128 +#define FC_DEAUTH FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_DEAUTH)
11129 +#define FC_ACTION FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_ACTION)
11131 +#define FC_PS_POLL FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_PS_POLL)
11132 +#define FC_RTS FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_RTS)
11133 +#define FC_CTS FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_CTS)
11134 +#define FC_ACK FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_ACK)
11135 +#define FC_CF_END FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_CF_END)
11136 +#define FC_CF_END_ACK FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_CF_END_ACK)
11138 +#define FC_DATA FC_KIND(FC_TYPE_DATA, FC_SUBTYPE_DATA)
11139 +#define FC_NULL_DATA FC_KIND(FC_TYPE_DATA, FC_SUBTYPE_NULL)
11140 +#define FC_DATA_CF_ACK FC_KIND(FC_TYPE_DATA, FC_SUBTYPE_DATA_CF_ACK)
11142 +/* Management Frames */
11144 +/* Management Frame Constants */
11146 +/* Fixed fields */
11147 +#define DOT11_MNG_AUTH_ALGO_LEN 2
11148 +#define DOT11_MNG_AUTH_SEQ_LEN 2
11149 +#define DOT11_MNG_BEACON_INT_LEN 2
11150 +#define DOT11_MNG_CAP_LEN 2
11151 +#define DOT11_MNG_AP_ADDR_LEN 6
11152 +#define DOT11_MNG_LISTEN_INT_LEN 2
11153 +#define DOT11_MNG_REASON_LEN 2
11154 +#define DOT11_MNG_AID_LEN 2
11155 +#define DOT11_MNG_STATUS_LEN 2
11156 +#define DOT11_MNG_TIMESTAMP_LEN 8
11158 +/* DUR/ID field in assoc resp is 0xc000 | AID */
11159 +#define DOT11_AID_MASK 0x3fff
11161 +/* Reason Codes */
11162 +#define DOT11_RC_RESERVED 0
11163 +#define DOT11_RC_UNSPECIFIED 1 /* Unspecified reason */
11164 +#define DOT11_RC_AUTH_INVAL 2 /* Previous authentication no longer valid */
11165 +#define DOT11_RC_DEAUTH_LEAVING 3 /* Deauthenticated because sending station is
11166 + leaving (or has left) IBSS or ESS */
11167 +#define DOT11_RC_INACTIVITY 4 /* Disassociated due to inactivity */
11168 +#define DOT11_RC_BUSY 5 /* Disassociated because AP is unable to handle
11169 + all currently associated stations */
11170 +#define DOT11_RC_INVAL_CLASS_2 6 /* Class 2 frame received from
11171 + nonauthenticated station */
11172 +#define DOT11_RC_INVAL_CLASS_3 7 /* Class 3 frame received from
11173 + nonassociated station */
11174 +#define DOT11_RC_DISASSOC_LEAVING 8 /* Disassociated because sending station is
11175 + leaving (or has left) BSS */
11176 +#define DOT11_RC_NOT_AUTH 9 /* Station requesting (re)association is
11177 + not authenticated with responding station */
11178 +#define DOT11_RC_MAX 23 /* Reason codes > 23 are reserved */
11180 +/* Status Codes */
11181 +#define DOT11_STATUS_SUCCESS 0 /* Successful */
11182 +#define DOT11_STATUS_FAILURE 1 /* Unspecified failure */
11183 +#define DOT11_STATUS_CAP_MISMATCH 10 /* Cannot support all requested capabilities
11184 + in the Capability Information field */
11185 +#define DOT11_STATUS_REASSOC_FAIL 11 /* Reassociation denied due to inability to
11186 + confirm that association exists */
11187 +#define DOT11_STATUS_ASSOC_FAIL 12 /* Association denied due to reason outside
11188 + the scope of this standard */
11189 +#define DOT11_STATUS_AUTH_MISMATCH 13 /* Responding station does not support the
11190 + specified authentication algorithm */
11191 +#define DOT11_STATUS_AUTH_SEQ 14 /* Received an Authentication frame with
11192 + authentication transaction sequence number
11193 + out of expected sequence */
11194 +#define DOT11_STATUS_AUTH_CHALLENGE_FAIL 15 /* Authentication rejected because of challenge failure */
11195 +#define DOT11_STATUS_AUTH_TIMEOUT 16 /* Authentication rejected due to timeout waiting
11196 + for next frame in sequence */
11197 +#define DOT11_STATUS_ASSOC_BUSY_FAIL 17 /* Association denied because AP is unable to
11198 + handle additional associated stations */
11199 +#define DOT11_STATUS_ASSOC_RATE_MISMATCH 18 /* Association denied due to requesting station
11200 + not supporting all of the data rates in the
11201 + BSSBasicRateSet parameter */
11202 +#define DOT11_STATUS_ASSOC_SHORT_REQUIRED 19 /* Association denied due to requesting station
11203 + not supporting the Short Preamble option */
11204 +#define DOT11_STATUS_ASSOC_PBCC_REQUIRED 20 /* Association denied due to requesting station
11205 + not supporting the PBCC Modulation option */
11206 +#define DOT11_STATUS_ASSOC_AGILITY_REQUIRED 21 /* Association denied due to requesting station
11207 + not supporting the Channel Agility option */
11208 +#define DOT11_STATUS_ASSOC_SPECTRUM_REQUIRED 22 /* Association denied because Spectrum Management
11209 + capability is required. */
11210 +#define DOT11_STATUS_ASSOC_BAD_POWER_CAP 23 /* Association denied because the info in the
11211 + Power Cap element is unacceptable. */
11212 +#define DOT11_STATUS_ASSOC_BAD_SUP_CHANNELS 24 /* Association denied because the info in the
11213 + Supported Channel element is unacceptable */
11214 +#define DOT11_STATUS_ASSOC_SHORTSLOT_REQUIRED 25 /* Association denied due to requesting station
11215 + not supporting the Short Slot Time option */
11216 +#define DOT11_STATUS_ASSOC_ERPBCC_REQUIRED 26 /* Association denied due to requesting station
11217 + not supporting the ER-PBCC Modulation option */
11218 +#define DOT11_STATUS_ASSOC_DSSOFDM_REQUIRED 27 /* Association denied due to requesting station
11219 + not supporting the DSS-OFDM option */
11221 +/* Info Elts, length of INFORMATION portion of Info Elts */
11222 +#define DOT11_MNG_DS_PARAM_LEN 1
11223 +#define DOT11_MNG_IBSS_PARAM_LEN 2
11225 +/* TIM Info element has 3 bytes fixed info in INFORMATION field,
11226 + * followed by 1 to 251 bytes of Partial Virtual Bitmap */
11227 +#define DOT11_MNG_TIM_FIXED_LEN 3
11228 +#define DOT11_MNG_TIM_DTIM_COUNT 0
11229 +#define DOT11_MNG_TIM_DTIM_PERIOD 1
11230 +#define DOT11_MNG_TIM_BITMAP_CTL 2
11231 +#define DOT11_MNG_TIM_PVB 3
11234 +#define TLV_TAG_OFF 0
11235 +#define TLV_LEN_OFF 1
11236 +#define TLV_HDR_LEN 2
11237 +#define TLV_BODY_OFF 2
11239 +/* Management Frame Information Element IDs */
11240 +#define DOT11_MNG_SSID_ID 0
11241 +#define DOT11_MNG_RATES_ID 1
11242 +#define DOT11_MNG_FH_PARMS_ID 2
11243 +#define DOT11_MNG_DS_PARMS_ID 3
11244 +#define DOT11_MNG_CF_PARMS_ID 4
11245 +#define DOT11_MNG_TIM_ID 5
11246 +#define DOT11_MNG_IBSS_PARMS_ID 6
11247 +#define DOT11_MNG_COUNTRY_ID 7
11248 +#define DOT11_MNG_HOPPING_PARMS_ID 8
11249 +#define DOT11_MNG_HOPPING_TABLE_ID 9
11250 +#define DOT11_MNG_REQUEST_ID 10
11251 +#define DOT11_MNG_CHALLENGE_ID 16
11252 +#define DOT11_MNG_PWR_CONSTRAINT_ID 32 /* 11H PowerConstraint */
11253 +#define DOT11_MNG_PWR_CAP_ID 33 /* 11H PowerCapability */
11254 +#define DOT11_MNG_TPC_REQUEST_ID 34 /* 11H TPC Request */
11255 +#define DOT11_MNG_TPC_REPORT_ID 35 /* 11H TPC Report */
11256 +#define DOT11_MNG_SUPP_CHANNELS_ID 36 /* 11H Supported Channels */
11257 +#define DOT11_MNG_CHANNEL_SWITCH_ID 37 /* 11H ChannelSwitch Announcement*/
11258 +#define DOT11_MNG_MEASURE_REQUEST_ID 38 /* 11H MeasurementRequest */
11259 +#define DOT11_MNG_MEASURE_REPORT_ID 39 /* 11H MeasurementReport */
11260 +#define DOT11_MNG_QUIET_ID 40 /* 11H Quiet */
11261 +#define DOT11_MNG_IBSS_DFS_ID 41 /* 11H IBSS_DFS */
11262 +#define DOT11_MNG_ERP_ID 42
11263 +#define DOT11_MNG_NONERP_ID 47
11264 +#define DOT11_MNG_EXT_RATES_ID 50
11265 +#define DOT11_MNG_WPA_ID 221
11266 +#define DOT11_MNG_PROPR_ID 221
11268 +/* ERP info element bit values */
11269 +#define DOT11_MNG_ERP_LEN 1 /* ERP is currently 1 byte long */
11270 +#define DOT11_MNG_NONERP_PRESENT 0x01 /* NonERP (802.11b) STAs are present in the BSS */
11271 +#define DOT11_MNG_USE_PROTECTION 0x02 /* Use protection mechanisms for ERP-OFDM frames */
11272 +#define DOT11_MNG_BARKER_PREAMBLE 0x04 /* Short Preambles: 0 == allowed, 1 == not allowed */
11274 +/* Capability Information Field */
11275 +#define DOT11_CAP_ESS 0x0001
11276 +#define DOT11_CAP_IBSS 0x0002
11277 +#define DOT11_CAP_POLLABLE 0x0004
11278 +#define DOT11_CAP_POLL_RQ 0x0008
11279 +#define DOT11_CAP_PRIVACY 0x0010
11280 +#define DOT11_CAP_SHORT 0x0020
11281 +#define DOT11_CAP_PBCC 0x0040
11282 +#define DOT11_CAP_AGILITY 0x0080
11283 +#define DOT11_CAP_SPECTRUM 0x0100
11284 +#define DOT11_CAP_SHORTSLOT 0x0400
11285 +#define DOT11_CAP_CCK_OFDM 0x2000
11287 +/* Action Frame Constants */
11288 +#define DOT11_ACTION_CAT_ERR_MASK 0x10
11289 +#define DOT11_ACTION_CAT_SPECT_MNG 0x00
11291 +#define DOT11_ACTION_ID_M_REQ 0
11292 +#define DOT11_ACTION_ID_M_REP 1
11293 +#define DOT11_ACTION_ID_TPC_REQ 2
11294 +#define DOT11_ACTION_ID_TPC_REP 3
11295 +#define DOT11_ACTION_ID_CHANNEL_SWITCH 4
11297 +/* MLME Enumerations */
11298 +#define DOT11_BSSTYPE_INFRASTRUCTURE 0
11299 +#define DOT11_BSSTYPE_INDEPENDENT 1
11300 +#define DOT11_BSSTYPE_ANY 2
11301 +#define DOT11_SCANTYPE_ACTIVE 0
11302 +#define DOT11_SCANTYPE_PASSIVE 1
11304 +/* 802.11 A PHY constants */
11305 +#define APHY_SLOT_TIME 9
11306 +#define APHY_SIFS_TIME 16
11307 +#define APHY_DIFS_TIME (APHY_SIFS_TIME + (2 * APHY_SLOT_TIME))
11308 +#define APHY_PREAMBLE_TIME 16
11309 +#define APHY_SIGNAL_TIME 4
11310 +#define APHY_SYMBOL_TIME 4
11311 +#define APHY_SERVICE_NBITS 16
11312 +#define APHY_TAIL_NBITS 6
11313 +#define APHY_CWMIN 15
11315 +/* 802.11 B PHY constants */
11316 +#define BPHY_SLOT_TIME 20
11317 +#define BPHY_SIFS_TIME 10
11318 +#define BPHY_DIFS_TIME 50
11319 +#define BPHY_PLCP_TIME 192
11320 +#define BPHY_PLCP_SHORT_TIME 96
11321 +#define BPHY_CWMIN 31
11323 +/* 802.11 G constants */
11324 +#define DOT11_OFDM_SIGNAL_EXTENSION 6
11326 +#define PHY_CWMAX 1023
11328 +#define DOT11_MAXNUMFRAGS 16 /* max # fragments per MSDU */
11330 +/* dot11Counters Table - 802.11 spec., Annex D */
11331 +typedef struct d11cnt {
11332 + uint32 txfrag; /* dot11TransmittedFragmentCount */
11333 + uint32 txmulti; /* dot11MulticastTransmittedFrameCount */
11334 + uint32 txfail; /* dot11FailedCount */
11335 + uint32 txretry; /* dot11RetryCount */
11336 + uint32 txretrie; /* dot11MultipleRetryCount */
11337 + uint32 rxdup; /* dot11FrameduplicateCount */
11338 + uint32 txrts; /* dot11RTSSuccessCount */
11339 + uint32 txnocts; /* dot11RTSFailureCount */
11340 + uint32 txnoack; /* dot11ACKFailureCount */
11341 + uint32 rxfrag; /* dot11ReceivedFragmentCount */
11342 + uint32 rxmulti; /* dot11MulticastReceivedFrameCount */
11343 + uint32 rxcrc; /* dot11FCSErrorCount */
11344 + uint32 txfrmsnt; /* dot11TransmittedFrameCount */
11345 + uint32 rxundec; /* dot11WEPUndecryptableCount */
11349 +#define BRCM_OUI "\x00\x10\x18"
11351 +/* WPA definitions */
11352 +#define WPA_VERSION 1
11353 +#define WPA_OUI "\x00\x50\xF2"
11355 +#define WPA_OUI_LEN 3
11357 +/* WPA authentication modes */
11358 +#define WPA_AUTH_NONE 0 /* None */
11359 +#define WPA_AUTH_UNSPECIFIED 1 /* Unspecified authentication over 802.1X: default for WPA */
11360 +#define WPA_AUTH_PSK 2 /* Pre-shared Key over 802.1X */
11361 +#define WPA_AUTH_DISABLED 255 /* Legacy (i.e., non-WPA) */
11363 +#define IS_WPA_AUTH(auth) ((auth) == WPA_AUTH_NONE || \
11364 + (auth) == WPA_AUTH_UNSPECIFIED || \
11365 + (auth) == WPA_AUTH_PSK)
11368 +/* Key related defines */
11369 +#define DOT11_MAX_KEY_SIZE 32 /* max size of any key */
11370 +#define DOT11_MAX_IV_SIZE 16 /* max size of any IV */
11371 +#define DOT11_EXT_IV_FLAG (1<<5) /* flag to indicate IV is > 4 bytes */
11373 +#define WEP1_KEY_SIZE 5 /* max size of any WEP key */
11374 +#define WEP1_KEY_HEX_SIZE 10 /* size of WEP key in hex. */
11375 +#define WEP128_KEY_SIZE 13 /* max size of any WEP key */
11376 +#define WEP128_KEY_HEX_SIZE 26 /* size of WEP key in hex. */
11377 +#define TKIP_MIC_SIZE 8 /* size of TKIP MIC */
11378 +#define TKIP_EOM_SIZE 7 /* max size of TKIP EOM */
11379 +#define TKIP_EOM_FLAG 0x5a /* TKIP EOM flag byte */
11380 +#define TKIP_KEY_SIZE 32 /* size of any TKIP key */
11381 +#define TKIP_MIC_AUTH_TX 16 /* offset to Authenticator MIC TX key */
11382 +#define TKIP_MIC_AUTH_RX 24 /* offset to Authenticator MIC RX key */
11383 +#define TKIP_MIC_SUP_RX 16 /* offset to Supplicant MIC RX key */
11384 +#define TKIP_MIC_SUP_TX 24 /* offset to Supplicant MIC TX key */
11385 +#define AES_KEY_SIZE 16 /* size of AES key */
11388 +#if !defined(__GNUC__)
11392 +#endif /* _802_11_H_ */
11393 diff -Nur linux-2.6.12.5/arch/mips/bcm947xx/include/proto/ethernet.h linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/proto/ethernet.h
11394 --- linux-2.6.12.5/arch/mips/bcm947xx/include/proto/ethernet.h 1970-01-01 01:00:00.000000000 +0100
11395 +++ linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/proto/ethernet.h 2005-08-28 11:12:20.450856112 +0200
11397 +/*******************************************************************************
11399 + * Copyright 2001-2003, Broadcom Corporation
11400 + * All Rights Reserved.
11402 + * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
11403 + * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
11404 + * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
11405 + * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
11406 + * From FreeBSD 2.2.7: Fundamental constants relating to ethernet.
11407 + ******************************************************************************/
11409 +#ifndef _NET_ETHERNET_H_ /* use native BSD ethernet.h when available */
11410 +#define _NET_ETHERNET_H_
11412 +#ifndef _TYPEDEFS_H_
11413 +#include "typedefs.h"
11416 +#if defined(__GNUC__)
11417 +#define PACKED __attribute__((packed))
11423 + * The number of bytes in an ethernet (MAC) address.
11425 +#define ETHER_ADDR_LEN 6
11428 + * The number of bytes in the type field.
11430 +#define ETHER_TYPE_LEN 2
11433 + * The number of bytes in the trailing CRC field.
11435 +#define ETHER_CRC_LEN 4
11438 + * The length of the combined header.
11440 +#define ETHER_HDR_LEN (ETHER_ADDR_LEN*2+ETHER_TYPE_LEN)
11443 + * The minimum packet length.
11445 +#define ETHER_MIN_LEN 64
11448 + * The minimum packet user data length.
11450 +#define ETHER_MIN_DATA 46
11453 + * The maximum packet length.
11455 +#define ETHER_MAX_LEN 1518
11458 + * The maximum packet user data length.
11460 +#define ETHER_MAX_DATA 1500
11463 + * Used to uniquely identify a 802.1q VLAN-tagged header.
11465 +#define VLAN_TAG 0x8100
11468 + * Located after dest & src address in ether header.
11470 +#define VLAN_FIELDS_OFFSET (ETHER_ADDR_LEN * 2)
11473 + * 4 bytes of vlan field info.
11475 +#define VLAN_FIELDS_SIZE 4
11477 +/* location of pri bits in 16-bit vlan fields */
11478 +#define VLAN_PRI_SHIFT 13
11480 +/* 3 bits of priority */
11481 +#define VLAN_PRI_MASK 7
11483 +/* 802.1X ethertype */
11484 +#define ETHER_TYPE_802_1X 0x888e
11487 + * A macro to validate a length with
11489 +#define ETHER_IS_VALID_LEN(foo) \
11490 + ((foo) >= ETHER_MIN_LEN && (foo) <= ETHER_MAX_LEN)
11493 +#ifndef __INCif_etherh /* Quick and ugly hack for VxWorks */
11495 + * Structure of a 10Mb/s Ethernet header.
11497 +struct ether_header {
11498 + uint8 ether_dhost[ETHER_ADDR_LEN];
11499 + uint8 ether_shost[ETHER_ADDR_LEN];
11500 + uint16 ether_type;
11504 + * Structure of a 48-bit Ethernet address.
11506 +struct ether_addr {
11507 + uint8 octet[ETHER_ADDR_LEN];
11512 + * Takes a pointer, returns true if a 48-bit multicast address
11513 + * (including broadcast, since it is all ones)
11515 +#define ETHER_ISMULTI(ea) (((uint8 *)(ea))[0] & 1)
11518 + * Takes a pointer, returns true if a 48-bit broadcast (all ones)
11520 +#define ETHER_ISBCAST(ea) ((((uint8 *)(ea))[0] & \
11521 + ((uint8 *)(ea))[1] & \
11522 + ((uint8 *)(ea))[2] & \
11523 + ((uint8 *)(ea))[3] & \
11524 + ((uint8 *)(ea))[4] & \
11525 + ((uint8 *)(ea))[5]) == 0xff)
11527 +static const struct ether_addr ether_bcast = {{255, 255, 255, 255, 255, 255}};
11530 + * Takes a pointer, returns true if a 48-bit null address (all zeros)
11532 +#define ETHER_ISNULLADDR(ea) ((((uint8 *)(ea))[0] | \
11533 + ((uint8 *)(ea))[1] | \
11534 + ((uint8 *)(ea))[2] | \
11535 + ((uint8 *)(ea))[3] | \
11536 + ((uint8 *)(ea))[4] | \
11537 + ((uint8 *)(ea))[5]) == 0)
11541 +#endif /* _NET_ETHERNET_H_ */
11542 diff -Nur linux-2.6.12.5/arch/mips/bcm947xx/include/rts/crc.h linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/rts/crc.h
11543 --- linux-2.6.12.5/arch/mips/bcm947xx/include/rts/crc.h 1970-01-01 01:00:00.000000000 +0100
11544 +++ linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/rts/crc.h 2005-08-28 11:12:20.451855960 +0200
11546 +/*******************************************************************************
11548 + * Copyright 2001-2003, Broadcom Corporation
11549 + * All Rights Reserved.
11551 + * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
11552 + * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
11553 + * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
11554 + * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
11555 + * crc.h - a function to compute crc for iLine10 headers
11556 + ******************************************************************************/
11558 +#ifndef _RTS_CRC_H_
11559 +#define _RTS_CRC_H_ 1
11561 +#include "typedefs.h"
11563 +#ifdef __cplusplus
11568 +#define CRC8_INIT_VALUE 0xff /* Initial CRC8 checksum value */
11569 +#define CRC8_GOOD_VALUE 0x9f /* Good final CRC8 checksum value */
11570 +#define HCS_GOOD_VALUE 0x39 /* Good final header checksum value */
11572 +#define CRC16_INIT_VALUE 0xffff /* Initial CRC16 checksum value */
11573 +#define CRC16_GOOD_VALUE 0xf0b8 /* Good final CRC16 checksum value */
11575 +#define CRC32_INIT_VALUE 0xffffffff /* Initial CRC32 checksum value */
11576 +#define CRC32_GOOD_VALUE 0xdebb20e3 /* Good final CRC32 checksum value */
11578 +void hcs(uint8 *, uint);
11579 +uint8 crc8(uint8 *, uint, uint8);
11580 +uint16 crc16(uint8 *, uint, uint16);
11581 +uint32 crc32(uint8 *, uint, uint32);
11583 +/* macros for common usage */
11585 +#define APPEND_CRC8(pbytes, nbytes) \
11587 + uint8 tmp = crc8(pbytes, nbytes, CRC8_INIT_VALUE) ^ 0xff; \
11588 + (pbytes)[(nbytes)] = tmp; \
11592 +#define APPEND_CRC16(pbytes, nbytes) \
11594 + uint16 tmp = crc16(pbytes, nbytes, CRC16_INIT_VALUE) ^ 0xffff; \
11595 + (pbytes)[(nbytes) + 0] = (tmp >> 0) & 0xff; \
11596 + (pbytes)[(nbytes) + 1] = (tmp >> 8) & 0xff; \
11600 +#define APPEND_CRC32(pbytes, nbytes) \
11602 + uint32 tmp = crc32(pbytes, nbytes, CRC32_INIT_VALUE) ^ 0xffffffff; \
11603 + (pbytes)[(nbytes) + 0] = (tmp >> 0) & 0xff; \
11604 + (pbytes)[(nbytes) + 1] = (tmp >> 8) & 0xff; \
11605 + (pbytes)[(nbytes) + 2] = (tmp >> 16) & 0xff; \
11606 + (pbytes)[(nbytes) + 3] = (tmp >> 24) & 0xff; \
11610 +#ifdef __cplusplus
11614 +#endif /* _RTS_CRC_H_ */
11615 diff -Nur linux-2.6.12.5/arch/mips/bcm947xx/include/s5.h linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/s5.h
11616 --- linux-2.6.12.5/arch/mips/bcm947xx/include/s5.h 1970-01-01 01:00:00.000000000 +0100
11617 +++ linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/s5.h 2005-08-28 11:12:20.451855960 +0200
11622 + * Copyright 2003, Broadcom Corporation
11623 + * All Rights Reserved.
11625 + * Broadcom Sentry5 (S5) BCM5365, 53xx, BCM58xx SOC Internal Core
11626 + * and MIPS3301 (R4K) System Address Space
11628 + * This program is free software; you can redistribute it and/or
11629 + * modify it under the terms of the GNU General Public License as
11630 + * published by the Free Software Foundation, located in the file
11633 + * $Id: s5.h,v 1.3 2003/06/10 18:54:51 jfd Exp $
11637 +/* BCM5365 Address map */
11638 +#define KSEG1ADDR(x) ( (x) | 0xa0000000)
11639 +#define BCM5365_SDRAM 0x00000000 /* 0-128MB Physical SDRAM */
11640 +#define BCM5365_PCI_MEM 0x08000000 /* Host Mode PCI mem space (64MB) */
11641 +#define BCM5365_PCI_CFG 0x0c000000 /* Host Mode PCI cfg space (64MB) */
11642 +#define BCM5365_PCI_DMA 0x40000000 /* Client Mode PCI mem space (1GB)*/
11643 +#define BCM5365_SDRAM_SWAPPED 0x10000000 /* Byteswapped Physical SDRAM */
11644 +#define BCM5365_ENUM 0x18000000 /* Beginning of core enum space */
11646 +/* BCM5365 Core register space */
11647 +#define BCM5365_REG_CHIPC 0x18000000 /* Chipcommon registers */
11648 +#define BCM5365_REG_EMAC0 0x18001000 /* Ethernet MAC0 core registers */
11649 +#define BCM5365_REG_IPSEC 0x18002000 /* BCM582x CryptoCore registers */
11650 +#define BCM5365_REG_USB 0x18003000 /* USB core registers */
11651 +#define BCM5365_REG_PCI 0x18004000 /* PCI core registers */
11652 +#define BCM5365_REG_MIPS33 0x18005000 /* MIPS core registers */
11653 +#define BCM5365_REG_MEMC 0x18006000 /* MEMC core registers */
11654 +#define BCM5365_REG_UARTS (BCM5365_REG_CHIPC + 0x300) /* UART regs */
11655 +#define BCM5365_EJTAG 0xff200000 /* MIPS EJTAG space (2M) */
11657 +/* COM Ports 1/2 */
11658 +#define BCM5365_UART (BCM5365_REG_UARTS)
11659 +#define BCM5365_UART_COM2 (BCM5365_REG_UARTS + 0x00000100)
11661 +/* Registers common to MIPS33 Core used in 5365 */
11662 +#define MIPS33_FLASH_REGION 0x1fc00000 /* Boot FLASH Region */
11663 +#define MIPS33_EXTIF_REGION 0x1a000000 /* Chipcommon EXTIF region*/
11664 +#define BCM5365_EXTIF 0x1b000000 /* MISC_CS */
11665 +#define MIPS33_FLASH_REGION_AUX 0x1c000000 /* FLASH Region 2*/
11667 +/* Internal Core Sonics Backplane Devices */
11668 +#define INTERNAL_UART_COM1 BCM5365_UART
11669 +#define INTERNAL_UART_COM2 BCM5365_UART_COM2
11670 +#define SB_REG_CHIPC BCM5365_REG_CHIPC
11671 +#define SB_REG_ENET0 BCM5365_REG_EMAC0
11672 +#define SB_REG_IPSEC BCM5365_REG_IPSEC
11673 +#define SB_REG_USB BCM5365_REG_USB
11674 +#define SB_REG_PCI BCM5365_REG_PCI
11675 +#define SB_REG_MIPS BCM5365_REG_MIPS33
11676 +#define SB_REG_MEMC BCM5365_REG_MEMC
11677 +#define SB_REG_MEMC_OFF 0x6000
11678 +#define SB_EXTIF_SPACE MIPS33_EXTIF_REGION
11679 +#define SB_FLASH_SPACE MIPS33_FLASH_REGION
11683 + * 5365-specific backplane interrupt flag numbers. This should be done
11684 + * dynamically instead.
11686 +#define SBFLAG_PCI 0
11687 +#define SBFLAG_ENET0 1
11688 +#define SBFLAG_ILINE20 2
11689 +#define SBFLAG_CODEC 3
11690 +#define SBFLAG_USB 4
11691 +#define SBFLAG_EXTIF 5
11692 +#define SBFLAG_ENET1 6
11694 +/* BCM95365 Local Bus devices */
11695 +#define BCM95365K_RESET_ADDR BCM5365_EXTIF
11696 +#define BCM95365K_BOARDID_ADDR (BCM5365_EXTIF | 0x4000)
11697 +#define BCM95365K_DOC_ADDR (BCM5365_EXTIF | 0x6000)
11698 +#define BCM95365K_LED_ADDR (BCM5365_EXTIF | 0xc000)
11699 +#define BCM95365K_TOD_REG_BASE (BCM95365K_NVRAM_ADDR | 0x1ff0)
11700 +#define BCM95365K_NVRAM_ADDR (BCM5365_EXTIF | 0xe000)
11701 +#define BCM95365K_NVRAM_SIZE 0x1ff0 /* 8K NVRAM : DS1743/STM48txx*/
11703 +/* Write to DLR2416 VFD Display character RAM */
11704 +#define LED_REG(x) \
11705 + (*(volatile unsigned char *) (KSEG1ADDR(BCM95365K_LED_ADDR) + (x)))
11707 +#ifdef CONFIG_VSIM
11708 +#define BCM5365_TRACE(trval) do { *((int *)0xa0002ff8) = (trval); \
11711 +#define BCM5365_TRACE(trval) do { *((unsigned char *)\
11712 + KSEG1ADDR(BCM5365K_LED_ADDR)) = (trval); \
11713 + *((int *)0xa0002ff8) = (trval); } while (0)
11716 +/* BCM9536R Local Bus devices */
11717 +#define BCM95365R_DOC_ADDR BCM5365_EXTIF
11721 +#endif /*!_S5_H_ */
11722 diff -Nur linux-2.6.12.5/arch/mips/bcm947xx/include/sbchipc.h linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/sbchipc.h
11723 --- linux-2.6.12.5/arch/mips/bcm947xx/include/sbchipc.h 1970-01-01 01:00:00.000000000 +0100
11724 +++ linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/sbchipc.h 2005-08-28 11:12:20.468853376 +0200
11727 + * SiliconBackplane Chipcommon core hardware definitions.
11729 + * The chipcommon core provides chip identification, SB control,
11730 + * jtag, 0/1/2 uarts, clock frequency control, a watchdog interrupt timer,
11731 + * gpio interface, extbus, and support for serial and parallel flashes.
11733 + * Copyright 2001-2003, Broadcom Corporation
11734 + * All Rights Reserved.
11736 + * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
11737 + * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
11738 + * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
11739 + * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
11744 +#ifndef _SBCHIPC_H
11745 +#define _SBCHIPC_H
11748 +/* cpp contortions to concatenate w/arg prescan */
11750 +#define _PADLINE(line) pad ## line
11751 +#define _XSTR(line) _PADLINE(line)
11752 +#define PAD _XSTR(__LINE__)
11755 +typedef volatile struct {
11756 + uint32 chipid; /* 0x0 */
11757 + uint32 capabilities;
11758 + uint32 corecontrol; /* corerev >= 1 */
11761 + /* Interrupt control */
11762 + uint32 intstatus; /* 0x20 */
11766 + /* serial flash interface registers */
11767 + uint32 flashcontrol; /* 0x40 */
11768 + uint32 flashaddress;
11769 + uint32 flashdata;
11772 + /* Silicon backplane configuration broadcast control */
11773 + uint32 broadcastaddress;
11774 + uint32 broadcastdata;
11777 + /* gpio - cleared only by power-on-reset */
11778 + uint32 gpioin; /* 0x60 */
11780 + uint32 gpioouten;
11781 + uint32 gpiocontrol;
11782 + uint32 gpiointpolarity;
11783 + uint32 gpiointmask;
11786 + /* Watchdog timer */
11787 + uint32 watchdog; /* 0x80 */
11790 + /* clock control */
11791 + uint32 clockcontrol_n; /* 0x90 */
11792 + uint32 clockcontrol_sb; /* aka m0 */
11793 + uint32 clockcontrol_pci; /* aka m1 */
11794 + uint32 clockcontrol_m2; /* mii/uart/mipsref */
11795 + uint32 clockcontrol_mips; /* aka m3 */
11796 + uint32 uart_clkdiv; /* corerev >= 3 */
11799 + /* pll delay registers (corerev >= 4) */
11800 + uint32 pll_on_delay; /* 0xb0 */
11801 + uint32 fref_sel_delay;
11802 + uint32 slow_clk_ctl;
11805 + /* ExtBus control registers (corerev >= 3) */
11806 + uint32 cs01config; /* 0x100 */
11807 + uint32 cs01memwaitcnt;
11808 + uint32 cs01attrwaitcnt;
11809 + uint32 cs01iowaitcnt;
11810 + uint32 cs23config;
11811 + uint32 cs23memwaitcnt;
11812 + uint32 cs23attrwaitcnt;
11813 + uint32 cs23iowaitcnt;
11814 + uint32 cs4config;
11815 + uint32 cs4waitcnt;
11816 + uint32 parallelflashconfig;
11817 + uint32 parallelflashwaitcnt;
11821 + uint8 uart0data; /* 0x300 */
11828 + uint8 uart0scratch;
11829 + uint8 PAD[248]; /* corerev >= 1 */
11831 + uint8 uart1data; /* 0x400 */
11838 + uint8 uart1scratch;
11842 +#define CID_ID_MASK 0x0000ffff /* Chip Id mask */
11843 +#define CID_REV_MASK 0x000f0000 /* Chip Revision mask */
11844 +#define CID_REV_SHIFT 16 /* Chip Revision shift */
11845 +#define CID_PKG_MASK 0x00f00000 /* Package Option mask */
11846 +#define CID_PKG_SHIFT 20 /* Package Option shift */
11847 +#define CID_CC_MASK 0x0f000000 /* CoreCount (corerev >= 4) */
11848 +#define CID_CC_SHIFT 24
11850 +/* capabilities */
11851 +#define CAP_UARTS_MASK 0x00000003 /* Number of uarts */
11852 +#define CAP_MIPSEB 0x00000004 /* MIPS is in big-endian mode */
11853 +#define CAP_UCLKSEL 0x00000018 /* UARTs clock select */
11854 +#define CAP_UINTCLK 0x00000008 /* UARTs are driven by internal divided clock */
11855 +#define CAP_UARTGPIO 0x00000020 /* UARTs own Gpio's 15:12 */
11856 +#define CAP_EXTBUS 0x00000040 /* External bus present */
11857 +#define CAP_FLASH_MASK 0x00000700 /* Type of flash */
11858 +#define CAP_PLL_MASK 0x00038000 /* Type of PLL */
11859 +#define CAP_PWR_CTL 0x00040000 /* Power control */
11862 +#define PLL_NONE 0x00000000
11863 +#define PLL_TYPE1 0x00010000 /* 48Mhz base, 3 dividers */
11864 +#define PLL_TYPE2 0x00020000 /* 48Mhz, 4 dividers */
11865 +#define PLL_TYPE3 0x00030000 /* 25Mhz, 2 dividers */
11866 +#define PLL_TYPE4 0x00008000 /* 48Mhz, 4 dividers */
11869 +#define CC_UARTCLKO 0x00000001 /* Drive UART with internal clock */
11870 +#define CC_SE 0x00000002 /* sync clk out enable (corerev >= 3) */
11872 +/* intstatus/intmask */
11873 +#define CI_EI 0x00000002 /* ro: ext intr pin (corerev >= 3) */
11875 +/* slow_clk_ctl */
11876 +#define SCC_SS_MASK 0x00000007 /* slow clock source mask */
11877 +#define SCC_SS_LPO 0x00000000 /* source of slow clock is LPO */
11878 +#define SCC_SS_XTAL 0x00000001 /* source of slow clock is crystal */
11879 +#define SCC_SS_PCI 0x00000002 /* source of slow clock is PCI */
11880 +#define SCC_LF 0x00000200 /* LPOFreqSel, 1: 160Khz, 0: 32KHz */
11881 +#define SCC_LP 0x00000400 /* LPOPowerDown, 1: LPO is disabled, 0: LPO is enabled */
11882 +#define SCC_FS 0x00000800 /* ForceSlowClk, 1: sb/cores running on slow clock, 0: power logic control */
11883 +#define SCC_IP 0x00001000 /* IgnorePllOffReq, 1/0: power logic ignores/honors PLL clock disable requests from core */
11884 +#define SCC_XC 0x00002000 /* XtalControlEn, 1/0: power logic does/doesn't disable crystal when appropriate */
11885 +#define SCC_XP 0x00004000 /* XtalPU (RO), 1/0: crystal running/disabled */
11886 +#define SCC_CD_MASK 0xffff0000 /* ClockDivider mask, SlowClk = 1/(4+divisor) * crystal/PCI clock */
11887 +#define SCC_CD_SHF 16 /* CLockDivider shift */
11889 +/* clockcontrol_n */
11890 +#define CN_N1_MASK 0x3f /* n1 control */
11891 +#define CN_N2_MASK 0x3f00 /* n2 control */
11892 +#define CN_N2_SHIFT 8
11894 +/* clockcontrol_sb/pci/uart */
11895 +#define CC_M1_MASK 0x3f /* m1 control */
11896 +#define CC_M2_MASK 0x3f00 /* m2 control */
11897 +#define CC_M2_SHIFT 8
11898 +#define CC_M3_MASK 0x3f0000 /* m3 control */
11899 +#define CC_M3_SHIFT 16
11900 +#define CC_MC_MASK 0x1f000000 /* mux control */
11901 +#define CC_MC_SHIFT 24
11903 +/* N3M Clock control values for 125Mhz */
11904 +#define CC_125_N 0x0802 /* Default values for bcm4310 */
11905 +#define CC_125_M 0x04020009
11906 +#define CC_125_M25 0x11090009
11907 +#define CC_125_M33 0x11090005
11909 +/* N3M Clock control magic field values */
11910 +#define CC_F6_2 0x02 /* A factor of 2 in */
11911 +#define CC_F6_3 0x03 /* 6-bit fields like */
11912 +#define CC_F6_4 0x05 /* N1, M1 or M3 */
11913 +#define CC_F6_5 0x09
11914 +#define CC_F6_6 0x11
11915 +#define CC_F6_7 0x21
11917 +#define CC_F5_BIAS 5 /* 5-bit fields get this added */
11919 +#define CC_MC_BYPASS 0x08
11920 +#define CC_MC_M1 0x04
11921 +#define CC_MC_M1M2 0x02
11922 +#define CC_MC_M1M2M3 0x01
11923 +#define CC_MC_M1M3 0x11
11925 +/* Type 2 Clock control magic field values */
11926 +#define CC_T2_BIAS 2 /* n1, n2, m1 & m3 bias */
11927 +#define CC_T2M2_BIAS 3 /* m2 bias */
11929 +#define CC_T2MC_M1BYP 1
11930 +#define CC_T2MC_M2BYP 2
11931 +#define CC_T2MC_M3BYP 4
11933 +/* Common clock base */
11934 +#define CC_CLOCK_BASE 24000000 /* Half the clock freq */
11936 +/* Flash types in the chipcommon capabilities register */
11937 +#define FLASH_NONE 0x000 /* No flash */
11938 +#define SFLASH_ST 0x100 /* ST serial flash */
11939 +#define SFLASH_AT 0x200 /* Atmel serial flash */
11940 +#define PFLASH 0x700 /* Parallel flash */
11942 +/* Bits in the config registers */
11943 +#define CC_CFG_EN 0x0001 /* Enable */
11944 +#define CC_CFG_EM_MASK 0x000e /* Extif Mode */
11945 +#define CC_CFG_EM_ASYNC 0x0002 /* Async/Parallel flash */
11946 +#define CC_CFG_EM_SYNC 0x0004 /* Synchronous */
11947 +#define CC_CFG_EM_PCMCIA 0x0008 /* PCMCIA */
11948 +#define CC_CFG_EM_IDE 0x000a /* IDE */
11949 +#define CC_CFG_DS 0x0010 /* Data size, 0=8bit, 1=16bit */
11950 +#define CC_CFG_CD_MASK 0x0060 /* Sync: Clock divisor */
11951 +#define CC_CFG_CE 0x0080 /* Sync: Clock enable */
11952 +#define CC_CFG_SB 0x0100 /* Sync: Size/Bytestrobe */
11954 +/* Start/busy bit in flashcontrol */
11955 +#define SFLASH_START 0x80000000
11956 +#define SFLASH_BUSY SFLASH_START
11958 +/* flashcontrol opcodes for ST flashes */
11959 +#define SFLASH_ST_WREN 0x0006 /* Write Enable */
11960 +#define SFLASH_ST_WRDIS 0x0004 /* Write Disable */
11961 +#define SFLASH_ST_RDSR 0x0105 /* Read Status Register */
11962 +#define SFLASH_ST_WRSR 0x0101 /* Write Status Register */
11963 +#define SFLASH_ST_READ 0x0303 /* Read Data Bytes */
11964 +#define SFLASH_ST_PP 0x0302 /* Page Program */
11965 +#define SFLASH_ST_SE 0x02d8 /* Sector Erase */
11966 +#define SFLASH_ST_BE 0x00c7 /* Bulk Erase */
11967 +#define SFLASH_ST_DP 0x00b9 /* Deep Power-down */
11968 +#define SFLASH_ST_RES 0x03ab /* Read Electronic Signature */
11970 +/* Status register bits for ST flashes */
11971 +#define SFLASH_ST_WIP 0x01 /* Write In Progress */
11972 +#define SFLASH_ST_WEL 0x02 /* Write Enable Latch */
11973 +#define SFLASH_ST_BP_MASK 0x1c /* Block Protect */
11974 +#define SFLASH_ST_BP_SHIFT 2
11975 +#define SFLASH_ST_SRWD 0x80 /* Status Register Write Disable */
11977 +/* flashcontrol opcodes for Atmel flashes */
11978 +#define SFLASH_AT_READ 0x07e8
11979 +#define SFLASH_AT_PAGE_READ 0x07d2
11980 +#define SFLASH_AT_BUF1_READ
11981 +#define SFLASH_AT_BUF2_READ
11982 +#define SFLASH_AT_STATUS 0x01d7
11983 +#define SFLASH_AT_BUF1_WRITE 0x0384
11984 +#define SFLASH_AT_BUF2_WRITE 0x0387
11985 +#define SFLASH_AT_BUF1_ERASE_PROGRAM 0x0283
11986 +#define SFLASH_AT_BUF2_ERASE_PROGRAM 0x0286
11987 +#define SFLASH_AT_BUF1_PROGRAM 0x0288
11988 +#define SFLASH_AT_BUF2_PROGRAM 0x0289
11989 +#define SFLASH_AT_PAGE_ERASE 0x0281
11990 +#define SFLASH_AT_BLOCK_ERASE 0x0250
11991 +#define SFLASH_AT_BUF1_WRITE_ERASE_PROGRAM 0x0382
11992 +#define SFLASH_AT_BUF2_WRITE_ERASE_PROGRAM 0x0385
11993 +#define SFLASH_AT_BUF1_LOAD 0x0253
11994 +#define SFLASH_AT_BUF2_LOAD 0x0255
11995 +#define SFLASH_AT_BUF1_COMPARE 0x0260
11996 +#define SFLASH_AT_BUF2_COMPARE 0x0261
11997 +#define SFLASH_AT_BUF1_REPROGRAM 0x0258
11998 +#define SFLASH_AT_BUF2_REPROGRAM 0x0259
12000 +/* Status register bits for Atmel flashes */
12001 +#define SFLASH_AT_READY 0x80
12002 +#define SFLASH_AT_MISMATCH 0x40
12003 +#define SFLASH_AT_ID_MASK 0x38
12004 +#define SFLASH_AT_ID_SHIFT 3
12006 +#endif /* _SBCHIPC_H */
12007 diff -Nur linux-2.6.12.5/arch/mips/bcm947xx/include/sbconfig.h linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/sbconfig.h
12008 --- linux-2.6.12.5/arch/mips/bcm947xx/include/sbconfig.h 1970-01-01 01:00:00.000000000 +0100
12009 +++ linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/sbconfig.h 2005-08-28 11:12:20.469853224 +0200
12012 + * Broadcom SiliconBackplane hardware register definitions.
12014 + * Copyright 2001-2003, Broadcom Corporation
12015 + * All Rights Reserved.
12017 + * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
12018 + * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
12019 + * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
12020 + * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
12024 +#ifndef _SBCONFIG_H
12025 +#define _SBCONFIG_H
12027 +/* cpp contortions to concatenate w/arg prescan */
12029 +#define _PADLINE(line) pad ## line
12030 +#define _XSTR(line) _PADLINE(line)
12031 +#define PAD _XSTR(__LINE__)
12035 + * SiliconBackplane Address Map.
12036 + * All regions may not exist on all chips.
12038 +#define SB_SDRAM_BASE 0x00000000 /* Physical SDRAM */
12039 +#define SB_PCI_MEM 0x08000000 /* Host Mode PCI memory access space (64 MB) */
12040 +#define SB_PCI_CFG 0x0c000000 /* Host Mode PCI configuration space (64 MB) */
12041 +#define SB_SDRAM_SWAPPED 0x10000000 /* Byteswapped Physical SDRAM */
12042 +#define SB_ENUM_BASE 0x18000000 /* Enumeration space base */
12043 +#define SB_ENUM_LIM 0x18010000 /* Enumeration space limit */
12044 +#define SB_EXTIF_BASE 0x1f000000 /* External Interface region base address */
12045 +#define SB_PCI_DMA 0x40000000 /* Client Mode PCI memory access space (1 GB) */
12046 +#define SB_EUART (SB_EXTIF_BASE + 0x00800000)
12047 +#define SB_LED (SB_EXTIF_BASE + 0x00900000)
12049 +/* enumeration space related defs */
12050 +#define SB_CORE_SIZE 0x1000 /* each core gets 4Kbytes for registers */
12051 +#define SB_MAXCORES ((SB_ENUM_LIM - SB_ENUM_BASE)/SB_CORE_SIZE)
12052 +#define SBCONFIGOFF 0xf00 /* core sbconfig regs are top 256bytes of regs */
12053 +#define SBCONFIGSIZE 256 /* sizeof (sbconfig_t) */
12055 +/* mips address */
12056 +#define SB_EJTAG 0xff200000 /* MIPS EJTAG space (2M) */
12059 + * Sonics Configuration Space Registers.
12061 +#ifdef _LANGUAGE_ASSEMBLY
12063 +#define SBIPSFLAG 0x08
12064 +#define SBTPSFLAG 0x18
12065 +#define SBTMERRLOGA 0x48 /* sonics >= 2.3 */
12066 +#define SBTMERRLOG 0x50 /* sonics >= 2.3 */
12067 +#define SBADMATCH3 0x60
12068 +#define SBADMATCH2 0x68
12069 +#define SBADMATCH1 0x70
12070 +#define SBIMSTATE 0x90
12071 +#define SBINTVEC 0x94
12072 +#define SBTMSTATELOW 0x98
12073 +#define SBTMSTATEHIGH 0x9c
12074 +#define SBBWA0 0xa0
12075 +#define SBIMCONFIGLOW 0xa8
12076 +#define SBIMCONFIGHIGH 0xac
12077 +#define SBADMATCH0 0xb0
12078 +#define SBTMCONFIGLOW 0xb8
12079 +#define SBTMCONFIGHIGH 0xbc
12080 +#define SBBCONFIG 0xc0
12081 +#define SBBSTATE 0xc8
12082 +#define SBACTCNFG 0xd8
12083 +#define SBFLAGST 0xe8
12084 +#define SBIDLOW 0xf8
12085 +#define SBIDHIGH 0xfc
12090 +typedef volatile struct _sbconfig {
12092 + uint32 sbipsflag; /* initiator port ocp slave flag */
12094 + uint32 sbtpsflag; /* target port ocp slave flag */
12096 + uint32 sbtmerrloga; /* (sonics >= 2.3) */
12098 + uint32 sbtmerrlog; /* (sonics >= 2.3) */
12100 + uint32 sbadmatch3; /* address match3 */
12102 + uint32 sbadmatch2; /* address match2 */
12104 + uint32 sbadmatch1; /* address match1 */
12106 + uint32 sbimstate; /* initiator agent state */
12107 + uint32 sbintvec; /* interrupt mask */
12108 + uint32 sbtmstatelow; /* target state */
12109 + uint32 sbtmstatehigh; /* target state */
12110 + uint32 sbbwa0; /* bandwidth allocation table0 */
12112 + uint32 sbimconfiglow; /* initiator configuration */
12113 + uint32 sbimconfighigh; /* initiator configuration */
12114 + uint32 sbadmatch0; /* address match0 */
12116 + uint32 sbtmconfiglow; /* target configuration */
12117 + uint32 sbtmconfighigh; /* target configuration */
12118 + uint32 sbbconfig; /* broadcast configuration */
12120 + uint32 sbbstate; /* broadcast state */
12122 + uint32 sbactcnfg; /* activate configuration */
12124 + uint32 sbflagst; /* current sbflags */
12126 + uint32 sbidlow; /* identification */
12127 + uint32 sbidhigh; /* identification */
12130 +#endif /* _LANGUAGE_ASSEMBLY */
12133 +#define SBIPS_INT1_MASK 0x3f /* which sbflags get routed to mips interrupt 1 */
12134 +#define SBIPS_INT1_SHIFT 0
12135 +#define SBIPS_INT2_MASK 0x3f00 /* which sbflags get routed to mips interrupt 2 */
12136 +#define SBIPS_INT2_SHIFT 8
12137 +#define SBIPS_INT3_MASK 0x3f0000 /* which sbflags get routed to mips interrupt 3 */
12138 +#define SBIPS_INT3_SHIFT 16
12139 +#define SBIPS_INT4_MASK 0x3f000000 /* which sbflags get routed to mips interrupt 4 */
12140 +#define SBIPS_INT4_SHIFT 24
12143 +#define SBTPS_NUM0_MASK 0x3f /* interrupt sbFlag # generated by this core */
12144 +#define SBTPS_F0EN0 0x40 /* interrupt is always sent on the backplane */
12147 +#define SBTMEL_CM 0x00000007 /* command */
12148 +#define SBTMEL_CI 0x0000ff00 /* connection id */
12149 +#define SBTMEL_EC 0x0f000000 /* error code */
12150 +#define SBTMEL_ME 0x80000000 /* multiple error */
12153 +#define SBIM_PC 0xf /* pipecount */
12154 +#define SBIM_AP_MASK 0x30 /* arbitration policy */
12155 +#define SBIM_AP_BOTH 0x00 /* use both timeslaces and token */
12156 +#define SBIM_AP_TS 0x10 /* use timesliaces only */
12157 +#define SBIM_AP_TK 0x20 /* use token only */
12158 +#define SBIM_AP_RSV 0x30 /* reserved */
12159 +#define SBIM_IBE 0x20000 /* inbanderror */
12160 +#define SBIM_TO 0x40000 /* timeout */
12161 +#define SBIM_BY 0x01800000 /* busy (sonics >= 2.3) */
12162 +#define SBIM_RJ 0x02000000 /* reject (sonics >= 2.3) */
12164 +/* sbtmstatelow */
12165 +#define SBTML_RESET 0x1 /* reset */
12166 +#define SBTML_REJ 0x2 /* reject */
12167 +#define SBTML_CLK 0x10000 /* clock enable */
12168 +#define SBTML_FGC 0x20000 /* force gated clocks on */
12169 +#define SBTML_FL_MASK 0x3ffc0000 /* core-specific flags */
12170 +#define SBTML_PE 0x40000000 /* pme enable */
12171 +#define SBTML_BE 0x80000000 /* bist enable */
12173 +/* sbtmstatehigh */
12174 +#define SBTMH_SERR 0x1 /* serror */
12175 +#define SBTMH_INT 0x2 /* interrupt */
12176 +#define SBTMH_BUSY 0x4 /* busy */
12177 +#define SBTMH_TO 0x00000020 /* timeout (sonics >= 2.3) */
12178 +#define SBTMH_FL_MASK 0x1fff0000 /* core-specific flags */
12179 +#define SBTMH_GCR 0x20000000 /* gated clock request */
12180 +#define SBTMH_BISTF 0x40000000 /* bist failed */
12181 +#define SBTMH_BISTD 0x80000000 /* bist done */
12184 +#define SBBWA_TAB0_MASK 0xffff /* lookup table 0 */
12185 +#define SBBWA_TAB1_MASK 0xffff /* lookup table 1 */
12186 +#define SBBWA_TAB1_SHIFT 16
12188 +/* sbimconfiglow */
12189 +#define SBIMCL_STO_MASK 0x7 /* service timeout */
12190 +#define SBIMCL_RTO_MASK 0x70 /* request timeout */
12191 +#define SBIMCL_RTO_SHIFT 4
12192 +#define SBIMCL_CID_MASK 0xff0000 /* connection id */
12193 +#define SBIMCL_CID_SHIFT 16
12195 +/* sbimconfighigh */
12196 +#define SBIMCH_IEM_MASK 0xc /* inband error mode */
12197 +#define SBIMCH_TEM_MASK 0x30 /* timeout error mode */
12198 +#define SBIMCH_TEM_SHIFT 4
12199 +#define SBIMCH_BEM_MASK 0xc0 /* bus error mode */
12200 +#define SBIMCH_BEM_SHIFT 6
12203 +#define SBAM_TYPE_MASK 0x3 /* address type */
12204 +#define SBAM_AD64 0x4 /* reserved */
12205 +#define SBAM_ADINT0_MASK 0xf8 /* type0 size */
12206 +#define SBAM_ADINT0_SHIFT 3
12207 +#define SBAM_ADINT1_MASK 0x1f8 /* type1 size */
12208 +#define SBAM_ADINT1_SHIFT 3
12209 +#define SBAM_ADINT2_MASK 0x1f8 /* type2 size */
12210 +#define SBAM_ADINT2_SHIFT 3
12211 +#define SBAM_ADEN 0x400 /* enable */
12212 +#define SBAM_ADNEG 0x800 /* negative decode */
12213 +#define SBAM_BASE0_MASK 0xffffff00 /* type0 base address */
12214 +#define SBAM_BASE0_SHIFT 8
12215 +#define SBAM_BASE1_MASK 0xfffff000 /* type1 base address for the core */
12216 +#define SBAM_BASE1_SHIFT 12
12217 +#define SBAM_BASE2_MASK 0xffff0000 /* type2 base address for the core */
12218 +#define SBAM_BASE2_SHIFT 16
12220 +/* sbtmconfiglow */
12221 +#define SBTMCL_CD_MASK 0xff /* clock divide */
12222 +#define SBTMCL_CO_MASK 0xf800 /* clock offset */
12223 +#define SBTMCL_CO_SHIFT 11
12224 +#define SBTMCL_IF_MASK 0xfc0000 /* interrupt flags */
12225 +#define SBTMCL_IF_SHIFT 18
12226 +#define SBTMCL_IM_MASK 0x3000000 /* interrupt mode */
12227 +#define SBTMCL_IM_SHIFT 24
12229 +/* sbtmconfighigh */
12230 +#define SBTMCH_BM_MASK 0x3 /* busy mode */
12231 +#define SBTMCH_RM_MASK 0x3 /* retry mode */
12232 +#define SBTMCH_RM_SHIFT 2
12233 +#define SBTMCH_SM_MASK 0x30 /* stop mode */
12234 +#define SBTMCH_SM_SHIFT 4
12235 +#define SBTMCH_EM_MASK 0x300 /* sb error mode */
12236 +#define SBTMCH_EM_SHIFT 8
12237 +#define SBTMCH_IM_MASK 0xc00 /* int mode */
12238 +#define SBTMCH_IM_SHIFT 10
12241 +#define SBBC_LAT_MASK 0x3 /* sb latency */
12242 +#define SBBC_MAX0_MASK 0xf0000 /* maxccntr0 */
12243 +#define SBBC_MAX0_SHIFT 16
12244 +#define SBBC_MAX1_MASK 0xf00000 /* maxccntr1 */
12245 +#define SBBC_MAX1_SHIFT 20
12248 +#define SBBS_SRD 0x1 /* st reg disable */
12249 +#define SBBS_HRD 0x2 /* hold reg disable */
12252 +#define SBIDL_CS_MASK 0x3 /* config space */
12253 +#define SBIDL_AR_MASK 0x38 /* # address ranges supported */
12254 +#define SBIDL_AR_SHIFT 3
12255 +#define SBIDL_SYNCH 0x40 /* sync */
12256 +#define SBIDL_INIT 0x80 /* initiator */
12257 +#define SBIDL_MINLAT_MASK 0xf00 /* minimum backplane latency */
12258 +#define SBIDL_MINLAT_SHIFT 8
12259 +#define SBIDL_MAXLAT 0xf000 /* maximum backplane latency */
12260 +#define SBIDL_MAXLAT_SHIFT 12
12261 +#define SBIDL_FIRST 0x10000 /* this initiator is first */
12262 +#define SBIDL_CW_MASK 0xc0000 /* cycle counter width */
12263 +#define SBIDL_CW_SHIFT 18
12264 +#define SBIDL_TP_MASK 0xf00000 /* target ports */
12265 +#define SBIDL_TP_SHIFT 20
12266 +#define SBIDL_IP_MASK 0xf000000 /* initiator ports */
12267 +#define SBIDL_IP_SHIFT 24
12268 +#define SBIDL_RV_MASK 0xf0000000 /* sonics backplane revision code */
12269 +#define SBIDL_RV_SHIFT 28
12272 +#define SBIDH_RC_MASK 0xf /* revision code*/
12273 +#define SBIDH_CC_MASK 0xfff0 /* core code */
12274 +#define SBIDH_CC_SHIFT 4
12275 +#define SBIDH_VC_MASK 0xffff0000 /* vendor code */
12276 +#define SBIDH_VC_SHIFT 16
12278 +#define SB_COMMIT 0xfd8 /* update buffered registers value */
12280 +/* vendor codes */
12281 +#define SB_VEND_BCM 0x4243 /* Broadcom's SB vendor code */
12284 +#define SB_CC 0x800 /* chipcommon core */
12285 +#define SB_ILINE20 0x801 /* iline20 core */
12286 +#define SB_SDRAM 0x803 /* sdram core */
12287 +#define SB_PCI 0x804 /* pci core */
12288 +#define SB_MIPS 0x805 /* mips core */
12289 +#define SB_ENET 0x806 /* enet mac core */
12290 +#define SB_CODEC 0x807 /* v90 codec core */
12291 +#define SB_USB 0x808 /* usb 1.1 host/device core */
12292 +#define SB_ILINE100 0x80a /* iline100 core */
12293 +#define SB_IPSEC 0x80b /* ipsec core */
12294 +#define SB_PCMCIA 0x80d /* pcmcia core */
12295 +#define SB_MEMC 0x80f /* memc sdram core */
12296 +#define SB_EXTIF 0x811 /* external interface core */
12297 +#define SB_D11 0x812 /* 802.11 MAC core */
12298 +#define SB_MIPS33 0x816 /* mips3302 core */
12299 +#define SB_USB11H 0x817 /* usb 1.1 host core */
12300 +#define SB_USB11D 0x818 /* usb 1.1 device core */
12301 +#define SB_USB20H 0x819 /* usb 2.0 host core */
12302 +#define SB_USB20D 0x81A /* usb 2.0 device core */
12303 +#define SB_SDIOH 0x81B /* sdio host core */
12304 +#define SB_ROBO 0x81C /* robo switch core */
12306 +#endif /* _SBCONFIG_H */
12307 diff -Nur linux-2.6.12.5/arch/mips/bcm947xx/include/sbextif.h linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/sbextif.h
12308 --- linux-2.6.12.5/arch/mips/bcm947xx/include/sbextif.h 1970-01-01 01:00:00.000000000 +0100
12309 +++ linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/sbextif.h 2005-08-28 11:12:20.470853072 +0200
12312 + * Hardware-specific External Interface I/O core definitions
12313 + * for the BCM47xx family of SiliconBackplane-based chips.
12315 + * The External Interface core supports a total of three external chip selects
12316 + * supporting external interfaces. One of the external chip selects is
12317 + * used for Flash, one is used for PCMCIA, and the other may be
12318 + * programmed to support either a synchronous interface or an
12319 + * asynchronous interface. The asynchronous interface can be used to
12320 + * support external devices such as UARTs and the BCM2019 Bluetooth
12321 + * baseband processor.
12322 + * The external interface core also contains 2 on-chip 16550 UARTs, clock
12323 + * frequency control, a watchdog interrupt timer, and a GPIO interface.
12325 + * Copyright 2001-2003, Broadcom Corporation
12326 + * All Rights Reserved.
12328 + * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
12329 + * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
12330 + * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
12331 + * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
12335 +#ifndef _SBEXTIF_H
12336 +#define _SBEXTIF_H
12338 +/* external interface address space */
12339 +#define EXTIF_PCMCIA_MEMBASE(x) (x)
12340 +#define EXTIF_PCMCIA_IOBASE(x) ((x) + 0x100000)
12341 +#define EXTIF_PCMCIA_CFGBASE(x) ((x) + 0x200000)
12342 +#define EXTIF_CFGIF_BASE(x) ((x) + 0x800000)
12343 +#define EXTIF_FLASH_BASE(x) ((x) + 0xc00000)
12345 +/* cpp contortions to concatenate w/arg prescan */
12347 +#define _PADLINE(line) pad ## line
12348 +#define _XSTR(line) _PADLINE(line)
12349 +#define PAD _XSTR(__LINE__)
12353 + * The multiple instances of output and output enable registers
12354 + * are present to allow driver software for multiple cores to control
12355 + * gpio outputs without needing to share a single register pair.
12361 +#define NGPIOUSER 5
12363 +typedef volatile struct {
12364 + uint32 corecontrol;
12365 + uint32 extstatus;
12368 + /* pcmcia control registers */
12369 + uint32 pcmcia_config;
12370 + uint32 pcmcia_memwait;
12371 + uint32 pcmcia_attrwait;
12372 + uint32 pcmcia_iowait;
12374 + /* programmable interface control registers */
12375 + uint32 prog_config;
12376 + uint32 prog_waitcount;
12378 + /* flash control registers */
12379 + uint32 flash_config;
12380 + uint32 flash_waitcount;
12385 + /* clock control */
12386 + uint32 clockcontrol_n;
12387 + uint32 clockcontrol_sb;
12388 + uint32 clockcontrol_pci;
12389 + uint32 clockcontrol_mii;
12394 + struct gpiouser gpio[NGPIOUSER];
12396 + uint32 ejtagouten;
12397 + uint32 gpiointpolarity;
12398 + uint32 gpiointmask;
12415 + uint8 uartscratch;
12420 +#define CC_UE (1 << 0) /* uart enable */
12423 +#define ES_EM (1 << 0) /* endian mode (ro) */
12424 +#define ES_EI (1 << 1) /* external interrupt pin (ro) */
12425 +#define ES_GI (1 << 2) /* gpio interrupt pin (ro) */
12427 +/* gpio bit mask */
12428 +#define GPIO_BIT0 (1 << 0)
12429 +#define GPIO_BIT1 (1 << 1)
12430 +#define GPIO_BIT2 (1 << 2)
12431 +#define GPIO_BIT3 (1 << 3)
12432 +#define GPIO_BIT4 (1 << 4)
12433 +#define GPIO_BIT5 (1 << 5)
12434 +#define GPIO_BIT6 (1 << 6)
12435 +#define GPIO_BIT7 (1 << 7)
12438 +/* pcmcia/prog/flash_config */
12439 +#define CF_EN (1 << 0) /* enable */
12440 +#define CF_EM_MASK 0xe /* mode */
12441 +#define CF_EM_SHIFT 1
12442 +#define CF_EM_FLASH 0x0 /* flash/asynchronous mode */
12443 +#define CF_EM_SYNC 0x2 /* synchronous mode */
12444 +#define CF_EM_PCMCIA 0x4 /* pcmcia mode */
12445 +#define CF_DS (1 << 4) /* destsize: 0=8bit, 1=16bit */
12446 +#define CF_BS (1 << 5) /* byteswap */
12447 +#define CF_CD_MASK 0xc0 /* clock divider */
12448 +#define CF_CD_SHIFT 6
12449 +#define CF_CD_DIV2 0x0 /* backplane/2 */
12450 +#define CF_CD_DIV3 0x40 /* backplane/3 */
12451 +#define CF_CD_DIV4 0x80 /* backplane/4 */
12452 +#define CF_CE (1 << 8) /* clock enable */
12453 +#define CF_SB (1 << 9) /* size/bytestrobe (synch only) */
12455 +/* pcmcia_memwait */
12456 +#define PM_W0_MASK 0x3f /* waitcount0 */
12457 +#define PM_W1_MASK 0x1f00 /* waitcount1 */
12458 +#define PM_W1_SHIFT 8
12459 +#define PM_W2_MASK 0x1f0000 /* waitcount2 */
12460 +#define PM_W2_SHIFT 16
12461 +#define PM_W3_MASK 0x1f000000 /* waitcount3 */
12462 +#define PM_W3_SHIFT 24
12464 +/* pcmcia_attrwait */
12465 +#define PA_W0_MASK 0x3f /* waitcount0 */
12466 +#define PA_W1_MASK 0x1f00 /* waitcount1 */
12467 +#define PA_W1_SHIFT 8
12468 +#define PA_W2_MASK 0x1f0000 /* waitcount2 */
12469 +#define PA_W2_SHIFT 16
12470 +#define PA_W3_MASK 0x1f000000 /* waitcount3 */
12471 +#define PA_W3_SHIFT 24
12473 +/* pcmcia_iowait */
12474 +#define PI_W0_MASK 0x3f /* waitcount0 */
12475 +#define PI_W1_MASK 0x1f00 /* waitcount1 */
12476 +#define PI_W1_SHIFT 8
12477 +#define PI_W2_MASK 0x1f0000 /* waitcount2 */
12478 +#define PI_W2_SHIFT 16
12479 +#define PI_W3_MASK 0x1f000000 /* waitcount3 */
12480 +#define PI_W3_SHIFT 24
12482 +/* prog_waitcount */
12483 +#define PW_W0_MASK 0x0000001f /* waitcount0 */
12484 +#define PW_W1_MASK 0x00001f00 /* waitcount1 */
12485 +#define PW_W1_SHIFT 8
12486 +#define PW_W2_MASK 0x001f0000 /* waitcount2 */
12487 +#define PW_W2_SHIFT 16
12488 +#define PW_W3_MASK 0x1f000000 /* waitcount3 */
12489 +#define PW_W3_SHIFT 24
12491 +#define PW_W0 0x0000000c
12492 +#define PW_W1 0x00000a00
12493 +#define PW_W2 0x00020000
12494 +#define PW_W3 0x01000000
12496 +/* flash_waitcount */
12497 +#define FW_W0_MASK 0x1f /* waitcount0 */
12498 +#define FW_W1_MASK 0x1f00 /* waitcount1 */
12499 +#define FW_W1_SHIFT 8
12500 +#define FW_W2_MASK 0x1f0000 /* waitcount2 */
12501 +#define FW_W2_SHIFT 16
12502 +#define FW_W3_MASK 0x1f000000 /* waitcount3 */
12503 +#define FW_W3_SHIFT 24
12506 +#define WATCHDOG_CLOCK 48000000 /* Hz */
12508 +/* clockcontrol_n */
12509 +#define CN_N1_MASK 0x3f /* n1 control */
12510 +#define CN_N2_MASK 0x3f00 /* n2 control */
12511 +#define CN_N2_SHIFT 8
12513 +/* clockcontrol_sb/pci/mii */
12514 +#define CC_M1_MASK 0x3f /* m1 control */
12515 +#define CC_M2_MASK 0x3f00 /* m2 control */
12516 +#define CC_M2_SHIFT 8
12517 +#define CC_M3_MASK 0x3f0000 /* m3 control */
12518 +#define CC_M3_SHIFT 16
12519 +#define CC_MC_MASK 0x1f000000 /* mux control */
12520 +#define CC_MC_SHIFT 24
12522 +/* Clock control default values */
12523 +#define CC_DEF_N 0x0009 /* Default values for bcm4710 */
12524 +#define CC_DEF_100 0x04020011
12525 +#define CC_DEF_33 0x11030011
12526 +#define CC_DEF_25 0x11050011
12528 +/* Clock control values for 125Mhz */
12529 +#define CC_125_N 0x0802
12530 +#define CC_125_M 0x04020009
12531 +#define CC_125_M25 0x11090009
12532 +#define CC_125_M33 0x11090005
12534 +/* Clock control magic field values */
12535 +#define CC_F6_2 0x02 /* A factor of 2 in */
12536 +#define CC_F6_3 0x03 /* 6-bit fields like */
12537 +#define CC_F6_4 0x05 /* N1, M1 or M3 */
12538 +#define CC_F6_5 0x09
12539 +#define CC_F6_6 0x11
12540 +#define CC_F6_7 0x21
12542 +#define CC_F5_BIAS 5 /* 5-bit fields get this added */
12544 +#define CC_MC_BYPASS 0x08
12545 +#define CC_MC_M1 0x04
12546 +#define CC_MC_M1M2 0x02
12547 +#define CC_MC_M1M2M3 0x01
12548 +#define CC_MC_M1M3 0x11
12550 +#define CC_CLOCK_BASE 24000000 /* Half the clock freq. in the 4710 */
12552 +#endif /* _SBEXTIF_H */
12553 diff -Nur linux-2.6.12.5/arch/mips/bcm947xx/include/sbmemc.h linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/sbmemc.h
12554 --- linux-2.6.12.5/arch/mips/bcm947xx/include/sbmemc.h 1970-01-01 01:00:00.000000000 +0100
12555 +++ linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/sbmemc.h 2005-08-28 11:12:20.471852920 +0200
12558 + * BCM47XX Sonics SiliconBackplane DDR/SDRAM controller core hardware definitions.
12560 + * Copyright 2001-2003, Broadcom Corporation
12561 + * All Rights Reserved.
12563 + * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
12564 + * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
12565 + * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
12566 + * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
12573 +#ifdef _LANGUAGE_ASSEMBLY
12575 +#define MEMC_CONTROL 0x00
12576 +#define MEMC_CONFIG 0x04
12577 +#define MEMC_REFRESH 0x08
12578 +#define MEMC_BISTSTAT 0x0c
12579 +#define MEMC_MODEBUF 0x10
12580 +#define MEMC_BKCLS 0x14
12581 +#define MEMC_PRIORINV 0x18
12582 +#define MEMC_DRAMTIM 0x1c
12583 +#define MEMC_INTSTAT 0x20
12584 +#define MEMC_INTMASK 0x24
12585 +#define MEMC_INTINFO 0x28
12586 +#define MEMC_NCDLCTL 0x30
12587 +#define MEMC_RDNCDLCOR 0x34
12588 +#define MEMC_WRNCDLCOR 0x38
12589 +#define MEMC_MISCDLYCTL 0x3c
12590 +#define MEMC_DQSGATENCDL 0x40
12591 +#define MEMC_SPARE 0x44
12592 +#define MEMC_TPADDR 0x48
12593 +#define MEMC_TPDATA 0x4c
12594 +#define MEMC_BARRIER 0x50
12595 +#define MEMC_CORE 0x54
12600 +/* Sonics side: MEMC core registers */
12601 +typedef volatile struct sbmemcregs {
12613 + uint32 reserved1;
12615 + uint32 rdncdlcor;
12616 + uint32 wrncdlcor;
12617 + uint32 miscdlyctl;
12618 + uint32 dqsgatencdl;
12628 +/* MEMC Core Init values (OCP ID 0x80f) */
12631 +#define MEMC_SD_CONFIG_INIT 0x00048000
12632 +#define MEMC_SD_DRAMTIM_INIT 0x000754da
12633 +#define MEMC_SD_RDNCDLCOR_INIT 0x00000000
12634 +#define MEMC_SD_WRNCDLCOR_INIT 0x49351200
12635 +#define MEMC_SD1_WRNCDLCOR_INIT 0x14500200 /* For corerev 1 (4712) */
12636 +#define MEMC_SD_MISCDLYCTL_INIT 0x00061c1b
12637 +#define MEMC_SD1_MISCDLYCTL_INIT 0x00021416 /* For corerev 1 (4712) */
12638 +#define MEMC_SD_CONTROL_INIT0 0x00000002
12639 +#define MEMC_SD_CONTROL_INIT1 0x00000008
12640 +#define MEMC_SD_CONTROL_INIT2 0x00000004
12641 +#define MEMC_SD_CONTROL_INIT3 0x00000010
12642 +#define MEMC_SD_CONTROL_INIT4 0x00000001
12643 +#define MEMC_SD_MODEBUF_INIT 0x00000000
12644 +#define MEMC_SD_REFRESH_INIT 0x0000840f
12647 +/* This is for SDRM8X8X4 */
12648 +#define MEMC_SDR_INIT 0x0008
12649 +#define MEMC_SDR_MODE 0x32
12650 +#define MEMC_SDR_NCDL 0x00020032
12651 +#define MEMC_SDR1_NCDL 0x0002020f /* For corerev 1 (4712) */
12654 +#define MEMC_CONFIG_INIT 0x00048000
12655 +#define MEMC_DRAMTIM_INIT 0x000754d9
12656 +#define MEMC_RDNCDLCOR_INIT 0x00000000
12657 +#define MEMC_WRNCDLCOR_INIT 0x49351200
12658 +#define MEMC_1_WRNCDLCOR_INIT 0x14500200
12659 +#define MEMC_DQSGATENCDL_INIT 0x00030000
12660 +#define MEMC_MISCDLYCTL_INIT 0x21061c1b
12661 +#define MEMC_1_MISCDLYCTL_INIT 0x21021400
12662 +#define MEMC_NCDLCTL_INIT 0x00002001
12663 +#define MEMC_CONTROL_INIT0 0x00000002
12664 +#define MEMC_CONTROL_INIT1 0x00000008
12665 +#define MEMC_MODEBUF_INIT0 0x00004000
12666 +#define MEMC_CONTROL_INIT2 0x00000010
12667 +#define MEMC_MODEBUF_INIT1 0x00000100
12668 +#define MEMC_CONTROL_INIT3 0x00000010
12669 +#define MEMC_CONTROL_INIT4 0x00000008
12670 +#define MEMC_REFRESH_INIT 0x0000840f
12671 +#define MEMC_CONTROL_INIT5 0x00000004
12672 +#define MEMC_MODEBUF_INIT2 0x00000000
12673 +#define MEMC_CONTROL_INIT6 0x00000010
12674 +#define MEMC_CONTROL_INIT7 0x00000001
12677 +/* This is for DDRM16X16X2 */
12678 +#define MEMC_DDR_INIT 0x0009
12679 +#define MEMC_DDR_MODE 0x62
12680 +#define MEMC_DDR_NCDL 0x0005050a
12681 +#define MEMC_DDR1_NCDL 0x00000a0a /* For corerev 1 (4712) */
12683 +/* mask for sdr/ddr calibration registers */
12684 +#define MEMC_RDNCDLCOR_RD_MASK 0x000000ff
12685 +#define MEMC_WRNCDLCOR_WR_MASK 0x000000ff
12686 +#define MEMC_DQSGATENCDL_G_MASK 0x000000ff
12688 +/* masks for miscdlyctl registers */
12689 +#define MEMC_MISC_SM_MASK 0x30000000
12690 +#define MEMC_MISC_SM_SHIFT 28
12691 +#define MEMC_MISC_SD_MASK 0x0f000000
12692 +#define MEMC_MISC_SD_SHIFT 24
12694 +/* hw threshhold for calculating wr/rd for sdr memc */
12695 +#define MEMC_CD_THRESHOLD 128
12697 +/* Low bit of init register says if memc is ddr or sdr */
12698 +#define MEMC_CONFIG_DDR 0x00000001
12700 +#endif /* _SBMEMC_H */
12701 diff -Nur linux-2.6.12.5/arch/mips/bcm947xx/include/sbmips.h linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/sbmips.h
12702 --- linux-2.6.12.5/arch/mips/bcm947xx/include/sbmips.h 1970-01-01 01:00:00.000000000 +0100
12703 +++ linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/sbmips.h 2005-08-28 11:12:20.471852920 +0200
12706 + * Broadcom SiliconBackplane MIPS definitions
12708 + * SB MIPS cores are custom MIPS32 processors with SiliconBackplane
12709 + * OCP interfaces. The CP0 processor ID is 0x00024000, where bits
12710 + * 23:16 mean Broadcom and bits 15:8 mean a MIPS core with an OCP
12711 + * interface. The core revision is stored in the SB ID register in SB
12712 + * configuration space.
12714 + * Copyright 2001-2003, Broadcom Corporation
12715 + * All Rights Reserved.
12717 + * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
12718 + * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
12719 + * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
12720 + * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
12728 +#ifndef _LANGUAGE_ASSEMBLY
12730 +/* cpp contortions to concatenate w/arg prescan */
12732 +#define _PADLINE(line) pad ## line
12733 +#define _XSTR(line) _PADLINE(line)
12734 +#define PAD _XSTR(__LINE__)
12737 +typedef volatile struct {
12738 + uint32 corecontrol;
12740 + uint32 biststatus;
12742 + uint32 intstatus;
12747 +extern uint32 sb_flag(void *sbh);
12748 +extern uint sb_irq(void *sbh);
12750 +extern void sb_serial_init(void *sbh, void (*add)(void *regs, uint irq, uint baud_base, uint reg_shift));
12752 +extern void sb_mips_init(void *sbh);
12753 +extern uint32 sb_mips_clock(void *sbh);
12754 +extern bool sb_mips_setclock(void *sbh, uint32 mipsclock, uint32 sbclock, uint32 pciclock);
12756 +extern uint32 sb_memc_get_ncdl(void *sbh);
12758 +#endif /* _LANGUAGE_ASSEMBLY */
12760 +#endif /* _SBMIPS_H */
12761 diff -Nur linux-2.6.12.5/arch/mips/bcm947xx/include/sbpci.h linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/sbpci.h
12762 --- linux-2.6.12.5/arch/mips/bcm947xx/include/sbpci.h 1970-01-01 01:00:00.000000000 +0100
12763 +++ linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/sbpci.h 2005-08-28 11:12:20.471852920 +0200
12766 + * BCM47XX Sonics SiliconBackplane PCI core hardware definitions.
12769 + * Copyright 2001-2003, Broadcom Corporation
12770 + * All Rights Reserved.
12772 + * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
12773 + * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
12774 + * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
12775 + * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
12781 +/* cpp contortions to concatenate w/arg prescan */
12783 +#define _PADLINE(line) pad ## line
12784 +#define _XSTR(line) _PADLINE(line)
12785 +#define PAD _XSTR(__LINE__)
12788 +/* Sonics side: PCI core and host control registers */
12789 +typedef struct sbpciregs {
12790 + uint32 control; /* PCI control */
12792 + uint32 arbcontrol; /* PCI arbiter control */
12794 + uint32 intstatus; /* Interrupt status */
12795 + uint32 intmask; /* Interrupt mask */
12796 + uint32 sbtopcimailbox; /* Sonics to PCI mailbox */
12798 + uint32 bcastaddr; /* Sonics broadcast address */
12799 + uint32 bcastdata; /* Sonics broadcast data */
12801 + uint32 gpioin; /* ro: gpio input (>=rev2) */
12802 + uint32 gpioout; /* rw: gpio output (>=rev2) */
12803 + uint32 gpioouten; /* rw: gpio output enable (>= rev2) */
12804 + uint32 gpiocontrol; /* rw: gpio control (>= rev2) */
12806 + uint32 sbtopci0; /* Sonics to PCI translation 0 */
12807 + uint32 sbtopci1; /* Sonics to PCI translation 1 */
12808 + uint32 sbtopci2; /* Sonics to PCI translation 2 */
12810 + uint16 sprom[36]; /* SPROM shadow Area */
12815 +#define PCI_RST_OE 0x01 /* When set, drives PCI_RESET out to pin */
12816 +#define PCI_RST 0x02 /* Value driven out to pin */
12817 +#define PCI_CLK_OE 0x04 /* When set, drives clock as gated by PCI_CLK out to pin */
12818 +#define PCI_CLK 0x08 /* Gate for clock driven out to pin */
12820 +/* PCI arbiter control */
12821 +#define PCI_INT_ARB 0x01 /* When set, use an internal arbiter */
12822 +#define PCI_EXT_ARB 0x02 /* When set, use an external arbiter */
12823 +#define PCI_PARKID_MASK 0x06 /* Selects which agent is parked on an idle bus */
12824 +#define PCI_PARKID_SHIFT 1
12825 +#define PCI_PARKID_LAST 0 /* Last requestor */
12826 +#define PCI_PARKID_4710 1 /* 4710 */
12827 +#define PCI_PARKID_EXTREQ0 2 /* External requestor 0 */
12828 +#define PCI_PARKID_EXTREQ1 3 /* External requestor 1 */
12830 +/* Interrupt status/mask */
12831 +#define PCI_INTA 0x01 /* PCI INTA# is asserted */
12832 +#define PCI_INTB 0x02 /* PCI INTB# is asserted */
12833 +#define PCI_SERR 0x04 /* PCI SERR# has been asserted (write one to clear) */
12834 +#define PCI_PERR 0x08 /* PCI PERR# has been asserted (write one to clear) */
12835 +#define PCI_PME 0x10 /* PCI PME# is asserted */
12837 +/* (General) PCI/SB mailbox interrupts, two bits per pci function */
12838 +#define MAILBOX_F0_0 0x100 /* function 0, int 0 */
12839 +#define MAILBOX_F0_1 0x200 /* function 0, int 1 */
12840 +#define MAILBOX_F1_0 0x400 /* function 1, int 0 */
12841 +#define MAILBOX_F1_1 0x800 /* function 1, int 1 */
12842 +#define MAILBOX_F2_0 0x1000 /* function 2, int 0 */
12843 +#define MAILBOX_F2_1 0x2000 /* function 2, int 1 */
12844 +#define MAILBOX_F3_0 0x4000 /* function 3, int 0 */
12845 +#define MAILBOX_F3_1 0x8000 /* function 3, int 1 */
12847 +/* Sonics broadcast address */
12848 +#define BCAST_ADDR_MASK 0xff /* Broadcast register address */
12850 +/* Sonics to PCI translation types */
12851 +#define SBTOPCI0_MASK 0xfc000000
12852 +#define SBTOPCI1_MASK 0xfc000000
12853 +#define SBTOPCI2_MASK 0xc0000000
12854 +#define SBTOPCI_MEM 0
12855 +#define SBTOPCI_IO 1
12856 +#define SBTOPCI_CFG0 2
12857 +#define SBTOPCI_CFG1 3
12858 +#define SBTOPCI_PREF 0x4 /* prefetch enable */
12859 +#define SBTOPCI_BURST 0x8 /* burst enable */
12861 +/* PCI side: Reserved PCI configuration registers (see pcicfg.h) */
12862 +#define cap_list rsvd_a[0]
12863 +#define bar0_window dev_dep[0x80 - 0x40]
12864 +#define bar1_window dev_dep[0x84 - 0x40]
12865 +#define sprom_control dev_dep[0x88 - 0x40]
12867 +#ifndef _LANGUAGE_ASSEMBLY
12869 +extern int sbpci_read_config(void *sbh, uint bus, uint dev, uint func, uint off, void *buf, int len);
12870 +extern int sbpci_write_config(void *sbh, uint bus, uint dev, uint func, uint off, void *buf, int len);
12871 +extern void sbpci_ban(uint16 core);
12872 +extern int sbpci_init(void *sbh);
12873 +extern void sbpci_check(void *sbh);
12875 +#endif /* !_LANGUAGE_ASSEMBLY */
12877 +#endif /* _SBPCI_H */
12878 diff -Nur linux-2.6.12.5/arch/mips/bcm947xx/include/sbpcmcia.h linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/sbpcmcia.h
12879 --- linux-2.6.12.5/arch/mips/bcm947xx/include/sbpcmcia.h 1970-01-01 01:00:00.000000000 +0100
12880 +++ linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/sbpcmcia.h 2005-08-28 11:12:20.472852768 +0200
12883 + * BCM43XX Sonics SiliconBackplane PCMCIA core hardware definitions.
12886 + * Copyright 2001-2003, Broadcom Corporation
12887 + * All Rights Reserved.
12889 + * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
12890 + * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
12891 + * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
12892 + * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
12895 +#ifndef _SBPCMCIA_H
12896 +#define _SBPCMCIA_H
12899 +/* All the addresses that are offsets in attribute space are divided
12900 + * by two to account for the fact that odd bytes are invalid in
12901 + * attribute space and our read/write routines make the space appear
12902 + * as if they didn't exist. Still we want to show the original numbers
12903 + * as documented in the hnd_pcmcia core manual.
12906 +/* PCMCIA Function Configuration Registers */
12907 +#define PCMCIA_FCR (0x700 / 2)
12909 +#define FCR0_OFF 0
12910 +#define FCR1_OFF (0x40 / 2)
12911 +#define FCR2_OFF (0x80 / 2)
12912 +#define FCR3_OFF (0xc0 / 2)
12914 +#define PCMCIA_FCR0 (0x700 / 2)
12915 +#define PCMCIA_FCR1 (0x740 / 2)
12916 +#define PCMCIA_FCR2 (0x780 / 2)
12917 +#define PCMCIA_FCR3 (0x7c0 / 2)
12919 +/* Standard PCMCIA FCR registers */
12921 +#define PCMCIA_COR 0
12923 +#define COR_RST 0x80
12924 +#define COR_LEV 0x40
12925 +#define COR_IRQEN 0x04
12926 +#define COR_BLREN 0x01
12927 +#define COR_FUNEN 0x01
12930 +#define PCICIA_FCSR (2 / 2)
12931 +#define PCICIA_PRR (4 / 2)
12932 +#define PCICIA_SCR (6 / 2)
12933 +#define PCICIA_ESR (8 / 2)
12936 +#define PCM_MEMOFF 0x0000
12937 +#define F0_MEMOFF 0x1000
12938 +#define F1_MEMOFF 0x2000
12939 +#define F2_MEMOFF 0x3000
12940 +#define F3_MEMOFF 0x4000
12942 +/* Memory base in the function fcr's */
12943 +#define MEM_ADDR0 (0x728 / 2)
12944 +#define MEM_ADDR1 (0x72a / 2)
12945 +#define MEM_ADDR2 (0x72c / 2)
12947 +/* PCMCIA base plus Srom access in fcr0: */
12948 +#define PCMCIA_ADDR0 (0x072e / 2)
12949 +#define PCMCIA_ADDR1 (0x0730 / 2)
12950 +#define PCMCIA_ADDR2 (0x0732 / 2)
12952 +#define MEM_SEG (0x0734 / 2)
12953 +#define SROM_CS (0x0736 / 2)
12954 +#define SROM_DATAL (0x0738 / 2)
12955 +#define SROM_DATAH (0x073a / 2)
12956 +#define SROM_ADDRL (0x073c / 2)
12957 +#define SROM_ADDRH (0x073e / 2)
12959 +/* Values for srom_cs: */
12960 +#define SROM_IDLE 0
12961 +#define SROM_WRITE 1
12962 +#define SROM_READ 2
12963 +#define SROM_WEN 4
12964 +#define SROM_WDS 7
12965 +#define SROM_DONE 8
12969 +/* The CIS stops where the FCRs start */
12970 +#define CIS_SIZE PCMCIA_FCR
12972 +/* Standard tuples we know about */
12974 +#define CISTPL_MANFID 0x20 /* Manufacturer and device id */
12975 +#define CISTPL_FUNCE 0x22 /* Function extensions */
12976 +#define CISTPL_CFTABLE 0x1b /* Config table entry */
12978 +/* Function extensions for LANs */
12980 +#define LAN_TECH 1 /* Technology type */
12981 +#define LAN_SPEED 2 /* Raw bit rate */
12982 +#define LAN_MEDIA 3 /* Transmission media */
12983 +#define LAN_NID 4 /* Node identification (aka MAC addr) */
12984 +#define LAN_CONN 5 /* Connector standard */
12988 +#define CFTABLE_REGWIN_2K 0x08 /* 2k reg windows size */
12989 +#define CFTABLE_REGWIN_4K 0x10 /* 4k reg windows size */
12990 +#define CFTABLE_REGWIN_8K 0x20 /* 8k reg windows size */
12992 +/* Vendor unique tuples are 0x80-0x8f. Within Broadcom we'll
12993 + * take one for HNBU, and use "extensions" (a la FUNCE) within it.
12996 +#define CISTPL_BRCM_HNBU 0x80
12998 +/* Subtypes of BRCM_HNBU: */
13000 +#define HNBU_CHIPID 0x01 /* Six bytes with PCI vendor &
13001 + * device id and chiprev
13003 +#define HNBU_BOARDREV 0x02 /* Two bytes board revision */
13004 +#define HNBU_PAPARMS 0x03 /* Eleven bytes PA parameters */
13005 +#define HNBU_OEM 0x04 /* Eight bytes OEM data */
13006 +#define HNBU_CC 0x05 /* Default country code */
13007 +#define HNBU_AA 0x06 /* Antennas available */
13008 +#define HNBU_AG 0x07 /* Antenna gain */
13009 +#define HNBU_BOARDFLAGS 0x08 /* board flags */
13010 +#define HNBU_LED 0x09 /* LED set */
13012 +#endif /* _SBPCMCIA_H */
13013 diff -Nur linux-2.6.12.5/arch/mips/bcm947xx/include/sbsdram.h linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/sbsdram.h
13014 --- linux-2.6.12.5/arch/mips/bcm947xx/include/sbsdram.h 1970-01-01 01:00:00.000000000 +0100
13015 +++ linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/sbsdram.h 2005-08-28 11:12:20.472852768 +0200
13018 + * BCM47XX Sonics SiliconBackplane SDRAM controller core hardware definitions.
13020 + * Copyright 2001-2003, Broadcom Corporation
13021 + * All Rights Reserved.
13023 + * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
13024 + * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
13025 + * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
13026 + * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
13030 +#ifndef _SBSDRAM_H
13031 +#define _SBSDRAM_H
13033 +#ifndef _LANGUAGE_ASSEMBLY
13035 +/* Sonics side: SDRAM core registers */
13036 +typedef volatile struct sbsdramregs {
13037 + uint32 initcontrol; /* Generates external SDRAM initialization sequence */
13038 + uint32 config; /* Initializes external SDRAM mode register */
13039 + uint32 refresh; /* Controls external SDRAM refresh rate */
13046 +/* SDRAM initialization control (initcontrol) register bits */
13047 +#define SDRAM_CBR 0x0001 /* Writing 1 generates refresh cycle and toggles bit */
13048 +#define SDRAM_PRE 0x0002 /* Writing 1 generates precharge cycle and toggles bit */
13049 +#define SDRAM_MRS 0x0004 /* Writing 1 generates mode register select cycle and toggles bit */
13050 +#define SDRAM_EN 0x0008 /* When set, enables access to SDRAM */
13051 +#define SDRAM_16Mb 0x0000 /* Use 16 Megabit SDRAM */
13052 +#define SDRAM_64Mb 0x0010 /* Use 64 Megabit SDRAM */
13053 +#define SDRAM_128Mb 0x0020 /* Use 128 Megabit SDRAM */
13054 +#define SDRAM_RSVMb 0x0030 /* Use special SDRAM */
13055 +#define SDRAM_RST 0x0080 /* Writing 1 causes soft reset of controller */
13056 +#define SDRAM_SELFREF 0x0100 /* Writing 1 enables self refresh mode */
13057 +#define SDRAM_PWRDOWN 0x0200 /* Writing 1 causes controller to power down */
13058 +#define SDRAM_32BIT 0x0400 /* When set, indicates 32 bit SDRAM interface */
13059 +#define SDRAM_9BITCOL 0x0800 /* When set, indicates 9 bit column */
13061 +/* SDRAM configuration (config) register bits */
13062 +#define SDRAM_BURSTFULL 0x0000 /* Use full page bursts */
13063 +#define SDRAM_BURST8 0x0001 /* Use burst of 8 */
13064 +#define SDRAM_BURST4 0x0002 /* Use burst of 4 */
13065 +#define SDRAM_BURST2 0x0003 /* Use burst of 2 */
13066 +#define SDRAM_CAS3 0x0000 /* Use CAS latency of 3 */
13067 +#define SDRAM_CAS2 0x0004 /* Use CAS latency of 2 */
13069 +/* SDRAM refresh control (refresh) register bits */
13070 +#define SDRAM_REF(p) (((p)&0xff) | SDRAM_REF_EN) /* Refresh period */
13071 +#define SDRAM_REF_EN 0x8000 /* Writing 1 enables periodic refresh */
13073 +/* SDRAM Core default Init values (OCP ID 0x803) */
13074 +#define SDRAM_INIT MEM4MX16X2
13075 +#define SDRAM_CONFIG SDRAM_BURSTFULL
13076 +#define SDRAM_REFRESH SDRAM_REF(0x40)
13078 +#define MEM1MX16 0x009 /* 2 MB */
13079 +#define MEM1MX16X2 0x409 /* 4 MB */
13080 +#define MEM2MX8X2 0x809 /* 4 MB */
13081 +#define MEM2MX8X4 0xc09 /* 8 MB */
13082 +#define MEM2MX32 0x439 /* 8 MB */
13083 +#define MEM4MX16 0x019 /* 8 MB */
13084 +#define MEM4MX16X2 0x419 /* 16 MB */
13085 +#define MEM8MX8X2 0x819 /* 16 MB */
13086 +#define MEM8MX16 0x829 /* 16 MB */
13087 +#define MEM4MX32 0x429 /* 16 MB */
13088 +#define MEM8MX8X4 0xc19 /* 32 MB */
13089 +#define MEM8MX16X2 0xc29 /* 32 MB */
13091 +#endif /* _SBSDRAM_H */
13092 diff -Nur linux-2.6.12.5/arch/mips/bcm947xx/include/sbutils.h linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/sbutils.h
13093 --- linux-2.6.12.5/arch/mips/bcm947xx/include/sbutils.h 1970-01-01 01:00:00.000000000 +0100
13094 +++ linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/sbutils.h 2005-08-28 11:12:20.473852616 +0200
13097 + * Misc utility routines for accessing chip-specific features
13098 + * of Broadcom HNBU SiliconBackplane-based chips.
13100 + * Copyright 2001-2003, Broadcom Corporation
13101 + * All Rights Reserved.
13103 + * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
13104 + * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
13105 + * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
13106 + * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
13111 +#ifndef _sbutils_h_
13112 +#define _sbutils_h_
13114 +/* Board styles (bustype) */
13115 +#define BOARDSTYLE_SOC 0 /* Silicon Backplane */
13116 +#define BOARDSTYLE_PCI 1 /* PCI/MiniPCI board */
13117 +#define BOARDSTYLE_PCMCIA 2 /* PCMCIA board */
13118 +#define BOARDSTYLE_CARDBUS 3 /* Cardbus board */
13121 + * Many of the routines below take an 'sbh' handle as their first arg.
13122 + * Allocate this by calling sb_attach(). Free it by calling sb_detach().
13123 + * At any one time, the sbh is logically focused on one particular sb core
13124 + * (the "current core").
13125 + * Use sb_setcore() or sb_setcoreidx() to change the association to another core.
13128 +/* exported externs */
13129 +extern void *sb_attach(uint pcidev, void *osh, void *regs, uint bustype, void *sdh, char **vars, int *varsz);
13130 +extern void *sb_kattach(void);
13131 +extern void sb_detach(void *sbh);
13132 +extern uint sb_chip(void *sbh);
13133 +extern uint sb_chiprev(void *sbh);
13134 +extern uint sb_chippkg(void *sbh);
13135 +extern uint sb_boardvendor(void *sbh);
13136 +extern uint sb_boardtype(void *sbh);
13137 +extern uint sb_boardstyle(void *sbh);
13138 +extern uint sb_bus(void *sbh);
13139 +extern uint sb_corelist(void *sbh, uint coreid[]);
13140 +extern uint sb_coreid(void *sbh);
13141 +extern uint sb_coreidx(void *sbh);
13142 +extern uint sb_coreunit(void *sbh);
13143 +extern uint sb_corevendor(void *sbh);
13144 +extern uint sb_corerev(void *sbh);
13145 +extern void *sb_coreregs(void *sbh);
13146 +extern uint32 sb_coreflags(void *sbh, uint32 mask, uint32 val);
13147 +extern uint32 sb_coreflagshi(void *sbh, uint32 mask, uint32 val);
13148 +extern bool sb_iscoreup(void *sbh);
13149 +extern void *sb_setcoreidx(void *sbh, uint coreidx);
13150 +extern void *sb_setcore(void *sbh, uint coreid, uint coreunit);
13151 +extern void sb_commit(void *sbh);
13152 +extern uint32 sb_base(uint32 admatch);
13153 +extern uint32 sb_size(uint32 admatch);
13154 +extern void sb_core_reset(void *sbh, uint32 bits);
13155 +extern void sb_core_tofixup(void *sbh);
13156 +extern void sb_core_disable(void *sbh, uint32 bits);
13157 +extern uint32 sb_clock_rate(uint32 pll_type, uint32 n, uint32 m);
13158 +extern uint32 sb_clock(void *sbh);
13159 +extern void sb_pci_setup(void *sbh, uint32 *dmaoffset, uint coremask);
13160 +extern void sb_pcmcia_init(void *sbh);
13161 +extern void sb_watchdog(void *sbh, uint ticks);
13162 +extern void *sb_gpiosetcore(void *sbh);
13163 +extern uint32 sb_gpiocontrol(void *sbh, uint32 mask, uint32 val);
13164 +extern uint32 sb_gpioouten(void *sbh, uint32 mask, uint32 val);
13165 +extern uint32 sb_gpioout(void *sbh, uint32 mask, uint32 val);
13166 +extern uint32 sb_gpioin(void *sbh);
13167 +extern uint32 sb_gpiointpolarity(void *sbh, uint32 mask, uint32 val);
13168 +extern uint32 sb_gpiointmask(void *sbh, uint32 mask, uint32 val);
13169 +extern bool sb_taclear(void *sbh);
13170 +extern void sb_pwrctl_init(void *sbh);
13171 +extern uint16 sb_pwrctl_fast_pwrup_delay(void *sbh);
13172 +extern bool sb_pwrctl_clk(void *sbh, uint mode);
13173 +extern int sb_pwrctl_xtal(void *sbh, uint what, bool on);
13174 +extern void sb_register_intr_callback(void *sbh, void *intrsoff_fn, void *intrsrestore_fn, void *intr_arg);
13176 +/* pwrctl xtal what flags */
13177 +#define XTAL 0x1 /* primary crystal oscillator (2050) */
13178 +#define PLL 0x2 /* main chip pll */
13180 +/* pwrctl clk mode */
13181 +#define CLK_FAST 0 /* force fast (pll) clock */
13182 +#define CLK_SLOW 1 /* force slow clock */
13183 +#define CLK_DYNAMIC 2 /* enable dynamic power control */
13185 +#endif /* _sbutils_h_ */
13186 diff -Nur linux-2.6.12.5/arch/mips/bcm947xx/include/sflash.h linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/sflash.h
13187 --- linux-2.6.12.5/arch/mips/bcm947xx/include/sflash.h 1970-01-01 01:00:00.000000000 +0100
13188 +++ linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/sflash.h 2005-08-28 11:12:20.473852616 +0200
13191 + * Broadcom SiliconBackplane chipcommon serial flash interface
13193 + * Copyright 2001-2003, Broadcom Corporation
13194 + * All Rights Reserved.
13196 + * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
13197 + * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
13198 + * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
13199 + * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
13204 +#ifndef _sflash_h_
13205 +#define _sflash_h_
13207 +#include <typedefs.h>
13208 +#include <sbchipc.h>
13210 +/* GPIO based bank selection (1 GPIO bit) */
13211 +#define SFLASH_MAX_BANKS 1
13212 +#define SFLASH_GPIO_SHIFT 2
13213 +#define SFLASH_GPIO_MASK ((SFLASH_MAX_BANKS - 1) << SFLASH_GPIO_SHIFT)
13215 +struct sflash_bank {
13216 + uint offset; /* Byte offset */
13217 + uint erasesize; /* Block size */
13218 + uint numblocks; /* Number of blocks */
13219 + uint size; /* Total bank size in bytes */
13223 + struct sflash_bank banks[SFLASH_MAX_BANKS]; /* GPIO selectable banks */
13224 + uint32 type; /* Type */
13225 + uint size; /* Total array size in bytes */
13228 +/* Utility functions */
13229 +extern int sflash_poll(chipcregs_t *cc, uint offset);
13230 +extern int sflash_read(chipcregs_t *cc, uint offset, uint len, uchar *buf);
13231 +extern int sflash_write(chipcregs_t *cc, uint offset, uint len, const uchar *buf);
13232 +extern int sflash_erase(chipcregs_t *cc, uint offset);
13233 +extern struct sflash * sflash_init(chipcregs_t *cc);
13235 +#endif /* _sflash_h_ */
13236 diff -Nur linux-2.6.12.5/arch/mips/bcm947xx/include/trxhdr.h linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/trxhdr.h
13237 --- linux-2.6.12.5/arch/mips/bcm947xx/include/trxhdr.h 1970-01-01 01:00:00.000000000 +0100
13238 +++ linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/trxhdr.h 2005-08-28 11:12:20.474852464 +0200
13241 + * TRX image file header format.
13243 + * Copyright 2001-2003, Broadcom Corporation
13244 + * All Rights Reserved.
13246 + * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
13247 + * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
13248 + * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
13249 + * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
13254 +#include <typedefs.h>
13256 +#define TRX_MAGIC 0x30524448 /* "HDR0" */
13257 +#define TRX_VERSION 1
13258 +#define TRX_MAX_LEN 0x3A0000
13259 +#define TRX_NO_HEADER 1 /* Do not write TRX header */
13261 +struct trx_header {
13262 + uint32 magic; /* "HDR0" */
13263 + uint32 len; /* Length of file including header */
13264 + uint32 crc32; /* 32-bit CRC from flag_version to end of file */
13265 + uint32 flag_version; /* 0:15 flags, 16:31 version */
13266 + uint32 offsets[3]; /* Offsets of partitions from start of header */
13269 +/* Compatibility */
13270 +typedef struct trx_header TRXHDR, *PTRXHDR;
13271 diff -Nur linux-2.6.12.5/arch/mips/bcm947xx/include/typedefs.h linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/typedefs.h
13272 --- linux-2.6.12.5/arch/mips/bcm947xx/include/typedefs.h 1970-01-01 01:00:00.000000000 +0100
13273 +++ linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/typedefs.h 2005-08-28 11:12:20.474852464 +0200
13276 + * Copyright 2001-2003, Broadcom Corporation
13277 + * All Rights Reserved.
13279 + * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
13280 + * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
13281 + * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
13282 + * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
13286 +#ifndef _TYPEDEFS_H_
13287 +#define _TYPEDEFS_H_
13289 +/*----------------------- define TRUE, FALSE, NULL, bool ----------------*/
13290 +#ifdef __cplusplus
13293 +#define FALSE false
13299 +#else /* !__cplusplus */
13301 +#if defined(_WIN32)
13303 +typedef unsigned char bool;
13307 +#if defined(MACOSX) && defined(KERNEL)
13308 +#include <IOKit/IOTypes.h>
13327 +#endif /* __cplusplus */
13337 +/*----------------------- define uchar, ushort, uint, ulong ----------------*/
13339 +typedef unsigned char uchar;
13341 +#if defined(_WIN32) || defined(PMON) || defined(__MRC__) || defined(V2_HAL) || defined(_CFE_)
13344 +typedef unsigned short ushort;
13347 +typedef unsigned int uint;
13348 +typedef unsigned long ulong;
13352 +/* pick up ushort & uint from standard types.h */
13353 +#if defined(linux) && defined(__KERNEL__)
13354 +#include <linux/types.h> /* sys/types.h and linux/types.h are oil and water */
13356 +#include <sys/types.h>
13357 +#if !defined(TARGETENV_sun4) && !defined(linux)
13358 +typedef unsigned long ulong;
13359 +#endif /* TARGETENV_sun4 */
13362 +typedef unsigned int uint;
13363 +typedef unsigned long long uint64;
13366 +#endif /* WIN32 || PMON || .. */
13368 +/*----------------------- define [u]int8/16/32/64 --------------------------*/
13372 +#include <bcmos.h>
13374 +typedef signed char int8;
13375 +typedef signed short int16;
13376 +typedef signed int int32;
13378 +typedef unsigned char uint8;
13379 +typedef unsigned short uint16;
13380 +typedef unsigned int uint32;
13381 +#endif /* V2_HAL */
13383 +typedef float float32;
13384 +typedef double float64;
13387 + * abstracted floating point type allows for compile time selection of
13388 + * single or double precision arithmetic. Compiling with -DFLOAT32
13389 + * selects single precision; the default is double precision.
13392 +#if defined(FLOAT32)
13393 +typedef float32 float_t;
13394 +#else /* default to double precision floating point */
13395 +typedef float64 float_t;
13396 +#endif /* FLOAT32 */
13398 +#ifdef _MSC_VER /* Microsoft C */
13399 +typedef signed __int64 int64;
13400 +typedef unsigned __int64 uint64;
13402 +#elif defined(__GNUC__) && !defined(__STRICT_ANSI__)
13403 +/* gcc understands signed/unsigned 64 bit types, but complains in ANSI mode */
13404 +typedef signed long long int64;
13405 +typedef unsigned long long uint64;
13407 +#elif defined(__ICL) && !defined(__STDC__)
13408 +/* ICL accepts unsigned 64 bit type only, and complains in ANSI mode */
13409 +typedef unsigned long long uint64;
13411 +#endif /* _MSC_VER */
13414 +/*----------------------- define PTRSZ, INLINE --------------------------*/
13416 +#define PTRSZ sizeof (char*)
13422 +#define INLINE __inline
13426 +#define INLINE __inline__
13432 +#endif /* _MSC_VER */
13434 +#endif /* INLINE */
13436 +#endif /* _TYPEDEFS_H_ */
13437 diff -Nur linux-2.6.12.5/arch/mips/bcm947xx/include/wlioctl.h linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/wlioctl.h
13438 --- linux-2.6.12.5/arch/mips/bcm947xx/include/wlioctl.h 1970-01-01 01:00:00.000000000 +0100
13439 +++ linux-2.6.12.5-brcm/arch/mips/bcm947xx/include/wlioctl.h 2005-08-28 11:12:20.475852312 +0200
13442 + * Custom OID/ioctl definitions for
13443 + * Broadcom 802.11abg Networking Device Driver
13445 + * Definitions subject to change without notice.
13447 + * Copyright 2001-2003, Broadcom Corporation
13448 + * All Rights Reserved.
13450 + * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
13451 + * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
13452 + * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
13453 + * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
13458 +#ifndef _wlioctl_h_
13459 +#define _wlioctl_h_
13461 +#include <typedefs.h>
13462 +#include <proto/ethernet.h>
13463 +#include <proto/802.11.h>
13465 +#if defined(__GNUC__)
13466 +#define PACKED __attribute__((packed))
13472 + * Per-bss information structure.
13475 +#define WL_NUMRATES 255 /* max # of rates in a rateset */
13477 +typedef struct wl_rateset {
13478 + uint32 count; /* # rates in this set */
13479 + uint8 rates[WL_NUMRATES]; /* rates in 500kbps units w/hi bit set if basic */
13482 +#define WL_LEGACY_BSS_INFO_VERSION 106 /* an older supported version of wl_bss_info struct */
13483 +#define WL_BSS_INFO_VERSION 107 /* current version of wl_bss_info struct */
13485 +typedef struct wl_bss_info106 {
13486 + uint version; /* version field */
13487 + struct ether_addr BSSID;
13490 + uint8 Privacy; /* 0=No WEP, 1=Use WEP */
13491 + int16 RSSI; /* receive signal strength (in dBm) */
13492 + uint16 beacon_period; /* units are Kusec */
13493 + uint16 atim_window; /* units are Kusec */
13494 + uint8 channel; /* Channel no. */
13495 + int8 infra; /* 0=IBSS, 1=infrastructure, 2=unknown */
13497 + uint count; /* # rates in this set */
13498 + uint8 rates[12]; /* rates in 500kbps units w/hi bit set if basic */
13499 + } rateset; /* supported rates */
13500 + uint8 dtim_period; /* DTIM period */
13501 + int8 phy_noise; /* noise right after tx (in dBm) */
13502 + uint16 capability; /* Capability information */
13503 + struct dot11_bcn_prb *prb; /* probe response frame (ioctl na) */
13504 + uint16 prb_len; /* probe response frame length (ioctl na) */
13506 + uint8 supported; /* wpa supported */
13507 + uint8 multicast; /* multicast cipher */
13508 + uint8 ucount; /* count of unicast ciphers */
13509 + uint8 unicast[4]; /* unicast ciphers */
13510 + uint8 acount; /* count of auth modes */
13511 + uint8 auth[4]; /* Authentication modes */
13513 +} wl_bss_info106_t;
13515 +typedef struct wl_bss_info {
13516 + uint32 version; /* version field */
13517 + uint32 length; /* byte length of data in this record, starting at version and including IEs */
13518 + struct ether_addr BSSID;
13519 + uint16 beacon_period; /* units are Kusec */
13520 + uint16 capability; /* Capability information */
13524 + uint count; /* # rates in this set */
13525 + uint8 rates[16]; /* rates in 500kbps units w/hi bit set if basic */
13526 + } rateset; /* supported rates */
13527 + uint8 channel; /* Channel no. */
13528 + uint16 atim_window; /* units are Kusec */
13529 + uint8 dtim_period; /* DTIM period */
13530 + int16 RSSI; /* receive signal strength (in dBm) */
13531 + int8 phy_noise; /* noise (in dBm) */
13532 + uint32 ie_length; /* byte length of Information Elements */
13533 + /* variable length Information Elements */
13536 +typedef struct wl_scan_results {
13540 + wl_bss_info_t bss_info[1];
13541 +} wl_scan_results_t;
13542 +/* size of wl_scan_results not including variable length array */
13543 +#define WL_SCAN_RESULTS_FIXED_SIZE 12
13546 +typedef struct wl_uint32_list {
13547 + /* in - # of elements, out - # of entries */
13549 + /* variable length uint32 list */
13550 + uint32 element[1];
13551 +} wl_uint32_list_t;
13553 +typedef struct wlc_ssid {
13558 +#define WLC_CNTRY_BUF_SZ 4 /* Country string is 3 bytes + NULL */
13560 +typedef struct wl_channels_in_country {
13563 + char country_abbrev[WLC_CNTRY_BUF_SZ];
13565 + uint32 channel[1];
13566 +} wl_channels_in_country_t;
13568 +typedef struct wl_country_list {
13573 + char country_abbrev[1];
13574 +} wl_country_list_t;
13578 +* Maximum # of keys that wl driver supports in S/W. Keys supported
13579 +* in H/W is less than or equal to WSEC_MAX_KEYS.
13581 +#define WSEC_MAX_KEYS 54 /* Max # of keys (50 + 4 default keys) */
13582 +#define WSEC_MAX_DEFAULT_KEYS 4 /* # of default keys */
13585 +* Remove these two defines if access to crypto/tkhash.h
13586 +* is unconditionally permitted.
13588 +#define TKHASH_P1_KEY_SIZE 10 /* size of TKHash Phase1 output, in bytes */
13589 +#define TKHASH_P2_KEY_SIZE 16 /* size of TKHash Phase2 output */
13591 +/* Enumerate crypto algorithms */
13592 +#define CRYPTO_ALGO_OFF 0
13593 +#define CRYPTO_ALGO_WEP1 1
13594 +#define CRYPTO_ALGO_TKIP 2
13595 +#define CRYPTO_ALGO_WEP128 3
13596 +#define CRYPTO_ALGO_AES_CCM 4
13597 +#define CRYPTO_ALGO_AES_OCB_MSDU 5
13598 +#define CRYPTO_ALGO_AES_OCB_MPDU 6
13599 +#define CRYPTO_ALGO_NALG 7
13601 +/* For use with wlc_wep_key.flags */
13602 +#define WSEC_PRIMARY_KEY (1 << 1) /* Indicates this key is the primary (ie tx) key */
13603 +#define WSEC_TKIP_ERROR (1 << 2) /* Provoke deliberate MIC error */
13604 +#define WSEC_REPLAY_ERROR (1 << 3) /* Provoke deliberate replay */
13606 +#define WSEC_GEN_MIC_ERROR 0x0001
13607 +#define WSEC_GEN_REPLAY 0x0002
13609 +typedef struct tkip_info {
13610 + uint16 phase1[TKHASH_P1_KEY_SIZE/sizeof(uint16)]; /* tkhash phase1 result */
13611 + uint8 phase2[TKHASH_P2_KEY_SIZE]; /* tkhash phase2 result */
13616 +typedef struct wsec_iv {
13617 + uint32 hi; /* upper 32 bits of IV */
13618 + uint16 lo; /* lower 16 bits of IV */
13621 +typedef struct wsec_key {
13622 + uint32 index; /* key index */
13623 + uint32 len; /* key length */
13624 + uint8 data[DOT11_MAX_KEY_SIZE]; /* key data */
13625 + tkip_info_t tkip_tx; /* tkip transmit state */
13626 + tkip_info_t tkip_rx; /* tkip receive state */
13627 + uint32 algo; /* CRYPTO_ALGO_AES_CCM, CRYPTO_ALGO_WEP128, etc */
13628 + uint32 flags; /* misc flags */
13629 + uint32 algo_hw; /* cache for hw register*/
13630 + uint32 aes_mode; /* cache for hw register*/
13631 + int iv_len; /* IV length */
13632 + int iv_initialized; /* has IV been initialized already? */
13633 + int icv_len; /* ICV length */
13634 + wsec_iv_t rxiv; /* Rx IV */
13635 + wsec_iv_t txiv; /* Tx IV */
13636 + struct ether_addr ea; /* per station */
13639 +/* wireless security bitvec */
13640 +#define WEP_ENABLED 1
13641 +#define TKIP_ENABLED 2
13642 +#define AES_ENABLED 4
13643 +#define WSEC_SWFLAG 8
13645 +#define WSEC_SW(wsec) ((wsec) & WSEC_SWFLAG)
13646 +#define WSEC_HW(wsec) (!WSEC_SW(wsec))
13647 +#define WSEC_WEP_ENABLED(wsec) ((wsec) & WEP_ENABLED)
13648 +#define WSEC_TKIP_ENABLED(wsec) ((wsec) & TKIP_ENABLED)
13649 +#define WSEC_AES_ENABLED(wsec) ((wsec) & AES_ENABLED)
13650 +#define WSEC_ENABLED(wsec) ((wsec) & (WEP_ENABLED | TKIP_ENABLED | AES_ENABLED))
13652 +/* wireless authentication bit vector */
13653 +#define WPA_ENABLED 1
13654 +#define PSK_ENABLED 2
13656 +#define WAUTH_WPA_ENABLED(wauth) ((wauth) & WPA_ENABLED)
13657 +#define WAUTH_PSK_ENABLED(wauth) ((wauth) & PSK_ENABLED)
13658 +#define WAUTH_ENABLED(wauth) ((wauth) & (WPA_ENABLED | PSK_ENABLED))
13660 +/* group/mcast cipher */
13661 +#define WPA_MCAST_CIPHER(wsec) (((wsec) & TKIP_ENABLED) ? WPA_CIPHER_TKIP : \
13662 + ((wsec) & AES_ENABLED) ? WPA_CIPHER_AES_CCM : \
13665 +typedef struct wl_led_info {
13666 + uint32 index; /* led index */
13672 + * definitions for driver messages passed from WL to NAS.
13674 +/* Use this to recognize wpa and 802.1x driver messages. */
13675 +static const uint8 wl_wpa_snap_template[] =
13676 + { 0xaa, 0xaa, 0x03, 0x00, 0x90, 0x4c };
13678 +#define WL_WPA_MSG_IFNAME_MAX 16
13680 +/* WPA driver message */
13681 +typedef struct wl_wpa_header {
13682 + struct ether_header eth;
13683 + struct dot11_llc_snap_header snap;
13686 + /* version 2 additions */
13687 + char ifname[WL_WPA_MSG_IFNAME_MAX];
13688 + /* version specific data */
13689 + /* uint8 data[1]; */
13690 +} wl_wpa_header_t PACKED;
13692 +#define WL_WPA_HEADER_LEN (ETHER_HDR_LEN + DOT11_LLC_SNAP_HDR_LEN + 2 + WL_WPA_MSG_IFNAME_MAX)
13694 +/* WPA driver message ethertype - private between wlc and nas */
13695 +#define WL_WPA_ETHER_TYPE 0x9999
13697 +/* WPA driver message current version */
13698 +#define WL_WPA_MSG_VERSION 2
13700 +/* Type field values for the 802.2 driver messages for WPA. */
13701 +#define WLC_ASSOC_MSG 1
13702 +#define WLC_DISASSOC_MSG 2
13703 +#define WLC_PTK_MIC_MSG 3
13704 +#define WLC_GTK_MIC_MSG 4
13706 +/* 802.1x driver message */
13707 +typedef struct wl_eapol_header {
13708 + struct ether_header eth;
13709 + struct dot11_llc_snap_header snap;
13712 + char ifname[WL_WPA_MSG_IFNAME_MAX];
13713 + /* version specific data */
13714 + /* uint8 802_1x_msg[1]; */
13715 +} wl_eapol_header_t PACKED;
13717 +#define WL_EAPOL_HEADER_LEN (ETHER_HDR_LEN + DOT11_LLC_SNAP_HDR_LEN + 2 + WL_WPA_MSG_IFNAME_MAX)
13719 +/* 802.1x driver message ethertype - private between wlc and nas */
13720 +#define WL_EAPOL_ETHER_TYPE 0x999A
13722 +/* 802.1x driver message current version */
13723 +#define WL_EAPOL_MSG_VERSION 1
13725 +/* srom read/write struct passed through ioctl */
13727 + uint byteoff; /* byte offset */
13728 + uint nbytes; /* number of bytes */
13732 +/* R_REG and W_REG struct passed through ioctl */
13734 + uint32 byteoff; /* byte offset of the field in d11regs_t */
13735 + uint32 val; /* read/write value of the field */
13736 + uint32 size; /* sizeof the field */
13739 +/* Structure used by GET/SET_ATTEN ioctls */
13741 + uint16 auto_ctrl; /* 1: Automatic control, 0: overriden */
13742 + uint16 bb; /* Baseband attenuation */
13743 + uint16 radio; /* Radio attenuation */
13744 + uint16 txctl1; /* Radio TX_CTL1 value */
13747 +/* Used to get specific STA parameters */
13750 + struct ether_addr ea;
13753 +/* callback registration data types */
13755 +typedef struct _mac_event_params {
13757 + struct ether_addr *addr;
13761 +} mac_event_params_t;
13763 +typedef struct _mic_error_params {
13764 + struct ether_addr *ea;
13767 +} mic_error_params_t;
13769 +typedef enum _wl_callback {
13770 + WL_MAC_EVENT_CALLBACK = 0,
13771 + WL_LINK_UP_CALLBACK,
13772 + WL_LINK_DOWN_CALLBACK,
13773 + WL_MIC_ERROR_CALLBACK,
13777 +typedef struct _callback {
13778 + void (*fn)(void *, void *);
13782 +typedef struct _scan_callback {
13783 + void (*fn)(void *);
13785 +} scan_callback_t;
13787 +/* used to register an arbitrary callback via the IOCTL interface */
13788 +typedef struct _set_callback {
13790 + callback_t callback;
13794 + * Country locale determines which channels are available to us.
13796 +typedef enum _wlc_locale {
13797 + WLC_WW = 0, /* Worldwide */
13798 + WLC_THA, /* Thailand */
13799 + WLC_ISR, /* Israel */
13800 + WLC_JDN, /* Jordan */
13801 + WLC_PRC, /* China */
13802 + WLC_JPN, /* Japan */
13803 + WLC_FCC, /* USA */
13804 + WLC_EUR, /* Europe */
13805 + WLC_USL, /* US Low Band only */
13806 + WLC_JPH, /* Japan High Band only */
13807 + WLC_ALL, /* All the channels in this band */
13808 + WLC_11D, /* Represents locale recieved by 11d beacons */
13810 + WLC_UNDEFINED_LOCALE = 0xf
13813 +/* channel encoding */
13814 +typedef struct channel_info {
13816 + int target_channel;
13817 + int scan_channel;
13820 +/* For ioctls that take a list of MAC addresses */
13822 + uint count; /* number of MAC addresses */
13823 + struct ether_addr ea[1]; /* variable length array of MAC addresses */
13826 +/* get pkt count struct passed through ioctl */
13827 +typedef struct get_pktcnt {
13828 + uint rx_good_pkt;
13830 + uint tx_good_pkt;
13834 +/* Linux network driver ioctl encoding */
13835 +typedef struct wl_ioctl {
13836 + int cmd; /* common ioctl definition */
13837 + void *buf; /* pointer to user buffer */
13838 + int len; /* length of user buffer */
13842 + * Structure for passing hardware and software
13843 + * revision info up from the driver.
13845 +typedef struct wlc_rev_info {
13846 + uint vendorid; /* PCI vendor id */
13847 + uint deviceid; /* device id of chip */
13848 + uint radiorev; /* radio revision */
13849 + uint chiprev; /* chip revision */
13850 + uint corerev; /* core revision */
13851 + uint boardid; /* board identifier (usu. PCI sub-device id) */
13852 + uint boardvendor; /* board vendor (usu. PCI sub-vendor id) */
13853 + uint boardrev; /* board revision */
13854 + uint driverrev; /* driver version */
13855 + uint ucoderev; /* microcode version */
13856 + uint bus; /* bus type */
13857 + uint chipnum; /* chip number */
13860 +/* check this magic number */
13861 +#define WLC_IOCTL_MAGIC 0x14e46c77
13863 +/* bump this number if you change the ioctl interface */
13864 +#define WLC_IOCTL_VERSION 1
13866 +/* maximum length buffer required */
13867 +#define WLC_IOCTL_MAXLEN 8192
13869 +/* common ioctl definitions */
13870 +#define WLC_GET_MAGIC 0
13871 +#define WLC_GET_VERSION 1
13873 +#define WLC_DOWN 3
13874 +#define WLC_DUMP 6
13875 +#define WLC_GET_MSGLEVEL 7
13876 +#define WLC_SET_MSGLEVEL 8
13877 +#define WLC_GET_PROMISC 9
13878 +#define WLC_SET_PROMISC 10
13879 +#define WLC_GET_RATE 12
13880 +#define WLC_SET_RATE 13
13881 +#define WLC_GET_INSTANCE 14
13882 +#define WLC_GET_FRAG 15
13883 +#define WLC_SET_FRAG 16
13884 +#define WLC_GET_RTS 17
13885 +#define WLC_SET_RTS 18
13886 +#define WLC_GET_INFRA 19
13887 +#define WLC_SET_INFRA 20
13888 +#define WLC_GET_AUTH 21
13889 +#define WLC_SET_AUTH 22
13890 +#define WLC_GET_BSSID 23
13891 +#define WLC_SET_BSSID 24
13892 +#define WLC_GET_SSID 25
13893 +#define WLC_SET_SSID 26
13894 +#define WLC_RESTART 27
13895 +#define WLC_GET_CHANNEL 29
13896 +#define WLC_SET_CHANNEL 30
13897 +#define WLC_GET_SRL 31
13898 +#define WLC_SET_SRL 32
13899 +#define WLC_GET_LRL 33
13900 +#define WLC_SET_LRL 34
13901 +#define WLC_GET_PLCPHDR 35
13902 +#define WLC_SET_PLCPHDR 36
13903 +#define WLC_GET_RADIO 37
13904 +#define WLC_SET_RADIO 38
13905 +#define WLC_GET_PHYTYPE 39
13906 +#define WLC_GET_WEP 42
13907 +#define WLC_SET_WEP 43
13908 +#define WLC_GET_KEY 44
13909 +#define WLC_SET_KEY 45
13910 +#define WLC_SCAN 50
13911 +#define WLC_SCAN_RESULTS 51
13912 +#define WLC_DISASSOC 52
13913 +#define WLC_REASSOC 53
13914 +#define WLC_GET_ROAM_TRIGGER 54
13915 +#define WLC_SET_ROAM_TRIGGER 55
13916 +#define WLC_GET_TXANT 61
13917 +#define WLC_SET_TXANT 62
13918 +#define WLC_GET_ANTDIV 63
13919 +#define WLC_SET_ANTDIV 64
13920 +#define WLC_GET_TXPWR 65
13921 +#define WLC_SET_TXPWR 66
13922 +#define WLC_GET_CLOSED 67
13923 +#define WLC_SET_CLOSED 68
13924 +#define WLC_GET_MACLIST 69
13925 +#define WLC_SET_MACLIST 70
13926 +#define WLC_GET_RATESET 71
13927 +#define WLC_SET_RATESET 72
13928 +#define WLC_GET_LOCALE 73
13929 +#define WLC_SET_LOCALE 74
13930 +#define WLC_GET_BCNPRD 75
13931 +#define WLC_SET_BCNPRD 76
13932 +#define WLC_GET_DTIMPRD 77
13933 +#define WLC_SET_DTIMPRD 78
13934 +#define WLC_GET_SROM 79
13935 +#define WLC_SET_SROM 80
13936 +#define WLC_GET_WEP_RESTRICT 81
13937 +#define WLC_SET_WEP_RESTRICT 82
13938 +#define WLC_GET_COUNTRY 83
13939 +#define WLC_SET_COUNTRY 84
13940 +#define WLC_GET_REVINFO 98
13941 +#define WLC_GET_MACMODE 105
13942 +#define WLC_SET_MACMODE 106
13943 +#define WLC_GET_GMODE 109
13944 +#define WLC_SET_GMODE 110
13945 +#define WLC_GET_CURR_RATESET 114 /* current rateset */
13946 +#define WLC_GET_SCANSUPPRESS 115
13947 +#define WLC_SET_SCANSUPPRESS 116
13948 +#define WLC_GET_AP 117
13949 +#define WLC_SET_AP 118
13950 +#define WLC_GET_EAP_RESTRICT 119
13951 +#define WLC_SET_EAP_RESTRICT 120
13952 +#define WLC_GET_WDSLIST 123
13953 +#define WLC_SET_WDSLIST 124
13954 +#define WLC_GET_RSSI 127
13955 +#define WLC_GET_WSEC 133
13956 +#define WLC_SET_WSEC 134
13957 +#define WLC_GET_BSS_INFO 136
13958 +#define WLC_GET_LAZYWDS 138
13959 +#define WLC_SET_LAZYWDS 139
13960 +#define WLC_GET_BANDLIST 140
13961 +#define WLC_GET_BAND 141
13962 +#define WLC_SET_BAND 142
13963 +#define WLC_GET_SHORTSLOT 144
13964 +#define WLC_GET_SHORTSLOT_OVERRIDE 145
13965 +#define WLC_SET_SHORTSLOT_OVERRIDE 146
13966 +#define WLC_GET_SHORTSLOT_RESTRICT 147
13967 +#define WLC_SET_SHORTSLOT_RESTRICT 148
13968 +#define WLC_GET_GMODE_PROTECTION 149
13969 +#define WLC_GET_GMODE_PROTECTION_OVERRIDE 150
13970 +#define WLC_SET_GMODE_PROTECTION_OVERRIDE 151
13971 +#define WLC_UPGRADE 152
13972 +#define WLC_GET_ASSOCLIST 159
13973 +#define WLC_GET_CLK 160
13974 +#define WLC_SET_CLK 161
13975 +#define WLC_GET_UP 162
13976 +#define WLC_OUT 163
13977 +#define WLC_GET_WPA_AUTH 164
13978 +#define WLC_SET_WPA_AUTH 165
13979 +#define WLC_GET_GMODE_PROTECTION_CONTROL 178
13980 +#define WLC_SET_GMODE_PROTECTION_CONTROL 179
13981 +#define WLC_GET_PHYLIST 180
13982 +#define WLC_GET_GMODE_PROTECTION_CTS 198
13983 +#define WLC_SET_GMODE_PROTECTION_CTS 199
13984 +#define WLC_GET_PIOMODE 203
13985 +#define WLC_SET_PIOMODE 204
13986 +#define WLC_SET_LED 209
13987 +#define WLC_GET_LED 210
13988 +#define WLC_GET_CHANNEL_SEL 215
13989 +#define WLC_START_CHANNEL_SEL 216
13990 +#define WLC_GET_VALID_CHANNELS 217
13991 +#define WLC_GET_FAKEFRAG 218
13992 +#define WLC_SET_FAKEFRAG 219
13993 +#define WLC_GET_WET 230
13994 +#define WLC_SET_WET 231
13995 +#define WLC_GET_KEY_PRIMARY 235
13996 +#define WLC_SET_KEY_PRIMARY 236
13997 +#define WLC_SCAN_WITH_CALLBACK 240
13998 +#define WLC_SET_CS_SCAN_TIMER 248
13999 +#define WLC_GET_CS_SCAN_TIMER 249
14000 +#define WLC_CURRENT_PWR 256
14001 +#define WLC_GET_CHANNELS_IN_COUNTRY 260
14002 +#define WLC_GET_COUNTRY_LIST 261
14003 +#define WLC_NVRAM_GET 264
14004 +#define WLC_NVRAM_SET 265
14005 +#define WLC_LAST 271 /* bump after adding */
14008 + * Minor kludge alert:
14009 + * Duplicate a few definitions that irelay requires from epiioctl.h here
14010 + * so caller doesn't have to include this file and epiioctl.h .
14011 + * If this grows any more, it would be time to move these irelay-specific
14012 + * definitions out of the epiioctl.h and into a separate driver common file.
14014 +#ifndef EPICTRL_COOKIE
14015 +#define EPICTRL_COOKIE 0xABADCEDE
14018 +/* vx wlc ioctl's offset */
14019 +#define CMN_IOCTL_OFF 0x180
14022 + * custom OID support
14024 + * 0xFF - implementation specific OID
14025 + * 0xE4 - first byte of Broadcom PCI vendor ID
14026 + * 0x14 - second byte of Broadcom PCI vendor ID
14027 + * 0xXX - the custom OID number
14030 +/* begin 0x1f values beyond the start of the ET driver range. */
14031 +#define WL_OID_BASE 0xFFE41420
14033 +/* NDIS overrides */
14034 +#define OID_WL_GETINSTANCE (WL_OID_BASE + WLC_GET_INSTANCE)
14036 +#define WL_DECRYPT_STATUS_SUCCESS 1
14037 +#define WL_DECRYPT_STATUS_FAILURE 2
14038 +#define WL_DECRYPT_STATUS_UNKNOWN 3
14040 +/* allows user-mode app to poll the status of USB image upgrade */
14041 +#define WLC_UPGRADE_SUCCESS 0
14042 +#define WLC_UPGRADE_PENDING 1
14044 +/* Bit masks for radio disabled status - returned by WL_GET_RADIO */
14045 +#define WL_RADIO_SW_DISABLE (1<<0)
14046 +#define WL_RADIO_HW_DISABLE (1<<1)
14048 +/* Override bit for WLC_SET_TXPWR. if set, ignore other level limits */
14049 +#define WL_TXPWR_OVERRIDE (1<<31)
14053 +#define WL_SB_BUS 0 /* Silicon Backplane */
14054 +#define WL_PCI_BUS 1 /* PCI target */
14055 +#define WL_PCMCIA_BUS 2 /* PCMCIA target */
14058 +#define WLC_BAND_AUTO 0 /* auto-select */
14059 +#define WLC_BAND_A 1 /* "a" band (5 Ghz) */
14060 +#define WLC_BAND_B 2 /* "b" band (2.4 Ghz) */
14062 +/* MAC list modes */
14063 +#define WLC_MACMODE_DISABLED 0 /* MAC list disabled */
14064 +#define WLC_MACMODE_DENY 1 /* Deny specified (i.e. allow unspecified) */
14065 +#define WLC_MACMODE_ALLOW 2 /* Allow specified (i.e. deny unspecified) */
14070 +#define GMODE_LEGACY_B 0
14071 +#define GMODE_AUTO 1
14072 +#define GMODE_ONLY 2
14073 +#define GMODE_B_DEFERRED 3
14074 +#define GMODE_PERFORMANCE 4
14075 +#define GMODE_LRS 5
14076 +#define GMODE_MAX 6
14078 +/* values for PLCPHdr_override */
14079 +#define WLC_PLCP_AUTO -1
14080 +#define WLC_PLCP_SHORT 0
14081 +#define WLC_PLCP_LONG 1
14083 +/* values for g_protection_override */
14084 +#define WLC_G_PROTECTION_AUTO -1
14085 +#define WLC_G_PROTECTION_OFF 0
14086 +#define WLC_G_PROTECTION_ON 1
14088 +/* values for g_protection_control */
14089 +#define WLC_G_PROTECTION_CTL_OFF 0
14090 +#define WLC_G_PROTECTION_CTL_LOCAL 1
14091 +#define WLC_G_PROTECTION_CTL_OVERLAP 2
14098 +/* max # of leds supported by GPIO (gpio pin# == led index#) */
14099 +#define WL_LED_NUMGPIO 16 /* gpio 0-15 */
14101 +/* led per-pin behaviors */
14102 +#define WL_LED_OFF 0 /* always off */
14103 +#define WL_LED_ON 1 /* always on */
14104 +#define WL_LED_ACTIVITY 2 /* activity */
14105 +#define WL_LED_RADIO 3 /* radio enabled */
14106 +#define WL_LED_ARADIO 4 /* 5 Ghz radio enabled */
14107 +#define WL_LED_BRADIO 5 /* 2.4Ghz radio enabled */
14108 +#define WL_LED_BGMODE 6 /* on if gmode, off if bmode */
14109 +#define WL_LED_WI1 7
14110 +#define WL_LED_WI2 8
14111 +#define WL_LED_WI3 9
14112 +#define WL_LED_ASSOC 10 /* associated state indicator */
14113 +#define WL_LED_INACTIVE 11 /* null behavior (clears default behavior) */
14114 +#define WL_LED_NUMBEHAVIOR 12
14116 +/* led behavior numeric value format */
14117 +#define WL_LED_BEH_MASK 0x7f /* behavior mask */
14118 +#define WL_LED_AL_MASK 0x80 /* activelow (polarity) bit */
14122 +#define WL_RATE_OFDM(r) (((r) & 0x7f) == 12 || ((r) & 0x7f) == 18 || \
14123 + ((r) & 0x7f) == 24 || ((r) & 0x7f) == 36 || \
14124 + ((r) & 0x7f) == 48 || ((r) & 0x7f) == 72 || \
14125 + ((r) & 0x7f) == 96 || ((r) & 0x7f) == 108)
14130 +#endif /* _wlioctl_h_ */
14131 diff -Nur linux-2.6.12.5/arch/mips/bcm947xx/int-handler.S linux-2.6.12.5-brcm/arch/mips/bcm947xx/int-handler.S
14132 --- linux-2.6.12.5/arch/mips/bcm947xx/int-handler.S 1970-01-01 01:00:00.000000000 +0100
14133 +++ linux-2.6.12.5-brcm/arch/mips/bcm947xx/int-handler.S 2005-08-28 16:58:08.027788792 +0200
14136 + * Copyright (C) 2004 Florian Schirmer (jolt@tuxbox.org)
14138 + * This program is free software; you can redistribute it and/or modify it
14139 + * under the terms of the GNU General Public License as published by the
14140 + * Free Software Foundation; either version 2 of the License, or (at your
14141 + * option) any later version.
14143 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
14144 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
14145 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
14146 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
14147 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
14148 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
14149 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
14150 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14151 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
14152 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14154 + * You should have received a copy of the GNU General Public License along
14155 + * with this program; if not, write to the Free Software Foundation, Inc.,
14156 + * 675 Mass Ave, Cambridge, MA 02139, USA.
14159 +#include <asm/asm.h>
14160 +#include <asm/mipsregs.h>
14161 +#include <asm/regdef.h>
14162 +#include <asm/stackframe.h>
14169 + NESTED(bcm47xx_irq_handler, PT_SIZE, sp)
14176 + jal bcm47xx_irq_dispatch
14182 + END(bcm47xx_irq_handler)
14183 diff -Nur linux-2.6.12.5/arch/mips/bcm947xx/irq.c linux-2.6.12.5-brcm/arch/mips/bcm947xx/irq.c
14184 --- linux-2.6.12.5/arch/mips/bcm947xx/irq.c 1970-01-01 01:00:00.000000000 +0100
14185 +++ linux-2.6.12.5-brcm/arch/mips/bcm947xx/irq.c 2005-08-28 16:58:26.178029536 +0200
14188 + * Copyright (C) 2004 Florian Schirmer (jolt@tuxbox.org)
14190 + * This program is free software; you can redistribute it and/or modify it
14191 + * under the terms of the GNU General Public License as published by the
14192 + * Free Software Foundation; either version 2 of the License, or (at your
14193 + * option) any later version.
14195 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
14196 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
14197 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
14198 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
14199 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
14200 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
14201 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
14202 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14203 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
14204 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14206 + * You should have received a copy of the GNU General Public License along
14207 + * with this program; if not, write to the Free Software Foundation, Inc.,
14208 + * 675 Mass Ave, Cambridge, MA 02139, USA.
14211 +#include <linux/config.h>
14212 +#include <linux/errno.h>
14213 +#include <linux/init.h>
14214 +#include <linux/interrupt.h>
14215 +#include <linux/irq.h>
14216 +#include <linux/module.h>
14217 +#include <linux/smp.h>
14218 +#include <linux/types.h>
14220 +#include <asm/cpu.h>
14221 +#include <asm/io.h>
14222 +#include <asm/irq.h>
14223 +#include <asm/irq_cpu.h>
14224 +#include <asm/gdb-stub.h>
14226 +extern asmlinkage void bcm47xx_irq_handler(void);
14228 +void bcm47xx_irq_dispatch(struct pt_regs *regs)
14232 + cause = read_c0_cause() & read_c0_status() & CAUSEF_IP;
14234 + clear_c0_status(cause);
14236 + if (cause & CAUSEF_IP7)
14238 + if (cause & CAUSEF_IP2)
14240 + if (cause & CAUSEF_IP3)
14242 + if (cause & CAUSEF_IP4)
14244 + if (cause & CAUSEF_IP5)
14246 + if (cause & CAUSEF_IP6)
14250 +void __init arch_init_irq(void)
14252 + set_except_vector(0, bcm47xx_irq_handler);
14253 + mips_cpu_irq_init(0);
14255 diff -Nur linux-2.6.12.5/arch/mips/bcm947xx/prom.c linux-2.6.12.5-brcm/arch/mips/bcm947xx/prom.c
14256 --- linux-2.6.12.5/arch/mips/bcm947xx/prom.c 1970-01-01 01:00:00.000000000 +0100
14257 +++ linux-2.6.12.5-brcm/arch/mips/bcm947xx/prom.c 2005-08-28 16:58:41.789656208 +0200
14260 + * Copyright (C) 2004 Florian Schirmer (jolt@tuxbox.org)
14262 + * This program is free software; you can redistribute it and/or modify it
14263 + * under the terms of the GNU General Public License as published by the
14264 + * Free Software Foundation; either version 2 of the License, or (at your
14265 + * option) any later version.
14267 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
14268 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
14269 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
14270 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
14271 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
14272 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
14273 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
14274 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14275 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
14276 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14278 + * You should have received a copy of the GNU General Public License along
14279 + * with this program; if not, write to the Free Software Foundation, Inc.,
14280 + * 675 Mass Ave, Cambridge, MA 02139, USA.
14283 +#include <linux/init.h>
14284 +#include <linux/mm.h>
14285 +#include <linux/sched.h>
14286 +#include <linux/bootmem.h>
14288 +#include <asm/addrspace.h>
14289 +#include <asm/bootinfo.h>
14290 +#include <asm/pmon.h>
14292 +const char *get_system_type(void)
14294 + return "Broadcom BCM47xx";
14297 +void __init prom_init(void)
14299 + unsigned long mem;
14301 + mips_machgroup = MACH_GROUP_BRCM;
14302 + mips_machtype = MACH_BCM47XX;
14304 + /* Figure out memory size by finding aliases */
14305 + for (mem = (1 << 20); mem < (128 << 20); mem += (1 << 20)) {
14306 + if (*(unsigned long *)((unsigned long)(prom_init) + mem) ==
14307 + *(unsigned long *)(prom_init))
14311 + add_memory_region(0, mem, BOOT_MEM_RAM);
14314 +unsigned long __init prom_free_prom_memory(void)
14318 diff -Nur linux-2.6.12.5/arch/mips/bcm947xx/setup.c linux-2.6.12.5-brcm/arch/mips/bcm947xx/setup.c
14319 --- linux-2.6.12.5/arch/mips/bcm947xx/setup.c 1970-01-01 01:00:00.000000000 +0100
14320 +++ linux-2.6.12.5-brcm/arch/mips/bcm947xx/setup.c 2005-08-28 16:57:28.317825624 +0200
14323 + * Copyright (C) 2004 Florian Schirmer (jolt@tuxbox.org)
14325 + * This program is free software; you can redistribute it and/or modify it
14326 + * under the terms of the GNU General Public License as published by the
14327 + * Free Software Foundation; either version 2 of the License, or (at your
14328 + * option) any later version.
14330 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
14331 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
14332 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
14333 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
14334 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
14335 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
14336 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
14337 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14338 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
14339 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14341 + * You should have received a copy of the GNU General Public License along
14342 + * with this program; if not, write to the Free Software Foundation, Inc.,
14343 + * 675 Mass Ave, Cambridge, MA 02139, USA.
14346 +#include <linux/init.h>
14347 +#include <linux/types.h>
14348 +#include <linux/tty.h>
14349 +#include <linux/serial.h>
14350 +#include <linux/serial_core.h>
14351 +#include <linux/serial_reg.h>
14352 +#include <asm/time.h>
14353 +#include <asm/reboot.h>
14355 +#include <typedefs.h>
14356 +#include <sbutils.h>
14357 +#include <sbmips.h>
14358 +#include <sbpci.h>
14359 +#include <sbconfig.h>
14360 +#include <bcmdevs.h>
14364 +#define SER_PORT1(reg) (*((volatile unsigned char *)(0xb8000400+reg)))
14366 +int putDebugChar(char c)
14368 + while (!(SER_PORT1(UART_LSR) & UART_LSR_THRE));
14369 + SER_PORT1(UART_TX) = c;
14374 +char getDebugChar(void)
14376 + while (!(SER_PORT1(UART_LSR) & 1));
14377 + return SER_PORT1(UART_RX);
14381 +static int ser_line = 0;
14384 +serial_add(void *regs, uint irq, uint baud_base, uint reg_shift)
14386 + struct uart_port s;
14388 + memset(&s, 0, sizeof(s));
14390 + s.line = ser_line++;
14391 + s.membase = regs;
14393 + s.uartclk = baud_base;
14394 + s.flags = ASYNC_BOOT_AUTOCONF;
14395 + s.iotype = SERIAL_IO_MEM;
14396 + s.regshift = reg_shift;
14398 + if (early_serial_setup(&s) != 0) {
14399 + printk(KERN_ERR "Serial setup failed!\n");
14404 +extern void bcm47xx_time_init(void);
14405 +extern void bcm47xx_timer_setup(struct irqaction *irq);
14407 +void *nvram_get(char *foo)
14414 +static void bcm47xx_machine_restart(char *command)
14416 + /* Set the watchdog timer to reset immediately */
14418 + sb_watchdog(sbh, 1);
14422 +static void bcm47xx_machine_halt(void)
14424 + /* Disable interrupts and watchdog and spin forever */
14426 + sb_watchdog(sbh, 0);
14430 +static int __init bcm47xx_init(void)
14433 + sbh = sb_kattach();
14434 + sb_mips_init(sbh);
14436 + sb_serial_init(sbh, serial_add);
14438 + _machine_restart = bcm47xx_machine_restart;
14439 + _machine_halt = bcm47xx_machine_halt;
14440 + _machine_power_off = bcm47xx_machine_halt;
14442 + board_time_init = bcm47xx_time_init;
14443 + board_timer_setup = bcm47xx_timer_setup;
14448 +early_initcall(bcm47xx_init);
14449 diff -Nur linux-2.6.12.5/arch/mips/bcm947xx/time.c linux-2.6.12.5-brcm/arch/mips/bcm947xx/time.c
14450 --- linux-2.6.12.5/arch/mips/bcm947xx/time.c 1970-01-01 01:00:00.000000000 +0100
14451 +++ linux-2.6.12.5-brcm/arch/mips/bcm947xx/time.c 2005-08-28 16:57:55.440702320 +0200
14454 + * Copyright (C) 2004 Florian Schirmer (jolt@tuxbox.org)
14456 + * This program is free software; you can redistribute it and/or modify it
14457 + * under the terms of the GNU General Public License as published by the
14458 + * Free Software Foundation; either version 2 of the License, or (at your
14459 + * option) any later version.
14461 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
14462 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
14463 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
14464 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
14465 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
14466 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
14467 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
14468 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14469 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
14470 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14472 + * You should have received a copy of the GNU General Public License along
14473 + * with this program; if not, write to the Free Software Foundation, Inc.,
14474 + * 675 Mass Ave, Cambridge, MA 02139, USA.
14477 +#include <linux/config.h>
14478 +#include <linux/init.h>
14479 +#include <linux/kernel.h>
14480 +#include <linux/sched.h>
14481 +#include <linux/serial_reg.h>
14482 +#include <linux/interrupt.h>
14483 +#include <asm/addrspace.h>
14484 +#include <asm/io.h>
14485 +#include <asm/time.h>
14488 +bcm47xx_time_init(void)
14493 + * Use deterministic values for initial counter interrupt
14494 + * so that calibrate delay avoids encountering a counter wrap.
14496 + write_c0_count(0);
14497 + write_c0_compare(0xffff);
14499 + hz = 200 * 1000 * 1000;
14501 + /* Set MIPS counter frequency for fixed_rate_gettimeoffset() */
14502 + mips_hpt_frequency = hz / 2;
14507 +bcm47xx_timer_setup(struct irqaction *irq)
14509 + /* Enable the timer interrupt */
14510 + setup_irq(7, irq);
14512 diff -Nur linux-2.6.12.5/arch/mips/kernel/cpu-probe.c linux-2.6.12.5-brcm/arch/mips/kernel/cpu-probe.c
14513 --- linux-2.6.12.5/arch/mips/kernel/cpu-probe.c 2005-08-15 02:20:18.000000000 +0200
14514 +++ linux-2.6.12.5-brcm/arch/mips/kernel/cpu-probe.c 2005-08-28 11:12:20.538842736 +0200
14515 @@ -555,6 +555,28 @@
14519 +static inline void cpu_probe_broadcom(struct cpuinfo_mips *c)
14521 + decode_config1(c);
14522 + switch (c->processor_id & 0xff00) {
14523 + case PRID_IMP_BCM3302:
14524 + c->cputype = CPU_BCM3302;
14525 + c->isa_level = MIPS_CPU_ISA_M32;
14526 + c->options = MIPS_CPU_TLB | MIPS_CPU_4KEX |
14527 + MIPS_CPU_4KTLB | MIPS_CPU_COUNTER;
14529 + case PRID_IMP_BCM4710:
14530 + c->cputype = CPU_BCM4710;
14531 + c->isa_level = MIPS_CPU_ISA_M32;
14532 + c->options = MIPS_CPU_TLB | MIPS_CPU_4KEX |
14533 + MIPS_CPU_4KTLB | MIPS_CPU_COUNTER;
14536 + c->cputype = CPU_UNKNOWN;
14541 __init void cpu_probe(void)
14543 struct cpuinfo_mips *c = ¤t_cpu_data;
14544 @@ -577,7 +599,9 @@
14545 case PRID_COMP_SIBYTE:
14546 cpu_probe_sibyte(c);
14549 + case PRID_COMP_BROADCOM:
14550 + cpu_probe_broadcom(c);
14552 case PRID_COMP_SANDCRAFT:
14553 cpu_probe_sandcraft(c);
14555 diff -Nur linux-2.6.12.5/arch/mips/kernel/head.S linux-2.6.12.5-brcm/arch/mips/kernel/head.S
14556 --- linux-2.6.12.5/arch/mips/kernel/head.S 2005-08-15 02:20:18.000000000 +0200
14557 +++ linux-2.6.12.5-brcm/arch/mips/kernel/head.S 2005-08-28 11:12:20.539842584 +0200
14558 @@ -122,6 +122,14 @@
14562 +#ifdef CONFIG_BCM4710
14564 +#define eret nop; nop; eret
14571 * Reserved space for exception handlers.
14572 * Necessary for machines which link their kernels at KSEG0.
14573 diff -Nur linux-2.6.12.5/arch/mips/kernel/proc.c linux-2.6.12.5-brcm/arch/mips/kernel/proc.c
14574 --- linux-2.6.12.5/arch/mips/kernel/proc.c 2005-08-15 02:20:18.000000000 +0200
14575 +++ linux-2.6.12.5-brcm/arch/mips/kernel/proc.c 2005-08-28 11:12:20.553840456 +0200
14577 [CPU_VR4133] "NEC VR4133",
14578 [CPU_VR4181] "NEC VR4181",
14579 [CPU_VR4181A] "NEC VR4181A",
14580 - [CPU_SR71000] "Sandcraft SR71000"
14581 + [CPU_SR71000] "Sandcraft SR71000",
14582 + [CPU_BCM3302] "Broadcom BCM3302",
14583 + [CPU_BCM4710] "Broadcom BCM4710"
14587 diff -Nur linux-2.6.12.5/arch/mips/mm/tlbex.c linux-2.6.12.5-brcm/arch/mips/mm/tlbex.c
14588 --- linux-2.6.12.5/arch/mips/mm/tlbex.c 2005-08-15 02:20:18.000000000 +0200
14589 +++ linux-2.6.12.5-brcm/arch/mips/mm/tlbex.c 2005-08-28 11:12:20.587835288 +0200
14590 @@ -851,6 +851,8 @@
14594 + case CPU_BCM3302:
14595 + case CPU_BCM4710:
14599 diff -Nur linux-2.6.12.5/arch/mips/pci/Makefile linux-2.6.12.5-brcm/arch/mips/pci/Makefile
14600 --- linux-2.6.12.5/arch/mips/pci/Makefile 2005-08-15 02:20:18.000000000 +0200
14601 +++ linux-2.6.12.5-brcm/arch/mips/pci/Makefile 2005-08-28 16:41:44.565297816 +0200
14603 obj-$(CONFIG_MIPS_TX3927) += ops-jmr3927.o
14604 obj-$(CONFIG_PCI_VR41XX) += ops-vr41xx.o pci-vr41xx.o
14605 obj-$(CONFIG_NEC_CMBVR4133) += fixup-vr4133.o
14606 +obj-$(CONFIG_BCM947XX) += ops-sb.o fixup-bcm47xx.o pci-bcm47xx.o
14609 # These are still pretty much in the old state, watch, go blind.
14610 diff -Nur linux-2.6.12.5/arch/mips/pci/fixup-bcm47xx.c linux-2.6.12.5-brcm/arch/mips/pci/fixup-bcm47xx.c
14611 --- linux-2.6.12.5/arch/mips/pci/fixup-bcm47xx.c 1970-01-01 01:00:00.000000000 +0100
14612 +++ linux-2.6.12.5-brcm/arch/mips/pci/fixup-bcm47xx.c 2005-08-28 11:12:20.611831640 +0200
14614 +#include <linux/init.h>
14615 +#include <linux/pci.h>
14617 +/* Do platform specific device initialization at pci_enable_device() time */
14618 +int pcibios_plat_dev_init(struct pci_dev *dev)
14623 +int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
14627 + if (dev->bus->number == 1)
14630 + pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &irq);
14634 +struct pci_fixup pcibios_fixups[] __initdata = {
14637 diff -Nur linux-2.6.12.5/arch/mips/pci/ops-sb.c linux-2.6.12.5-brcm/arch/mips/pci/ops-sb.c
14638 --- linux-2.6.12.5/arch/mips/pci/ops-sb.c 1970-01-01 01:00:00.000000000 +0100
14639 +++ linux-2.6.12.5-brcm/arch/mips/pci/ops-sb.c 2005-08-28 11:12:20.612831488 +0200
14641 +#include <linux/kernel.h>
14642 +#include <linux/init.h>
14643 +#include <linux/pci.h>
14644 +#include <linux/types.h>
14645 +#include <asm/pci.h>
14647 +#include <typedefs.h>
14648 +#include <sbpci.h>
14651 +//extern spinlock_t bcm47xx_sbh_lock;
14654 +sb_pci_read_config(struct pci_bus *bus, unsigned int devfn,
14655 + int reg, int size, u32 *val)
14657 + //unsigned long flags;
14661 + //spin_lock_irqsave(&sbh_lock, flags);
14662 + ret = sbpci_read_config(sbh, bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn), reg, val, size);
14663 + //spin_unlock_irqrestore(&sbh_lock, flags);
14665 + return ret ? PCIBIOS_DEVICE_NOT_FOUND : PCIBIOS_SUCCESSFUL;
14669 +sb_pci_write_config(struct pci_bus *bus, unsigned int devfn,
14670 + int reg, int size, u32 val)
14672 +// unsigned long flags;
14675 +// spin_lock_irqsave(&sbh_lock, flags);
14676 + ret = sbpci_write_config(sbh, bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn), reg, &val, size);
14677 +// spin_unlock_irqrestore(&sbh_lock, flags);
14678 + return ret ? PCIBIOS_DEVICE_NOT_FOUND : PCIBIOS_SUCCESSFUL;
14681 +struct pci_ops sb_pci_ops = {
14682 + .read = sb_pci_read_config,
14683 + .write = sb_pci_write_config,
14685 diff -Nur linux-2.6.12.5/arch/mips/pci/pci-bcm47xx.c linux-2.6.12.5-brcm/arch/mips/pci/pci-bcm47xx.c
14686 --- linux-2.6.12.5/arch/mips/pci/pci-bcm47xx.c 1970-01-01 01:00:00.000000000 +0100
14687 +++ linux-2.6.12.5-brcm/arch/mips/pci/pci-bcm47xx.c 2005-08-28 11:12:20.612831488 +0200
14689 +#include <linux/init.h>
14690 +#include <linux/pci.h>
14691 +#include <linux/types.h>
14693 +#include <asm/cpu.h>
14694 +#include <asm/io.h>
14696 +#include <typedefs.h>
14697 +#include <sbconfig.h>
14699 +extern struct pci_ops sb_pci_ops;
14701 +static struct resource sb_pci_mem_resource = {
14702 + .name = "SB PCI Memory resources",
14703 + .start = SB_ENUM_BASE,
14704 + .end = SB_ENUM_LIM - 1,
14705 + .flags = IORESOURCE_MEM,
14708 +static struct resource sb_pci_io_resource = {
14709 + .name = "SB PCI I/O resources",
14712 + .flags = IORESOURCE_IO,
14715 +static struct pci_controller bcm47xx_sb_pci_controller = {
14716 + .pci_ops = &sb_pci_ops,
14717 + .mem_resource = &sb_pci_mem_resource,
14718 + .io_resource = &sb_pci_io_resource,
14721 +static struct resource ext_pci_mem_resource = {
14722 + .name = "Ext PCI Memory resources",
14723 + .start = SB_PCI_DMA,
14724 +// .end = 0x7FFFFFFF,
14725 + .end = 0x40FFFFFF,
14726 + .flags = IORESOURCE_MEM,
14729 +static struct resource ext_pci_io_resource = {
14730 + .name = "Ext PCI I/O resources",
14733 + .flags = IORESOURCE_IO,
14736 +static struct pci_controller bcm47xx_ext_pci_controller = {
14737 + .pci_ops = &sb_pci_ops,
14738 + .mem_resource = &ext_pci_mem_resource,
14739 + .io_resource = &ext_pci_io_resource,
14742 +static int __init bcm47xx_pci_init(void)
14744 + register_pci_controller(&bcm47xx_sb_pci_controller);
14745 + register_pci_controller(&bcm47xx_ext_pci_controller);
14749 +early_initcall(bcm47xx_pci_init);
14750 diff -Nur linux-2.6.12.5/arch/mips/pci/pci.c linux-2.6.12.5-brcm/arch/mips/pci/pci.c
14751 --- linux-2.6.12.5/arch/mips/pci/pci.c 2005-08-15 02:20:18.000000000 +0200
14752 +++ linux-2.6.12.5-brcm/arch/mips/pci/pci.c 2005-08-28 11:12:20.629828904 +0200
14753 @@ -238,7 +238,8 @@
14754 if (dev->resource[i].flags & IORESOURCE_IO)
14755 offset = hose->io_offset;
14756 else if (dev->resource[i].flags & IORESOURCE_MEM)
14757 - offset = hose->mem_offset;
14758 + offset = 0x26000000;
14759 + // offset = hose->mem_offset;
14761 dev->resource[i].start += offset;
14762 dev->resource[i].end += offset;
14763 diff -Nur linux-2.6.12.5/drivers/mtd/maps/Kconfig linux-2.6.12.5-brcm/drivers/mtd/maps/Kconfig
14764 --- linux-2.6.12.5/drivers/mtd/maps/Kconfig 2005-08-15 02:20:18.000000000 +0200
14765 +++ linux-2.6.12.5-brcm/drivers/mtd/maps/Kconfig 2005-08-28 16:21:23.595930936 +0200
14766 @@ -357,6 +357,12 @@
14767 Mapping for the Flaga digital module. If you don't have one, ignore
14770 +config MTD_BCM47XX
14771 + tristate "BCM47xx flash device"
14772 + depends on MIPS && MTD_CFI && BCM947XX
14774 + Support for the flash chips on the BCM947xx board.
14777 tristate "CFI Flash device mapped on IBM 405LP Beech"
14778 depends on MTD_CFI && PPC32 && 40x && BEECH
14779 diff -Nur linux-2.6.12.5/drivers/mtd/maps/Makefile linux-2.6.12.5-brcm/drivers/mtd/maps/Makefile
14780 --- linux-2.6.12.5/drivers/mtd/maps/Makefile 2005-08-15 02:20:18.000000000 +0200
14781 +++ linux-2.6.12.5-brcm/drivers/mtd/maps/Makefile 2005-08-28 11:12:20.666823280 +0200
14783 obj-$(CONFIG_MTD_PCMCIA) += pcmciamtd.o
14784 obj-$(CONFIG_MTD_RPXLITE) += rpxlite.o
14785 obj-$(CONFIG_MTD_TQM8XXL) += tqm8xxl.o
14786 +obj-$(CONFIG_MTD_BCM47XX) += bcm47xx-flash.o
14787 obj-$(CONFIG_MTD_SA1100) += sa1100-flash.o
14788 obj-$(CONFIG_MTD_IPAQ) += ipaq-flash.o
14789 obj-$(CONFIG_MTD_SBC_GXX) += sbc_gxx.o
14790 diff -Nur linux-2.6.12.5/drivers/mtd/maps/bcm47xx-flash.c linux-2.6.12.5-brcm/drivers/mtd/maps/bcm47xx-flash.c
14791 --- linux-2.6.12.5/drivers/mtd/maps/bcm47xx-flash.c 1970-01-01 01:00:00.000000000 +0100
14792 +++ linux-2.6.12.5-brcm/drivers/mtd/maps/bcm47xx-flash.c 2005-08-28 17:01:50.948899632 +0200
14795 + * Flash mapping for BCM947XX boards
14797 + * Copyright (C) 2001 Broadcom Corporation
14799 + * $Id: bcm47xx-flash.c,v 1.1 2004/10/21 07:18:31 jolt Exp $
14802 +#include <linux/init.h>
14803 +#include <linux/module.h>
14804 +#include <linux/types.h>
14805 +#include <linux/kernel.h>
14806 +#include <asm/io.h>
14807 +#include <linux/mtd/mtd.h>
14808 +#include <linux/mtd/map.h>
14809 +#include <linux/mtd/partitions.h>
14810 +#include <linux/config.h>
14812 +#define WINDOW_ADDR 0x1c000000
14813 +#define WINDOW_SIZE (0x400000*2)
14814 +#define BUSWIDTH 2
14816 +static struct mtd_info *bcm947xx_mtd;
14818 +static void bcm947xx_map_copy_from(struct map_info *map, void *to, unsigned long from, ssize_t len)
14820 +#define MIPS_MEMCPY_ALIGN 4
14822 + ssize_t transfer;
14823 + ssize_t done = 0;
14824 + if ((len >= MIPS_MEMCPY_ALIGN) && (!(from & (MIPS_MEMCPY_ALIGN - 1))) && (!(((unsigned int)to & (MIPS_MEMCPY_ALIGN - 1))))) {
14825 + done = len & ~(MIPS_MEMCPY_ALIGN - 1);
14826 + memcpy_fromio(to, map->virt + from, done);
14828 + while (done < len) {
14829 + ret = map->read(map, from + done);
14830 + transfer = len - done;
14831 + if (transfer > map->bankwidth)
14832 + transfer = map->bankwidth;
14833 + memcpy((void *)((unsigned long)to + done), &ret.x[0], transfer);
14834 + done += transfer;
14838 +static struct map_info bcm947xx_map = {
14839 + name: "Physically mapped flash",
14840 + size: WINDOW_SIZE,
14841 + bankwidth: BUSWIDTH,
14842 + phys: WINDOW_ADDR,
14845 +#define SECTORS *64*1024
14847 +#ifdef CONFIG_MTD_PARTITIONS
14849 +static struct mtd_partition bcm947xx_parts[] = {
14850 +// 64 - 4 - 14 - 1 = 45 = 8 + 37
14851 + { name: "pmon", offset: 0, size: 4 SECTORS, mask_flags: MTD_WRITEABLE },
14852 + { name: "linux", offset: MTDPART_OFS_APPEND, size: 14 SECTORS },
14853 + { name: "rescue", offset: MTDPART_OFS_APPEND, size: 8 SECTORS },
14854 + { name: "rootfs", offset: MTDPART_OFS_APPEND, size: 37 SECTORS },
14855 + { name: "nvram", offset: MTDPART_OFS_APPEND, size: 1 SECTORS, mask_flags: MTD_WRITEABLE },
14858 +static struct mtd_partition bcm947xx_parts[] = {
14862 + mask_flags: MTD_WRITEABLE
14864 + { name: "config",
14865 + offset: MTDPART_OFS_APPEND,
14869 + offset: MTDPART_OFS_APPEND,
14870 + size: 10*128*1024
14873 + offset: MTDPART_OFS_APPEND,
14874 + size: (8*1024*1024)-((384*1024)+(128*1024)+(10*128*1024)+(128*1024)),
14877 + offset: MTDPART_OFS_APPEND,
14879 + mask_flags: MTD_WRITEABLE
14885 +int __init init_bcm947xx_map(void)
14887 + bcm947xx_map.virt = (unsigned long)ioremap(WINDOW_ADDR, WINDOW_SIZE);
14889 + if (!bcm947xx_map.virt) {
14890 + printk("Failed to ioremap\n");
14893 + simple_map_init(&bcm947xx_map);
14895 + bcm947xx_map.copy_from = bcm947xx_map_copy_from;
14897 + if (!(bcm947xx_mtd = do_map_probe("cfi_probe", &bcm947xx_map))) {
14898 + printk("Failed to do_map_probe\n");
14899 + iounmap((void *)bcm947xx_map.virt);
14903 + bcm947xx_mtd->owner = THIS_MODULE;
14905 + printk(KERN_NOTICE "flash device: %x at %x\n", bcm947xx_mtd->size, WINDOW_ADDR);
14907 +#ifdef CONFIG_MTD_PARTITIONS
14908 + return add_mtd_partitions(bcm947xx_mtd, bcm947xx_parts, sizeof(bcm947xx_parts)/sizeof(bcm947xx_parts[0]));
14914 +void __exit cleanup_bcm947xx_map(void)
14916 +#ifdef CONFIG_MTD_PARTITIONS
14917 + del_mtd_partitions(bcm947xx_mtd);
14919 + map_destroy(bcm947xx_mtd);
14920 + iounmap((void *)bcm947xx_map.virt);
14923 +module_init(init_bcm947xx_map);
14924 +module_exit(cleanup_bcm947xx_map);
14925 diff -Nur linux-2.6.12.5/drivers/net/b44.c linux-2.6.12.5-brcm/drivers/net/b44.c
14926 --- linux-2.6.12.5/drivers/net/b44.c 2005-08-15 02:20:18.000000000 +0200
14927 +++ linux-2.6.12.5-brcm/drivers/net/b44.c 2005-08-28 11:12:20.691819480 +0200
14929 -/* b44.c: Broadcom 4400 device driver.
14930 +/* b44.c: Broadcom 4400/47xx device driver.
14932 * Copyright (C) 2002 David S. Miller (davem@redhat.com)
14933 - * Fixed by Pekka Pietikainen (pp@ee.oulu.fi)
14934 + * Copyright (C) 2004 Pekka Pietikainen (pp@ee.oulu.fi)
14935 + * Copyright (C) 2004 Florian Schirmer (jolt@tuxbox.org)
14937 * Distribute under GPL.
14940 DRV_MODULE_NAME ".c:v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n";
14942 MODULE_AUTHOR("Florian Schirmer, Pekka Pietikainen, David S. Miller");
14943 -MODULE_DESCRIPTION("Broadcom 4400 10/100 PCI ethernet driver");
14944 +MODULE_DESCRIPTION("Broadcom 4400/47xx 10/100 PCI ethernet driver");
14945 MODULE_LICENSE("GPL");
14946 MODULE_VERSION(DRV_MODULE_VERSION);
14949 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
14950 { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_BCM4401B1,
14951 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
14952 + { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_BCM4713,
14953 + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
14954 { } /* terminate list with empty entry */
14957 @@ -106,24 +109,13 @@
14958 static void b44_poll_controller(struct net_device *dev);
14961 -static inline unsigned long br32(const struct b44 *bp, unsigned long reg)
14963 - return readl(bp->regs + reg);
14966 -static inline void bw32(const struct b44 *bp,
14967 - unsigned long reg, unsigned long val)
14969 - writel(val, bp->regs + reg);
14972 static int b44_wait_bit(struct b44 *bp, unsigned long reg,
14973 u32 bit, unsigned long timeout, const int clear)
14977 for (i = 0; i < timeout; i++) {
14978 - u32 val = br32(bp, reg);
14979 + u32 val = br32(reg);
14981 if (clear && !(val & bit))
14983 @@ -154,7 +146,7 @@
14985 static u32 ssb_get_core_rev(struct b44 *bp)
14987 - return (br32(bp, B44_SBIDHIGH) & SBIDHIGH_RC_MASK);
14988 + return (br32(B44_SBIDHIGH) & SBIDHIGH_RC_MASK);
14991 static u32 ssb_pci_setup(struct b44 *bp, u32 cores)
14992 @@ -165,13 +157,13 @@
14993 pci_write_config_dword(bp->pdev, SSB_BAR0_WIN, BCM4400_PCI_CORE_ADDR);
14994 pci_rev = ssb_get_core_rev(bp);
14996 - val = br32(bp, B44_SBINTVEC);
14997 + val = br32(B44_SBINTVEC);
14999 - bw32(bp, B44_SBINTVEC, val);
15000 + bw32(B44_SBINTVEC, val);
15002 - val = br32(bp, SSB_PCI_TRANS_2);
15003 + val = br32(SSB_PCI_TRANS_2);
15004 val |= SSB_PCI_PREF | SSB_PCI_BURST;
15005 - bw32(bp, SSB_PCI_TRANS_2, val);
15006 + bw32(SSB_PCI_TRANS_2, val);
15008 pci_write_config_dword(bp->pdev, SSB_BAR0_WIN, bar_orig);
15010 @@ -180,18 +172,18 @@
15012 static void ssb_core_disable(struct b44 *bp)
15014 - if (br32(bp, B44_SBTMSLOW) & SBTMSLOW_RESET)
15015 + if (br32(B44_SBTMSLOW) & SBTMSLOW_RESET)
15018 - bw32(bp, B44_SBTMSLOW, (SBTMSLOW_REJECT | SBTMSLOW_CLOCK));
15019 + bw32(B44_SBTMSLOW, (SBTMSLOW_REJECT | SBTMSLOW_CLOCK));
15020 b44_wait_bit(bp, B44_SBTMSLOW, SBTMSLOW_REJECT, 100000, 0);
15021 b44_wait_bit(bp, B44_SBTMSHIGH, SBTMSHIGH_BUSY, 100000, 1);
15022 - bw32(bp, B44_SBTMSLOW, (SBTMSLOW_FGC | SBTMSLOW_CLOCK |
15023 + bw32(B44_SBTMSLOW, (SBTMSLOW_FGC | SBTMSLOW_CLOCK |
15024 SBTMSLOW_REJECT | SBTMSLOW_RESET));
15025 - br32(bp, B44_SBTMSLOW);
15026 + br32(B44_SBTMSLOW);
15028 - bw32(bp, B44_SBTMSLOW, (SBTMSLOW_REJECT | SBTMSLOW_RESET));
15029 - br32(bp, B44_SBTMSLOW);
15030 + bw32(B44_SBTMSLOW, (SBTMSLOW_REJECT | SBTMSLOW_RESET));
15031 + br32(B44_SBTMSLOW);
15035 @@ -200,58 +192,65 @@
15038 ssb_core_disable(bp);
15039 - bw32(bp, B44_SBTMSLOW, (SBTMSLOW_RESET | SBTMSLOW_CLOCK | SBTMSLOW_FGC));
15040 - br32(bp, B44_SBTMSLOW);
15041 + bw32(B44_SBTMSLOW, (SBTMSLOW_RESET | SBTMSLOW_CLOCK | SBTMSLOW_FGC));
15042 + br32(B44_SBTMSLOW);
15045 /* Clear SERR if set, this is a hw bug workaround. */
15046 - if (br32(bp, B44_SBTMSHIGH) & SBTMSHIGH_SERR)
15047 - bw32(bp, B44_SBTMSHIGH, 0);
15048 + if (br32(B44_SBTMSHIGH) & SBTMSHIGH_SERR)
15049 + bw32(B44_SBTMSHIGH, 0);
15051 - val = br32(bp, B44_SBIMSTATE);
15052 + val = br32(B44_SBIMSTATE);
15053 if (val & (SBIMSTATE_IBE | SBIMSTATE_TO))
15054 - bw32(bp, B44_SBIMSTATE, val & ~(SBIMSTATE_IBE | SBIMSTATE_TO));
15055 + bw32(B44_SBIMSTATE, val & ~(SBIMSTATE_IBE | SBIMSTATE_TO));
15057 - bw32(bp, B44_SBTMSLOW, (SBTMSLOW_CLOCK | SBTMSLOW_FGC));
15058 - br32(bp, B44_SBTMSLOW);
15059 + bw32(B44_SBTMSLOW, (SBTMSLOW_CLOCK | SBTMSLOW_FGC));
15060 + br32(B44_SBTMSLOW);
15063 - bw32(bp, B44_SBTMSLOW, (SBTMSLOW_CLOCK));
15064 - br32(bp, B44_SBTMSLOW);
15065 + bw32(B44_SBTMSLOW, (SBTMSLOW_CLOCK));
15066 + br32(B44_SBTMSLOW);
15070 +static int b44_4713_instance;
15072 static int ssb_core_unit(struct b44 *bp)
15075 - u32 val = br32(bp, B44_SBADMATCH0);
15078 - type = val & SBADMATCH0_TYPE_MASK;
15081 - base = val & SBADMATCH0_BS0_MASK;
15085 - base = val & SBADMATCH0_BS1_MASK;
15090 - base = val & SBADMATCH0_BS2_MASK;
15095 + if (bp->pdev->device == PCI_DEVICE_ID_BCM4713)
15096 + return b44_4713_instance++;
15101 static int ssb_is_core_up(struct b44 *bp)
15103 - return ((br32(bp, B44_SBTMSLOW) & (SBTMSLOW_RESET | SBTMSLOW_REJECT | SBTMSLOW_CLOCK))
15104 + return ((br32(B44_SBTMSLOW) & (SBTMSLOW_RESET | SBTMSLOW_REJECT | SBTMSLOW_CLOCK))
15105 == SBTMSLOW_CLOCK);
15108 +static void __b44_cam_read(struct b44 *bp, unsigned char *data, int index)
15112 + bw32(B44_CAM_CTRL, (CAM_CTRL_READ |
15113 + (index << CAM_CTRL_INDEX_SHIFT)));
15115 + b44_wait_bit(bp, B44_CAM_CTRL, CAM_CTRL_BUSY, 100, 1);
15117 + val = br32(B44_CAM_DATA_LO);
15119 + data[2] = (val >> 24) & 0xFF;
15120 + data[3] = (val >> 16) & 0xFF;
15121 + data[4] = (val >> 8) & 0xFF;
15122 + data[5] = (val >> 0) & 0xFF;
15124 + val = br32(B44_CAM_DATA_HI);
15126 + data[0] = (val >> 8) & 0xFF;
15127 + data[1] = (val >> 0) & 0xFF;
15130 static void __b44_cam_write(struct b44 *bp, unsigned char *data, int index)
15133 @@ -260,19 +259,19 @@
15134 val |= ((u32) data[3]) << 16;
15135 val |= ((u32) data[4]) << 8;
15136 val |= ((u32) data[5]) << 0;
15137 - bw32(bp, B44_CAM_DATA_LO, val);
15138 + bw32(B44_CAM_DATA_LO, val);
15139 val = (CAM_DATA_HI_VALID |
15140 (((u32) data[0]) << 8) |
15141 (((u32) data[1]) << 0));
15142 - bw32(bp, B44_CAM_DATA_HI, val);
15143 - bw32(bp, B44_CAM_CTRL, (CAM_CTRL_WRITE |
15144 + bw32(B44_CAM_DATA_HI, val);
15145 + bw32(B44_CAM_CTRL, (CAM_CTRL_WRITE |
15146 (index << CAM_CTRL_INDEX_SHIFT)));
15147 b44_wait_bit(bp, B44_CAM_CTRL, CAM_CTRL_BUSY, 100, 1);
15150 static inline void __b44_disable_ints(struct b44 *bp)
15152 - bw32(bp, B44_IMASK, 0);
15153 + bw32(B44_IMASK, 0);
15156 static void b44_disable_ints(struct b44 *bp)
15157 @@ -280,34 +279,40 @@
15158 __b44_disable_ints(bp);
15160 /* Flush posted writes. */
15161 - br32(bp, B44_IMASK);
15165 static void b44_enable_ints(struct b44 *bp)
15167 - bw32(bp, B44_IMASK, bp->imask);
15168 + bw32(B44_IMASK, bp->imask);
15171 static int b44_readphy(struct b44 *bp, int reg, u32 *val)
15175 - bw32(bp, B44_EMAC_ISTAT, EMAC_INT_MII);
15176 - bw32(bp, B44_MDIO_DATA, (MDIO_DATA_SB_START |
15177 + if (bp->phy_addr == B44_PHY_ADDR_NO_PHY)
15180 + bw32(B44_EMAC_ISTAT, EMAC_INT_MII);
15181 + bw32(B44_MDIO_DATA, (MDIO_DATA_SB_START |
15182 (MDIO_OP_READ << MDIO_DATA_OP_SHIFT) |
15183 (bp->phy_addr << MDIO_DATA_PMD_SHIFT) |
15184 (reg << MDIO_DATA_RA_SHIFT) |
15185 (MDIO_TA_VALID << MDIO_DATA_TA_SHIFT)));
15186 err = b44_wait_bit(bp, B44_EMAC_ISTAT, EMAC_INT_MII, 100, 0);
15187 - *val = br32(bp, B44_MDIO_DATA) & MDIO_DATA_DATA;
15188 + *val = br32(B44_MDIO_DATA) & MDIO_DATA_DATA;
15193 static int b44_writephy(struct b44 *bp, int reg, u32 val)
15195 - bw32(bp, B44_EMAC_ISTAT, EMAC_INT_MII);
15196 - bw32(bp, B44_MDIO_DATA, (MDIO_DATA_SB_START |
15197 + if (bp->phy_addr == B44_PHY_ADDR_NO_PHY)
15200 + bw32(B44_EMAC_ISTAT, EMAC_INT_MII);
15201 + bw32(B44_MDIO_DATA, (MDIO_DATA_SB_START |
15202 (MDIO_OP_WRITE << MDIO_DATA_OP_SHIFT) |
15203 (bp->phy_addr << MDIO_DATA_PMD_SHIFT) |
15204 (reg << MDIO_DATA_RA_SHIFT) |
15205 @@ -344,6 +349,9 @@
15209 + if (bp->phy_addr == B44_PHY_ADDR_NO_PHY)
15212 err = b44_writephy(bp, MII_BMCR, BMCR_RESET);
15215 @@ -367,20 +375,20 @@
15216 bp->flags &= ~(B44_FLAG_TX_PAUSE | B44_FLAG_RX_PAUSE);
15217 bp->flags |= pause_flags;
15219 - val = br32(bp, B44_RXCONFIG);
15220 + val = br32(B44_RXCONFIG);
15221 if (pause_flags & B44_FLAG_RX_PAUSE)
15222 val |= RXCONFIG_FLOW;
15224 val &= ~RXCONFIG_FLOW;
15225 - bw32(bp, B44_RXCONFIG, val);
15226 + bw32(B44_RXCONFIG, val);
15228 - val = br32(bp, B44_MAC_FLOW);
15229 + val = br32(B44_MAC_FLOW);
15230 if (pause_flags & B44_FLAG_TX_PAUSE)
15231 val |= (MAC_FLOW_PAUSE_ENAB |
15232 (0xc0 & MAC_FLOW_RX_HI_WATER));
15234 val &= ~MAC_FLOW_PAUSE_ENAB;
15235 - bw32(bp, B44_MAC_FLOW, val);
15236 + bw32(B44_MAC_FLOW, val);
15239 static void b44_set_flow_ctrl(struct b44 *bp, u32 local, u32 remote)
15240 @@ -414,6 +422,9 @@
15244 + if (bp->phy_addr == B44_PHY_ADDR_NO_PHY)
15247 if ((err = b44_readphy(bp, B44_MII_ALEDCTRL, &val)) != 0)
15249 if ((err = b44_writephy(bp, B44_MII_ALEDCTRL,
15250 @@ -476,11 +487,11 @@
15252 val = &bp->hw_stats.tx_good_octets;
15253 for (reg = B44_TX_GOOD_O; reg <= B44_TX_PAUSE; reg += 4UL) {
15254 - *val++ += br32(bp, reg);
15255 + *val++ += br32(reg);
15257 val = &bp->hw_stats.rx_good_octets;
15258 for (reg = B44_RX_GOOD_O; reg <= B44_RX_NPAUSE; reg += 4UL) {
15259 - *val++ += br32(bp, reg);
15260 + *val++ += br32(reg);
15264 @@ -506,6 +517,19 @@
15268 + if (bp->phy_addr == B44_PHY_ADDR_NO_PHY) {
15269 + bp->flags |= B44_FLAG_100_BASE_T;
15270 + bp->flags |= B44_FLAG_FULL_DUPLEX;
15271 + if (!netif_carrier_ok(bp->dev)) {
15272 + u32 val = br32(B44_TX_CTRL);
15273 + val |= TX_CTRL_DUPLEX;
15274 + bw32(B44_TX_CTRL, val);
15275 + netif_carrier_on(bp->dev);
15276 + b44_link_report(bp);
15281 if (!b44_readphy(bp, MII_BMSR, &bmsr) &&
15282 !b44_readphy(bp, B44_MII_AUXCTRL, &aux) &&
15283 (bmsr != 0xffff)) {
15284 @@ -520,14 +544,14 @@
15286 if (!netif_carrier_ok(bp->dev) &&
15287 (bmsr & BMSR_LSTATUS)) {
15288 - u32 val = br32(bp, B44_TX_CTRL);
15289 + u32 val = br32(B44_TX_CTRL);
15290 u32 local_adv, remote_adv;
15292 if (bp->flags & B44_FLAG_FULL_DUPLEX)
15293 val |= TX_CTRL_DUPLEX;
15295 val &= ~TX_CTRL_DUPLEX;
15296 - bw32(bp, B44_TX_CTRL, val);
15297 + bw32(B44_TX_CTRL, val);
15299 if (!(bp->flags & B44_FLAG_FORCE_LINK) &&
15300 !b44_readphy(bp, MII_ADVERTISE, &local_adv) &&
15301 @@ -572,7 +596,7 @@
15305 - cur = br32(bp, B44_DMATX_STAT) & DMATX_STAT_CDMASK;
15306 + cur = br32(B44_DMATX_STAT) & DMATX_STAT_CDMASK;
15307 cur /= sizeof(struct dma_desc);
15309 /* XXX needs updating when NETIF_F_SG is supported */
15310 @@ -596,7 +620,7 @@
15311 TX_BUFFS_AVAIL(bp) > B44_TX_WAKEUP_THRESH)
15312 netif_wake_queue(bp->dev);
15314 - bw32(bp, B44_GPTIMER, 0);
15315 + bw32(B44_GPTIMER, 0);
15318 /* Works like this. This chip writes a 'struct rx_header" 30 bytes
15319 @@ -713,7 +737,7 @@
15323 - prod = br32(bp, B44_DMARX_STAT) & DMARX_STAT_CDMASK;
15324 + prod = br32(B44_DMARX_STAT) & DMARX_STAT_CDMASK;
15325 prod /= sizeof(struct dma_desc);
15326 cons = bp->rx_cons;
15328 @@ -792,7 +816,7 @@
15331 bp->rx_cons = cons;
15332 - bw32(bp, B44_DMARX_PTR, cons * sizeof(struct dma_desc));
15333 + bw32(B44_DMARX_PTR, cons * sizeof(struct dma_desc));
15337 @@ -856,8 +880,8 @@
15339 spin_lock_irqsave(&bp->lock, flags);
15341 - istat = br32(bp, B44_ISTAT);
15342 - imask = br32(bp, B44_IMASK);
15343 + istat = br32(B44_ISTAT);
15344 + imask = br32(B44_IMASK);
15346 /* ??? What the fuck is the purpose of the interrupt mask
15347 * ??? register if we have to mask it out by hand anyways?
15348 @@ -877,8 +901,8 @@
15352 - bw32(bp, B44_ISTAT, istat);
15353 - br32(bp, B44_ISTAT);
15354 + bw32(B44_ISTAT, istat);
15357 spin_unlock_irqrestore(&bp->lock, flags);
15358 return IRQ_RETVAL(handled);
15359 @@ -965,11 +989,11 @@
15363 - bw32(bp, B44_DMATX_PTR, entry * sizeof(struct dma_desc));
15364 + bw32(B44_DMATX_PTR, entry * sizeof(struct dma_desc));
15365 if (bp->flags & B44_FLAG_BUGGY_TXPTR)
15366 - bw32(bp, B44_DMATX_PTR, entry * sizeof(struct dma_desc));
15367 + bw32(B44_DMATX_PTR, entry * sizeof(struct dma_desc));
15368 if (bp->flags & B44_FLAG_REORDER_BUG)
15369 - br32(bp, B44_DMATX_PTR);
15370 + br32(B44_DMATX_PTR);
15372 if (TX_BUFFS_AVAIL(bp) < 1)
15373 netif_stop_queue(dev);
15374 @@ -1137,32 +1161,35 @@
15378 - bw32(bp, B44_MIB_CTRL, MIB_CTRL_CLR_ON_READ);
15379 + bw32(B44_MIB_CTRL, MIB_CTRL_CLR_ON_READ);
15380 for (reg = B44_TX_GOOD_O; reg <= B44_TX_PAUSE; reg += 4UL)
15383 for (reg = B44_RX_GOOD_O; reg <= B44_RX_NPAUSE; reg += 4UL)
15388 /* bp->lock is held. */
15389 static void b44_chip_reset(struct b44 *bp)
15391 + unsigned int sb_clock;
15393 if (ssb_is_core_up(bp)) {
15394 - bw32(bp, B44_RCV_LAZY, 0);
15395 - bw32(bp, B44_ENET_CTRL, ENET_CTRL_DISABLE);
15396 + bw32(B44_RCV_LAZY, 0);
15397 + bw32(B44_ENET_CTRL, ENET_CTRL_DISABLE);
15398 b44_wait_bit(bp, B44_ENET_CTRL, ENET_CTRL_DISABLE, 100, 1);
15399 - bw32(bp, B44_DMATX_CTRL, 0);
15400 + bw32(B44_DMATX_CTRL, 0);
15401 bp->tx_prod = bp->tx_cons = 0;
15402 - if (br32(bp, B44_DMARX_STAT) & DMARX_STAT_EMASK) {
15403 + if (br32(B44_DMARX_STAT) & DMARX_STAT_EMASK) {
15404 b44_wait_bit(bp, B44_DMARX_STAT, DMARX_STAT_SIDLE,
15407 - bw32(bp, B44_DMARX_CTRL, 0);
15408 + bw32(B44_DMARX_CTRL, 0);
15409 bp->rx_prod = bp->rx_cons = 0;
15411 - ssb_pci_setup(bp, (bp->core_unit == 0 ?
15413 - SBINTVEC_ENET1));
15414 + if (bp->pdev->device != PCI_DEVICE_ID_BCM4713)
15415 + ssb_pci_setup(bp, (bp->core_unit == 0 ?
15417 + SBINTVEC_ENET1));
15420 ssb_core_reset(bp);
15421 @@ -1170,20 +1197,26 @@
15422 b44_clear_stats(bp);
15424 /* Make PHY accessible. */
15425 - bw32(bp, B44_MDIO_CTRL, (MDIO_CTRL_PREAMBLE |
15426 - (0x0d & MDIO_CTRL_MAXF_MASK)));
15427 - br32(bp, B44_MDIO_CTRL);
15429 - if (!(br32(bp, B44_DEVCTRL) & DEVCTRL_IPP)) {
15430 - bw32(bp, B44_ENET_CTRL, ENET_CTRL_EPSEL);
15431 - br32(bp, B44_ENET_CTRL);
15432 + if (bp->pdev->device == PCI_DEVICE_ID_BCM4713)
15433 + sb_clock = 100000000; /* 100 MHz */
15435 + sb_clock = 62500000; /* 62.5 MHz */
15437 + bw32(B44_MDIO_CTRL, (MDIO_CTRL_PREAMBLE |
15438 + (((sb_clock + (B44_MDC_RATIO / 2)) / B44_MDC_RATIO)
15439 + & MDIO_CTRL_MAXF_MASK)));
15440 + br32(B44_MDIO_CTRL);
15442 + if (!(br32(B44_DEVCTRL) & DEVCTRL_IPP)) {
15443 + bw32(B44_ENET_CTRL, ENET_CTRL_EPSEL);
15444 + br32(B44_ENET_CTRL);
15445 bp->flags &= ~B44_FLAG_INTERNAL_PHY;
15447 - u32 val = br32(bp, B44_DEVCTRL);
15448 + u32 val = br32(B44_DEVCTRL);
15450 if (val & DEVCTRL_EPR) {
15451 - bw32(bp, B44_DEVCTRL, (val & ~DEVCTRL_EPR));
15452 - br32(bp, B44_DEVCTRL);
15453 + bw32(B44_DEVCTRL, (val & ~DEVCTRL_EPR));
15454 + br32(B44_DEVCTRL);
15457 bp->flags |= B44_FLAG_INTERNAL_PHY;
15458 @@ -1200,13 +1233,13 @@
15459 /* bp->lock is held. */
15460 static void __b44_set_mac_addr(struct b44 *bp)
15462 - bw32(bp, B44_CAM_CTRL, 0);
15463 + bw32(B44_CAM_CTRL, 0);
15464 if (!(bp->dev->flags & IFF_PROMISC)) {
15467 __b44_cam_write(bp, bp->dev->dev_addr, 0);
15468 - val = br32(bp, B44_CAM_CTRL);
15469 - bw32(bp, B44_CAM_CTRL, val | CAM_CTRL_ENABLE);
15470 + val = br32(B44_CAM_CTRL);
15471 + bw32(B44_CAM_CTRL, val | CAM_CTRL_ENABLE);
15475 @@ -1240,30 +1273,30 @@
15478 /* Enable CRC32, set proper LED modes and power on PHY */
15479 - bw32(bp, B44_MAC_CTRL, MAC_CTRL_CRC32_ENAB | MAC_CTRL_PHY_LEDCTRL);
15480 - bw32(bp, B44_RCV_LAZY, (1 << RCV_LAZY_FC_SHIFT));
15481 + bw32(B44_MAC_CTRL, MAC_CTRL_CRC32_ENAB | MAC_CTRL_PHY_LEDCTRL);
15482 + bw32(B44_RCV_LAZY, (1 << RCV_LAZY_FC_SHIFT));
15484 /* This sets the MAC address too. */
15485 __b44_set_rx_mode(bp->dev);
15487 /* MTU + eth header + possible VLAN tag + struct rx_header */
15488 - bw32(bp, B44_RXMAXLEN, bp->dev->mtu + ETH_HLEN + 8 + RX_HEADER_LEN);
15489 - bw32(bp, B44_TXMAXLEN, bp->dev->mtu + ETH_HLEN + 8 + RX_HEADER_LEN);
15490 + bw32(B44_RXMAXLEN, bp->dev->mtu + ETH_HLEN + 8 + RX_HEADER_LEN);
15491 + bw32(B44_TXMAXLEN, bp->dev->mtu + ETH_HLEN + 8 + RX_HEADER_LEN);
15493 - bw32(bp, B44_TX_WMARK, 56); /* XXX magic */
15494 - bw32(bp, B44_DMATX_CTRL, DMATX_CTRL_ENABLE);
15495 - bw32(bp, B44_DMATX_ADDR, bp->tx_ring_dma + bp->dma_offset);
15496 - bw32(bp, B44_DMARX_CTRL, (DMARX_CTRL_ENABLE |
15497 + bw32(B44_TX_WMARK, 56); /* XXX magic */
15498 + bw32(B44_DMATX_CTRL, DMATX_CTRL_ENABLE);
15499 + bw32(B44_DMATX_ADDR, bp->tx_ring_dma + bp->dma_offset);
15500 + bw32(B44_DMARX_CTRL, (DMARX_CTRL_ENABLE |
15501 (bp->rx_offset << DMARX_CTRL_ROSHIFT)));
15502 - bw32(bp, B44_DMARX_ADDR, bp->rx_ring_dma + bp->dma_offset);
15503 + bw32(B44_DMARX_ADDR, bp->rx_ring_dma + bp->dma_offset);
15505 - bw32(bp, B44_DMARX_PTR, bp->rx_pending);
15506 + bw32(B44_DMARX_PTR, bp->rx_pending);
15507 bp->rx_prod = bp->rx_pending;
15509 - bw32(bp, B44_MIB_CTRL, MIB_CTRL_CLR_ON_READ);
15510 + bw32(B44_MIB_CTRL, MIB_CTRL_CLR_ON_READ);
15512 - val = br32(bp, B44_ENET_CTRL);
15513 - bw32(bp, B44_ENET_CTRL, (val | ENET_CTRL_ENABLE));
15514 + val = br32(B44_ENET_CTRL);
15515 + bw32(B44_ENET_CTRL, (val | ENET_CTRL_ENABLE));
15518 static int b44_open(struct net_device *dev)
15519 @@ -1416,11 +1449,11 @@
15521 unsigned char zero[6] = {0,0,0,0,0,0};
15523 - val = br32(bp, B44_RXCONFIG);
15524 + val = br32(B44_RXCONFIG);
15525 val &= ~(RXCONFIG_PROMISC | RXCONFIG_ALLMULTI);
15526 if (dev->flags & IFF_PROMISC) {
15527 val |= RXCONFIG_PROMISC;
15528 - bw32(bp, B44_RXCONFIG, val);
15529 + bw32(B44_RXCONFIG, val);
15531 __b44_set_mac_addr(bp);
15533 @@ -1432,9 +1465,9 @@
15535 __b44_cam_write(bp, zero, i);
15537 - bw32(bp, B44_RXCONFIG, val);
15538 - val = br32(bp, B44_CAM_CTRL);
15539 - bw32(bp, B44_CAM_CTRL, val | CAM_CTRL_ENABLE);
15540 + bw32(B44_RXCONFIG, val);
15541 + val = br32(B44_CAM_CTRL);
15542 + bw32(B44_CAM_CTRL, val | CAM_CTRL_ENABLE);
15546 @@ -1704,19 +1737,41 @@
15550 + unsigned long flags;
15552 - err = b44_read_eeprom(bp, &eeprom[0]);
15556 - bp->dev->dev_addr[0] = eeprom[79];
15557 - bp->dev->dev_addr[1] = eeprom[78];
15558 - bp->dev->dev_addr[2] = eeprom[81];
15559 - bp->dev->dev_addr[3] = eeprom[80];
15560 - bp->dev->dev_addr[4] = eeprom[83];
15561 - bp->dev->dev_addr[5] = eeprom[82];
15563 - bp->phy_addr = eeprom[90] & 0x1f;
15564 + if (bp->pdev->device == PCI_DEVICE_ID_BCM4713) {
15566 + * BCM47xx boards don't have a EEPROM. The MAC is stored in
15567 + * a NVRAM area somewhere in the flash memory. As we don't
15568 + * know the location and/or the format of the NVRAM area
15569 + * here, we simply rely on the bootloader to write the
15570 + * MAC into the CAM.
15572 + spin_lock_irqsave(&bp->lock, flags);
15573 + __b44_cam_read(bp, bp->dev->dev_addr, 0);
15574 + spin_unlock_irqrestore(&bp->lock, flags);
15577 + * BCM47xx boards don't have a PHY. Usually there is a switch
15578 + * chip with multiple PHYs connected to the PHY port.
15580 + bp->phy_addr = B44_PHY_ADDR_NO_PHY;
15581 + bp->dma_offset = 0;
15583 + err = b44_read_eeprom(bp, &eeprom[0]);
15587 + bp->dev->dev_addr[0] = eeprom[79];
15588 + bp->dev->dev_addr[1] = eeprom[78];
15589 + bp->dev->dev_addr[2] = eeprom[81];
15590 + bp->dev->dev_addr[3] = eeprom[80];
15591 + bp->dev->dev_addr[4] = eeprom[83];
15592 + bp->dev->dev_addr[5] = eeprom[82];
15594 + bp->phy_addr = eeprom[90] & 0x1f;
15595 + bp->dma_offset = SB_PCI_DMA;
15598 /* With this, plus the rx_header prepended to the data by the
15599 * hardware, we'll land the ethernet header on a 2-byte boundary.
15600 @@ -1726,13 +1781,12 @@
15601 bp->imask = IMASK_DEF;
15603 bp->core_unit = ssb_core_unit(bp);
15604 - bp->dma_offset = SB_PCI_DMA;
15606 /* XXX - really required?
15607 bp->flags |= B44_FLAG_BUGGY_TXPTR;
15615 static int __devinit b44_init_one(struct pci_dev *pdev,
15616 @@ -1810,7 +1864,7 @@
15618 spin_lock_init(&bp->lock);
15620 - bp->regs = ioremap(b44reg_base, b44reg_len);
15621 + bp->regs = (unsigned long) ioremap(b44reg_base, b44reg_len);
15622 if (bp->regs == 0UL) {
15623 printk(KERN_ERR PFX "Cannot map device registers, "
15625 @@ -1871,7 +1925,8 @@
15627 pci_save_state(bp->pdev);
15629 - printk(KERN_INFO "%s: Broadcom 4400 10/100BaseT Ethernet ", dev->name);
15630 + printk(KERN_INFO "%s: Broadcom %s 10/100BaseT Ethernet ", dev->name,
15631 + (pdev->device == PCI_DEVICE_ID_BCM4713) ? "47xx" : "4400");
15632 for (i = 0; i < 6; i++)
15633 printk("%2.2x%c", dev->dev_addr[i],
15634 i == 5 ? '\n' : ':');
15635 @@ -1879,7 +1934,7 @@
15639 - iounmap(bp->regs);
15640 + iounmap((void *) bp->regs);
15644 @@ -1901,7 +1956,7 @@
15645 struct b44 *bp = netdev_priv(dev);
15647 unregister_netdev(dev);
15648 - iounmap(bp->regs);
15649 + iounmap((void *) bp->regs);
15651 pci_release_regions(pdev);
15652 pci_disable_device(pdev);
15653 diff -Nur linux-2.6.12.5/drivers/net/b44.c.orig linux-2.6.12.5-brcm/drivers/net/b44.c.orig
15654 --- linux-2.6.12.5/drivers/net/b44.c.orig 1970-01-01 01:00:00.000000000 +0100
15655 +++ linux-2.6.12.5-brcm/drivers/net/b44.c.orig 2005-08-15 02:20:18.000000000 +0200
15657 +/* b44.c: Broadcom 4400 device driver.
15659 + * Copyright (C) 2002 David S. Miller (davem@redhat.com)
15660 + * Fixed by Pekka Pietikainen (pp@ee.oulu.fi)
15662 + * Distribute under GPL.
15665 +#include <linux/kernel.h>
15666 +#include <linux/module.h>
15667 +#include <linux/moduleparam.h>
15668 +#include <linux/types.h>
15669 +#include <linux/netdevice.h>
15670 +#include <linux/ethtool.h>
15671 +#include <linux/mii.h>
15672 +#include <linux/if_ether.h>
15673 +#include <linux/etherdevice.h>
15674 +#include <linux/pci.h>
15675 +#include <linux/delay.h>
15676 +#include <linux/init.h>
15677 +#include <linux/version.h>
15679 +#include <asm/uaccess.h>
15680 +#include <asm/io.h>
15681 +#include <asm/irq.h>
15685 +#define DRV_MODULE_NAME "b44"
15686 +#define PFX DRV_MODULE_NAME ": "
15687 +#define DRV_MODULE_VERSION "0.95"
15688 +#define DRV_MODULE_RELDATE "Aug 3, 2004"
15690 +#define B44_DEF_MSG_ENABLE \
15691 + (NETIF_MSG_DRV | \
15692 + NETIF_MSG_PROBE | \
15693 + NETIF_MSG_LINK | \
15694 + NETIF_MSG_TIMER | \
15695 + NETIF_MSG_IFDOWN | \
15696 + NETIF_MSG_IFUP | \
15697 + NETIF_MSG_RX_ERR | \
15698 + NETIF_MSG_TX_ERR)
15700 +/* length of time before we decide the hardware is borked,
15701 + * and dev->tx_timeout() should be called to fix the problem
15703 +#define B44_TX_TIMEOUT (5 * HZ)
15705 +/* hardware minimum and maximum for a single frame's data payload */
15706 +#define B44_MIN_MTU 60
15707 +#define B44_MAX_MTU 1500
15709 +#define B44_RX_RING_SIZE 512
15710 +#define B44_DEF_RX_RING_PENDING 200
15711 +#define B44_RX_RING_BYTES (sizeof(struct dma_desc) * \
15712 + B44_RX_RING_SIZE)
15713 +#define B44_TX_RING_SIZE 512
15714 +#define B44_DEF_TX_RING_PENDING (B44_TX_RING_SIZE - 1)
15715 +#define B44_TX_RING_BYTES (sizeof(struct dma_desc) * \
15716 + B44_TX_RING_SIZE)
15717 +#define B44_DMA_MASK 0x3fffffff
15719 +#define TX_RING_GAP(BP) \
15720 + (B44_TX_RING_SIZE - (BP)->tx_pending)
15721 +#define TX_BUFFS_AVAIL(BP) \
15722 + (((BP)->tx_cons <= (BP)->tx_prod) ? \
15723 + (BP)->tx_cons + (BP)->tx_pending - (BP)->tx_prod : \
15724 + (BP)->tx_cons - (BP)->tx_prod - TX_RING_GAP(BP))
15725 +#define NEXT_TX(N) (((N) + 1) & (B44_TX_RING_SIZE - 1))
15727 +#define RX_PKT_BUF_SZ (1536 + bp->rx_offset + 64)
15728 +#define TX_PKT_BUF_SZ (B44_MAX_MTU + ETH_HLEN + 8)
15730 +/* minimum number of free TX descriptors required to wake up TX process */
15731 +#define B44_TX_WAKEUP_THRESH (B44_TX_RING_SIZE / 4)
15733 +static char version[] __devinitdata =
15734 + DRV_MODULE_NAME ".c:v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n";
15736 +MODULE_AUTHOR("Florian Schirmer, Pekka Pietikainen, David S. Miller");
15737 +MODULE_DESCRIPTION("Broadcom 4400 10/100 PCI ethernet driver");
15738 +MODULE_LICENSE("GPL");
15739 +MODULE_VERSION(DRV_MODULE_VERSION);
15741 +static int b44_debug = -1; /* -1 == use B44_DEF_MSG_ENABLE as value */
15742 +module_param(b44_debug, int, 0);
15743 +MODULE_PARM_DESC(b44_debug, "B44 bitmapped debugging message enable value");
15745 +static struct pci_device_id b44_pci_tbl[] = {
15746 + { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_BCM4401,
15747 + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
15748 + { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_BCM4401B0,
15749 + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
15750 + { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_BCM4401B1,
15751 + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
15752 + { } /* terminate list with empty entry */
15755 +MODULE_DEVICE_TABLE(pci, b44_pci_tbl);
15757 +static void b44_halt(struct b44 *);
15758 +static void b44_init_rings(struct b44 *);
15759 +static void b44_init_hw(struct b44 *);
15760 +static int b44_poll(struct net_device *dev, int *budget);
15761 +#ifdef CONFIG_NET_POLL_CONTROLLER
15762 +static void b44_poll_controller(struct net_device *dev);
15765 +static inline unsigned long br32(const struct b44 *bp, unsigned long reg)
15767 + return readl(bp->regs + reg);
15770 +static inline void bw32(const struct b44 *bp,
15771 + unsigned long reg, unsigned long val)
15773 + writel(val, bp->regs + reg);
15776 +static int b44_wait_bit(struct b44 *bp, unsigned long reg,
15777 + u32 bit, unsigned long timeout, const int clear)
15781 + for (i = 0; i < timeout; i++) {
15782 + u32 val = br32(bp, reg);
15784 + if (clear && !(val & bit))
15786 + if (!clear && (val & bit))
15790 + if (i == timeout) {
15791 + printk(KERN_ERR PFX "%s: BUG! Timeout waiting for bit %08x of register "
15795 + (clear ? "clear" : "set"));
15801 +/* Sonics SiliconBackplane support routines. ROFL, you should see all the
15802 + * buzz words used on this company's website :-)
15804 + * All of these routines must be invoked with bp->lock held and
15805 + * interrupts disabled.
15808 +#define SB_PCI_DMA 0x40000000 /* Client Mode PCI memory access space (1 GB) */
15809 +#define BCM4400_PCI_CORE_ADDR 0x18002000 /* Address of PCI core on BCM4400 cards */
15811 +static u32 ssb_get_core_rev(struct b44 *bp)
15813 + return (br32(bp, B44_SBIDHIGH) & SBIDHIGH_RC_MASK);
15816 +static u32 ssb_pci_setup(struct b44 *bp, u32 cores)
15818 + u32 bar_orig, pci_rev, val;
15820 + pci_read_config_dword(bp->pdev, SSB_BAR0_WIN, &bar_orig);
15821 + pci_write_config_dword(bp->pdev, SSB_BAR0_WIN, BCM4400_PCI_CORE_ADDR);
15822 + pci_rev = ssb_get_core_rev(bp);
15824 + val = br32(bp, B44_SBINTVEC);
15826 + bw32(bp, B44_SBINTVEC, val);
15828 + val = br32(bp, SSB_PCI_TRANS_2);
15829 + val |= SSB_PCI_PREF | SSB_PCI_BURST;
15830 + bw32(bp, SSB_PCI_TRANS_2, val);
15832 + pci_write_config_dword(bp->pdev, SSB_BAR0_WIN, bar_orig);
15837 +static void ssb_core_disable(struct b44 *bp)
15839 + if (br32(bp, B44_SBTMSLOW) & SBTMSLOW_RESET)
15842 + bw32(bp, B44_SBTMSLOW, (SBTMSLOW_REJECT | SBTMSLOW_CLOCK));
15843 + b44_wait_bit(bp, B44_SBTMSLOW, SBTMSLOW_REJECT, 100000, 0);
15844 + b44_wait_bit(bp, B44_SBTMSHIGH, SBTMSHIGH_BUSY, 100000, 1);
15845 + bw32(bp, B44_SBTMSLOW, (SBTMSLOW_FGC | SBTMSLOW_CLOCK |
15846 + SBTMSLOW_REJECT | SBTMSLOW_RESET));
15847 + br32(bp, B44_SBTMSLOW);
15849 + bw32(bp, B44_SBTMSLOW, (SBTMSLOW_REJECT | SBTMSLOW_RESET));
15850 + br32(bp, B44_SBTMSLOW);
15854 +static void ssb_core_reset(struct b44 *bp)
15858 + ssb_core_disable(bp);
15859 + bw32(bp, B44_SBTMSLOW, (SBTMSLOW_RESET | SBTMSLOW_CLOCK | SBTMSLOW_FGC));
15860 + br32(bp, B44_SBTMSLOW);
15863 + /* Clear SERR if set, this is a hw bug workaround. */
15864 + if (br32(bp, B44_SBTMSHIGH) & SBTMSHIGH_SERR)
15865 + bw32(bp, B44_SBTMSHIGH, 0);
15867 + val = br32(bp, B44_SBIMSTATE);
15868 + if (val & (SBIMSTATE_IBE | SBIMSTATE_TO))
15869 + bw32(bp, B44_SBIMSTATE, val & ~(SBIMSTATE_IBE | SBIMSTATE_TO));
15871 + bw32(bp, B44_SBTMSLOW, (SBTMSLOW_CLOCK | SBTMSLOW_FGC));
15872 + br32(bp, B44_SBTMSLOW);
15875 + bw32(bp, B44_SBTMSLOW, (SBTMSLOW_CLOCK));
15876 + br32(bp, B44_SBTMSLOW);
15880 +static int ssb_core_unit(struct b44 *bp)
15883 + u32 val = br32(bp, B44_SBADMATCH0);
15886 + type = val & SBADMATCH0_TYPE_MASK;
15889 + base = val & SBADMATCH0_BS0_MASK;
15893 + base = val & SBADMATCH0_BS1_MASK;
15898 + base = val & SBADMATCH0_BS2_MASK;
15905 +static int ssb_is_core_up(struct b44 *bp)
15907 + return ((br32(bp, B44_SBTMSLOW) & (SBTMSLOW_RESET | SBTMSLOW_REJECT | SBTMSLOW_CLOCK))
15908 + == SBTMSLOW_CLOCK);
15911 +static void __b44_cam_write(struct b44 *bp, unsigned char *data, int index)
15915 + val = ((u32) data[2]) << 24;
15916 + val |= ((u32) data[3]) << 16;
15917 + val |= ((u32) data[4]) << 8;
15918 + val |= ((u32) data[5]) << 0;
15919 + bw32(bp, B44_CAM_DATA_LO, val);
15920 + val = (CAM_DATA_HI_VALID |
15921 + (((u32) data[0]) << 8) |
15922 + (((u32) data[1]) << 0));
15923 + bw32(bp, B44_CAM_DATA_HI, val);
15924 + bw32(bp, B44_CAM_CTRL, (CAM_CTRL_WRITE |
15925 + (index << CAM_CTRL_INDEX_SHIFT)));
15926 + b44_wait_bit(bp, B44_CAM_CTRL, CAM_CTRL_BUSY, 100, 1);
15929 +static inline void __b44_disable_ints(struct b44 *bp)
15931 + bw32(bp, B44_IMASK, 0);
15934 +static void b44_disable_ints(struct b44 *bp)
15936 + __b44_disable_ints(bp);
15938 + /* Flush posted writes. */
15939 + br32(bp, B44_IMASK);
15942 +static void b44_enable_ints(struct b44 *bp)
15944 + bw32(bp, B44_IMASK, bp->imask);
15947 +static int b44_readphy(struct b44 *bp, int reg, u32 *val)
15951 + bw32(bp, B44_EMAC_ISTAT, EMAC_INT_MII);
15952 + bw32(bp, B44_MDIO_DATA, (MDIO_DATA_SB_START |
15953 + (MDIO_OP_READ << MDIO_DATA_OP_SHIFT) |
15954 + (bp->phy_addr << MDIO_DATA_PMD_SHIFT) |
15955 + (reg << MDIO_DATA_RA_SHIFT) |
15956 + (MDIO_TA_VALID << MDIO_DATA_TA_SHIFT)));
15957 + err = b44_wait_bit(bp, B44_EMAC_ISTAT, EMAC_INT_MII, 100, 0);
15958 + *val = br32(bp, B44_MDIO_DATA) & MDIO_DATA_DATA;
15963 +static int b44_writephy(struct b44 *bp, int reg, u32 val)
15965 + bw32(bp, B44_EMAC_ISTAT, EMAC_INT_MII);
15966 + bw32(bp, B44_MDIO_DATA, (MDIO_DATA_SB_START |
15967 + (MDIO_OP_WRITE << MDIO_DATA_OP_SHIFT) |
15968 + (bp->phy_addr << MDIO_DATA_PMD_SHIFT) |
15969 + (reg << MDIO_DATA_RA_SHIFT) |
15970 + (MDIO_TA_VALID << MDIO_DATA_TA_SHIFT) |
15971 + (val & MDIO_DATA_DATA)));
15972 + return b44_wait_bit(bp, B44_EMAC_ISTAT, EMAC_INT_MII, 100, 0);
15975 +/* miilib interface */
15976 +/* FIXME FIXME: phy_id is ignored, bp->phy_addr use is unconditional
15977 + * due to code existing before miilib use was added to this driver.
15978 + * Someone should remove this artificial driver limitation in
15979 + * b44_{read,write}phy. bp->phy_addr itself is fine (and needed).
15981 +static int b44_mii_read(struct net_device *dev, int phy_id, int location)
15984 + struct b44 *bp = netdev_priv(dev);
15985 + int rc = b44_readphy(bp, location, &val);
15987 + return 0xffffffff;
15991 +static void b44_mii_write(struct net_device *dev, int phy_id, int location,
15994 + struct b44 *bp = netdev_priv(dev);
15995 + b44_writephy(bp, location, val);
15998 +static int b44_phy_reset(struct b44 *bp)
16003 + err = b44_writephy(bp, MII_BMCR, BMCR_RESET);
16007 + err = b44_readphy(bp, MII_BMCR, &val);
16009 + if (val & BMCR_RESET) {
16010 + printk(KERN_ERR PFX "%s: PHY Reset would not complete.\n",
16019 +static void __b44_set_flow_ctrl(struct b44 *bp, u32 pause_flags)
16023 + bp->flags &= ~(B44_FLAG_TX_PAUSE | B44_FLAG_RX_PAUSE);
16024 + bp->flags |= pause_flags;
16026 + val = br32(bp, B44_RXCONFIG);
16027 + if (pause_flags & B44_FLAG_RX_PAUSE)
16028 + val |= RXCONFIG_FLOW;
16030 + val &= ~RXCONFIG_FLOW;
16031 + bw32(bp, B44_RXCONFIG, val);
16033 + val = br32(bp, B44_MAC_FLOW);
16034 + if (pause_flags & B44_FLAG_TX_PAUSE)
16035 + val |= (MAC_FLOW_PAUSE_ENAB |
16036 + (0xc0 & MAC_FLOW_RX_HI_WATER));
16038 + val &= ~MAC_FLOW_PAUSE_ENAB;
16039 + bw32(bp, B44_MAC_FLOW, val);
16042 +static void b44_set_flow_ctrl(struct b44 *bp, u32 local, u32 remote)
16044 + u32 pause_enab = bp->flags & (B44_FLAG_TX_PAUSE |
16045 + B44_FLAG_RX_PAUSE);
16047 + if (local & ADVERTISE_PAUSE_CAP) {
16048 + if (local & ADVERTISE_PAUSE_ASYM) {
16049 + if (remote & LPA_PAUSE_CAP)
16050 + pause_enab |= (B44_FLAG_TX_PAUSE |
16051 + B44_FLAG_RX_PAUSE);
16052 + else if (remote & LPA_PAUSE_ASYM)
16053 + pause_enab |= B44_FLAG_RX_PAUSE;
16055 + if (remote & LPA_PAUSE_CAP)
16056 + pause_enab |= (B44_FLAG_TX_PAUSE |
16057 + B44_FLAG_RX_PAUSE);
16059 + } else if (local & ADVERTISE_PAUSE_ASYM) {
16060 + if ((remote & LPA_PAUSE_CAP) &&
16061 + (remote & LPA_PAUSE_ASYM))
16062 + pause_enab |= B44_FLAG_TX_PAUSE;
16065 + __b44_set_flow_ctrl(bp, pause_enab);
16068 +static int b44_setup_phy(struct b44 *bp)
16073 + if ((err = b44_readphy(bp, B44_MII_ALEDCTRL, &val)) != 0)
16075 + if ((err = b44_writephy(bp, B44_MII_ALEDCTRL,
16076 + val & MII_ALEDCTRL_ALLMSK)) != 0)
16078 + if ((err = b44_readphy(bp, B44_MII_TLEDCTRL, &val)) != 0)
16080 + if ((err = b44_writephy(bp, B44_MII_TLEDCTRL,
16081 + val | MII_TLEDCTRL_ENABLE)) != 0)
16084 + if (!(bp->flags & B44_FLAG_FORCE_LINK)) {
16085 + u32 adv = ADVERTISE_CSMA;
16087 + if (bp->flags & B44_FLAG_ADV_10HALF)
16088 + adv |= ADVERTISE_10HALF;
16089 + if (bp->flags & B44_FLAG_ADV_10FULL)
16090 + adv |= ADVERTISE_10FULL;
16091 + if (bp->flags & B44_FLAG_ADV_100HALF)
16092 + adv |= ADVERTISE_100HALF;
16093 + if (bp->flags & B44_FLAG_ADV_100FULL)
16094 + adv |= ADVERTISE_100FULL;
16096 + if (bp->flags & B44_FLAG_PAUSE_AUTO)
16097 + adv |= ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM;
16099 + if ((err = b44_writephy(bp, MII_ADVERTISE, adv)) != 0)
16101 + if ((err = b44_writephy(bp, MII_BMCR, (BMCR_ANENABLE |
16102 + BMCR_ANRESTART))) != 0)
16107 + if ((err = b44_readphy(bp, MII_BMCR, &bmcr)) != 0)
16109 + bmcr &= ~(BMCR_FULLDPLX | BMCR_ANENABLE | BMCR_SPEED100);
16110 + if (bp->flags & B44_FLAG_100_BASE_T)
16111 + bmcr |= BMCR_SPEED100;
16112 + if (bp->flags & B44_FLAG_FULL_DUPLEX)
16113 + bmcr |= BMCR_FULLDPLX;
16114 + if ((err = b44_writephy(bp, MII_BMCR, bmcr)) != 0)
16117 + /* Since we will not be negotiating there is no safe way
16118 + * to determine if the link partner supports flow control
16119 + * or not. So just disable it completely in this case.
16121 + b44_set_flow_ctrl(bp, 0, 0);
16128 +static void b44_stats_update(struct b44 *bp)
16130 + unsigned long reg;
16133 + val = &bp->hw_stats.tx_good_octets;
16134 + for (reg = B44_TX_GOOD_O; reg <= B44_TX_PAUSE; reg += 4UL) {
16135 + *val++ += br32(bp, reg);
16137 + val = &bp->hw_stats.rx_good_octets;
16138 + for (reg = B44_RX_GOOD_O; reg <= B44_RX_NPAUSE; reg += 4UL) {
16139 + *val++ += br32(bp, reg);
16143 +static void b44_link_report(struct b44 *bp)
16145 + if (!netif_carrier_ok(bp->dev)) {
16146 + printk(KERN_INFO PFX "%s: Link is down.\n", bp->dev->name);
16148 + printk(KERN_INFO PFX "%s: Link is up at %d Mbps, %s duplex.\n",
16150 + (bp->flags & B44_FLAG_100_BASE_T) ? 100 : 10,
16151 + (bp->flags & B44_FLAG_FULL_DUPLEX) ? "full" : "half");
16153 + printk(KERN_INFO PFX "%s: Flow control is %s for TX and "
16156 + (bp->flags & B44_FLAG_TX_PAUSE) ? "on" : "off",
16157 + (bp->flags & B44_FLAG_RX_PAUSE) ? "on" : "off");
16161 +static void b44_check_phy(struct b44 *bp)
16165 + if (!b44_readphy(bp, MII_BMSR, &bmsr) &&
16166 + !b44_readphy(bp, B44_MII_AUXCTRL, &aux) &&
16167 + (bmsr != 0xffff)) {
16168 + if (aux & MII_AUXCTRL_SPEED)
16169 + bp->flags |= B44_FLAG_100_BASE_T;
16171 + bp->flags &= ~B44_FLAG_100_BASE_T;
16172 + if (aux & MII_AUXCTRL_DUPLEX)
16173 + bp->flags |= B44_FLAG_FULL_DUPLEX;
16175 + bp->flags &= ~B44_FLAG_FULL_DUPLEX;
16177 + if (!netif_carrier_ok(bp->dev) &&
16178 + (bmsr & BMSR_LSTATUS)) {
16179 + u32 val = br32(bp, B44_TX_CTRL);
16180 + u32 local_adv, remote_adv;
16182 + if (bp->flags & B44_FLAG_FULL_DUPLEX)
16183 + val |= TX_CTRL_DUPLEX;
16185 + val &= ~TX_CTRL_DUPLEX;
16186 + bw32(bp, B44_TX_CTRL, val);
16188 + if (!(bp->flags & B44_FLAG_FORCE_LINK) &&
16189 + !b44_readphy(bp, MII_ADVERTISE, &local_adv) &&
16190 + !b44_readphy(bp, MII_LPA, &remote_adv))
16191 + b44_set_flow_ctrl(bp, local_adv, remote_adv);
16193 + /* Link now up */
16194 + netif_carrier_on(bp->dev);
16195 + b44_link_report(bp);
16196 + } else if (netif_carrier_ok(bp->dev) && !(bmsr & BMSR_LSTATUS)) {
16197 + /* Link now down */
16198 + netif_carrier_off(bp->dev);
16199 + b44_link_report(bp);
16202 + if (bmsr & BMSR_RFAULT)
16203 + printk(KERN_WARNING PFX "%s: Remote fault detected in PHY\n",
16205 + if (bmsr & BMSR_JCD)
16206 + printk(KERN_WARNING PFX "%s: Jabber detected in PHY\n",
16211 +static void b44_timer(unsigned long __opaque)
16213 + struct b44 *bp = (struct b44 *) __opaque;
16215 + spin_lock_irq(&bp->lock);
16217 + b44_check_phy(bp);
16219 + b44_stats_update(bp);
16221 + spin_unlock_irq(&bp->lock);
16223 + bp->timer.expires = jiffies + HZ;
16224 + add_timer(&bp->timer);
16227 +static void b44_tx(struct b44 *bp)
16231 + cur = br32(bp, B44_DMATX_STAT) & DMATX_STAT_CDMASK;
16232 + cur /= sizeof(struct dma_desc);
16234 + /* XXX needs updating when NETIF_F_SG is supported */
16235 + for (cons = bp->tx_cons; cons != cur; cons = NEXT_TX(cons)) {
16236 + struct ring_info *rp = &bp->tx_buffers[cons];
16237 + struct sk_buff *skb = rp->skb;
16239 + if (unlikely(skb == NULL))
16242 + pci_unmap_single(bp->pdev,
16243 + pci_unmap_addr(rp, mapping),
16245 + PCI_DMA_TODEVICE);
16247 + dev_kfree_skb_irq(skb);
16250 + bp->tx_cons = cons;
16251 + if (netif_queue_stopped(bp->dev) &&
16252 + TX_BUFFS_AVAIL(bp) > B44_TX_WAKEUP_THRESH)
16253 + netif_wake_queue(bp->dev);
16255 + bw32(bp, B44_GPTIMER, 0);
16258 +/* Works like this. This chip writes a 'struct rx_header" 30 bytes
16259 + * before the DMA address you give it. So we allocate 30 more bytes
16260 + * for the RX buffer, DMA map all of it, skb_reserve the 30 bytes, then
16261 + * point the chip at 30 bytes past where the rx_header will go.
16263 +static int b44_alloc_rx_skb(struct b44 *bp, int src_idx, u32 dest_idx_unmasked)
16265 + struct dma_desc *dp;
16266 + struct ring_info *src_map, *map;
16267 + struct rx_header *rh;
16268 + struct sk_buff *skb;
16269 + dma_addr_t mapping;
16274 + if (src_idx >= 0)
16275 + src_map = &bp->rx_buffers[src_idx];
16276 + dest_idx = dest_idx_unmasked & (B44_RX_RING_SIZE - 1);
16277 + map = &bp->rx_buffers[dest_idx];
16278 + skb = dev_alloc_skb(RX_PKT_BUF_SZ);
16282 + mapping = pci_map_single(bp->pdev, skb->data,
16284 + PCI_DMA_FROMDEVICE);
16286 + /* Hardware bug work-around, the chip is unable to do PCI DMA
16287 + to/from anything above 1GB :-( */
16288 + if(mapping+RX_PKT_BUF_SZ > B44_DMA_MASK) {
16290 + pci_unmap_single(bp->pdev, mapping, RX_PKT_BUF_SZ,PCI_DMA_FROMDEVICE);
16291 + dev_kfree_skb_any(skb);
16292 + skb = __dev_alloc_skb(RX_PKT_BUF_SZ,GFP_DMA);
16295 + mapping = pci_map_single(bp->pdev, skb->data,
16297 + PCI_DMA_FROMDEVICE);
16298 + if(mapping+RX_PKT_BUF_SZ > B44_DMA_MASK) {
16299 + pci_unmap_single(bp->pdev, mapping, RX_PKT_BUF_SZ,PCI_DMA_FROMDEVICE);
16300 + dev_kfree_skb_any(skb);
16305 + skb->dev = bp->dev;
16306 + skb_reserve(skb, bp->rx_offset);
16308 + rh = (struct rx_header *)
16309 + (skb->data - bp->rx_offset);
16314 + pci_unmap_addr_set(map, mapping, mapping);
16316 + if (src_map != NULL)
16317 + src_map->skb = NULL;
16319 + ctrl = (DESC_CTRL_LEN & (RX_PKT_BUF_SZ - bp->rx_offset));
16320 + if (dest_idx == (B44_RX_RING_SIZE - 1))
16321 + ctrl |= DESC_CTRL_EOT;
16323 + dp = &bp->rx_ring[dest_idx];
16324 + dp->ctrl = cpu_to_le32(ctrl);
16325 + dp->addr = cpu_to_le32((u32) mapping + bp->rx_offset + bp->dma_offset);
16327 + return RX_PKT_BUF_SZ;
16330 +static void b44_recycle_rx(struct b44 *bp, int src_idx, u32 dest_idx_unmasked)
16332 + struct dma_desc *src_desc, *dest_desc;
16333 + struct ring_info *src_map, *dest_map;
16334 + struct rx_header *rh;
16338 + dest_idx = dest_idx_unmasked & (B44_RX_RING_SIZE - 1);
16339 + dest_desc = &bp->rx_ring[dest_idx];
16340 + dest_map = &bp->rx_buffers[dest_idx];
16341 + src_desc = &bp->rx_ring[src_idx];
16342 + src_map = &bp->rx_buffers[src_idx];
16344 + dest_map->skb = src_map->skb;
16345 + rh = (struct rx_header *) src_map->skb->data;
16348 + pci_unmap_addr_set(dest_map, mapping,
16349 + pci_unmap_addr(src_map, mapping));
16351 + ctrl = src_desc->ctrl;
16352 + if (dest_idx == (B44_RX_RING_SIZE - 1))
16353 + ctrl |= cpu_to_le32(DESC_CTRL_EOT);
16355 + ctrl &= cpu_to_le32(~DESC_CTRL_EOT);
16357 + dest_desc->ctrl = ctrl;
16358 + dest_desc->addr = src_desc->addr;
16359 + src_map->skb = NULL;
16361 + pci_dma_sync_single_for_device(bp->pdev, src_desc->addr,
16363 + PCI_DMA_FROMDEVICE);
16366 +static int b44_rx(struct b44 *bp, int budget)
16372 + prod = br32(bp, B44_DMARX_STAT) & DMARX_STAT_CDMASK;
16373 + prod /= sizeof(struct dma_desc);
16374 + cons = bp->rx_cons;
16376 + while (cons != prod && budget > 0) {
16377 + struct ring_info *rp = &bp->rx_buffers[cons];
16378 + struct sk_buff *skb = rp->skb;
16379 + dma_addr_t map = pci_unmap_addr(rp, mapping);
16380 + struct rx_header *rh;
16383 + pci_dma_sync_single_for_cpu(bp->pdev, map,
16385 + PCI_DMA_FROMDEVICE);
16386 + rh = (struct rx_header *) skb->data;
16387 + len = cpu_to_le16(rh->len);
16388 + if ((len > (RX_PKT_BUF_SZ - bp->rx_offset)) ||
16389 + (rh->flags & cpu_to_le16(RX_FLAG_ERRORS))) {
16391 + b44_recycle_rx(bp, cons, bp->rx_prod);
16392 + drop_it_no_recycle:
16393 + bp->stats.rx_dropped++;
16403 + len = cpu_to_le16(rh->len);
16404 + } while (len == 0 && i++ < 5);
16412 + if (len > RX_COPY_THRESHOLD) {
16414 + skb_size = b44_alloc_rx_skb(bp, cons, bp->rx_prod);
16415 + if (skb_size < 0)
16417 + pci_unmap_single(bp->pdev, map,
16418 + skb_size, PCI_DMA_FROMDEVICE);
16419 + /* Leave out rx_header */
16420 + skb_put(skb, len+bp->rx_offset);
16421 + skb_pull(skb,bp->rx_offset);
16423 + struct sk_buff *copy_skb;
16425 + b44_recycle_rx(bp, cons, bp->rx_prod);
16426 + copy_skb = dev_alloc_skb(len + 2);
16427 + if (copy_skb == NULL)
16428 + goto drop_it_no_recycle;
16430 + copy_skb->dev = bp->dev;
16431 + skb_reserve(copy_skb, 2);
16432 + skb_put(copy_skb, len);
16433 + /* DMA sync done above, copy just the actual packet */
16434 + memcpy(copy_skb->data, skb->data+bp->rx_offset, len);
16438 + skb->ip_summed = CHECKSUM_NONE;
16439 + skb->protocol = eth_type_trans(skb, bp->dev);
16440 + netif_receive_skb(skb);
16441 + bp->dev->last_rx = jiffies;
16445 + bp->rx_prod = (bp->rx_prod + 1) &
16446 + (B44_RX_RING_SIZE - 1);
16447 + cons = (cons + 1) & (B44_RX_RING_SIZE - 1);
16450 + bp->rx_cons = cons;
16451 + bw32(bp, B44_DMARX_PTR, cons * sizeof(struct dma_desc));
16456 +static int b44_poll(struct net_device *netdev, int *budget)
16458 + struct b44 *bp = netdev_priv(netdev);
16461 + spin_lock_irq(&bp->lock);
16463 + if (bp->istat & (ISTAT_TX | ISTAT_TO)) {
16464 + /* spin_lock(&bp->tx_lock); */
16466 + /* spin_unlock(&bp->tx_lock); */
16468 + spin_unlock_irq(&bp->lock);
16471 + if (bp->istat & ISTAT_RX) {
16472 + int orig_budget = *budget;
16475 + if (orig_budget > netdev->quota)
16476 + orig_budget = netdev->quota;
16478 + work_done = b44_rx(bp, orig_budget);
16480 + *budget -= work_done;
16481 + netdev->quota -= work_done;
16483 + if (work_done >= orig_budget)
16487 + if (bp->istat & ISTAT_ERRORS) {
16488 + spin_lock_irq(&bp->lock);
16490 + b44_init_rings(bp);
16492 + netif_wake_queue(bp->dev);
16493 + spin_unlock_irq(&bp->lock);
16498 + netif_rx_complete(netdev);
16499 + b44_enable_ints(bp);
16502 + return (done ? 0 : 1);
16505 +static irqreturn_t b44_interrupt(int irq, void *dev_id, struct pt_regs *regs)
16507 + struct net_device *dev = dev_id;
16508 + struct b44 *bp = netdev_priv(dev);
16509 + unsigned long flags;
16510 + u32 istat, imask;
16513 + spin_lock_irqsave(&bp->lock, flags);
16515 + istat = br32(bp, B44_ISTAT);
16516 + imask = br32(bp, B44_IMASK);
16518 + /* ??? What the fuck is the purpose of the interrupt mask
16519 + * ??? register if we have to mask it out by hand anyways?
16524 + if (netif_rx_schedule_prep(dev)) {
16525 + /* NOTE: These writes are posted by the readback of
16526 + * the ISTAT register below.
16528 + bp->istat = istat;
16529 + __b44_disable_ints(bp);
16530 + __netif_rx_schedule(dev);
16532 + printk(KERN_ERR PFX "%s: Error, poll already scheduled\n",
16536 + bw32(bp, B44_ISTAT, istat);
16537 + br32(bp, B44_ISTAT);
16539 + spin_unlock_irqrestore(&bp->lock, flags);
16540 + return IRQ_RETVAL(handled);
16543 +static void b44_tx_timeout(struct net_device *dev)
16545 + struct b44 *bp = netdev_priv(dev);
16547 + printk(KERN_ERR PFX "%s: transmit timed out, resetting\n",
16550 + spin_lock_irq(&bp->lock);
16553 + b44_init_rings(bp);
16556 + spin_unlock_irq(&bp->lock);
16558 + b44_enable_ints(bp);
16560 + netif_wake_queue(dev);
16563 +static int b44_start_xmit(struct sk_buff *skb, struct net_device *dev)
16565 + struct b44 *bp = netdev_priv(dev);
16566 + struct sk_buff *bounce_skb;
16567 + dma_addr_t mapping;
16568 + u32 len, entry, ctrl;
16571 + spin_lock_irq(&bp->lock);
16573 + /* This is a hard error, log it. */
16574 + if (unlikely(TX_BUFFS_AVAIL(bp) < 1)) {
16575 + netif_stop_queue(dev);
16576 + spin_unlock_irq(&bp->lock);
16577 + printk(KERN_ERR PFX "%s: BUG! Tx Ring full when queue awake!\n",
16582 + mapping = pci_map_single(bp->pdev, skb->data, len, PCI_DMA_TODEVICE);
16583 + if(mapping+len > B44_DMA_MASK) {
16584 + /* Chip can't handle DMA to/from >1GB, use bounce buffer */
16585 + pci_unmap_single(bp->pdev, mapping, len, PCI_DMA_TODEVICE);
16587 + bounce_skb = __dev_alloc_skb(TX_PKT_BUF_SZ,
16588 + GFP_ATOMIC|GFP_DMA);
16590 + return NETDEV_TX_BUSY;
16592 + mapping = pci_map_single(bp->pdev, bounce_skb->data,
16593 + len, PCI_DMA_TODEVICE);
16594 + if(mapping+len > B44_DMA_MASK) {
16595 + pci_unmap_single(bp->pdev, mapping,
16596 + len, PCI_DMA_TODEVICE);
16597 + dev_kfree_skb_any(bounce_skb);
16598 + return NETDEV_TX_BUSY;
16601 + memcpy(skb_put(bounce_skb, len), skb->data, skb->len);
16602 + dev_kfree_skb_any(skb);
16603 + skb = bounce_skb;
16606 + entry = bp->tx_prod;
16607 + bp->tx_buffers[entry].skb = skb;
16608 + pci_unmap_addr_set(&bp->tx_buffers[entry], mapping, mapping);
16610 + ctrl = (len & DESC_CTRL_LEN);
16611 + ctrl |= DESC_CTRL_IOC | DESC_CTRL_SOF | DESC_CTRL_EOF;
16612 + if (entry == (B44_TX_RING_SIZE - 1))
16613 + ctrl |= DESC_CTRL_EOT;
16615 + bp->tx_ring[entry].ctrl = cpu_to_le32(ctrl);
16616 + bp->tx_ring[entry].addr = cpu_to_le32((u32) mapping+bp->dma_offset);
16618 + entry = NEXT_TX(entry);
16620 + bp->tx_prod = entry;
16624 + bw32(bp, B44_DMATX_PTR, entry * sizeof(struct dma_desc));
16625 + if (bp->flags & B44_FLAG_BUGGY_TXPTR)
16626 + bw32(bp, B44_DMATX_PTR, entry * sizeof(struct dma_desc));
16627 + if (bp->flags & B44_FLAG_REORDER_BUG)
16628 + br32(bp, B44_DMATX_PTR);
16630 + if (TX_BUFFS_AVAIL(bp) < 1)
16631 + netif_stop_queue(dev);
16633 + spin_unlock_irq(&bp->lock);
16635 + dev->trans_start = jiffies;
16640 +static int b44_change_mtu(struct net_device *dev, int new_mtu)
16642 + struct b44 *bp = netdev_priv(dev);
16644 + if (new_mtu < B44_MIN_MTU || new_mtu > B44_MAX_MTU)
16647 + if (!netif_running(dev)) {
16648 + /* We'll just catch it later when the
16649 + * device is up'd.
16651 + dev->mtu = new_mtu;
16655 + spin_lock_irq(&bp->lock);
16657 + dev->mtu = new_mtu;
16658 + b44_init_rings(bp);
16660 + spin_unlock_irq(&bp->lock);
16662 + b44_enable_ints(bp);
16667 +/* Free up pending packets in all rx/tx rings.
16669 + * The chip has been shut down and the driver detached from
16670 + * the networking, so no interrupts or new tx packets will
16671 + * end up in the driver. bp->lock is not held and we are not
16672 + * in an interrupt context and thus may sleep.
16674 +static void b44_free_rings(struct b44 *bp)
16676 + struct ring_info *rp;
16679 + for (i = 0; i < B44_RX_RING_SIZE; i++) {
16680 + rp = &bp->rx_buffers[i];
16682 + if (rp->skb == NULL)
16684 + pci_unmap_single(bp->pdev,
16685 + pci_unmap_addr(rp, mapping),
16687 + PCI_DMA_FROMDEVICE);
16688 + dev_kfree_skb_any(rp->skb);
16692 + /* XXX needs changes once NETIF_F_SG is set... */
16693 + for (i = 0; i < B44_TX_RING_SIZE; i++) {
16694 + rp = &bp->tx_buffers[i];
16696 + if (rp->skb == NULL)
16698 + pci_unmap_single(bp->pdev,
16699 + pci_unmap_addr(rp, mapping),
16701 + PCI_DMA_TODEVICE);
16702 + dev_kfree_skb_any(rp->skb);
16707 +/* Initialize tx/rx rings for packet processing.
16709 + * The chip has been shut down and the driver detached from
16710 + * the networking, so no interrupts or new tx packets will
16711 + * end up in the driver. bp->lock is not held and we are not
16712 + * in an interrupt context and thus may sleep.
16714 +static void b44_init_rings(struct b44 *bp)
16718 + b44_free_rings(bp);
16720 + memset(bp->rx_ring, 0, B44_RX_RING_BYTES);
16721 + memset(bp->tx_ring, 0, B44_TX_RING_BYTES);
16723 + for (i = 0; i < bp->rx_pending; i++) {
16724 + if (b44_alloc_rx_skb(bp, -1, i) < 0)
16730 + * Must not be invoked with interrupt sources disabled and
16731 + * the hardware shutdown down.
16733 +static void b44_free_consistent(struct b44 *bp)
16735 + if (bp->rx_buffers) {
16736 + kfree(bp->rx_buffers);
16737 + bp->rx_buffers = NULL;
16739 + if (bp->tx_buffers) {
16740 + kfree(bp->tx_buffers);
16741 + bp->tx_buffers = NULL;
16743 + if (bp->rx_ring) {
16744 + pci_free_consistent(bp->pdev, DMA_TABLE_BYTES,
16745 + bp->rx_ring, bp->rx_ring_dma);
16746 + bp->rx_ring = NULL;
16748 + if (bp->tx_ring) {
16749 + pci_free_consistent(bp->pdev, DMA_TABLE_BYTES,
16750 + bp->tx_ring, bp->tx_ring_dma);
16751 + bp->tx_ring = NULL;
16756 + * Must not be invoked with interrupt sources disabled and
16757 + * the hardware shutdown down. Can sleep.
16759 +static int b44_alloc_consistent(struct b44 *bp)
16763 + size = B44_RX_RING_SIZE * sizeof(struct ring_info);
16764 + bp->rx_buffers = kmalloc(size, GFP_KERNEL);
16765 + if (!bp->rx_buffers)
16767 + memset(bp->rx_buffers, 0, size);
16769 + size = B44_TX_RING_SIZE * sizeof(struct ring_info);
16770 + bp->tx_buffers = kmalloc(size, GFP_KERNEL);
16771 + if (!bp->tx_buffers)
16773 + memset(bp->tx_buffers, 0, size);
16775 + size = DMA_TABLE_BYTES;
16776 + bp->rx_ring = pci_alloc_consistent(bp->pdev, size, &bp->rx_ring_dma);
16777 + if (!bp->rx_ring)
16780 + bp->tx_ring = pci_alloc_consistent(bp->pdev, size, &bp->tx_ring_dma);
16781 + if (!bp->tx_ring)
16787 + b44_free_consistent(bp);
16791 +/* bp->lock is held. */
16792 +static void b44_clear_stats(struct b44 *bp)
16794 + unsigned long reg;
16796 + bw32(bp, B44_MIB_CTRL, MIB_CTRL_CLR_ON_READ);
16797 + for (reg = B44_TX_GOOD_O; reg <= B44_TX_PAUSE; reg += 4UL)
16799 + for (reg = B44_RX_GOOD_O; reg <= B44_RX_NPAUSE; reg += 4UL)
16803 +/* bp->lock is held. */
16804 +static void b44_chip_reset(struct b44 *bp)
16806 + if (ssb_is_core_up(bp)) {
16807 + bw32(bp, B44_RCV_LAZY, 0);
16808 + bw32(bp, B44_ENET_CTRL, ENET_CTRL_DISABLE);
16809 + b44_wait_bit(bp, B44_ENET_CTRL, ENET_CTRL_DISABLE, 100, 1);
16810 + bw32(bp, B44_DMATX_CTRL, 0);
16811 + bp->tx_prod = bp->tx_cons = 0;
16812 + if (br32(bp, B44_DMARX_STAT) & DMARX_STAT_EMASK) {
16813 + b44_wait_bit(bp, B44_DMARX_STAT, DMARX_STAT_SIDLE,
16816 + bw32(bp, B44_DMARX_CTRL, 0);
16817 + bp->rx_prod = bp->rx_cons = 0;
16819 + ssb_pci_setup(bp, (bp->core_unit == 0 ?
16821 + SBINTVEC_ENET1));
16824 + ssb_core_reset(bp);
16826 + b44_clear_stats(bp);
16828 + /* Make PHY accessible. */
16829 + bw32(bp, B44_MDIO_CTRL, (MDIO_CTRL_PREAMBLE |
16830 + (0x0d & MDIO_CTRL_MAXF_MASK)));
16831 + br32(bp, B44_MDIO_CTRL);
16833 + if (!(br32(bp, B44_DEVCTRL) & DEVCTRL_IPP)) {
16834 + bw32(bp, B44_ENET_CTRL, ENET_CTRL_EPSEL);
16835 + br32(bp, B44_ENET_CTRL);
16836 + bp->flags &= ~B44_FLAG_INTERNAL_PHY;
16838 + u32 val = br32(bp, B44_DEVCTRL);
16840 + if (val & DEVCTRL_EPR) {
16841 + bw32(bp, B44_DEVCTRL, (val & ~DEVCTRL_EPR));
16842 + br32(bp, B44_DEVCTRL);
16845 + bp->flags |= B44_FLAG_INTERNAL_PHY;
16849 +/* bp->lock is held. */
16850 +static void b44_halt(struct b44 *bp)
16852 + b44_disable_ints(bp);
16853 + b44_chip_reset(bp);
16856 +/* bp->lock is held. */
16857 +static void __b44_set_mac_addr(struct b44 *bp)
16859 + bw32(bp, B44_CAM_CTRL, 0);
16860 + if (!(bp->dev->flags & IFF_PROMISC)) {
16863 + __b44_cam_write(bp, bp->dev->dev_addr, 0);
16864 + val = br32(bp, B44_CAM_CTRL);
16865 + bw32(bp, B44_CAM_CTRL, val | CAM_CTRL_ENABLE);
16869 +static int b44_set_mac_addr(struct net_device *dev, void *p)
16871 + struct b44 *bp = netdev_priv(dev);
16872 + struct sockaddr *addr = p;
16874 + if (netif_running(dev))
16877 + memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
16879 + spin_lock_irq(&bp->lock);
16880 + __b44_set_mac_addr(bp);
16881 + spin_unlock_irq(&bp->lock);
16886 +/* Called at device open time to get the chip ready for
16887 + * packet processing. Invoked with bp->lock held.
16889 +static void __b44_set_rx_mode(struct net_device *);
16890 +static void b44_init_hw(struct b44 *bp)
16894 + b44_chip_reset(bp);
16895 + b44_phy_reset(bp);
16896 + b44_setup_phy(bp);
16898 + /* Enable CRC32, set proper LED modes and power on PHY */
16899 + bw32(bp, B44_MAC_CTRL, MAC_CTRL_CRC32_ENAB | MAC_CTRL_PHY_LEDCTRL);
16900 + bw32(bp, B44_RCV_LAZY, (1 << RCV_LAZY_FC_SHIFT));
16902 + /* This sets the MAC address too. */
16903 + __b44_set_rx_mode(bp->dev);
16905 + /* MTU + eth header + possible VLAN tag + struct rx_header */
16906 + bw32(bp, B44_RXMAXLEN, bp->dev->mtu + ETH_HLEN + 8 + RX_HEADER_LEN);
16907 + bw32(bp, B44_TXMAXLEN, bp->dev->mtu + ETH_HLEN + 8 + RX_HEADER_LEN);
16909 + bw32(bp, B44_TX_WMARK, 56); /* XXX magic */
16910 + bw32(bp, B44_DMATX_CTRL, DMATX_CTRL_ENABLE);
16911 + bw32(bp, B44_DMATX_ADDR, bp->tx_ring_dma + bp->dma_offset);
16912 + bw32(bp, B44_DMARX_CTRL, (DMARX_CTRL_ENABLE |
16913 + (bp->rx_offset << DMARX_CTRL_ROSHIFT)));
16914 + bw32(bp, B44_DMARX_ADDR, bp->rx_ring_dma + bp->dma_offset);
16916 + bw32(bp, B44_DMARX_PTR, bp->rx_pending);
16917 + bp->rx_prod = bp->rx_pending;
16919 + bw32(bp, B44_MIB_CTRL, MIB_CTRL_CLR_ON_READ);
16921 + val = br32(bp, B44_ENET_CTRL);
16922 + bw32(bp, B44_ENET_CTRL, (val | ENET_CTRL_ENABLE));
16925 +static int b44_open(struct net_device *dev)
16927 + struct b44 *bp = netdev_priv(dev);
16930 + err = b44_alloc_consistent(bp);
16934 + err = request_irq(dev->irq, b44_interrupt, SA_SHIRQ, dev->name, dev);
16936 + goto err_out_free;
16938 + spin_lock_irq(&bp->lock);
16940 + b44_init_rings(bp);
16942 + bp->flags |= B44_FLAG_INIT_COMPLETE;
16944 + spin_unlock_irq(&bp->lock);
16946 + init_timer(&bp->timer);
16947 + bp->timer.expires = jiffies + HZ;
16948 + bp->timer.data = (unsigned long) bp;
16949 + bp->timer.function = b44_timer;
16950 + add_timer(&bp->timer);
16952 + b44_enable_ints(bp);
16957 + b44_free_consistent(bp);
16962 +/*static*/ void b44_dump_state(struct b44 *bp)
16964 + u32 val32, val32_2, val32_3, val32_4, val32_5;
16967 + pci_read_config_word(bp->pdev, PCI_STATUS, &val16);
16968 + printk("DEBUG: PCI status [%04x] \n", val16);
16973 +#ifdef CONFIG_NET_POLL_CONTROLLER
16975 + * Polling receive - used by netconsole and other diagnostic tools
16976 + * to allow network i/o with interrupts disabled.
16978 +static void b44_poll_controller(struct net_device *dev)
16980 + disable_irq(dev->irq);
16981 + b44_interrupt(dev->irq, dev, NULL);
16982 + enable_irq(dev->irq);
16986 +static int b44_close(struct net_device *dev)
16988 + struct b44 *bp = netdev_priv(dev);
16990 + netif_stop_queue(dev);
16992 + del_timer_sync(&bp->timer);
16994 + spin_lock_irq(&bp->lock);
16997 + b44_dump_state(bp);
17000 + b44_free_rings(bp);
17001 + bp->flags &= ~B44_FLAG_INIT_COMPLETE;
17002 + netif_carrier_off(bp->dev);
17004 + spin_unlock_irq(&bp->lock);
17006 + free_irq(dev->irq, dev);
17008 + b44_free_consistent(bp);
17013 +static struct net_device_stats *b44_get_stats(struct net_device *dev)
17015 + struct b44 *bp = netdev_priv(dev);
17016 + struct net_device_stats *nstat = &bp->stats;
17017 + struct b44_hw_stats *hwstat = &bp->hw_stats;
17019 + /* Convert HW stats into netdevice stats. */
17020 + nstat->rx_packets = hwstat->rx_pkts;
17021 + nstat->tx_packets = hwstat->tx_pkts;
17022 + nstat->rx_bytes = hwstat->rx_octets;
17023 + nstat->tx_bytes = hwstat->tx_octets;
17024 + nstat->tx_errors = (hwstat->tx_jabber_pkts +
17025 + hwstat->tx_oversize_pkts +
17026 + hwstat->tx_underruns +
17027 + hwstat->tx_excessive_cols +
17028 + hwstat->tx_late_cols);
17029 + nstat->multicast = hwstat->tx_multicast_pkts;
17030 + nstat->collisions = hwstat->tx_total_cols;
17032 + nstat->rx_length_errors = (hwstat->rx_oversize_pkts +
17033 + hwstat->rx_undersize);
17034 + nstat->rx_over_errors = hwstat->rx_missed_pkts;
17035 + nstat->rx_frame_errors = hwstat->rx_align_errs;
17036 + nstat->rx_crc_errors = hwstat->rx_crc_errs;
17037 + nstat->rx_errors = (hwstat->rx_jabber_pkts +
17038 + hwstat->rx_oversize_pkts +
17039 + hwstat->rx_missed_pkts +
17040 + hwstat->rx_crc_align_errs +
17041 + hwstat->rx_undersize +
17042 + hwstat->rx_crc_errs +
17043 + hwstat->rx_align_errs +
17044 + hwstat->rx_symbol_errs);
17046 + nstat->tx_aborted_errors = hwstat->tx_underruns;
17048 + /* Carrier lost counter seems to be broken for some devices */
17049 + nstat->tx_carrier_errors = hwstat->tx_carrier_lost;
17055 +static int __b44_load_mcast(struct b44 *bp, struct net_device *dev)
17057 + struct dev_mc_list *mclist;
17060 + num_ents = min_t(int, dev->mc_count, B44_MCAST_TABLE_SIZE);
17061 + mclist = dev->mc_list;
17062 + for (i = 0; mclist && i < num_ents; i++, mclist = mclist->next) {
17063 + __b44_cam_write(bp, mclist->dmi_addr, i + 1);
17068 +static void __b44_set_rx_mode(struct net_device *dev)
17070 + struct b44 *bp = netdev_priv(dev);
17073 + unsigned char zero[6] = {0,0,0,0,0,0};
17075 + val = br32(bp, B44_RXCONFIG);
17076 + val &= ~(RXCONFIG_PROMISC | RXCONFIG_ALLMULTI);
17077 + if (dev->flags & IFF_PROMISC) {
17078 + val |= RXCONFIG_PROMISC;
17079 + bw32(bp, B44_RXCONFIG, val);
17081 + __b44_set_mac_addr(bp);
17083 + if (dev->flags & IFF_ALLMULTI)
17084 + val |= RXCONFIG_ALLMULTI;
17086 + i=__b44_load_mcast(bp, dev);
17089 + __b44_cam_write(bp, zero, i);
17091 + bw32(bp, B44_RXCONFIG, val);
17092 + val = br32(bp, B44_CAM_CTRL);
17093 + bw32(bp, B44_CAM_CTRL, val | CAM_CTRL_ENABLE);
17097 +static void b44_set_rx_mode(struct net_device *dev)
17099 + struct b44 *bp = netdev_priv(dev);
17101 + spin_lock_irq(&bp->lock);
17102 + __b44_set_rx_mode(dev);
17103 + spin_unlock_irq(&bp->lock);
17106 +static u32 b44_get_msglevel(struct net_device *dev)
17108 + struct b44 *bp = netdev_priv(dev);
17109 + return bp->msg_enable;
17112 +static void b44_set_msglevel(struct net_device *dev, u32 value)
17114 + struct b44 *bp = netdev_priv(dev);
17115 + bp->msg_enable = value;
17118 +static void b44_get_drvinfo (struct net_device *dev, struct ethtool_drvinfo *info)
17120 + struct b44 *bp = netdev_priv(dev);
17121 + struct pci_dev *pci_dev = bp->pdev;
17123 + strcpy (info->driver, DRV_MODULE_NAME);
17124 + strcpy (info->version, DRV_MODULE_VERSION);
17125 + strcpy (info->bus_info, pci_name(pci_dev));
17128 +static int b44_nway_reset(struct net_device *dev)
17130 + struct b44 *bp = netdev_priv(dev);
17134 + spin_lock_irq(&bp->lock);
17135 + b44_readphy(bp, MII_BMCR, &bmcr);
17136 + b44_readphy(bp, MII_BMCR, &bmcr);
17138 + if (bmcr & BMCR_ANENABLE) {
17139 + b44_writephy(bp, MII_BMCR,
17140 + bmcr | BMCR_ANRESTART);
17143 + spin_unlock_irq(&bp->lock);
17148 +static int b44_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
17150 + struct b44 *bp = netdev_priv(dev);
17152 + if (!(bp->flags & B44_FLAG_INIT_COMPLETE))
17154 + cmd->supported = (SUPPORTED_Autoneg);
17155 + cmd->supported |= (SUPPORTED_100baseT_Half |
17156 + SUPPORTED_100baseT_Full |
17157 + SUPPORTED_10baseT_Half |
17158 + SUPPORTED_10baseT_Full |
17161 + cmd->advertising = 0;
17162 + if (bp->flags & B44_FLAG_ADV_10HALF)
17163 + cmd->advertising |= ADVERTISE_10HALF;
17164 + if (bp->flags & B44_FLAG_ADV_10FULL)
17165 + cmd->advertising |= ADVERTISE_10FULL;
17166 + if (bp->flags & B44_FLAG_ADV_100HALF)
17167 + cmd->advertising |= ADVERTISE_100HALF;
17168 + if (bp->flags & B44_FLAG_ADV_100FULL)
17169 + cmd->advertising |= ADVERTISE_100FULL;
17170 + cmd->advertising |= ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM;
17171 + cmd->speed = (bp->flags & B44_FLAG_100_BASE_T) ?
17172 + SPEED_100 : SPEED_10;
17173 + cmd->duplex = (bp->flags & B44_FLAG_FULL_DUPLEX) ?
17174 + DUPLEX_FULL : DUPLEX_HALF;
17176 + cmd->phy_address = bp->phy_addr;
17177 + cmd->transceiver = (bp->flags & B44_FLAG_INTERNAL_PHY) ?
17178 + XCVR_INTERNAL : XCVR_EXTERNAL;
17179 + cmd->autoneg = (bp->flags & B44_FLAG_FORCE_LINK) ?
17180 + AUTONEG_DISABLE : AUTONEG_ENABLE;
17181 + cmd->maxtxpkt = 0;
17182 + cmd->maxrxpkt = 0;
17186 +static int b44_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
17188 + struct b44 *bp = netdev_priv(dev);
17190 + if (!(bp->flags & B44_FLAG_INIT_COMPLETE))
17193 + /* We do not support gigabit. */
17194 + if (cmd->autoneg == AUTONEG_ENABLE) {
17195 + if (cmd->advertising &
17196 + (ADVERTISED_1000baseT_Half |
17197 + ADVERTISED_1000baseT_Full))
17199 + } else if ((cmd->speed != SPEED_100 &&
17200 + cmd->speed != SPEED_10) ||
17201 + (cmd->duplex != DUPLEX_HALF &&
17202 + cmd->duplex != DUPLEX_FULL)) {
17206 + spin_lock_irq(&bp->lock);
17208 + if (cmd->autoneg == AUTONEG_ENABLE) {
17209 + bp->flags &= ~B44_FLAG_FORCE_LINK;
17210 + bp->flags &= ~(B44_FLAG_ADV_10HALF |
17211 + B44_FLAG_ADV_10FULL |
17212 + B44_FLAG_ADV_100HALF |
17213 + B44_FLAG_ADV_100FULL);
17214 + if (cmd->advertising & ADVERTISE_10HALF)
17215 + bp->flags |= B44_FLAG_ADV_10HALF;
17216 + if (cmd->advertising & ADVERTISE_10FULL)
17217 + bp->flags |= B44_FLAG_ADV_10FULL;
17218 + if (cmd->advertising & ADVERTISE_100HALF)
17219 + bp->flags |= B44_FLAG_ADV_100HALF;
17220 + if (cmd->advertising & ADVERTISE_100FULL)
17221 + bp->flags |= B44_FLAG_ADV_100FULL;
17223 + bp->flags |= B44_FLAG_FORCE_LINK;
17224 + if (cmd->speed == SPEED_100)
17225 + bp->flags |= B44_FLAG_100_BASE_T;
17226 + if (cmd->duplex == DUPLEX_FULL)
17227 + bp->flags |= B44_FLAG_FULL_DUPLEX;
17230 + b44_setup_phy(bp);
17232 + spin_unlock_irq(&bp->lock);
17237 +static void b44_get_ringparam(struct net_device *dev,
17238 + struct ethtool_ringparam *ering)
17240 + struct b44 *bp = netdev_priv(dev);
17242 + ering->rx_max_pending = B44_RX_RING_SIZE - 1;
17243 + ering->rx_pending = bp->rx_pending;
17245 + /* XXX ethtool lacks a tx_max_pending, oops... */
17248 +static int b44_set_ringparam(struct net_device *dev,
17249 + struct ethtool_ringparam *ering)
17251 + struct b44 *bp = netdev_priv(dev);
17253 + if ((ering->rx_pending > B44_RX_RING_SIZE - 1) ||
17254 + (ering->rx_mini_pending != 0) ||
17255 + (ering->rx_jumbo_pending != 0) ||
17256 + (ering->tx_pending > B44_TX_RING_SIZE - 1))
17259 + spin_lock_irq(&bp->lock);
17261 + bp->rx_pending = ering->rx_pending;
17262 + bp->tx_pending = ering->tx_pending;
17265 + b44_init_rings(bp);
17267 + netif_wake_queue(bp->dev);
17268 + spin_unlock_irq(&bp->lock);
17270 + b44_enable_ints(bp);
17275 +static void b44_get_pauseparam(struct net_device *dev,
17276 + struct ethtool_pauseparam *epause)
17278 + struct b44 *bp = netdev_priv(dev);
17280 + epause->autoneg =
17281 + (bp->flags & B44_FLAG_PAUSE_AUTO) != 0;
17282 + epause->rx_pause =
17283 + (bp->flags & B44_FLAG_RX_PAUSE) != 0;
17284 + epause->tx_pause =
17285 + (bp->flags & B44_FLAG_TX_PAUSE) != 0;
17288 +static int b44_set_pauseparam(struct net_device *dev,
17289 + struct ethtool_pauseparam *epause)
17291 + struct b44 *bp = netdev_priv(dev);
17293 + spin_lock_irq(&bp->lock);
17294 + if (epause->autoneg)
17295 + bp->flags |= B44_FLAG_PAUSE_AUTO;
17297 + bp->flags &= ~B44_FLAG_PAUSE_AUTO;
17298 + if (epause->rx_pause)
17299 + bp->flags |= B44_FLAG_RX_PAUSE;
17301 + bp->flags &= ~B44_FLAG_RX_PAUSE;
17302 + if (epause->tx_pause)
17303 + bp->flags |= B44_FLAG_TX_PAUSE;
17305 + bp->flags &= ~B44_FLAG_TX_PAUSE;
17306 + if (bp->flags & B44_FLAG_PAUSE_AUTO) {
17308 + b44_init_rings(bp);
17311 + __b44_set_flow_ctrl(bp, bp->flags);
17313 + spin_unlock_irq(&bp->lock);
17315 + b44_enable_ints(bp);
17320 +static struct ethtool_ops b44_ethtool_ops = {
17321 + .get_drvinfo = b44_get_drvinfo,
17322 + .get_settings = b44_get_settings,
17323 + .set_settings = b44_set_settings,
17324 + .nway_reset = b44_nway_reset,
17325 + .get_link = ethtool_op_get_link,
17326 + .get_ringparam = b44_get_ringparam,
17327 + .set_ringparam = b44_set_ringparam,
17328 + .get_pauseparam = b44_get_pauseparam,
17329 + .set_pauseparam = b44_set_pauseparam,
17330 + .get_msglevel = b44_get_msglevel,
17331 + .set_msglevel = b44_set_msglevel,
17334 +static int b44_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
17336 + struct mii_ioctl_data *data = if_mii(ifr);
17337 + struct b44 *bp = netdev_priv(dev);
17340 + spin_lock_irq(&bp->lock);
17341 + err = generic_mii_ioctl(&bp->mii_if, data, cmd, NULL);
17342 + spin_unlock_irq(&bp->lock);
17347 +/* Read 128-bytes of EEPROM. */
17348 +static int b44_read_eeprom(struct b44 *bp, u8 *data)
17351 + u16 *ptr = (u16 *) data;
17353 + for (i = 0; i < 128; i += 2)
17354 + ptr[i / 2] = readw(bp->regs + 4096 + i);
17359 +static int __devinit b44_get_invariants(struct b44 *bp)
17364 + err = b44_read_eeprom(bp, &eeprom[0]);
17368 + bp->dev->dev_addr[0] = eeprom[79];
17369 + bp->dev->dev_addr[1] = eeprom[78];
17370 + bp->dev->dev_addr[2] = eeprom[81];
17371 + bp->dev->dev_addr[3] = eeprom[80];
17372 + bp->dev->dev_addr[4] = eeprom[83];
17373 + bp->dev->dev_addr[5] = eeprom[82];
17375 + bp->phy_addr = eeprom[90] & 0x1f;
17377 + /* With this, plus the rx_header prepended to the data by the
17378 + * hardware, we'll land the ethernet header on a 2-byte boundary.
17380 + bp->rx_offset = 30;
17382 + bp->imask = IMASK_DEF;
17384 + bp->core_unit = ssb_core_unit(bp);
17385 + bp->dma_offset = SB_PCI_DMA;
17387 + /* XXX - really required?
17388 + bp->flags |= B44_FLAG_BUGGY_TXPTR;
17394 +static int __devinit b44_init_one(struct pci_dev *pdev,
17395 + const struct pci_device_id *ent)
17397 + static int b44_version_printed = 0;
17398 + unsigned long b44reg_base, b44reg_len;
17399 + struct net_device *dev;
17403 + if (b44_version_printed++ == 0)
17404 + printk(KERN_INFO "%s", version);
17406 + err = pci_enable_device(pdev);
17408 + printk(KERN_ERR PFX "Cannot enable PCI device, "
17413 + if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) {
17414 + printk(KERN_ERR PFX "Cannot find proper PCI device "
17415 + "base address, aborting.\n");
17417 + goto err_out_disable_pdev;
17420 + err = pci_request_regions(pdev, DRV_MODULE_NAME);
17422 + printk(KERN_ERR PFX "Cannot obtain PCI resources, "
17424 + goto err_out_disable_pdev;
17427 + pci_set_master(pdev);
17429 + err = pci_set_dma_mask(pdev, (u64) B44_DMA_MASK);
17431 + printk(KERN_ERR PFX "No usable DMA configuration, "
17433 + goto err_out_free_res;
17436 + err = pci_set_consistent_dma_mask(pdev, (u64) B44_DMA_MASK);
17438 + printk(KERN_ERR PFX "No usable DMA configuration, "
17440 + goto err_out_free_res;
17443 + b44reg_base = pci_resource_start(pdev, 0);
17444 + b44reg_len = pci_resource_len(pdev, 0);
17446 + dev = alloc_etherdev(sizeof(*bp));
17448 + printk(KERN_ERR PFX "Etherdev alloc failed, aborting.\n");
17450 + goto err_out_free_res;
17453 + SET_MODULE_OWNER(dev);
17454 + SET_NETDEV_DEV(dev,&pdev->dev);
17456 + /* No interesting netdevice features in this card... */
17457 + dev->features |= 0;
17459 + bp = netdev_priv(dev);
17462 + if (b44_debug >= 0)
17463 + bp->msg_enable = (1 << b44_debug) - 1;
17465 + bp->msg_enable = B44_DEF_MSG_ENABLE;
17467 + spin_lock_init(&bp->lock);
17469 + bp->regs = ioremap(b44reg_base, b44reg_len);
17470 + if (bp->regs == 0UL) {
17471 + printk(KERN_ERR PFX "Cannot map device registers, "
17474 + goto err_out_free_dev;
17477 + bp->rx_pending = B44_DEF_RX_RING_PENDING;
17478 + bp->tx_pending = B44_DEF_TX_RING_PENDING;
17480 + dev->open = b44_open;
17481 + dev->stop = b44_close;
17482 + dev->hard_start_xmit = b44_start_xmit;
17483 + dev->get_stats = b44_get_stats;
17484 + dev->set_multicast_list = b44_set_rx_mode;
17485 + dev->set_mac_address = b44_set_mac_addr;
17486 + dev->do_ioctl = b44_ioctl;
17487 + dev->tx_timeout = b44_tx_timeout;
17488 + dev->poll = b44_poll;
17489 + dev->weight = 64;
17490 + dev->watchdog_timeo = B44_TX_TIMEOUT;
17491 +#ifdef CONFIG_NET_POLL_CONTROLLER
17492 + dev->poll_controller = b44_poll_controller;
17494 + dev->change_mtu = b44_change_mtu;
17495 + dev->irq = pdev->irq;
17496 + SET_ETHTOOL_OPS(dev, &b44_ethtool_ops);
17498 + err = b44_get_invariants(bp);
17500 + printk(KERN_ERR PFX "Problem fetching invariants of chip, "
17502 + goto err_out_iounmap;
17505 + bp->mii_if.dev = dev;
17506 + bp->mii_if.mdio_read = b44_mii_read;
17507 + bp->mii_if.mdio_write = b44_mii_write;
17508 + bp->mii_if.phy_id = bp->phy_addr;
17509 + bp->mii_if.phy_id_mask = 0x1f;
17510 + bp->mii_if.reg_num_mask = 0x1f;
17512 + /* By default, advertise all speed/duplex settings. */
17513 + bp->flags |= (B44_FLAG_ADV_10HALF | B44_FLAG_ADV_10FULL |
17514 + B44_FLAG_ADV_100HALF | B44_FLAG_ADV_100FULL);
17516 + /* By default, auto-negotiate PAUSE. */
17517 + bp->flags |= B44_FLAG_PAUSE_AUTO;
17519 + err = register_netdev(dev);
17521 + printk(KERN_ERR PFX "Cannot register net device, "
17523 + goto err_out_iounmap;
17526 + pci_set_drvdata(pdev, dev);
17528 + pci_save_state(bp->pdev);
17530 + printk(KERN_INFO "%s: Broadcom 4400 10/100BaseT Ethernet ", dev->name);
17531 + for (i = 0; i < 6; i++)
17532 + printk("%2.2x%c", dev->dev_addr[i],
17533 + i == 5 ? '\n' : ':');
17538 + iounmap(bp->regs);
17541 + free_netdev(dev);
17544 + pci_release_regions(pdev);
17546 +err_out_disable_pdev:
17547 + pci_disable_device(pdev);
17548 + pci_set_drvdata(pdev, NULL);
17552 +static void __devexit b44_remove_one(struct pci_dev *pdev)
17554 + struct net_device *dev = pci_get_drvdata(pdev);
17557 + struct b44 *bp = netdev_priv(dev);
17559 + unregister_netdev(dev);
17560 + iounmap(bp->regs);
17561 + free_netdev(dev);
17562 + pci_release_regions(pdev);
17563 + pci_disable_device(pdev);
17564 + pci_set_drvdata(pdev, NULL);
17568 +static int b44_suspend(struct pci_dev *pdev, pm_message_t state)
17570 + struct net_device *dev = pci_get_drvdata(pdev);
17571 + struct b44 *bp = netdev_priv(dev);
17573 + if (!netif_running(dev))
17576 + del_timer_sync(&bp->timer);
17578 + spin_lock_irq(&bp->lock);
17581 + netif_carrier_off(bp->dev);
17582 + netif_device_detach(bp->dev);
17583 + b44_free_rings(bp);
17585 + spin_unlock_irq(&bp->lock);
17589 +static int b44_resume(struct pci_dev *pdev)
17591 + struct net_device *dev = pci_get_drvdata(pdev);
17592 + struct b44 *bp = netdev_priv(dev);
17594 + pci_restore_state(pdev);
17596 + if (!netif_running(dev))
17599 + spin_lock_irq(&bp->lock);
17601 + b44_init_rings(bp);
17603 + netif_device_attach(bp->dev);
17604 + spin_unlock_irq(&bp->lock);
17606 + bp->timer.expires = jiffies + HZ;
17607 + add_timer(&bp->timer);
17609 + b44_enable_ints(bp);
17613 +static struct pci_driver b44_driver = {
17614 + .name = DRV_MODULE_NAME,
17615 + .id_table = b44_pci_tbl,
17616 + .probe = b44_init_one,
17617 + .remove = __devexit_p(b44_remove_one),
17618 + .suspend = b44_suspend,
17619 + .resume = b44_resume,
17622 +static int __init b44_init(void)
17624 + return pci_module_init(&b44_driver);
17627 +static void __exit b44_cleanup(void)
17629 + pci_unregister_driver(&b44_driver);
17632 +module_init(b44_init);
17633 +module_exit(b44_cleanup);
17635 diff -Nur linux-2.6.12.5/drivers/net/b44.h linux-2.6.12.5-brcm/drivers/net/b44.h
17636 --- linux-2.6.12.5/drivers/net/b44.h 2005-08-15 02:20:18.000000000 +0200
17637 +++ linux-2.6.12.5-brcm/drivers/net/b44.h 2005-08-28 11:12:20.694819024 +0200
17638 @@ -292,6 +292,9 @@
17639 #define SSB_PCI_MASK1 0xfc000000
17640 #define SSB_PCI_MASK2 0xc0000000
17642 +#define br32(REG) readl(bp->regs + (REG))
17643 +#define bw32(REG,VAL) writel((VAL), bp->regs + (REG))
17645 /* 4400 PHY registers */
17646 #define B44_MII_AUXCTRL 24 /* Auxiliary Control */
17647 #define MII_AUXCTRL_DUPLEX 0x0001 /* Full Duplex */
17648 @@ -345,6 +348,8 @@
17651 #define B44_MCAST_TABLE_SIZE 32
17652 +#define B44_PHY_ADDR_NO_PHY 30
17653 +#define B44_MDC_RATIO 5000000
17655 /* SW copy of device statistics, kept up to date by periodic timer
17656 * which probes HW values. Must have same relative layout as HW
17657 @@ -410,7 +415,7 @@
17658 struct net_device_stats stats;
17659 struct b44_hw_stats hw_stats;
17661 - void __iomem *regs;
17662 + unsigned long regs;
17663 struct pci_dev *pdev;
17664 struct net_device *dev;
17666 diff -Nur linux-2.6.12.5/drivers/net/b44.h.orig linux-2.6.12.5-brcm/drivers/net/b44.h.orig
17667 --- linux-2.6.12.5/drivers/net/b44.h.orig 1970-01-01 01:00:00.000000000 +0100
17668 +++ linux-2.6.12.5-brcm/drivers/net/b44.h.orig 2005-08-15 02:20:18.000000000 +0200
17673 +/* Register layout. (These correspond to struct _bcmenettregs in bcm4400.) */
17674 +#define B44_DEVCTRL 0x0000UL /* Device Control */
17675 +#define DEVCTRL_MPM 0x00000040 /* Magic Packet PME Enable (B0 only) */
17676 +#define DEVCTRL_PFE 0x00000080 /* Pattern Filtering Enable */
17677 +#define DEVCTRL_IPP 0x00000400 /* Internal EPHY Present */
17678 +#define DEVCTRL_EPR 0x00008000 /* EPHY Reset */
17679 +#define DEVCTRL_PME 0x00001000 /* PHY Mode Enable */
17680 +#define DEVCTRL_PMCE 0x00002000 /* PHY Mode Clocks Enable */
17681 +#define DEVCTRL_PADDR 0x0007c000 /* PHY Address */
17682 +#define DEVCTRL_PADDR_SHIFT 18
17683 +#define B44_BIST_STAT 0x000CUL /* Built-In Self-Test Status */
17684 +#define B44_WKUP_LEN 0x0010UL /* Wakeup Length */
17685 +#define WKUP_LEN_P0_MASK 0x0000007f /* Pattern 0 */
17686 +#define WKUP_LEN_D0 0x00000080
17687 +#define WKUP_LEN_P1_MASK 0x00007f00 /* Pattern 1 */
17688 +#define WKUP_LEN_P1_SHIFT 8
17689 +#define WKUP_LEN_D1 0x00008000
17690 +#define WKUP_LEN_P2_MASK 0x007f0000 /* Pattern 2 */
17691 +#define WKUP_LEN_P2_SHIFT 16
17692 +#define WKUP_LEN_D2 0x00000000
17693 +#define WKUP_LEN_P3_MASK 0x7f000000 /* Pattern 3 */
17694 +#define WKUP_LEN_P3_SHIFT 24
17695 +#define WKUP_LEN_D3 0x80000000
17696 +#define B44_ISTAT 0x0020UL /* Interrupt Status */
17697 +#define ISTAT_LS 0x00000020 /* Link Change (B0 only) */
17698 +#define ISTAT_PME 0x00000040 /* Power Management Event */
17699 +#define ISTAT_TO 0x00000080 /* General Purpose Timeout */
17700 +#define ISTAT_DSCE 0x00000400 /* Descriptor Error */
17701 +#define ISTAT_DATAE 0x00000800 /* Data Error */
17702 +#define ISTAT_DPE 0x00001000 /* Descr. Protocol Error */
17703 +#define ISTAT_RDU 0x00002000 /* Receive Descr. Underflow */
17704 +#define ISTAT_RFO 0x00004000 /* Receive FIFO Overflow */
17705 +#define ISTAT_TFU 0x00008000 /* Transmit FIFO Underflow */
17706 +#define ISTAT_RX 0x00010000 /* RX Interrupt */
17707 +#define ISTAT_TX 0x01000000 /* TX Interrupt */
17708 +#define ISTAT_EMAC 0x04000000 /* EMAC Interrupt */
17709 +#define ISTAT_MII_WRITE 0x08000000 /* MII Write Interrupt */
17710 +#define ISTAT_MII_READ 0x10000000 /* MII Read Interrupt */
17711 +#define ISTAT_ERRORS (ISTAT_DSCE|ISTAT_DATAE|ISTAT_DPE|ISTAT_RDU|ISTAT_RFO|ISTAT_TFU)
17712 +#define B44_IMASK 0x0024UL /* Interrupt Mask */
17713 +#define IMASK_DEF (ISTAT_ERRORS | ISTAT_TO | ISTAT_RX | ISTAT_TX)
17714 +#define B44_GPTIMER 0x0028UL /* General Purpose Timer */
17715 +#define B44_ADDR_LO 0x0088UL /* ENET Address Lo (B0 only) */
17716 +#define B44_ADDR_HI 0x008CUL /* ENET Address Hi (B0 only) */
17717 +#define B44_FILT_ADDR 0x0090UL /* ENET Filter Address */
17718 +#define B44_FILT_DATA 0x0094UL /* ENET Filter Data */
17719 +#define B44_TXBURST 0x00A0UL /* TX Max Burst Length */
17720 +#define B44_RXBURST 0x00A4UL /* RX Max Burst Length */
17721 +#define B44_MAC_CTRL 0x00A8UL /* MAC Control */
17722 +#define MAC_CTRL_CRC32_ENAB 0x00000001 /* CRC32 Generation Enable */
17723 +#define MAC_CTRL_PHY_PDOWN 0x00000004 /* Onchip EPHY Powerdown */
17724 +#define MAC_CTRL_PHY_EDET 0x00000008 /* Onchip EPHY Energy Detected */
17725 +#define MAC_CTRL_PHY_LEDCTRL 0x000000e0 /* Onchip EPHY LED Control */
17726 +#define MAC_CTRL_PHY_LEDCTRL_SHIFT 5
17727 +#define B44_MAC_FLOW 0x00ACUL /* MAC Flow Control */
17728 +#define MAC_FLOW_RX_HI_WATER 0x000000ff /* Receive FIFO HI Water Mark */
17729 +#define MAC_FLOW_PAUSE_ENAB 0x00008000 /* Enable Pause Frame Generation */
17730 +#define B44_RCV_LAZY 0x0100UL /* Lazy Interrupt Control */
17731 +#define RCV_LAZY_TO_MASK 0x00ffffff /* Timeout */
17732 +#define RCV_LAZY_FC_MASK 0xff000000 /* Frame Count */
17733 +#define RCV_LAZY_FC_SHIFT 24
17734 +#define B44_DMATX_CTRL 0x0200UL /* DMA TX Control */
17735 +#define DMATX_CTRL_ENABLE 0x00000001 /* Enable */
17736 +#define DMATX_CTRL_SUSPEND 0x00000002 /* Suepend Request */
17737 +#define DMATX_CTRL_LPBACK 0x00000004 /* Loopback Enable */
17738 +#define DMATX_CTRL_FAIRPRIOR 0x00000008 /* Fair Priority */
17739 +#define DMATX_CTRL_FLUSH 0x00000010 /* Flush Request */
17740 +#define B44_DMATX_ADDR 0x0204UL /* DMA TX Descriptor Ring Address */
17741 +#define B44_DMATX_PTR 0x0208UL /* DMA TX Last Posted Descriptor */
17742 +#define B44_DMATX_STAT 0x020CUL /* DMA TX Current Active Desc. + Status */
17743 +#define DMATX_STAT_CDMASK 0x00000fff /* Current Descriptor Mask */
17744 +#define DMATX_STAT_SMASK 0x0000f000 /* State Mask */
17745 +#define DMATX_STAT_SDISABLED 0x00000000 /* State Disabled */
17746 +#define DMATX_STAT_SACTIVE 0x00001000 /* State Active */
17747 +#define DMATX_STAT_SIDLE 0x00002000 /* State Idle Wait */
17748 +#define DMATX_STAT_SSTOPPED 0x00003000 /* State Stopped */
17749 +#define DMATX_STAT_SSUSP 0x00004000 /* State Suspend Pending */
17750 +#define DMATX_STAT_EMASK 0x000f0000 /* Error Mask */
17751 +#define DMATX_STAT_ENONE 0x00000000 /* Error None */
17752 +#define DMATX_STAT_EDPE 0x00010000 /* Error Desc. Protocol Error */
17753 +#define DMATX_STAT_EDFU 0x00020000 /* Error Data FIFO Underrun */
17754 +#define DMATX_STAT_EBEBR 0x00030000 /* Error Bus Error on Buffer Read */
17755 +#define DMATX_STAT_EBEDA 0x00040000 /* Error Bus Error on Desc. Access */
17756 +#define DMATX_STAT_FLUSHED 0x00100000 /* Flushed */
17757 +#define B44_DMARX_CTRL 0x0210UL /* DMA RX Control */
17758 +#define DMARX_CTRL_ENABLE 0x00000001 /* Enable */
17759 +#define DMARX_CTRL_ROMASK 0x000000fe /* Receive Offset Mask */
17760 +#define DMARX_CTRL_ROSHIFT 1 /* Receive Offset Shift */
17761 +#define B44_DMARX_ADDR 0x0214UL /* DMA RX Descriptor Ring Address */
17762 +#define B44_DMARX_PTR 0x0218UL /* DMA RX Last Posted Descriptor */
17763 +#define B44_DMARX_STAT 0x021CUL /* DMA RX Current Active Desc. + Status */
17764 +#define DMARX_STAT_CDMASK 0x00000fff /* Current Descriptor Mask */
17765 +#define DMARX_STAT_SMASK 0x0000f000 /* State Mask */
17766 +#define DMARX_STAT_SDISABLED 0x00000000 /* State Disbaled */
17767 +#define DMARX_STAT_SACTIVE 0x00001000 /* State Active */
17768 +#define DMARX_STAT_SIDLE 0x00002000 /* State Idle Wait */
17769 +#define DMARX_STAT_SSTOPPED 0x00003000 /* State Stopped */
17770 +#define DMARX_STAT_EMASK 0x000f0000 /* Error Mask */
17771 +#define DMARX_STAT_ENONE 0x00000000 /* Error None */
17772 +#define DMARX_STAT_EDPE 0x00010000 /* Error Desc. Protocol Error */
17773 +#define DMARX_STAT_EDFO 0x00020000 /* Error Data FIFO Overflow */
17774 +#define DMARX_STAT_EBEBW 0x00030000 /* Error Bus Error on Buffer Write */
17775 +#define DMARX_STAT_EBEDA 0x00040000 /* Error Bus Error on Desc. Access */
17776 +#define B44_DMAFIFO_AD 0x0220UL /* DMA FIFO Diag Address */
17777 +#define DMAFIFO_AD_OMASK 0x0000ffff /* Offset Mask */
17778 +#define DMAFIFO_AD_SMASK 0x000f0000 /* Select Mask */
17779 +#define DMAFIFO_AD_SXDD 0x00000000 /* Select Transmit DMA Data */
17780 +#define DMAFIFO_AD_SXDP 0x00010000 /* Select Transmit DMA Pointers */
17781 +#define DMAFIFO_AD_SRDD 0x00040000 /* Select Receive DMA Data */
17782 +#define DMAFIFO_AD_SRDP 0x00050000 /* Select Receive DMA Pointers */
17783 +#define DMAFIFO_AD_SXFD 0x00080000 /* Select Transmit FIFO Data */
17784 +#define DMAFIFO_AD_SXFP 0x00090000 /* Select Transmit FIFO Pointers */
17785 +#define DMAFIFO_AD_SRFD 0x000c0000 /* Select Receive FIFO Data */
17786 +#define DMAFIFO_AD_SRFP 0x000c0000 /* Select Receive FIFO Pointers */
17787 +#define B44_DMAFIFO_LO 0x0224UL /* DMA FIFO Diag Low Data */
17788 +#define B44_DMAFIFO_HI 0x0228UL /* DMA FIFO Diag High Data */
17789 +#define B44_RXCONFIG 0x0400UL /* EMAC RX Config */
17790 +#define RXCONFIG_DBCAST 0x00000001 /* Disable Broadcast */
17791 +#define RXCONFIG_ALLMULTI 0x00000002 /* Accept All Multicast */
17792 +#define RXCONFIG_NORX_WHILE_TX 0x00000004 /* Receive Disable While Transmitting */
17793 +#define RXCONFIG_PROMISC 0x00000008 /* Promiscuous Enable */
17794 +#define RXCONFIG_LPBACK 0x00000010 /* Loopback Enable */
17795 +#define RXCONFIG_FLOW 0x00000020 /* Flow Control Enable */
17796 +#define RXCONFIG_FLOW_ACCEPT 0x00000040 /* Accept Unicast Flow Control Frame */
17797 +#define RXCONFIG_RFILT 0x00000080 /* Reject Filter */
17798 +#define B44_RXMAXLEN 0x0404UL /* EMAC RX Max Packet Length */
17799 +#define B44_TXMAXLEN 0x0408UL /* EMAC TX Max Packet Length */
17800 +#define B44_MDIO_CTRL 0x0410UL /* EMAC MDIO Control */
17801 +#define MDIO_CTRL_MAXF_MASK 0x0000007f /* MDC Frequency */
17802 +#define MDIO_CTRL_PREAMBLE 0x00000080 /* MII Preamble Enable */
17803 +#define B44_MDIO_DATA 0x0414UL /* EMAC MDIO Data */
17804 +#define MDIO_DATA_DATA 0x0000ffff /* R/W Data */
17805 +#define MDIO_DATA_TA_MASK 0x00030000 /* Turnaround Value */
17806 +#define MDIO_DATA_TA_SHIFT 16
17807 +#define MDIO_TA_VALID 2
17808 +#define MDIO_DATA_RA_MASK 0x007c0000 /* Register Address */
17809 +#define MDIO_DATA_RA_SHIFT 18
17810 +#define MDIO_DATA_PMD_MASK 0x0f800000 /* Physical Media Device */
17811 +#define MDIO_DATA_PMD_SHIFT 23
17812 +#define MDIO_DATA_OP_MASK 0x30000000 /* Opcode */
17813 +#define MDIO_DATA_OP_SHIFT 28
17814 +#define MDIO_OP_WRITE 1
17815 +#define MDIO_OP_READ 2
17816 +#define MDIO_DATA_SB_MASK 0xc0000000 /* Start Bits */
17817 +#define MDIO_DATA_SB_SHIFT 30
17818 +#define MDIO_DATA_SB_START 0x40000000 /* Start Of Frame */
17819 +#define B44_EMAC_IMASK 0x0418UL /* EMAC Interrupt Mask */
17820 +#define B44_EMAC_ISTAT 0x041CUL /* EMAC Interrupt Status */
17821 +#define EMAC_INT_MII 0x00000001 /* MII MDIO Interrupt */
17822 +#define EMAC_INT_MIB 0x00000002 /* MIB Interrupt */
17823 +#define EMAC_INT_FLOW 0x00000003 /* Flow Control Interrupt */
17824 +#define B44_CAM_DATA_LO 0x0420UL /* EMAC CAM Data Low */
17825 +#define B44_CAM_DATA_HI 0x0424UL /* EMAC CAM Data High */
17826 +#define CAM_DATA_HI_VALID 0x00010000 /* Valid Bit */
17827 +#define B44_CAM_CTRL 0x0428UL /* EMAC CAM Control */
17828 +#define CAM_CTRL_ENABLE 0x00000001 /* CAM Enable */
17829 +#define CAM_CTRL_MSEL 0x00000002 /* Mask Select */
17830 +#define CAM_CTRL_READ 0x00000004 /* Read */
17831 +#define CAM_CTRL_WRITE 0x00000008 /* Read */
17832 +#define CAM_CTRL_INDEX_MASK 0x003f0000 /* Index Mask */
17833 +#define CAM_CTRL_INDEX_SHIFT 16
17834 +#define CAM_CTRL_BUSY 0x80000000 /* CAM Busy */
17835 +#define B44_ENET_CTRL 0x042CUL /* EMAC ENET Control */
17836 +#define ENET_CTRL_ENABLE 0x00000001 /* EMAC Enable */
17837 +#define ENET_CTRL_DISABLE 0x00000002 /* EMAC Disable */
17838 +#define ENET_CTRL_SRST 0x00000004 /* EMAC Soft Reset */
17839 +#define ENET_CTRL_EPSEL 0x00000008 /* External PHY Select */
17840 +#define B44_TX_CTRL 0x0430UL /* EMAC TX Control */
17841 +#define TX_CTRL_DUPLEX 0x00000001 /* Full Duplex */
17842 +#define TX_CTRL_FMODE 0x00000002 /* Flow Mode */
17843 +#define TX_CTRL_SBENAB 0x00000004 /* Single Backoff Enable */
17844 +#define TX_CTRL_SMALL_SLOT 0x00000008 /* Small Slottime */
17845 +#define B44_TX_WMARK 0x0434UL /* EMAC TX Watermark */
17846 +#define B44_MIB_CTRL 0x0438UL /* EMAC MIB Control */
17847 +#define MIB_CTRL_CLR_ON_READ 0x00000001 /* Autoclear on Read */
17848 +#define B44_TX_GOOD_O 0x0500UL /* MIB TX Good Octets */
17849 +#define B44_TX_GOOD_P 0x0504UL /* MIB TX Good Packets */
17850 +#define B44_TX_O 0x0508UL /* MIB TX Octets */
17851 +#define B44_TX_P 0x050CUL /* MIB TX Packets */
17852 +#define B44_TX_BCAST 0x0510UL /* MIB TX Broadcast Packets */
17853 +#define B44_TX_MCAST 0x0514UL /* MIB TX Multicast Packets */
17854 +#define B44_TX_64 0x0518UL /* MIB TX <= 64 byte Packets */
17855 +#define B44_TX_65_127 0x051CUL /* MIB TX 65 to 127 byte Packets */
17856 +#define B44_TX_128_255 0x0520UL /* MIB TX 128 to 255 byte Packets */
17857 +#define B44_TX_256_511 0x0524UL /* MIB TX 256 to 511 byte Packets */
17858 +#define B44_TX_512_1023 0x0528UL /* MIB TX 512 to 1023 byte Packets */
17859 +#define B44_TX_1024_MAX 0x052CUL /* MIB TX 1024 to max byte Packets */
17860 +#define B44_TX_JABBER 0x0530UL /* MIB TX Jabber Packets */
17861 +#define B44_TX_OSIZE 0x0534UL /* MIB TX Oversize Packets */
17862 +#define B44_TX_FRAG 0x0538UL /* MIB TX Fragment Packets */
17863 +#define B44_TX_URUNS 0x053CUL /* MIB TX Underruns */
17864 +#define B44_TX_TCOLS 0x0540UL /* MIB TX Total Collisions */
17865 +#define B44_TX_SCOLS 0x0544UL /* MIB TX Single Collisions */
17866 +#define B44_TX_MCOLS 0x0548UL /* MIB TX Multiple Collisions */
17867 +#define B44_TX_ECOLS 0x054CUL /* MIB TX Excessive Collisions */
17868 +#define B44_TX_LCOLS 0x0550UL /* MIB TX Late Collisions */
17869 +#define B44_TX_DEFERED 0x0554UL /* MIB TX Defered Packets */
17870 +#define B44_TX_CLOST 0x0558UL /* MIB TX Carrier Lost */
17871 +#define B44_TX_PAUSE 0x055CUL /* MIB TX Pause Packets */
17872 +#define B44_RX_GOOD_O 0x0580UL /* MIB RX Good Octets */
17873 +#define B44_RX_GOOD_P 0x0584UL /* MIB RX Good Packets */
17874 +#define B44_RX_O 0x0588UL /* MIB RX Octets */
17875 +#define B44_RX_P 0x058CUL /* MIB RX Packets */
17876 +#define B44_RX_BCAST 0x0590UL /* MIB RX Broadcast Packets */
17877 +#define B44_RX_MCAST 0x0594UL /* MIB RX Multicast Packets */
17878 +#define B44_RX_64 0x0598UL /* MIB RX <= 64 byte Packets */
17879 +#define B44_RX_65_127 0x059CUL /* MIB RX 65 to 127 byte Packets */
17880 +#define B44_RX_128_255 0x05A0UL /* MIB RX 128 to 255 byte Packets */
17881 +#define B44_RX_256_511 0x05A4UL /* MIB RX 256 to 511 byte Packets */
17882 +#define B44_RX_512_1023 0x05A8UL /* MIB RX 512 to 1023 byte Packets */
17883 +#define B44_RX_1024_MAX 0x05ACUL /* MIB RX 1024 to max byte Packets */
17884 +#define B44_RX_JABBER 0x05B0UL /* MIB RX Jabber Packets */
17885 +#define B44_RX_OSIZE 0x05B4UL /* MIB RX Oversize Packets */
17886 +#define B44_RX_FRAG 0x05B8UL /* MIB RX Fragment Packets */
17887 +#define B44_RX_MISS 0x05BCUL /* MIB RX Missed Packets */
17888 +#define B44_RX_CRCA 0x05C0UL /* MIB RX CRC Align Errors */
17889 +#define B44_RX_USIZE 0x05C4UL /* MIB RX Undersize Packets */
17890 +#define B44_RX_CRC 0x05C8UL /* MIB RX CRC Errors */
17891 +#define B44_RX_ALIGN 0x05CCUL /* MIB RX Align Errors */
17892 +#define B44_RX_SYM 0x05D0UL /* MIB RX Symbol Errors */
17893 +#define B44_RX_PAUSE 0x05D4UL /* MIB RX Pause Packets */
17894 +#define B44_RX_NPAUSE 0x05D8UL /* MIB RX Non-Pause Packets */
17896 +/* Silicon backplane register definitions */
17897 +#define B44_SBIMSTATE 0x0F90UL /* SB Initiator Agent State */
17898 +#define SBIMSTATE_PC 0x0000000f /* Pipe Count */
17899 +#define SBIMSTATE_AP_MASK 0x00000030 /* Arbitration Priority */
17900 +#define SBIMSTATE_AP_BOTH 0x00000000 /* Use both timeslices and token */
17901 +#define SBIMSTATE_AP_TS 0x00000010 /* Use timeslices only */
17902 +#define SBIMSTATE_AP_TK 0x00000020 /* Use token only */
17903 +#define SBIMSTATE_AP_RSV 0x00000030 /* Reserved */
17904 +#define SBIMSTATE_IBE 0x00020000 /* In Band Error */
17905 +#define SBIMSTATE_TO 0x00040000 /* Timeout */
17906 +#define B44_SBINTVEC 0x0F94UL /* SB Interrupt Mask */
17907 +#define SBINTVEC_PCI 0x00000001 /* Enable interrupts for PCI */
17908 +#define SBINTVEC_ENET0 0x00000002 /* Enable interrupts for enet 0 */
17909 +#define SBINTVEC_ILINE20 0x00000004 /* Enable interrupts for iline20 */
17910 +#define SBINTVEC_CODEC 0x00000008 /* Enable interrupts for v90 codec */
17911 +#define SBINTVEC_USB 0x00000010 /* Enable interrupts for usb */
17912 +#define SBINTVEC_EXTIF 0x00000020 /* Enable interrupts for external i/f */
17913 +#define SBINTVEC_ENET1 0x00000040 /* Enable interrupts for enet 1 */
17914 +#define B44_SBTMSLOW 0x0F98UL /* SB Target State Low */
17915 +#define SBTMSLOW_RESET 0x00000001 /* Reset */
17916 +#define SBTMSLOW_REJECT 0x00000002 /* Reject */
17917 +#define SBTMSLOW_CLOCK 0x00010000 /* Clock Enable */
17918 +#define SBTMSLOW_FGC 0x00020000 /* Force Gated Clocks On */
17919 +#define SBTMSLOW_PE 0x40000000 /* Power Management Enable */
17920 +#define SBTMSLOW_BE 0x80000000 /* BIST Enable */
17921 +#define B44_SBTMSHIGH 0x0F9CUL /* SB Target State High */
17922 +#define SBTMSHIGH_SERR 0x00000001 /* S-error */
17923 +#define SBTMSHIGH_INT 0x00000002 /* Interrupt */
17924 +#define SBTMSHIGH_BUSY 0x00000004 /* Busy */
17925 +#define SBTMSHIGH_GCR 0x20000000 /* Gated Clock Request */
17926 +#define SBTMSHIGH_BISTF 0x40000000 /* BIST Failed */
17927 +#define SBTMSHIGH_BISTD 0x80000000 /* BIST Done */
17928 +#define B44_SBIDHIGH 0x0FFCUL /* SB Identification High */
17929 +#define SBIDHIGH_RC_MASK 0x0000000f /* Revision Code */
17930 +#define SBIDHIGH_CC_MASK 0x0000fff0 /* Core Code */
17931 +#define SBIDHIGH_CC_SHIFT 4
17932 +#define SBIDHIGH_VC_MASK 0xffff0000 /* Vendor Code */
17933 +#define SBIDHIGH_VC_SHIFT 16
17935 +/* SSB PCI config space registers. */
17936 +#define SSB_BAR0_WIN 0x80
17937 +#define SSB_BAR1_WIN 0x84
17938 +#define SSB_SPROM_CONTROL 0x88
17939 +#define SSB_BAR1_CONTROL 0x8c
17941 +/* SSB core and host control registers. */
17942 +#define SSB_CONTROL 0x0000UL
17943 +#define SSB_ARBCONTROL 0x0010UL
17944 +#define SSB_ISTAT 0x0020UL
17945 +#define SSB_IMASK 0x0024UL
17946 +#define SSB_MBOX 0x0028UL
17947 +#define SSB_BCAST_ADDR 0x0050UL
17948 +#define SSB_BCAST_DATA 0x0054UL
17949 +#define SSB_PCI_TRANS_0 0x0100UL
17950 +#define SSB_PCI_TRANS_1 0x0104UL
17951 +#define SSB_PCI_TRANS_2 0x0108UL
17952 +#define SSB_SPROM 0x0800UL
17954 +#define SSB_PCI_MEM 0x00000000
17955 +#define SSB_PCI_IO 0x00000001
17956 +#define SSB_PCI_CFG0 0x00000002
17957 +#define SSB_PCI_CFG1 0x00000003
17958 +#define SSB_PCI_PREF 0x00000004
17959 +#define SSB_PCI_BURST 0x00000008
17960 +#define SSB_PCI_MASK0 0xfc000000
17961 +#define SSB_PCI_MASK1 0xfc000000
17962 +#define SSB_PCI_MASK2 0xc0000000
17964 +/* 4400 PHY registers */
17965 +#define B44_MII_AUXCTRL 24 /* Auxiliary Control */
17966 +#define MII_AUXCTRL_DUPLEX 0x0001 /* Full Duplex */
17967 +#define MII_AUXCTRL_SPEED 0x0002 /* 1=100Mbps, 0=10Mbps */
17968 +#define MII_AUXCTRL_FORCED 0x0004 /* Forced 10/100 */
17969 +#define B44_MII_ALEDCTRL 26 /* Activity LED */
17970 +#define MII_ALEDCTRL_ALLMSK 0x7fff
17971 +#define B44_MII_TLEDCTRL 27 /* Traffic Meter LED */
17972 +#define MII_TLEDCTRL_ENABLE 0x0040
17979 +/* There are only 12 bits in the DMA engine for descriptor offsetting
17980 + * so the table must be aligned on a boundary of this.
17982 +#define DMA_TABLE_BYTES 4096
17984 +#define DESC_CTRL_LEN 0x00001fff
17985 +#define DESC_CTRL_CMASK 0x0ff00000 /* Core specific bits */
17986 +#define DESC_CTRL_EOT 0x10000000 /* End of Table */
17987 +#define DESC_CTRL_IOC 0x20000000 /* Interrupt On Completion */
17988 +#define DESC_CTRL_EOF 0x40000000 /* End of Frame */
17989 +#define DESC_CTRL_SOF 0x80000000 /* Start of Frame */
17991 +#define RX_COPY_THRESHOLD 256
17993 +struct rx_header {
17998 +#define RX_HEADER_LEN 28
18000 +#define RX_FLAG_OFIFO 0x00000001 /* FIFO Overflow */
18001 +#define RX_FLAG_CRCERR 0x00000002 /* CRC Error */
18002 +#define RX_FLAG_SERR 0x00000004 /* Receive Symbol Error */
18003 +#define RX_FLAG_ODD 0x00000008 /* Frame has odd number of nibbles */
18004 +#define RX_FLAG_LARGE 0x00000010 /* Frame is > RX MAX Length */
18005 +#define RX_FLAG_MCAST 0x00000020 /* Dest is Multicast Address */
18006 +#define RX_FLAG_BCAST 0x00000040 /* Dest is Broadcast Address */
18007 +#define RX_FLAG_MISS 0x00000080 /* Received due to promisc mode */
18008 +#define RX_FLAG_LAST 0x00000800 /* Last buffer in frame */
18009 +#define RX_FLAG_ERRORS (RX_FLAG_ODD | RX_FLAG_SERR | RX_FLAG_CRCERR | RX_FLAG_OFIFO)
18011 +struct ring_info {
18012 + struct sk_buff *skb;
18013 + DECLARE_PCI_UNMAP_ADDR(mapping);
18016 +#define B44_MCAST_TABLE_SIZE 32
18018 +/* SW copy of device statistics, kept up to date by periodic timer
18019 + * which probes HW values. Must have same relative layout as HW
18020 + * register above, because b44_stats_update depends upon this.
18022 +struct b44_hw_stats {
18023 + u32 tx_good_octets, tx_good_pkts, tx_octets;
18024 + u32 tx_pkts, tx_broadcast_pkts, tx_multicast_pkts;
18025 + u32 tx_len_64, tx_len_65_to_127, tx_len_128_to_255;
18026 + u32 tx_len_256_to_511, tx_len_512_to_1023, tx_len_1024_to_max;
18027 + u32 tx_jabber_pkts, tx_oversize_pkts, tx_fragment_pkts;
18028 + u32 tx_underruns, tx_total_cols, tx_single_cols;
18029 + u32 tx_multiple_cols, tx_excessive_cols, tx_late_cols;
18030 + u32 tx_defered, tx_carrier_lost, tx_pause_pkts;
18033 + u32 rx_good_octets, rx_good_pkts, rx_octets;
18034 + u32 rx_pkts, rx_broadcast_pkts, rx_multicast_pkts;
18035 + u32 rx_len_64, rx_len_65_to_127, rx_len_128_to_255;
18036 + u32 rx_len_256_to_511, rx_len_512_to_1023, rx_len_1024_to_max;
18037 + u32 rx_jabber_pkts, rx_oversize_pkts, rx_fragment_pkts;
18038 + u32 rx_missed_pkts, rx_crc_align_errs, rx_undersize;
18039 + u32 rx_crc_errs, rx_align_errs, rx_symbol_errs;
18040 + u32 rx_pause_pkts, rx_nonpause_pkts;
18046 + u32 imask, istat;
18048 + struct dma_desc *rx_ring, *tx_ring;
18050 + u32 tx_prod, tx_cons;
18051 + u32 rx_prod, rx_cons;
18053 + struct ring_info *rx_buffers;
18054 + struct ring_info *tx_buffers;
18058 +#define B44_FLAG_INIT_COMPLETE 0x00000001
18059 +#define B44_FLAG_BUGGY_TXPTR 0x00000002
18060 +#define B44_FLAG_REORDER_BUG 0x00000004
18061 +#define B44_FLAG_PAUSE_AUTO 0x00008000
18062 +#define B44_FLAG_FULL_DUPLEX 0x00010000
18063 +#define B44_FLAG_100_BASE_T 0x00020000
18064 +#define B44_FLAG_TX_PAUSE 0x00040000
18065 +#define B44_FLAG_RX_PAUSE 0x00080000
18066 +#define B44_FLAG_FORCE_LINK 0x00100000
18067 +#define B44_FLAG_ADV_10HALF 0x01000000
18068 +#define B44_FLAG_ADV_10FULL 0x02000000
18069 +#define B44_FLAG_ADV_100HALF 0x04000000
18070 +#define B44_FLAG_ADV_100FULL 0x08000000
18071 +#define B44_FLAG_INTERNAL_PHY 0x10000000
18077 + struct timer_list timer;
18079 + struct net_device_stats stats;
18080 + struct b44_hw_stats hw_stats;
18082 + void __iomem *regs;
18083 + struct pci_dev *pdev;
18084 + struct net_device *dev;
18086 + dma_addr_t rx_ring_dma, tx_ring_dma;
18093 + struct mii_if_info mii_if;
18096 +#endif /* _B44_H */
18097 diff -Nur linux-2.6.12.5/include/asm-mips/bootinfo.h linux-2.6.12.5-brcm/include/asm-mips/bootinfo.h
18098 --- linux-2.6.12.5/include/asm-mips/bootinfo.h 2005-08-15 02:20:18.000000000 +0200
18099 +++ linux-2.6.12.5-brcm/include/asm-mips/bootinfo.h 2005-08-28 11:12:20.695818872 +0200
18100 @@ -213,6 +213,12 @@
18101 #define MACH_GROUP_TITAN 22 /* PMC-Sierra Titan */
18102 #define MACH_TITAN_YOSEMITE 1 /* PMC-Sierra Yosemite */
18105 + * Valid machtype for group Broadcom
18107 +#define MACH_GROUP_BRCM 23 /* Broadcom */
18108 +#define MACH_BCM47XX 1 /* Broadcom BCM47xx */
18110 #define CL_SIZE COMMAND_LINE_SIZE
18112 const char *get_system_type(void);
18113 diff -Nur linux-2.6.12.5/include/asm-mips/cpu.h linux-2.6.12.5-brcm/include/asm-mips/cpu.h
18114 --- linux-2.6.12.5/include/asm-mips/cpu.h 2005-08-15 02:20:18.000000000 +0200
18115 +++ linux-2.6.12.5-brcm/include/asm-mips/cpu.h 2005-08-28 11:12:20.695818872 +0200
18117 #define PRID_IMP_SR71000 0x0400
18120 + * These are the PRID's for when 23:16 == PRID_COMP_BROADCOM
18123 +#define PRID_IMP_BCM4710 0x4000
18124 +#define PRID_IMP_BCM3302 0x9000
18127 * Definitions for 7:0 on legacy processors
18130 @@ -177,7 +184,9 @@
18131 #define CPU_VR4133 56
18132 #define CPU_AU1550 57
18134 -#define CPU_LAST 58
18135 +#define CPU_BCM3302 59
18136 +#define CPU_BCM4710 60
18137 +#define CPU_LAST 60
18140 * ISA Level encodings
18141 diff -Nur linux-2.6.12.5/include/asm-mips/mipsregs.h linux-2.6.12.5-brcm/include/asm-mips/mipsregs.h
18142 --- linux-2.6.12.5/include/asm-mips/mipsregs.h 2005-08-15 02:20:18.000000000 +0200
18143 +++ linux-2.6.12.5-brcm/include/asm-mips/mipsregs.h 2005-08-28 11:12:20.722814768 +0200
18144 @@ -790,10 +790,18 @@
18145 #define read_c0_config1() __read_32bit_c0_register($16, 1)
18146 #define read_c0_config2() __read_32bit_c0_register($16, 2)
18147 #define read_c0_config3() __read_32bit_c0_register($16, 3)
18148 +#define read_c0_config4() __read_32bit_c0_register($16, 4)
18149 +#define read_c0_config5() __read_32bit_c0_register($16, 5)
18150 +#define read_c0_config6() __read_32bit_c0_register($16, 6)
18151 +#define read_c0_config7() __read_32bit_c0_register($16, 7)
18152 #define write_c0_config(val) __write_32bit_c0_register($16, 0, val)
18153 #define write_c0_config1(val) __write_32bit_c0_register($16, 1, val)
18154 #define write_c0_config2(val) __write_32bit_c0_register($16, 2, val)
18155 #define write_c0_config3(val) __write_32bit_c0_register($16, 3, val)
18156 +#define write_c0_config4(val) __write_32bit_c0_register($16, 4, val)
18157 +#define write_c0_config5(val) __write_32bit_c0_register($16, 5, val)
18158 +#define write_c0_config6(val) __write_32bit_c0_register($16, 6, val)
18159 +#define write_c0_config7(val) __write_32bit_c0_register($16, 7, val)
18162 * The WatchLo register. There may be upto 8 of them.
18163 diff -Nur linux-2.6.12.5/include/linux/init.h linux-2.6.12.5-brcm/include/linux/init.h
18164 --- linux-2.6.12.5/include/linux/init.h 2005-08-15 02:20:18.000000000 +0200
18165 +++ linux-2.6.12.5-brcm/include/linux/init.h 2005-08-28 11:12:20.723814616 +0200
18167 static initcall_t __initcall_##fn __attribute_used__ \
18168 __attribute__((__section__(".initcall" level ".init"))) = fn
18170 +#define early_initcall(fn) __define_initcall(".early1",fn)
18172 #define core_initcall(fn) __define_initcall("1",fn)
18173 #define postcore_initcall(fn) __define_initcall("2",fn)
18174 #define arch_initcall(fn) __define_initcall("3",fn)
18175 diff -Nur linux-2.6.12.5/include/linux/pci_ids.h linux-2.6.12.5-brcm/include/linux/pci_ids.h
18176 --- linux-2.6.12.5/include/linux/pci_ids.h 2005-08-15 02:20:18.000000000 +0200
18177 +++ linux-2.6.12.5-brcm/include/linux/pci_ids.h 2005-08-28 11:12:20.726814160 +0200
18178 @@ -2110,6 +2110,7 @@
18179 #define PCI_DEVICE_ID_TIGON3_5901_2 0x170e
18180 #define PCI_DEVICE_ID_BCM4401 0x4401
18181 #define PCI_DEVICE_ID_BCM4401B0 0x4402
18182 +#define PCI_DEVICE_ID_BCM4713 0x4713
18184 #define PCI_VENDOR_ID_TOPIC 0x151f
18185 #define PCI_DEVICE_ID_TOPIC_TP560 0x0000
18186 diff -Nur linux-2.6.12.5/include/linux/pci_ids.h.orig linux-2.6.12.5-brcm/include/linux/pci_ids.h.orig
18187 --- linux-2.6.12.5/include/linux/pci_ids.h.orig 1970-01-01 01:00:00.000000000 +0100
18188 +++ linux-2.6.12.5-brcm/include/linux/pci_ids.h.orig 2005-08-15 02:20:18.000000000 +0200
18191 + * PCI Class, Vendor and Device IDs
18193 + * Please keep sorted.
18196 +/* Device classes and subclasses */
18198 +#define PCI_CLASS_NOT_DEFINED 0x0000
18199 +#define PCI_CLASS_NOT_DEFINED_VGA 0x0001
18201 +#define PCI_BASE_CLASS_STORAGE 0x01
18202 +#define PCI_CLASS_STORAGE_SCSI 0x0100
18203 +#define PCI_CLASS_STORAGE_IDE 0x0101
18204 +#define PCI_CLASS_STORAGE_FLOPPY 0x0102
18205 +#define PCI_CLASS_STORAGE_IPI 0x0103
18206 +#define PCI_CLASS_STORAGE_RAID 0x0104
18207 +#define PCI_CLASS_STORAGE_OTHER 0x0180
18209 +#define PCI_BASE_CLASS_NETWORK 0x02
18210 +#define PCI_CLASS_NETWORK_ETHERNET 0x0200
18211 +#define PCI_CLASS_NETWORK_TOKEN_RING 0x0201
18212 +#define PCI_CLASS_NETWORK_FDDI 0x0202
18213 +#define PCI_CLASS_NETWORK_ATM 0x0203
18214 +#define PCI_CLASS_NETWORK_OTHER 0x0280
18216 +#define PCI_BASE_CLASS_DISPLAY 0x03
18217 +#define PCI_CLASS_DISPLAY_VGA 0x0300
18218 +#define PCI_CLASS_DISPLAY_XGA 0x0301
18219 +#define PCI_CLASS_DISPLAY_3D 0x0302
18220 +#define PCI_CLASS_DISPLAY_OTHER 0x0380
18222 +#define PCI_BASE_CLASS_MULTIMEDIA 0x04
18223 +#define PCI_CLASS_MULTIMEDIA_VIDEO 0x0400
18224 +#define PCI_CLASS_MULTIMEDIA_AUDIO 0x0401
18225 +#define PCI_CLASS_MULTIMEDIA_PHONE 0x0402
18226 +#define PCI_CLASS_MULTIMEDIA_OTHER 0x0480
18228 +#define PCI_BASE_CLASS_MEMORY 0x05
18229 +#define PCI_CLASS_MEMORY_RAM 0x0500
18230 +#define PCI_CLASS_MEMORY_FLASH 0x0501
18231 +#define PCI_CLASS_MEMORY_OTHER 0x0580
18233 +#define PCI_BASE_CLASS_BRIDGE 0x06
18234 +#define PCI_CLASS_BRIDGE_HOST 0x0600
18235 +#define PCI_CLASS_BRIDGE_ISA 0x0601
18236 +#define PCI_CLASS_BRIDGE_EISA 0x0602
18237 +#define PCI_CLASS_BRIDGE_MC 0x0603
18238 +#define PCI_CLASS_BRIDGE_PCI 0x0604
18239 +#define PCI_CLASS_BRIDGE_PCMCIA 0x0605
18240 +#define PCI_CLASS_BRIDGE_NUBUS 0x0606
18241 +#define PCI_CLASS_BRIDGE_CARDBUS 0x0607
18242 +#define PCI_CLASS_BRIDGE_RACEWAY 0x0608
18243 +#define PCI_CLASS_BRIDGE_OTHER 0x0680
18245 +#define PCI_BASE_CLASS_COMMUNICATION 0x07
18246 +#define PCI_CLASS_COMMUNICATION_SERIAL 0x0700
18247 +#define PCI_CLASS_COMMUNICATION_PARALLEL 0x0701
18248 +#define PCI_CLASS_COMMUNICATION_MULTISERIAL 0x0702
18249 +#define PCI_CLASS_COMMUNICATION_MODEM 0x0703
18250 +#define PCI_CLASS_COMMUNICATION_OTHER 0x0780
18252 +#define PCI_BASE_CLASS_SYSTEM 0x08
18253 +#define PCI_CLASS_SYSTEM_PIC 0x0800
18254 +#define PCI_CLASS_SYSTEM_DMA 0x0801
18255 +#define PCI_CLASS_SYSTEM_TIMER 0x0802
18256 +#define PCI_CLASS_SYSTEM_RTC 0x0803
18257 +#define PCI_CLASS_SYSTEM_PCI_HOTPLUG 0x0804
18258 +#define PCI_CLASS_SYSTEM_OTHER 0x0880
18260 +#define PCI_BASE_CLASS_INPUT 0x09
18261 +#define PCI_CLASS_INPUT_KEYBOARD 0x0900
18262 +#define PCI_CLASS_INPUT_PEN 0x0901
18263 +#define PCI_CLASS_INPUT_MOUSE 0x0902
18264 +#define PCI_CLASS_INPUT_SCANNER 0x0903
18265 +#define PCI_CLASS_INPUT_GAMEPORT 0x0904
18266 +#define PCI_CLASS_INPUT_OTHER 0x0980
18268 +#define PCI_BASE_CLASS_DOCKING 0x0a
18269 +#define PCI_CLASS_DOCKING_GENERIC 0x0a00
18270 +#define PCI_CLASS_DOCKING_OTHER 0x0a80
18272 +#define PCI_BASE_CLASS_PROCESSOR 0x0b
18273 +#define PCI_CLASS_PROCESSOR_386 0x0b00
18274 +#define PCI_CLASS_PROCESSOR_486 0x0b01
18275 +#define PCI_CLASS_PROCESSOR_PENTIUM 0x0b02
18276 +#define PCI_CLASS_PROCESSOR_ALPHA 0x0b10
18277 +#define PCI_CLASS_PROCESSOR_POWERPC 0x0b20
18278 +#define PCI_CLASS_PROCESSOR_MIPS 0x0b30
18279 +#define PCI_CLASS_PROCESSOR_CO 0x0b40
18281 +#define PCI_BASE_CLASS_SERIAL 0x0c
18282 +#define PCI_CLASS_SERIAL_FIREWIRE 0x0c00
18283 +#define PCI_CLASS_SERIAL_ACCESS 0x0c01
18284 +#define PCI_CLASS_SERIAL_SSA 0x0c02
18285 +#define PCI_CLASS_SERIAL_USB 0x0c03
18286 +#define PCI_CLASS_SERIAL_FIBER 0x0c04
18287 +#define PCI_CLASS_SERIAL_SMBUS 0x0c05
18289 +#define PCI_BASE_CLASS_INTELLIGENT 0x0e
18290 +#define PCI_CLASS_INTELLIGENT_I2O 0x0e00
18292 +#define PCI_BASE_CLASS_SATELLITE 0x0f
18293 +#define PCI_CLASS_SATELLITE_TV 0x0f00
18294 +#define PCI_CLASS_SATELLITE_AUDIO 0x0f01
18295 +#define PCI_CLASS_SATELLITE_VOICE 0x0f03
18296 +#define PCI_CLASS_SATELLITE_DATA 0x0f04
18298 +#define PCI_BASE_CLASS_CRYPT 0x10
18299 +#define PCI_CLASS_CRYPT_NETWORK 0x1000
18300 +#define PCI_CLASS_CRYPT_ENTERTAINMENT 0x1001
18301 +#define PCI_CLASS_CRYPT_OTHER 0x1080
18303 +#define PCI_BASE_CLASS_SIGNAL_PROCESSING 0x11
18304 +#define PCI_CLASS_SP_DPIO 0x1100
18305 +#define PCI_CLASS_SP_OTHER 0x1180
18307 +#define PCI_CLASS_OTHERS 0xff
18309 +/* Vendors and devices. Sort key: vendor first, device next. */
18311 +#define PCI_VENDOR_ID_DYNALINK 0x0675
18312 +#define PCI_DEVICE_ID_DYNALINK_IS64PH 0x1702
18314 +#define PCI_VENDOR_ID_BERKOM 0x0871
18315 +#define PCI_DEVICE_ID_BERKOM_A1T 0xffa1
18316 +#define PCI_DEVICE_ID_BERKOM_T_CONCEPT 0xffa2
18317 +#define PCI_DEVICE_ID_BERKOM_A4T 0xffa4
18318 +#define PCI_DEVICE_ID_BERKOM_SCITEL_QUADRO 0xffa8
18320 +#define PCI_VENDOR_ID_COMPAQ 0x0e11
18321 +#define PCI_DEVICE_ID_COMPAQ_TOKENRING 0x0508
18322 +#define PCI_DEVICE_ID_COMPAQ_1280 0x3033
18323 +#define PCI_DEVICE_ID_COMPAQ_TRIFLEX 0x4000
18324 +#define PCI_DEVICE_ID_COMPAQ_6010 0x6010
18325 +#define PCI_DEVICE_ID_COMPAQ_TACHYON 0xa0fc
18326 +#define PCI_DEVICE_ID_COMPAQ_SMART2P 0xae10
18327 +#define PCI_DEVICE_ID_COMPAQ_NETEL100 0xae32
18328 +#define PCI_DEVICE_ID_COMPAQ_NETEL10 0xae34
18329 +#define PCI_DEVICE_ID_COMPAQ_TRIFLEX_IDE 0xae33
18330 +#define PCI_DEVICE_ID_COMPAQ_NETFLEX3I 0xae35
18331 +#define PCI_DEVICE_ID_COMPAQ_NETEL100D 0xae40
18332 +#define PCI_DEVICE_ID_COMPAQ_NETEL100PI 0xae43
18333 +#define PCI_DEVICE_ID_COMPAQ_NETEL100I 0xb011
18334 +#define PCI_DEVICE_ID_COMPAQ_CISS 0xb060
18335 +#define PCI_DEVICE_ID_COMPAQ_CISSB 0xb178
18336 +#define PCI_DEVICE_ID_COMPAQ_CISSC 0x46
18337 +#define PCI_DEVICE_ID_COMPAQ_THUNDER 0xf130
18338 +#define PCI_DEVICE_ID_COMPAQ_NETFLEX3B 0xf150
18340 +#define PCI_VENDOR_ID_NCR 0x1000
18341 +#define PCI_VENDOR_ID_LSI_LOGIC 0x1000
18342 +#define PCI_DEVICE_ID_NCR_53C810 0x0001
18343 +#define PCI_DEVICE_ID_NCR_53C820 0x0002
18344 +#define PCI_DEVICE_ID_NCR_53C825 0x0003
18345 +#define PCI_DEVICE_ID_NCR_53C815 0x0004
18346 +#define PCI_DEVICE_ID_LSI_53C810AP 0x0005
18347 +#define PCI_DEVICE_ID_NCR_53C860 0x0006
18348 +#define PCI_DEVICE_ID_LSI_53C1510 0x000a
18349 +#define PCI_DEVICE_ID_NCR_53C896 0x000b
18350 +#define PCI_DEVICE_ID_NCR_53C895 0x000c
18351 +#define PCI_DEVICE_ID_NCR_53C885 0x000d
18352 +#define PCI_DEVICE_ID_NCR_53C875 0x000f
18353 +#define PCI_DEVICE_ID_NCR_53C1510 0x0010
18354 +#define PCI_DEVICE_ID_LSI_53C895A 0x0012
18355 +#define PCI_DEVICE_ID_LSI_53C875A 0x0013
18356 +#define PCI_DEVICE_ID_LSI_53C1010_33 0x0020
18357 +#define PCI_DEVICE_ID_LSI_53C1010_66 0x0021
18358 +#define PCI_DEVICE_ID_LSI_53C1030 0x0030
18359 +#define PCI_DEVICE_ID_LSI_1030_53C1035 0x0032
18360 +#define PCI_DEVICE_ID_LSI_53C1035 0x0040
18361 +#define PCI_DEVICE_ID_NCR_53C875J 0x008f
18362 +#define PCI_DEVICE_ID_LSI_FC909 0x0621
18363 +#define PCI_DEVICE_ID_LSI_FC929 0x0622
18364 +#define PCI_DEVICE_ID_LSI_FC929_LAN 0x0623
18365 +#define PCI_DEVICE_ID_LSI_FC919 0x0624
18366 +#define PCI_DEVICE_ID_LSI_FC919_LAN 0x0625
18367 +#define PCI_DEVICE_ID_LSI_FC929X 0x0626
18368 +#define PCI_DEVICE_ID_LSI_FC939X 0x0642
18369 +#define PCI_DEVICE_ID_LSI_FC949X 0x0640
18370 +#define PCI_DEVICE_ID_LSI_FC919X 0x0628
18371 +#define PCI_DEVICE_ID_NCR_YELLOWFIN 0x0701
18372 +#define PCI_DEVICE_ID_LSI_61C102 0x0901
18373 +#define PCI_DEVICE_ID_LSI_63C815 0x1000
18374 +#define PCI_DEVICE_ID_LSI_SAS1064 0x0050
18375 +#define PCI_DEVICE_ID_LSI_SAS1066 0x005E
18376 +#define PCI_DEVICE_ID_LSI_SAS1068 0x0054
18377 +#define PCI_DEVICE_ID_LSI_SAS1064A 0x005C
18378 +#define PCI_DEVICE_ID_LSI_SAS1064E 0x0056
18379 +#define PCI_DEVICE_ID_LSI_SAS1066E 0x005A
18380 +#define PCI_DEVICE_ID_LSI_SAS1068E 0x0058
18381 +#define PCI_DEVICE_ID_LSI_SAS1078 0x0060
18383 +#define PCI_VENDOR_ID_ATI 0x1002
18385 +#define PCI_DEVICE_ID_ATI_68800 0x4158
18386 +#define PCI_DEVICE_ID_ATI_215CT222 0x4354
18387 +#define PCI_DEVICE_ID_ATI_210888CX 0x4358
18388 +#define PCI_DEVICE_ID_ATI_215ET222 0x4554
18389 +/* Mach64 / Rage */
18390 +#define PCI_DEVICE_ID_ATI_215GB 0x4742
18391 +#define PCI_DEVICE_ID_ATI_215GD 0x4744
18392 +#define PCI_DEVICE_ID_ATI_215GI 0x4749
18393 +#define PCI_DEVICE_ID_ATI_215GP 0x4750
18394 +#define PCI_DEVICE_ID_ATI_215GQ 0x4751
18395 +#define PCI_DEVICE_ID_ATI_215XL 0x4752
18396 +#define PCI_DEVICE_ID_ATI_215GT 0x4754
18397 +#define PCI_DEVICE_ID_ATI_215GTB 0x4755
18398 +#define PCI_DEVICE_ID_ATI_215_IV 0x4756
18399 +#define PCI_DEVICE_ID_ATI_215_IW 0x4757
18400 +#define PCI_DEVICE_ID_ATI_215_IZ 0x475A
18401 +#define PCI_DEVICE_ID_ATI_210888GX 0x4758
18402 +#define PCI_DEVICE_ID_ATI_215_LB 0x4c42
18403 +#define PCI_DEVICE_ID_ATI_215_LD 0x4c44
18404 +#define PCI_DEVICE_ID_ATI_215_LG 0x4c47
18405 +#define PCI_DEVICE_ID_ATI_215_LI 0x4c49
18406 +#define PCI_DEVICE_ID_ATI_215_LM 0x4c4D
18407 +#define PCI_DEVICE_ID_ATI_215_LN 0x4c4E
18408 +#define PCI_DEVICE_ID_ATI_215_LR 0x4c52
18409 +#define PCI_DEVICE_ID_ATI_215_LS 0x4c53
18410 +#define PCI_DEVICE_ID_ATI_264_LT 0x4c54
18412 +#define PCI_DEVICE_ID_ATI_264VT 0x5654
18413 +#define PCI_DEVICE_ID_ATI_264VU 0x5655
18414 +#define PCI_DEVICE_ID_ATI_264VV 0x5656
18416 +#define PCI_DEVICE_ID_ATI_RAGE128_RE 0x5245
18417 +#define PCI_DEVICE_ID_ATI_RAGE128_RF 0x5246
18418 +#define PCI_DEVICE_ID_ATI_RAGE128_RG 0x5247
18420 +#define PCI_DEVICE_ID_ATI_RAGE128_RK 0x524b
18421 +#define PCI_DEVICE_ID_ATI_RAGE128_RL 0x524c
18422 +#define PCI_DEVICE_ID_ATI_RAGE128_SE 0x5345
18423 +#define PCI_DEVICE_ID_ATI_RAGE128_SF 0x5346
18424 +#define PCI_DEVICE_ID_ATI_RAGE128_SG 0x5347
18425 +#define PCI_DEVICE_ID_ATI_RAGE128_SH 0x5348
18426 +#define PCI_DEVICE_ID_ATI_RAGE128_SK 0x534b
18427 +#define PCI_DEVICE_ID_ATI_RAGE128_SL 0x534c
18428 +#define PCI_DEVICE_ID_ATI_RAGE128_SM 0x534d
18429 +#define PCI_DEVICE_ID_ATI_RAGE128_SN 0x534e
18430 +/* Rage128 Ultra */
18431 +#define PCI_DEVICE_ID_ATI_RAGE128_TF 0x5446
18432 +#define PCI_DEVICE_ID_ATI_RAGE128_TL 0x544c
18433 +#define PCI_DEVICE_ID_ATI_RAGE128_TR 0x5452
18434 +#define PCI_DEVICE_ID_ATI_RAGE128_TS 0x5453
18435 +#define PCI_DEVICE_ID_ATI_RAGE128_TT 0x5454
18436 +#define PCI_DEVICE_ID_ATI_RAGE128_TU 0x5455
18438 +#define PCI_DEVICE_ID_ATI_RAGE128_LE 0x4c45
18439 +#define PCI_DEVICE_ID_ATI_RAGE128_LF 0x4c46
18441 +#define PCI_DEVICE_ID_ATI_RAGE128_MF 0x4d46
18442 +#define PCI_DEVICE_ID_ATI_RAGE128_ML 0x4d4c
18443 +/* Rage128 Pro GL */
18444 +#define PCI_DEVICE_ID_ATI_RAGE128_PA 0x5041
18445 +#define PCI_DEVICE_ID_ATI_RAGE128_PB 0x5042
18446 +#define PCI_DEVICE_ID_ATI_RAGE128_PC 0x5043
18447 +#define PCI_DEVICE_ID_ATI_RAGE128_PD 0x5044
18448 +#define PCI_DEVICE_ID_ATI_RAGE128_PE 0x5045
18449 +#define PCI_DEVICE_ID_ATI_RAGE128_PF 0x5046
18450 +/* Rage128 Pro VR */
18451 +#define PCI_DEVICE_ID_ATI_RAGE128_PG 0x5047
18452 +#define PCI_DEVICE_ID_ATI_RAGE128_PH 0x5048
18453 +#define PCI_DEVICE_ID_ATI_RAGE128_PI 0x5049
18454 +#define PCI_DEVICE_ID_ATI_RAGE128_PJ 0x504A
18455 +#define PCI_DEVICE_ID_ATI_RAGE128_PK 0x504B
18456 +#define PCI_DEVICE_ID_ATI_RAGE128_PL 0x504C
18457 +#define PCI_DEVICE_ID_ATI_RAGE128_PM 0x504D
18458 +#define PCI_DEVICE_ID_ATI_RAGE128_PN 0x504E
18459 +#define PCI_DEVICE_ID_ATI_RAGE128_PO 0x504F
18460 +#define PCI_DEVICE_ID_ATI_RAGE128_PP 0x5050
18461 +#define PCI_DEVICE_ID_ATI_RAGE128_PQ 0x5051
18462 +#define PCI_DEVICE_ID_ATI_RAGE128_PR 0x5052
18463 +#define PCI_DEVICE_ID_ATI_RAGE128_TR 0x5452
18464 +#define PCI_DEVICE_ID_ATI_RAGE128_PS 0x5053
18465 +#define PCI_DEVICE_ID_ATI_RAGE128_PT 0x5054
18466 +#define PCI_DEVICE_ID_ATI_RAGE128_PU 0x5055
18467 +#define PCI_DEVICE_ID_ATI_RAGE128_PV 0x5056
18468 +#define PCI_DEVICE_ID_ATI_RAGE128_PW 0x5057
18469 +#define PCI_DEVICE_ID_ATI_RAGE128_PX 0x5058
18471 +#define PCI_DEVICE_ID_ATI_RADEON_LE 0x4d45
18472 +#define PCI_DEVICE_ID_ATI_RADEON_LF 0x4d46
18474 +#define PCI_DEVICE_ID_ATI_RADEON_QD 0x5144
18475 +#define PCI_DEVICE_ID_ATI_RADEON_QE 0x5145
18476 +#define PCI_DEVICE_ID_ATI_RADEON_QF 0x5146
18477 +#define PCI_DEVICE_ID_ATI_RADEON_QG 0x5147
18478 +/* Radeon RV100 (VE) */
18479 +#define PCI_DEVICE_ID_ATI_RADEON_QY 0x5159
18480 +#define PCI_DEVICE_ID_ATI_RADEON_QZ 0x515a
18481 +/* Radeon R200 (8500) */
18482 +#define PCI_DEVICE_ID_ATI_RADEON_QL 0x514c
18483 +#define PCI_DEVICE_ID_ATI_RADEON_QN 0x514e
18484 +#define PCI_DEVICE_ID_ATI_RADEON_QO 0x514f
18485 +#define PCI_DEVICE_ID_ATI_RADEON_Ql 0x516c
18486 +#define PCI_DEVICE_ID_ATI_RADEON_BB 0x4242
18487 +/* Radeon R200 (9100) */
18488 +#define PCI_DEVICE_ID_ATI_RADEON_QM 0x514d
18489 +/* Radeon RV200 (7500) */
18490 +#define PCI_DEVICE_ID_ATI_RADEON_QW 0x5157
18491 +#define PCI_DEVICE_ID_ATI_RADEON_QX 0x5158
18492 +/* Radeon NV-100 */
18493 +#define PCI_DEVICE_ID_ATI_RADEON_N1 0x5159
18494 +#define PCI_DEVICE_ID_ATI_RADEON_N2 0x515a
18495 +/* Radeon RV250 (9000) */
18496 +#define PCI_DEVICE_ID_ATI_RADEON_Id 0x4964
18497 +#define PCI_DEVICE_ID_ATI_RADEON_Ie 0x4965
18498 +#define PCI_DEVICE_ID_ATI_RADEON_If 0x4966
18499 +#define PCI_DEVICE_ID_ATI_RADEON_Ig 0x4967
18500 +/* Radeon RV280 (9200) */
18501 +#define PCI_DEVICE_ID_ATI_RADEON_Y_ 0x5960
18502 +#define PCI_DEVICE_ID_ATI_RADEON_Ya 0x5961
18503 +#define PCI_DEVICE_ID_ATI_RADEON_Yd 0x5964
18504 +/* Radeon R300 (9500) */
18505 +#define PCI_DEVICE_ID_ATI_RADEON_AD 0x4144
18506 +/* Radeon R300 (9700) */
18507 +#define PCI_DEVICE_ID_ATI_RADEON_ND 0x4e44
18508 +#define PCI_DEVICE_ID_ATI_RADEON_NE 0x4e45
18509 +#define PCI_DEVICE_ID_ATI_RADEON_NF 0x4e46
18510 +#define PCI_DEVICE_ID_ATI_RADEON_NG 0x4e47
18511 +#define PCI_DEVICE_ID_ATI_RADEON_AE 0x4145
18512 +#define PCI_DEVICE_ID_ATI_RADEON_AF 0x4146
18513 +/* Radeon R350 (9800) */
18514 +#define PCI_DEVICE_ID_ATI_RADEON_NH 0x4e48
18515 +#define PCI_DEVICE_ID_ATI_RADEON_NI 0x4e49
18516 +/* Radeon RV350 (9600) */
18517 +#define PCI_DEVICE_ID_ATI_RADEON_AP 0x4150
18518 +#define PCI_DEVICE_ID_ATI_RADEON_AR 0x4152
18520 +#define PCI_DEVICE_ID_ATI_RADEON_LY 0x4c59
18521 +#define PCI_DEVICE_ID_ATI_RADEON_LZ 0x4c5a
18523 +#define PCI_DEVICE_ID_ATI_RADEON_LW 0x4c57
18524 +#define PCI_DEVICE_ID_ATI_RADEON_LX 0x4c58
18526 +#define PCI_DEVICE_ID_ATI_RADEON_Ld 0x4c64
18527 +#define PCI_DEVICE_ID_ATI_RADEON_Le 0x4c65
18528 +#define PCI_DEVICE_ID_ATI_RADEON_Lf 0x4c66
18529 +#define PCI_DEVICE_ID_ATI_RADEON_Lg 0x4c67
18531 +#define PCI_DEVICE_ID_ATI_RADEON_RA 0x5144
18532 +#define PCI_DEVICE_ID_ATI_RADEON_RB 0x5145
18533 +#define PCI_DEVICE_ID_ATI_RADEON_RC 0x5146
18534 +#define PCI_DEVICE_ID_ATI_RADEON_RD 0x5147
18536 +#define PCI_DEVICE_ID_ATI_RS100 0xcab0
18537 +#define PCI_DEVICE_ID_ATI_RS200 0xcab2
18538 +#define PCI_DEVICE_ID_ATI_RS200_B 0xcbb2
18539 +#define PCI_DEVICE_ID_ATI_RS250 0xcab3
18540 +#define PCI_DEVICE_ID_ATI_RS300_100 0x5830
18541 +#define PCI_DEVICE_ID_ATI_RS300_133 0x5831
18542 +#define PCI_DEVICE_ID_ATI_RS300_166 0x5832
18543 +#define PCI_DEVICE_ID_ATI_RS300_200 0x5833
18544 +#define PCI_DEVICE_ID_ATI_RS350_100 0x7830
18545 +#define PCI_DEVICE_ID_ATI_RS350_133 0x7831
18546 +#define PCI_DEVICE_ID_ATI_RS350_166 0x7832
18547 +#define PCI_DEVICE_ID_ATI_RS350_200 0x7833
18548 +#define PCI_DEVICE_ID_ATI_RS400_100 0x5a30
18549 +#define PCI_DEVICE_ID_ATI_RS400_133 0x5a31
18550 +#define PCI_DEVICE_ID_ATI_RS400_166 0x5a32
18551 +#define PCI_DEVICE_ID_ATI_RS400_200 0x5a33
18552 +#define PCI_DEVICE_ID_ATI_RS480 0x5950
18553 +/* ATI IXP Chipset */
18554 +#define PCI_DEVICE_ID_ATI_IXP200_IDE 0x4349
18555 +#define PCI_DEVICE_ID_ATI_IXP300_IDE 0x4369
18556 +#define PCI_DEVICE_ID_ATI_IXP300_SATA 0x436e
18557 +#define PCI_DEVICE_ID_ATI_IXP400_IDE 0x4376
18558 +#define PCI_DEVICE_ID_ATI_IXP400_SATA 0x4379
18560 +#define PCI_VENDOR_ID_VLSI 0x1004
18561 +#define PCI_DEVICE_ID_VLSI_82C592 0x0005
18562 +#define PCI_DEVICE_ID_VLSI_82C593 0x0006
18563 +#define PCI_DEVICE_ID_VLSI_82C594 0x0007
18564 +#define PCI_DEVICE_ID_VLSI_82C597 0x0009
18565 +#define PCI_DEVICE_ID_VLSI_82C541 0x000c
18566 +#define PCI_DEVICE_ID_VLSI_82C543 0x000d
18567 +#define PCI_DEVICE_ID_VLSI_82C532 0x0101
18568 +#define PCI_DEVICE_ID_VLSI_82C534 0x0102
18569 +#define PCI_DEVICE_ID_VLSI_82C535 0x0104
18570 +#define PCI_DEVICE_ID_VLSI_82C147 0x0105
18571 +#define PCI_DEVICE_ID_VLSI_VAS96011 0x0702
18573 +#define PCI_VENDOR_ID_ADL 0x1005
18574 +#define PCI_DEVICE_ID_ADL_2301 0x2301
18576 +#define PCI_VENDOR_ID_NS 0x100b
18577 +#define PCI_DEVICE_ID_NS_87415 0x0002
18578 +#define PCI_DEVICE_ID_NS_87560_LIO 0x000e
18579 +#define PCI_DEVICE_ID_NS_87560_USB 0x0012
18580 +#define PCI_DEVICE_ID_NS_83815 0x0020
18581 +#define PCI_DEVICE_ID_NS_83820 0x0022
18582 +#define PCI_DEVICE_ID_NS_SCx200_BRIDGE 0x0500
18583 +#define PCI_DEVICE_ID_NS_SCx200_SMI 0x0501
18584 +#define PCI_DEVICE_ID_NS_SCx200_IDE 0x0502
18585 +#define PCI_DEVICE_ID_NS_SCx200_AUDIO 0x0503
18586 +#define PCI_DEVICE_ID_NS_SCx200_VIDEO 0x0504
18587 +#define PCI_DEVICE_ID_NS_SCx200_XBUS 0x0505
18588 +#define PCI_DEVICE_ID_NS_SC1100_BRIDGE 0x0510
18589 +#define PCI_DEVICE_ID_NS_SC1100_SMI 0x0511
18590 +#define PCI_DEVICE_ID_NS_SC1100_XBUS 0x0515
18591 +#define PCI_DEVICE_ID_NS_87410 0xd001
18593 +#define PCI_VENDOR_ID_TSENG 0x100c
18594 +#define PCI_DEVICE_ID_TSENG_W32P_2 0x3202
18595 +#define PCI_DEVICE_ID_TSENG_W32P_b 0x3205
18596 +#define PCI_DEVICE_ID_TSENG_W32P_c 0x3206
18597 +#define PCI_DEVICE_ID_TSENG_W32P_d 0x3207
18598 +#define PCI_DEVICE_ID_TSENG_ET6000 0x3208
18600 +#define PCI_VENDOR_ID_WEITEK 0x100e
18601 +#define PCI_DEVICE_ID_WEITEK_P9000 0x9001
18602 +#define PCI_DEVICE_ID_WEITEK_P9100 0x9100
18604 +#define PCI_VENDOR_ID_DEC 0x1011
18605 +#define PCI_DEVICE_ID_DEC_BRD 0x0001
18606 +#define PCI_DEVICE_ID_DEC_TULIP 0x0002
18607 +#define PCI_DEVICE_ID_DEC_TGA 0x0004
18608 +#define PCI_DEVICE_ID_DEC_TULIP_FAST 0x0009
18609 +#define PCI_DEVICE_ID_DEC_TGA2 0x000D
18610 +#define PCI_DEVICE_ID_DEC_FDDI 0x000F
18611 +#define PCI_DEVICE_ID_DEC_TULIP_PLUS 0x0014
18612 +#define PCI_DEVICE_ID_DEC_21142 0x0019
18613 +#define PCI_DEVICE_ID_DEC_21052 0x0021
18614 +#define PCI_DEVICE_ID_DEC_21150 0x0022
18615 +#define PCI_DEVICE_ID_DEC_21152 0x0024
18616 +#define PCI_DEVICE_ID_DEC_21153 0x0025
18617 +#define PCI_DEVICE_ID_DEC_21154 0x0026
18618 +#define PCI_DEVICE_ID_DEC_21285 0x1065
18619 +#define PCI_DEVICE_ID_COMPAQ_42XX 0x0046
18621 +#define PCI_VENDOR_ID_CIRRUS 0x1013
18622 +#define PCI_DEVICE_ID_CIRRUS_7548 0x0038
18623 +#define PCI_DEVICE_ID_CIRRUS_5430 0x00a0
18624 +#define PCI_DEVICE_ID_CIRRUS_5434_4 0x00a4
18625 +#define PCI_DEVICE_ID_CIRRUS_5434_8 0x00a8
18626 +#define PCI_DEVICE_ID_CIRRUS_5436 0x00ac
18627 +#define PCI_DEVICE_ID_CIRRUS_5446 0x00b8
18628 +#define PCI_DEVICE_ID_CIRRUS_5480 0x00bc
18629 +#define PCI_DEVICE_ID_CIRRUS_5462 0x00d0
18630 +#define PCI_DEVICE_ID_CIRRUS_5464 0x00d4
18631 +#define PCI_DEVICE_ID_CIRRUS_5465 0x00d6
18632 +#define PCI_DEVICE_ID_CIRRUS_6729 0x1100
18633 +#define PCI_DEVICE_ID_CIRRUS_6832 0x1110
18634 +#define PCI_DEVICE_ID_CIRRUS_7542 0x1200
18635 +#define PCI_DEVICE_ID_CIRRUS_7543 0x1202
18636 +#define PCI_DEVICE_ID_CIRRUS_7541 0x1204
18638 +#define PCI_VENDOR_ID_IBM 0x1014
18639 +#define PCI_DEVICE_ID_IBM_FIRE_CORAL 0x000a
18640 +#define PCI_DEVICE_ID_IBM_TR 0x0018
18641 +#define PCI_DEVICE_ID_IBM_82G2675 0x001d
18642 +#define PCI_DEVICE_ID_IBM_MCA 0x0020
18643 +#define PCI_DEVICE_ID_IBM_82351 0x0022
18644 +#define PCI_DEVICE_ID_IBM_PYTHON 0x002d
18645 +#define PCI_DEVICE_ID_IBM_SERVERAID 0x002e
18646 +#define PCI_DEVICE_ID_IBM_TR_WAKE 0x003e
18647 +#define PCI_DEVICE_ID_IBM_MPIC 0x0046
18648 +#define PCI_DEVICE_ID_IBM_3780IDSP 0x007d
18649 +#define PCI_DEVICE_ID_IBM_CHUKAR 0x0096
18650 +#define PCI_DEVICE_ID_IBM_CPC710_PCI64 0x00fc
18651 +#define PCI_DEVICE_ID_IBM_CPC710_PCI32 0x0105
18652 +#define PCI_DEVICE_ID_IBM_405GP 0x0156
18653 +#define PCI_DEVICE_ID_IBM_SNIPE 0x0180
18654 +#define PCI_DEVICE_ID_IBM_SERVERAIDI960 0x01bd
18655 +#define PCI_DEVICE_ID_IBM_CITRINE 0x028C
18656 +#define PCI_DEVICE_ID_IBM_GEMSTONE 0xB166
18657 +#define PCI_DEVICE_ID_IBM_MPIC_2 0xffff
18658 +#define PCI_DEVICE_ID_IBM_ICOM_DEV_ID_1 0x0031
18659 +#define PCI_DEVICE_ID_IBM_ICOM_DEV_ID_2 0x0219
18660 +#define PCI_DEVICE_ID_IBM_ICOM_V2_TWO_PORTS_RVX 0x021A
18661 +#define PCI_DEVICE_ID_IBM_ICOM_V2_ONE_PORT_RVX_ONE_PORT_MDM 0x0251
18662 +#define PCI_DEVICE_ID_IBM_ICOM_FOUR_PORT_MODEL 0x252
18664 +#define PCI_VENDOR_ID_COMPEX2 0x101a // pci.ids says "AT&T GIS (NCR)"
18665 +#define PCI_DEVICE_ID_COMPEX2_100VG 0x0005
18667 +#define PCI_VENDOR_ID_WD 0x101c
18668 +#define PCI_DEVICE_ID_WD_7197 0x3296
18669 +#define PCI_DEVICE_ID_WD_90C 0xc24a
18671 +#define PCI_VENDOR_ID_AMI 0x101e
18672 +#define PCI_DEVICE_ID_AMI_MEGARAID3 0x1960
18673 +#define PCI_DEVICE_ID_AMI_MEGARAID 0x9010
18674 +#define PCI_DEVICE_ID_AMI_MEGARAID2 0x9060
18676 +#define PCI_VENDOR_ID_AMD 0x1022
18677 +#define PCI_DEVICE_ID_AMD_LANCE 0x2000
18678 +#define PCI_DEVICE_ID_AMD_LANCE_HOME 0x2001
18679 +#define PCI_DEVICE_ID_AMD_SCSI 0x2020
18680 +#define PCI_DEVICE_ID_AMD_SERENADE 0x36c0
18681 +#define PCI_DEVICE_ID_AMD_FE_GATE_7006 0x7006
18682 +#define PCI_DEVICE_ID_AMD_FE_GATE_7007 0x7007
18683 +#define PCI_DEVICE_ID_AMD_FE_GATE_700C 0x700C
18684 +#define PCI_DEVICE_ID_AMD_FE_GATE_700D 0x700D
18685 +#define PCI_DEVICE_ID_AMD_FE_GATE_700E 0x700E
18686 +#define PCI_DEVICE_ID_AMD_FE_GATE_700F 0x700F
18687 +#define PCI_DEVICE_ID_AMD_COBRA_7400 0x7400
18688 +#define PCI_DEVICE_ID_AMD_COBRA_7401 0x7401
18689 +#define PCI_DEVICE_ID_AMD_COBRA_7403 0x7403
18690 +#define PCI_DEVICE_ID_AMD_COBRA_7404 0x7404
18691 +#define PCI_DEVICE_ID_AMD_VIPER_7408 0x7408
18692 +#define PCI_DEVICE_ID_AMD_VIPER_7409 0x7409
18693 +#define PCI_DEVICE_ID_AMD_VIPER_740B 0x740B
18694 +#define PCI_DEVICE_ID_AMD_VIPER_740C 0x740C
18695 +#define PCI_DEVICE_ID_AMD_VIPER_7410 0x7410
18696 +#define PCI_DEVICE_ID_AMD_VIPER_7411 0x7411
18697 +#define PCI_DEVICE_ID_AMD_VIPER_7413 0x7413
18698 +#define PCI_DEVICE_ID_AMD_VIPER_7414 0x7414
18699 +#define PCI_DEVICE_ID_AMD_OPUS_7440 0x7440
18700 +# define PCI_DEVICE_ID_AMD_VIPER_7440 PCI_DEVICE_ID_AMD_OPUS_7440
18701 +#define PCI_DEVICE_ID_AMD_OPUS_7441 0x7441
18702 +# define PCI_DEVICE_ID_AMD_VIPER_7441 PCI_DEVICE_ID_AMD_OPUS_7441
18703 +#define PCI_DEVICE_ID_AMD_OPUS_7443 0x7443
18704 +# define PCI_DEVICE_ID_AMD_VIPER_7443 PCI_DEVICE_ID_AMD_OPUS_7443
18705 +#define PCI_DEVICE_ID_AMD_OPUS_7445 0x7445
18706 +#define PCI_DEVICE_ID_AMD_OPUS_7448 0x7448
18707 +# define PCI_DEVICE_ID_AMD_VIPER_7448 PCI_DEVICE_ID_AMD_OPUS_7448
18708 +#define PCI_DEVICE_ID_AMD_OPUS_7449 0x7449
18709 +# define PCI_DEVICE_ID_AMD_VIPER_7449 PCI_DEVICE_ID_AMD_OPUS_7449
18710 +#define PCI_DEVICE_ID_AMD_8111_LAN 0x7462
18711 +#define PCI_DEVICE_ID_AMD_8111_LPC 0x7468
18712 +#define PCI_DEVICE_ID_AMD_8111_IDE 0x7469
18713 +#define PCI_DEVICE_ID_AMD_8111_SMBUS2 0x746a
18714 +#define PCI_DEVICE_ID_AMD_8111_SMBUS 0x746b
18715 +#define PCI_DEVICE_ID_AMD_8111_AUDIO 0x746d
18716 +#define PCI_DEVICE_ID_AMD_8151_0 0x7454
18717 +#define PCI_DEVICE_ID_AMD_8131_APIC 0x7450
18719 +#define PCI_VENDOR_ID_TRIDENT 0x1023
18720 +#define PCI_DEVICE_ID_TRIDENT_4DWAVE_DX 0x2000
18721 +#define PCI_DEVICE_ID_TRIDENT_4DWAVE_NX 0x2001
18722 +#define PCI_DEVICE_ID_TRIDENT_9320 0x9320
18723 +#define PCI_DEVICE_ID_TRIDENT_9388 0x9388
18724 +#define PCI_DEVICE_ID_TRIDENT_9397 0x9397
18725 +#define PCI_DEVICE_ID_TRIDENT_939A 0x939A
18726 +#define PCI_DEVICE_ID_TRIDENT_9520 0x9520
18727 +#define PCI_DEVICE_ID_TRIDENT_9525 0x9525
18728 +#define PCI_DEVICE_ID_TRIDENT_9420 0x9420
18729 +#define PCI_DEVICE_ID_TRIDENT_9440 0x9440
18730 +#define PCI_DEVICE_ID_TRIDENT_9660 0x9660
18731 +#define PCI_DEVICE_ID_TRIDENT_9750 0x9750
18732 +#define PCI_DEVICE_ID_TRIDENT_9850 0x9850
18733 +#define PCI_DEVICE_ID_TRIDENT_9880 0x9880
18734 +#define PCI_DEVICE_ID_TRIDENT_8400 0x8400
18735 +#define PCI_DEVICE_ID_TRIDENT_8420 0x8420
18736 +#define PCI_DEVICE_ID_TRIDENT_8500 0x8500
18738 +#define PCI_VENDOR_ID_AI 0x1025
18739 +#define PCI_DEVICE_ID_AI_M1435 0x1435
18741 +#define PCI_VENDOR_ID_DELL 0x1028
18742 +#define PCI_DEVICE_ID_DELL_RACIII 0x0008
18743 +#define PCI_DEVICE_ID_DELL_RAC4 0x0012
18745 +#define PCI_VENDOR_ID_MATROX 0x102B
18746 +#define PCI_DEVICE_ID_MATROX_MGA_2 0x0518
18747 +#define PCI_DEVICE_ID_MATROX_MIL 0x0519
18748 +#define PCI_DEVICE_ID_MATROX_MYS 0x051A
18749 +#define PCI_DEVICE_ID_MATROX_MIL_2 0x051b
18750 +#define PCI_DEVICE_ID_MATROX_MIL_2_AGP 0x051f
18751 +#define PCI_DEVICE_ID_MATROX_MGA_IMP 0x0d10
18752 +#define PCI_DEVICE_ID_MATROX_G100_MM 0x1000
18753 +#define PCI_DEVICE_ID_MATROX_G100_AGP 0x1001
18754 +#define PCI_DEVICE_ID_MATROX_G200_PCI 0x0520
18755 +#define PCI_DEVICE_ID_MATROX_G200_AGP 0x0521
18756 +#define PCI_DEVICE_ID_MATROX_G400 0x0525
18757 +#define PCI_DEVICE_ID_MATROX_G550 0x2527
18758 +#define PCI_DEVICE_ID_MATROX_VIA 0x4536
18760 +#define PCI_VENDOR_ID_CT 0x102c
18761 +#define PCI_DEVICE_ID_CT_69000 0x00c0
18762 +#define PCI_DEVICE_ID_CT_65545 0x00d8
18763 +#define PCI_DEVICE_ID_CT_65548 0x00dc
18764 +#define PCI_DEVICE_ID_CT_65550 0x00e0
18765 +#define PCI_DEVICE_ID_CT_65554 0x00e4
18766 +#define PCI_DEVICE_ID_CT_65555 0x00e5
18768 +#define PCI_VENDOR_ID_MIRO 0x1031
18769 +#define PCI_DEVICE_ID_MIRO_36050 0x5601
18770 +#define PCI_DEVICE_ID_MIRO_DC10PLUS 0x7efe
18771 +#define PCI_DEVICE_ID_MIRO_DC30PLUS 0xd801
18773 +#define PCI_VENDOR_ID_NEC 0x1033
18774 +#define PCI_DEVICE_ID_NEC_CBUS_1 0x0001 /* PCI-Cbus Bridge */
18775 +#define PCI_DEVICE_ID_NEC_LOCAL 0x0002 /* Local Bridge */
18776 +#define PCI_DEVICE_ID_NEC_ATM 0x0003 /* ATM LAN Controller */
18777 +#define PCI_DEVICE_ID_NEC_R4000 0x0004 /* R4000 Bridge */
18778 +#define PCI_DEVICE_ID_NEC_486 0x0005 /* 486 Like Peripheral Bus Bridge */
18779 +#define PCI_DEVICE_ID_NEC_ACCEL_1 0x0006 /* Graphic Accelerator */
18780 +#define PCI_DEVICE_ID_NEC_UXBUS 0x0007 /* UX-Bus Bridge */
18781 +#define PCI_DEVICE_ID_NEC_ACCEL_2 0x0008 /* Graphic Accelerator */
18782 +#define PCI_DEVICE_ID_NEC_GRAPH 0x0009 /* PCI-CoreGraph Bridge */
18783 +#define PCI_DEVICE_ID_NEC_VL 0x0016 /* PCI-VL Bridge */
18784 +#define PCI_DEVICE_ID_NEC_STARALPHA2 0x002c /* STAR ALPHA2 */
18785 +#define PCI_DEVICE_ID_NEC_CBUS_2 0x002d /* PCI-Cbus Bridge */
18786 +#define PCI_DEVICE_ID_NEC_USB 0x0035 /* PCI-USB Host */
18787 +#define PCI_DEVICE_ID_NEC_CBUS_3 0x003b
18788 +#define PCI_DEVICE_ID_NEC_NAPCCARD 0x003e
18789 +#define PCI_DEVICE_ID_NEC_PCX2 0x0046 /* PowerVR */
18790 +#define PCI_DEVICE_ID_NEC_NILE4 0x005a
18791 +#define PCI_DEVICE_ID_NEC_VRC5476 0x009b
18792 +#define PCI_DEVICE_ID_NEC_VRC4173 0x00a5
18793 +#define PCI_DEVICE_ID_NEC_VRC5477_AC97 0x00a6
18794 +#define PCI_DEVICE_ID_NEC_PC9821CS01 0x800c /* PC-9821-CS01 */
18795 +#define PCI_DEVICE_ID_NEC_PC9821NRB06 0x800d /* PC-9821NR-B06 */
18797 +#define PCI_VENDOR_ID_FD 0x1036
18798 +#define PCI_DEVICE_ID_FD_36C70 0x0000
18800 +#define PCI_VENDOR_ID_SI 0x1039
18801 +#define PCI_DEVICE_ID_SI_5591_AGP 0x0001
18802 +#define PCI_DEVICE_ID_SI_6202 0x0002
18803 +#define PCI_DEVICE_ID_SI_503 0x0008
18804 +#define PCI_DEVICE_ID_SI_ACPI 0x0009
18805 +#define PCI_DEVICE_ID_SI_SMBUS 0x0016
18806 +#define PCI_DEVICE_ID_SI_LPC 0x0018
18807 +#define PCI_DEVICE_ID_SI_5597_VGA 0x0200
18808 +#define PCI_DEVICE_ID_SI_6205 0x0205
18809 +#define PCI_DEVICE_ID_SI_501 0x0406
18810 +#define PCI_DEVICE_ID_SI_496 0x0496
18811 +#define PCI_DEVICE_ID_SI_300 0x0300
18812 +#define PCI_DEVICE_ID_SI_315H 0x0310
18813 +#define PCI_DEVICE_ID_SI_315 0x0315
18814 +#define PCI_DEVICE_ID_SI_315PRO 0x0325
18815 +#define PCI_DEVICE_ID_SI_530 0x0530
18816 +#define PCI_DEVICE_ID_SI_540 0x0540
18817 +#define PCI_DEVICE_ID_SI_550 0x0550
18818 +#define PCI_DEVICE_ID_SI_540_VGA 0x5300
18819 +#define PCI_DEVICE_ID_SI_550_VGA 0x5315
18820 +#define PCI_DEVICE_ID_SI_601 0x0601
18821 +#define PCI_DEVICE_ID_SI_620 0x0620
18822 +#define PCI_DEVICE_ID_SI_630 0x0630
18823 +#define PCI_DEVICE_ID_SI_633 0x0633
18824 +#define PCI_DEVICE_ID_SI_635 0x0635
18825 +#define PCI_DEVICE_ID_SI_640 0x0640
18826 +#define PCI_DEVICE_ID_SI_645 0x0645
18827 +#define PCI_DEVICE_ID_SI_646 0x0646
18828 +#define PCI_DEVICE_ID_SI_648 0x0648
18829 +#define PCI_DEVICE_ID_SI_650 0x0650
18830 +#define PCI_DEVICE_ID_SI_651 0x0651
18831 +#define PCI_DEVICE_ID_SI_652 0x0652
18832 +#define PCI_DEVICE_ID_SI_655 0x0655
18833 +#define PCI_DEVICE_ID_SI_661 0x0661
18834 +#define PCI_DEVICE_ID_SI_730 0x0730
18835 +#define PCI_DEVICE_ID_SI_733 0x0733
18836 +#define PCI_DEVICE_ID_SI_630_VGA 0x6300
18837 +#define PCI_DEVICE_ID_SI_730_VGA 0x7300
18838 +#define PCI_DEVICE_ID_SI_735 0x0735
18839 +#define PCI_DEVICE_ID_SI_740 0x0740
18840 +#define PCI_DEVICE_ID_SI_741 0x0741
18841 +#define PCI_DEVICE_ID_SI_745 0x0745
18842 +#define PCI_DEVICE_ID_SI_746 0x0746
18843 +#define PCI_DEVICE_ID_SI_748 0x0748
18844 +#define PCI_DEVICE_ID_SI_750 0x0750
18845 +#define PCI_DEVICE_ID_SI_751 0x0751
18846 +#define PCI_DEVICE_ID_SI_752 0x0752
18847 +#define PCI_DEVICE_ID_SI_755 0x0755
18848 +#define PCI_DEVICE_ID_SI_760 0x0760
18849 +#define PCI_DEVICE_ID_SI_900 0x0900
18850 +#define PCI_DEVICE_ID_SI_961 0x0961
18851 +#define PCI_DEVICE_ID_SI_962 0x0962
18852 +#define PCI_DEVICE_ID_SI_963 0x0963
18853 +#define PCI_DEVICE_ID_SI_5107 0x5107
18854 +#define PCI_DEVICE_ID_SI_5300 0x5300
18855 +#define PCI_DEVICE_ID_SI_5511 0x5511
18856 +#define PCI_DEVICE_ID_SI_5513 0x5513
18857 +#define PCI_DEVICE_ID_SI_5518 0x5518
18858 +#define PCI_DEVICE_ID_SI_5571 0x5571
18859 +#define PCI_DEVICE_ID_SI_5581 0x5581
18860 +#define PCI_DEVICE_ID_SI_5582 0x5582
18861 +#define PCI_DEVICE_ID_SI_5591 0x5591
18862 +#define PCI_DEVICE_ID_SI_5596 0x5596
18863 +#define PCI_DEVICE_ID_SI_5597 0x5597
18864 +#define PCI_DEVICE_ID_SI_5598 0x5598
18865 +#define PCI_DEVICE_ID_SI_5600 0x5600
18866 +#define PCI_DEVICE_ID_SI_6300 0x6300
18867 +#define PCI_DEVICE_ID_SI_6306 0x6306
18868 +#define PCI_DEVICE_ID_SI_6326 0x6326
18869 +#define PCI_DEVICE_ID_SI_7001 0x7001
18870 +#define PCI_DEVICE_ID_SI_7012 0x7012
18871 +#define PCI_DEVICE_ID_SI_7016 0x7016
18873 +#define PCI_VENDOR_ID_HP 0x103c
18874 +#define PCI_DEVICE_ID_HP_VISUALIZE_EG 0x1005
18875 +#define PCI_DEVICE_ID_HP_VISUALIZE_FX6 0x1006
18876 +#define PCI_DEVICE_ID_HP_VISUALIZE_FX4 0x1008
18877 +#define PCI_DEVICE_ID_HP_VISUALIZE_FX2 0x100a
18878 +#define PCI_DEVICE_ID_HP_TACHYON 0x1028
18879 +#define PCI_DEVICE_ID_HP_TACHLITE 0x1029
18880 +#define PCI_DEVICE_ID_HP_J2585A 0x1030
18881 +#define PCI_DEVICE_ID_HP_J2585B 0x1031
18882 +#define PCI_DEVICE_ID_HP_J2973A 0x1040
18883 +#define PCI_DEVICE_ID_HP_J2970A 0x1042
18884 +#define PCI_DEVICE_ID_HP_DIVA 0x1048
18885 +#define PCI_DEVICE_ID_HP_DIVA_TOSCA1 0x1049
18886 +#define PCI_DEVICE_ID_HP_DIVA_TOSCA2 0x104A
18887 +#define PCI_DEVICE_ID_HP_DIVA_MAESTRO 0x104B
18888 +#define PCI_DEVICE_ID_HP_PCI_LBA 0x1054
18889 +#define PCI_DEVICE_ID_HP_REO_SBA 0x10f0
18890 +#define PCI_DEVICE_ID_HP_REO_IOC 0x10f1
18891 +#define PCI_DEVICE_ID_HP_VISUALIZE_FXE 0x108b
18892 +#define PCI_DEVICE_ID_HP_DIVA_HALFDOME 0x1223
18893 +#define PCI_DEVICE_ID_HP_DIVA_KEYSTONE 0x1226
18894 +#define PCI_DEVICE_ID_HP_DIVA_POWERBAR 0x1227
18895 +#define PCI_DEVICE_ID_HP_ZX1_SBA 0x1229
18896 +#define PCI_DEVICE_ID_HP_ZX1_IOC 0x122a
18897 +#define PCI_DEVICE_ID_HP_PCIX_LBA 0x122e
18898 +#define PCI_DEVICE_ID_HP_SX1000_IOC 0x127c
18899 +#define PCI_DEVICE_ID_HP_DIVA_EVEREST 0x1282
18900 +#define PCI_DEVICE_ID_HP_DIVA_AUX 0x1290
18901 +#define PCI_DEVICE_ID_HP_DIVA_RMP3 0x1301
18902 +#define PCI_DEVICE_ID_HP_CISSA 0x3220
18903 +#define PCI_DEVICE_ID_HP_CISSB 0x3230
18904 +#define PCI_DEVICE_ID_HP_ZX2_IOC 0x4031
18906 +#define PCI_VENDOR_ID_PCTECH 0x1042
18907 +#define PCI_DEVICE_ID_PCTECH_RZ1000 0x1000
18908 +#define PCI_DEVICE_ID_PCTECH_RZ1001 0x1001
18909 +#define PCI_DEVICE_ID_PCTECH_SAMURAI_0 0x3000
18910 +#define PCI_DEVICE_ID_PCTECH_SAMURAI_1 0x3010
18911 +#define PCI_DEVICE_ID_PCTECH_SAMURAI_IDE 0x3020
18913 +#define PCI_VENDOR_ID_ASUSTEK 0x1043
18914 +#define PCI_DEVICE_ID_ASUSTEK_0675 0x0675
18916 +#define PCI_VENDOR_ID_DPT 0x1044
18917 +#define PCI_DEVICE_ID_DPT 0xa400
18919 +#define PCI_VENDOR_ID_OPTI 0x1045
18920 +#define PCI_DEVICE_ID_OPTI_92C178 0xc178
18921 +#define PCI_DEVICE_ID_OPTI_82C557 0xc557
18922 +#define PCI_DEVICE_ID_OPTI_82C558 0xc558
18923 +#define PCI_DEVICE_ID_OPTI_82C621 0xc621
18924 +#define PCI_DEVICE_ID_OPTI_82C700 0xc700
18925 +#define PCI_DEVICE_ID_OPTI_82C701 0xc701
18926 +#define PCI_DEVICE_ID_OPTI_82C814 0xc814
18927 +#define PCI_DEVICE_ID_OPTI_82C822 0xc822
18928 +#define PCI_DEVICE_ID_OPTI_82C861 0xc861
18929 +#define PCI_DEVICE_ID_OPTI_82C825 0xd568
18931 +#define PCI_VENDOR_ID_ELSA 0x1048
18932 +#define PCI_DEVICE_ID_ELSA_MICROLINK 0x1000
18933 +#define PCI_DEVICE_ID_ELSA_QS3000 0x3000
18935 +#define PCI_VENDOR_ID_SGS 0x104a
18936 +#define PCI_DEVICE_ID_SGS_2000 0x0008
18937 +#define PCI_DEVICE_ID_SGS_1764 0x0009
18939 +#define PCI_VENDOR_ID_BUSLOGIC 0x104B
18940 +#define PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER_NC 0x0140
18941 +#define PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER 0x1040
18942 +#define PCI_DEVICE_ID_BUSLOGIC_FLASHPOINT 0x8130
18944 +#define PCI_VENDOR_ID_TI 0x104c
18945 +#define PCI_DEVICE_ID_TI_TVP4010 0x3d04
18946 +#define PCI_DEVICE_ID_TI_TVP4020 0x3d07
18947 +#define PCI_DEVICE_ID_TI_4450 0x8011
18948 +#define PCI_DEVICE_ID_TI_1130 0xac12
18949 +#define PCI_DEVICE_ID_TI_1031 0xac13
18950 +#define PCI_DEVICE_ID_TI_1131 0xac15
18951 +#define PCI_DEVICE_ID_TI_1250 0xac16
18952 +#define PCI_DEVICE_ID_TI_1220 0xac17
18953 +#define PCI_DEVICE_ID_TI_1221 0xac19
18954 +#define PCI_DEVICE_ID_TI_1210 0xac1a
18955 +#define PCI_DEVICE_ID_TI_1450 0xac1b
18956 +#define PCI_DEVICE_ID_TI_1225 0xac1c
18957 +#define PCI_DEVICE_ID_TI_1251A 0xac1d
18958 +#define PCI_DEVICE_ID_TI_1211 0xac1e
18959 +#define PCI_DEVICE_ID_TI_1251B 0xac1f
18960 +#define PCI_DEVICE_ID_TI_4410 0xac41
18961 +#define PCI_DEVICE_ID_TI_4451 0xac42
18962 +#define PCI_DEVICE_ID_TI_4510 0xac44
18963 +#define PCI_DEVICE_ID_TI_4520 0xac46
18964 +#define PCI_DEVICE_ID_TI_1410 0xac50
18965 +#define PCI_DEVICE_ID_TI_1420 0xac51
18966 +#define PCI_DEVICE_ID_TI_1451A 0xac52
18967 +#define PCI_DEVICE_ID_TI_1620 0xac54
18968 +#define PCI_DEVICE_ID_TI_1520 0xac55
18969 +#define PCI_DEVICE_ID_TI_1510 0xac56
18971 +#define PCI_VENDOR_ID_SONY 0x104d
18972 +#define PCI_DEVICE_ID_SONY_CXD3222 0x8039
18974 +#define PCI_VENDOR_ID_OAK 0x104e
18975 +#define PCI_DEVICE_ID_OAK_OTI107 0x0107
18977 +/* Winbond have two vendor IDs! See 0x10ad as well */
18978 +#define PCI_VENDOR_ID_WINBOND2 0x1050
18979 +#define PCI_DEVICE_ID_WINBOND2_89C940 0x0940
18980 +#define PCI_DEVICE_ID_WINBOND2_89C940F 0x5a5a
18981 +#define PCI_DEVICE_ID_WINBOND2_6692 0x6692
18983 +#define PCI_VENDOR_ID_ANIGMA 0x1051
18984 +#define PCI_DEVICE_ID_ANIGMA_MC145575 0x0100
18986 +#define PCI_VENDOR_ID_EFAR 0x1055
18987 +#define PCI_DEVICE_ID_EFAR_SLC90E66_1 0x9130
18988 +#define PCI_DEVICE_ID_EFAR_SLC90E66_0 0x9460
18989 +#define PCI_DEVICE_ID_EFAR_SLC90E66_2 0x9462
18990 +#define PCI_DEVICE_ID_EFAR_SLC90E66_3 0x9463
18992 +#define PCI_VENDOR_ID_MOTOROLA 0x1057
18993 +#define PCI_VENDOR_ID_MOTOROLA_OOPS 0x1507
18994 +#define PCI_DEVICE_ID_MOTOROLA_MPC105 0x0001
18995 +#define PCI_DEVICE_ID_MOTOROLA_MPC106 0x0002
18996 +#define PCI_DEVICE_ID_MOTOROLA_MPC107 0x0004
18997 +#define PCI_DEVICE_ID_MOTOROLA_RAVEN 0x4801
18998 +#define PCI_DEVICE_ID_MOTOROLA_FALCON 0x4802
18999 +#define PCI_DEVICE_ID_MOTOROLA_HAWK 0x4803
19000 +#define PCI_DEVICE_ID_MOTOROLA_CPX8216 0x4806
19001 +#define PCI_DEVICE_ID_MOTOROLA_HARRIER 0x480b
19002 +#define PCI_DEVICE_ID_MOTOROLA_MPC5200 0x5803
19004 +#define PCI_VENDOR_ID_PROMISE 0x105a
19005 +#define PCI_DEVICE_ID_PROMISE_20265 0x0d30
19006 +#define PCI_DEVICE_ID_PROMISE_20267 0x4d30
19007 +#define PCI_DEVICE_ID_PROMISE_20246 0x4d33
19008 +#define PCI_DEVICE_ID_PROMISE_20262 0x4d38
19009 +#define PCI_DEVICE_ID_PROMISE_20263 0x0D38
19010 +#define PCI_DEVICE_ID_PROMISE_20268 0x4d68
19011 +#define PCI_DEVICE_ID_PROMISE_20268R 0x6268
19012 +#define PCI_DEVICE_ID_PROMISE_20269 0x4d69
19013 +#define PCI_DEVICE_ID_PROMISE_20270 0x6268
19014 +#define PCI_DEVICE_ID_PROMISE_20271 0x6269
19015 +#define PCI_DEVICE_ID_PROMISE_20275 0x1275
19016 +#define PCI_DEVICE_ID_PROMISE_20276 0x5275
19017 +#define PCI_DEVICE_ID_PROMISE_20277 0x7275
19018 +#define PCI_DEVICE_ID_PROMISE_5300 0x5300
19020 +#define PCI_VENDOR_ID_N9 0x105d
19021 +#define PCI_DEVICE_ID_N9_I128 0x2309
19022 +#define PCI_DEVICE_ID_N9_I128_2 0x2339
19023 +#define PCI_DEVICE_ID_N9_I128_T2R 0x493d
19025 +#define PCI_VENDOR_ID_UMC 0x1060
19026 +#define PCI_DEVICE_ID_UMC_UM8673F 0x0101
19027 +#define PCI_DEVICE_ID_UMC_UM8891A 0x0891
19028 +#define PCI_DEVICE_ID_UMC_UM8886BF 0x673a
19029 +#define PCI_DEVICE_ID_UMC_UM8886A 0x886a
19030 +#define PCI_DEVICE_ID_UMC_UM8881F 0x8881
19031 +#define PCI_DEVICE_ID_UMC_UM8886F 0x8886
19032 +#define PCI_DEVICE_ID_UMC_UM9017F 0x9017
19033 +#define PCI_DEVICE_ID_UMC_UM8886N 0xe886
19034 +#define PCI_DEVICE_ID_UMC_UM8891N 0xe891
19036 +#define PCI_VENDOR_ID_X 0x1061
19037 +#define PCI_DEVICE_ID_X_AGX016 0x0001
19039 +#define PCI_VENDOR_ID_MYLEX 0x1069
19040 +#define PCI_DEVICE_ID_MYLEX_DAC960_P 0x0001
19041 +#define PCI_DEVICE_ID_MYLEX_DAC960_PD 0x0002
19042 +#define PCI_DEVICE_ID_MYLEX_DAC960_PG 0x0010
19043 +#define PCI_DEVICE_ID_MYLEX_DAC960_LA 0x0020
19044 +#define PCI_DEVICE_ID_MYLEX_DAC960_LP 0x0050
19045 +#define PCI_DEVICE_ID_MYLEX_DAC960_BA 0xBA56
19046 +#define PCI_DEVICE_ID_MYLEX_DAC960_GEM 0xB166
19048 +#define PCI_VENDOR_ID_PICOP 0x1066
19049 +#define PCI_DEVICE_ID_PICOP_PT86C52X 0x0001
19050 +#define PCI_DEVICE_ID_PICOP_PT80C524 0x8002
19052 +#define PCI_VENDOR_ID_APPLE 0x106b
19053 +#define PCI_DEVICE_ID_APPLE_BANDIT 0x0001
19054 +#define PCI_DEVICE_ID_APPLE_GC 0x0002
19055 +#define PCI_DEVICE_ID_APPLE_HYDRA 0x000e
19056 +#define PCI_DEVICE_ID_APPLE_UNI_N_FW 0x0018
19057 +#define PCI_DEVICE_ID_APPLE_KL_USB 0x0019
19058 +#define PCI_DEVICE_ID_APPLE_UNI_N_AGP 0x0020
19059 +#define PCI_DEVICE_ID_APPLE_UNI_N_GMAC 0x0021
19060 +#define PCI_DEVICE_ID_APPLE_KEYLARGO 0x0022
19061 +#define PCI_DEVICE_ID_APPLE_UNI_N_GMACP 0x0024
19062 +#define PCI_DEVICE_ID_APPLE_KEYLARGO_P 0x0025
19063 +#define PCI_DEVICE_ID_APPLE_KL_USB_P 0x0026
19064 +#define PCI_DEVICE_ID_APPLE_UNI_N_AGP_P 0x0027
19065 +#define PCI_DEVICE_ID_APPLE_UNI_N_AGP15 0x002d
19066 +#define PCI_DEVICE_ID_APPLE_UNI_N_PCI15 0x002e
19067 +#define PCI_DEVICE_ID_APPLE_UNI_N_FW2 0x0030
19068 +#define PCI_DEVICE_ID_APPLE_UNI_N_GMAC2 0x0032
19069 +#define PCI_DEVIEC_ID_APPLE_UNI_N_ATA 0x0033
19070 +#define PCI_DEVICE_ID_APPLE_UNI_N_AGP2 0x0034
19071 +#define PCI_DEVICE_ID_APPLE_IPID_ATA100 0x003b
19072 +#define PCI_DEVICE_ID_APPLE_KEYLARGO_I 0x003e
19073 +#define PCI_DEVICE_ID_APPLE_K2_ATA100 0x0043
19074 +#define PCI_DEVICE_ID_APPLE_U3_AGP 0x004b
19075 +#define PCI_DEVICE_ID_APPLE_K2_GMAC 0x004c
19076 +#define PCI_DEVICE_ID_APPLE_SH_ATA 0x0050
19077 +#define PCI_DEVICE_ID_APPLE_SH_SUNGEM 0x0051
19078 +#define PCI_DEVICE_ID_APPLE_SH_FW 0x0052
19079 +#define PCI_DEVICE_ID_APPLE_U3L_AGP 0x0058
19080 +#define PCI_DEVICE_ID_APPLE_U3H_AGP 0x0059
19081 +#define PCI_DEVICE_ID_APPLE_TIGON3 0x1645
19083 +#define PCI_VENDOR_ID_YAMAHA 0x1073
19084 +#define PCI_DEVICE_ID_YAMAHA_724 0x0004
19085 +#define PCI_DEVICE_ID_YAMAHA_724F 0x000d
19086 +#define PCI_DEVICE_ID_YAMAHA_740 0x000a
19087 +#define PCI_DEVICE_ID_YAMAHA_740C 0x000c
19088 +#define PCI_DEVICE_ID_YAMAHA_744 0x0010
19089 +#define PCI_DEVICE_ID_YAMAHA_754 0x0012
19091 +#define PCI_VENDOR_ID_NEXGEN 0x1074
19092 +#define PCI_DEVICE_ID_NEXGEN_82C501 0x4e78
19094 +#define PCI_VENDOR_ID_QLOGIC 0x1077
19095 +#define PCI_DEVICE_ID_QLOGIC_ISP1020 0x1020
19096 +#define PCI_DEVICE_ID_QLOGIC_ISP1022 0x1022
19097 +#define PCI_DEVICE_ID_QLOGIC_ISP2100 0x2100
19098 +#define PCI_DEVICE_ID_QLOGIC_ISP2200 0x2200
19100 +#define PCI_VENDOR_ID_CYRIX 0x1078
19101 +#define PCI_DEVICE_ID_CYRIX_5510 0x0000
19102 +#define PCI_DEVICE_ID_CYRIX_PCI_MASTER 0x0001
19103 +#define PCI_DEVICE_ID_CYRIX_5520 0x0002
19104 +#define PCI_DEVICE_ID_CYRIX_5530_LEGACY 0x0100
19105 +#define PCI_DEVICE_ID_CYRIX_5530_SMI 0x0101
19106 +#define PCI_DEVICE_ID_CYRIX_5530_IDE 0x0102
19107 +#define PCI_DEVICE_ID_CYRIX_5530_AUDIO 0x0103
19108 +#define PCI_DEVICE_ID_CYRIX_5530_VIDEO 0x0104
19110 +#define PCI_VENDOR_ID_LEADTEK 0x107d
19111 +#define PCI_DEVICE_ID_LEADTEK_805 0x0000
19113 +#define PCI_VENDOR_ID_INTERPHASE 0x107e
19114 +#define PCI_DEVICE_ID_INTERPHASE_5526 0x0004
19115 +#define PCI_DEVICE_ID_INTERPHASE_55x6 0x0005
19116 +#define PCI_DEVICE_ID_INTERPHASE_5575 0x0008
19118 +#define PCI_VENDOR_ID_CONTAQ 0x1080
19119 +#define PCI_DEVICE_ID_CONTAQ_82C599 0x0600
19120 +#define PCI_DEVICE_ID_CONTAQ_82C693 0xc693
19122 +#define PCI_VENDOR_ID_FOREX 0x1083
19124 +#define PCI_VENDOR_ID_OLICOM 0x108d
19125 +#define PCI_DEVICE_ID_OLICOM_OC3136 0x0001
19126 +#define PCI_DEVICE_ID_OLICOM_OC2315 0x0011
19127 +#define PCI_DEVICE_ID_OLICOM_OC2325 0x0012
19128 +#define PCI_DEVICE_ID_OLICOM_OC2183 0x0013
19129 +#define PCI_DEVICE_ID_OLICOM_OC2326 0x0014
19130 +#define PCI_DEVICE_ID_OLICOM_OC6151 0x0021
19132 +#define PCI_VENDOR_ID_SUN 0x108e
19133 +#define PCI_DEVICE_ID_SUN_EBUS 0x1000
19134 +#define PCI_DEVICE_ID_SUN_HAPPYMEAL 0x1001
19135 +#define PCI_DEVICE_ID_SUN_RIO_EBUS 0x1100
19136 +#define PCI_DEVICE_ID_SUN_RIO_GEM 0x1101
19137 +#define PCI_DEVICE_ID_SUN_RIO_1394 0x1102
19138 +#define PCI_DEVICE_ID_SUN_RIO_USB 0x1103
19139 +#define PCI_DEVICE_ID_SUN_GEM 0x2bad
19140 +#define PCI_DEVICE_ID_SUN_SIMBA 0x5000
19141 +#define PCI_DEVICE_ID_SUN_PBM 0x8000
19142 +#define PCI_DEVICE_ID_SUN_SCHIZO 0x8001
19143 +#define PCI_DEVICE_ID_SUN_SABRE 0xa000
19144 +#define PCI_DEVICE_ID_SUN_HUMMINGBIRD 0xa001
19145 +#define PCI_DEVICE_ID_SUN_TOMATILLO 0xa801
19147 +#define PCI_VENDOR_ID_CMD 0x1095
19148 +#define PCI_DEVICE_ID_CMD_640 0x0640
19149 +#define PCI_DEVICE_ID_CMD_643 0x0643
19150 +#define PCI_DEVICE_ID_CMD_646 0x0646
19151 +#define PCI_DEVICE_ID_CMD_647 0x0647
19152 +#define PCI_DEVICE_ID_CMD_648 0x0648
19153 +#define PCI_DEVICE_ID_CMD_649 0x0649
19154 +#define PCI_DEVICE_ID_CMD_670 0x0670
19155 +#define PCI_DEVICE_ID_CMD_680 0x0680
19157 +#define PCI_DEVICE_ID_SII_680 0x0680
19158 +#define PCI_DEVICE_ID_SII_3112 0x3112
19159 +#define PCI_DEVICE_ID_SII_1210SA 0x0240
19161 +#define PCI_VENDOR_ID_VISION 0x1098
19162 +#define PCI_DEVICE_ID_VISION_QD8500 0x0001
19163 +#define PCI_DEVICE_ID_VISION_QD8580 0x0002
19165 +#define PCI_VENDOR_ID_BROOKTREE 0x109e
19166 +#define PCI_DEVICE_ID_BROOKTREE_848 0x0350
19167 +#define PCI_DEVICE_ID_BROOKTREE_849A 0x0351
19168 +#define PCI_DEVICE_ID_BROOKTREE_878_1 0x036e
19169 +#define PCI_DEVICE_ID_BROOKTREE_878 0x0878
19170 +#define PCI_DEVICE_ID_BROOKTREE_8474 0x8474
19172 +#define PCI_VENDOR_ID_SIERRA 0x10a8
19173 +#define PCI_DEVICE_ID_SIERRA_STB 0x0000
19175 +#define PCI_VENDOR_ID_SGI 0x10a9
19176 +#define PCI_DEVICE_ID_SGI_IOC3 0x0003
19177 +#define PCI_DEVICE_ID_SGI_IOC4 0x100a
19178 +#define PCI_VENDOR_ID_SGI_LITHIUM 0x1002
19180 +#define PCI_VENDOR_ID_ACC 0x10aa
19181 +#define PCI_DEVICE_ID_ACC_2056 0x0000
19183 +#define PCI_VENDOR_ID_WINBOND 0x10ad
19184 +#define PCI_DEVICE_ID_WINBOND_83769 0x0001
19185 +#define PCI_DEVICE_ID_WINBOND_82C105 0x0105
19186 +#define PCI_DEVICE_ID_WINBOND_83C553 0x0565
19188 +#define PCI_VENDOR_ID_DATABOOK 0x10b3
19189 +#define PCI_DEVICE_ID_DATABOOK_87144 0xb106
19191 +#define PCI_VENDOR_ID_PLX 0x10b5
19192 +#define PCI_DEVICE_ID_PLX_R685 0x1030
19193 +#define PCI_DEVICE_ID_PLX_ROMULUS 0x106a
19194 +#define PCI_DEVICE_ID_PLX_SPCOM800 0x1076
19195 +#define PCI_DEVICE_ID_PLX_1077 0x1077
19196 +#define PCI_DEVICE_ID_PLX_SPCOM200 0x1103
19197 +#define PCI_DEVICE_ID_PLX_DJINN_ITOO 0x1151
19198 +#define PCI_DEVICE_ID_PLX_R753 0x1152
19199 +#define PCI_DEVICE_ID_PLX_9030 0x9030
19200 +#define PCI_DEVICE_ID_PLX_9050 0x9050
19201 +#define PCI_DEVICE_ID_PLX_9060 0x9060
19202 +#define PCI_DEVICE_ID_PLX_9060ES 0x906E
19203 +#define PCI_DEVICE_ID_PLX_9060SD 0x906D
19204 +#define PCI_DEVICE_ID_PLX_9080 0x9080
19205 +#define PCI_DEVICE_ID_PLX_GTEK_SERIAL2 0xa001
19207 +#define PCI_VENDOR_ID_MADGE 0x10b6
19208 +#define PCI_DEVICE_ID_MADGE_MK2 0x0002
19209 +#define PCI_DEVICE_ID_MADGE_C155S 0x1001
19211 +#define PCI_VENDOR_ID_3COM 0x10b7
19212 +#define PCI_DEVICE_ID_3COM_3C985 0x0001
19213 +#define PCI_DEVICE_ID_3COM_3C940 0x1700
19214 +#define PCI_DEVICE_ID_3COM_3C339 0x3390
19215 +#define PCI_DEVICE_ID_3COM_3C359 0x3590
19216 +#define PCI_DEVICE_ID_3COM_3C590 0x5900
19217 +#define PCI_DEVICE_ID_3COM_3C595TX 0x5950
19218 +#define PCI_DEVICE_ID_3COM_3C595T4 0x5951
19219 +#define PCI_DEVICE_ID_3COM_3C595MII 0x5952
19220 +#define PCI_DEVICE_ID_3COM_3C940B 0x80eb
19221 +#define PCI_DEVICE_ID_3COM_3C900TPO 0x9000
19222 +#define PCI_DEVICE_ID_3COM_3C900COMBO 0x9001
19223 +#define PCI_DEVICE_ID_3COM_3C905TX 0x9050
19224 +#define PCI_DEVICE_ID_3COM_3C905T4 0x9051
19225 +#define PCI_DEVICE_ID_3COM_3C905B_TX 0x9055
19226 +#define PCI_DEVICE_ID_3COM_3CR990 0x9900
19227 +#define PCI_DEVICE_ID_3COM_3CR990_TX_95 0x9902
19228 +#define PCI_DEVICE_ID_3COM_3CR990_TX_97 0x9903
19229 +#define PCI_DEVICE_ID_3COM_3CR990B 0x9904
19230 +#define PCI_DEVICE_ID_3COM_3CR990_FX 0x9905
19231 +#define PCI_DEVICE_ID_3COM_3CR990SVR95 0x9908
19232 +#define PCI_DEVICE_ID_3COM_3CR990SVR97 0x9909
19233 +#define PCI_DEVICE_ID_3COM_3CR990SVR 0x990a
19235 +#define PCI_VENDOR_ID_SMC 0x10b8
19236 +#define PCI_DEVICE_ID_SMC_EPIC100 0x0005
19238 +#define PCI_VENDOR_ID_AL 0x10b9
19239 +#define PCI_DEVICE_ID_AL_M1445 0x1445
19240 +#define PCI_DEVICE_ID_AL_M1449 0x1449
19241 +#define PCI_DEVICE_ID_AL_M1451 0x1451
19242 +#define PCI_DEVICE_ID_AL_M1461 0x1461
19243 +#define PCI_DEVICE_ID_AL_M1489 0x1489
19244 +#define PCI_DEVICE_ID_AL_M1511 0x1511
19245 +#define PCI_DEVICE_ID_AL_M1513 0x1513
19246 +#define PCI_DEVICE_ID_AL_M1521 0x1521
19247 +#define PCI_DEVICE_ID_AL_M1523 0x1523
19248 +#define PCI_DEVICE_ID_AL_M1531 0x1531
19249 +#define PCI_DEVICE_ID_AL_M1533 0x1533
19250 +#define PCI_DEVICE_ID_AL_M1535 0x1535
19251 +#define PCI_DEVICE_ID_AL_M1541 0x1541
19252 +#define PCI_DEVICE_ID_AL_M1543 0x1543
19253 +#define PCI_DEVICE_ID_AL_M1563 0x1563
19254 +#define PCI_DEVICE_ID_AL_M1621 0x1621
19255 +#define PCI_DEVICE_ID_AL_M1631 0x1631
19256 +#define PCI_DEVICE_ID_AL_M1632 0x1632
19257 +#define PCI_DEVICE_ID_AL_M1641 0x1641
19258 +#define PCI_DEVICE_ID_AL_M1644 0x1644
19259 +#define PCI_DEVICE_ID_AL_M1647 0x1647
19260 +#define PCI_DEVICE_ID_AL_M1651 0x1651
19261 +#define PCI_DEVICE_ID_AL_M1671 0x1671
19262 +#define PCI_DEVICE_ID_AL_M1681 0x1681
19263 +#define PCI_DEVICE_ID_AL_M1683 0x1683
19264 +#define PCI_DEVICE_ID_AL_M1689 0x1689
19265 +#define PCI_DEVICE_ID_AL_M3307 0x3307
19266 +#define PCI_DEVICE_ID_AL_M4803 0x5215
19267 +#define PCI_DEVICE_ID_AL_M5219 0x5219
19268 +#define PCI_DEVICE_ID_AL_M5228 0x5228
19269 +#define PCI_DEVICE_ID_AL_M5229 0x5229
19270 +#define PCI_DEVICE_ID_AL_M5237 0x5237
19271 +#define PCI_DEVICE_ID_AL_M5243 0x5243
19272 +#define PCI_DEVICE_ID_AL_M5451 0x5451
19273 +#define PCI_DEVICE_ID_AL_M7101 0x7101
19275 +#define PCI_VENDOR_ID_MITSUBISHI 0x10ba
19277 +#define PCI_VENDOR_ID_SURECOM 0x10bd
19278 +#define PCI_DEVICE_ID_SURECOM_NE34 0x0e34
19280 +#define PCI_VENDOR_ID_NEOMAGIC 0x10c8
19281 +#define PCI_DEVICE_ID_NEOMAGIC_MAGICGRAPH_NM2070 0x0001
19282 +#define PCI_DEVICE_ID_NEOMAGIC_MAGICGRAPH_128V 0x0002
19283 +#define PCI_DEVICE_ID_NEOMAGIC_MAGICGRAPH_128ZV 0x0003
19284 +#define PCI_DEVICE_ID_NEOMAGIC_MAGICGRAPH_NM2160 0x0004
19285 +#define PCI_DEVICE_ID_NEOMAGIC_MAGICMEDIA_256AV 0x0005
19286 +#define PCI_DEVICE_ID_NEOMAGIC_MAGICGRAPH_128ZVPLUS 0x0083
19288 +#define PCI_VENDOR_ID_ASP 0x10cd
19289 +#define PCI_DEVICE_ID_ASP_ABP940 0x1200
19290 +#define PCI_DEVICE_ID_ASP_ABP940U 0x1300
19291 +#define PCI_DEVICE_ID_ASP_ABP940UW 0x2300
19293 +#define PCI_VENDOR_ID_MACRONIX 0x10d9
19294 +#define PCI_DEVICE_ID_MACRONIX_MX98713 0x0512
19295 +#define PCI_DEVICE_ID_MACRONIX_MX987x5 0x0531
19297 +#define PCI_VENDOR_ID_TCONRAD 0x10da
19298 +#define PCI_DEVICE_ID_TCONRAD_TOKENRING 0x0508
19300 +#define PCI_VENDOR_ID_CERN 0x10dc
19301 +#define PCI_DEVICE_ID_CERN_SPSB_PMC 0x0001
19302 +#define PCI_DEVICE_ID_CERN_SPSB_PCI 0x0002
19303 +#define PCI_DEVICE_ID_CERN_HIPPI_DST 0x0021
19304 +#define PCI_DEVICE_ID_CERN_HIPPI_SRC 0x0022
19306 +#define PCI_VENDOR_ID_NVIDIA 0x10de
19307 +#define PCI_DEVICE_ID_NVIDIA_TNT 0x0020
19308 +#define PCI_DEVICE_ID_NVIDIA_TNT2 0x0028
19309 +#define PCI_DEVICE_ID_NVIDIA_UTNT2 0x0029
19310 +#define PCI_DEVICE_ID_NVIDIA_TNT_UNKNOWN 0x002a
19311 +#define PCI_DEVICE_ID_NVIDIA_VTNT2 0x002C
19312 +#define PCI_DEVICE_ID_NVIDIA_UVTNT2 0x002D
19313 +#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_IDE 0x0035
19314 +#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_SATA 0x0036
19315 +#define PCI_DEVICE_ID_NVIDIA_NVENET_10 0x0037
19316 +#define PCI_DEVICE_ID_NVIDIA_NVENET_11 0x0038
19317 +#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_SATA2 0x003e
19318 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE_6800_ULTRA 0x0040
19319 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE_6800 0x0041
19320 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE_6800_LE 0x0042
19321 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE_6800_GT 0x0045
19322 +#define PCI_DEVICE_ID_NVIDIA_QUADRO_FX_4000 0x004E
19323 +#define PCI_DEVICE_ID_NVIDIA_NFORCE4_SMBUS 0x0052
19324 +#define PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_IDE 0x0053
19325 +#define PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_SATA 0x0054
19326 +#define PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_SATA2 0x0055
19327 +#define PCI_DEVICE_ID_NVIDIA_NVENET_8 0x0056
19328 +#define PCI_DEVICE_ID_NVIDIA_NVENET_9 0x0057
19329 +#define PCI_DEVICE_ID_NVIDIA_CK804_AUDIO 0x0059
19330 +#define PCI_DEVICE_ID_NVIDIA_NFORCE2_SMBUS 0x0064
19331 +#define PCI_DEVICE_ID_NVIDIA_NFORCE2_IDE 0x0065
19332 +#define PCI_DEVICE_ID_NVIDIA_NVENET_2 0x0066
19333 +#define PCI_DEVICE_ID_NVIDIA_MCP2_AUDIO 0x006a
19334 +#define PCI_DEVICE_ID_NVIDIA_NFORCE2S_SMBUS 0x0084
19335 +#define PCI_DEVICE_ID_NVIDIA_NFORCE2S_IDE 0x0085
19336 +#define PCI_DEVICE_ID_NVIDIA_NVENET_4 0x0086
19337 +#define PCI_DEVICE_ID_NVIDIA_NVENET_5 0x008c
19338 +#define PCI_DEVICE_ID_NVIDIA_NFORCE2S_SATA 0x008e
19339 +#define PCI_DEVICE_ID_NVIDIA_ITNT2 0x00A0
19340 +#define PCI_DEVICE_ID_GEFORCE_6800A 0x00c1
19341 +#define PCI_DEVICE_ID_GEFORCE_6800A_LE 0x00c2
19342 +#define PCI_DEVICE_ID_GEFORCE_GO_6800 0x00c8
19343 +#define PCI_DEVICE_ID_GEFORCE_GO_6800_ULTRA 0x00c9
19344 +#define PCI_DEVICE_ID_QUADRO_FX_GO1400 0x00cc
19345 +#define PCI_DEVICE_ID_QUADRO_FX_1400 0x00ce
19346 +#define PCI_DEVICE_ID_NVIDIA_NFORCE3 0x00d1
19347 +#define PCI_DEVICE_ID_NVIDIA_MCP3_AUDIO 0x00da
19348 +#define PCI_DEVICE_ID_NVIDIA_NFORCE3_SMBUS 0x00d4
19349 +#define PCI_DEVICE_ID_NVIDIA_NFORCE3_IDE 0x00d5
19350 +#define PCI_DEVICE_ID_NVIDIA_NVENET_3 0x00d6
19351 +#define PCI_DEVICE_ID_NVIDIA_MCP3_AUDIO 0x00da
19352 +#define PCI_DEVICE_ID_NVIDIA_NVENET_7 0x00df
19353 +#define PCI_DEVICE_ID_NVIDIA_NFORCE3S 0x00e1
19354 +#define PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA 0x00e3
19355 +#define PCI_DEVICE_ID_NVIDIA_NFORCE3S_SMBUS 0x00e4
19356 +#define PCI_DEVICE_ID_NVIDIA_NFORCE3S_IDE 0x00e5
19357 +#define PCI_DEVICE_ID_NVIDIA_NVENET_6 0x00e6
19358 +#define PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA2 0x00ee
19359 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE_SDR 0x0100
19360 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE_DDR 0x0101
19361 +#define PCI_DEVICE_ID_NVIDIA_QUADRO 0x0103
19362 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE2_MX 0x0110
19363 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE2_MX2 0x0111
19364 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE2_GO 0x0112
19365 +#define PCI_DEVICE_ID_NVIDIA_QUADRO2_MXR 0x0113
19366 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE_6600_GT 0x0140
19367 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE_6600 0x0141
19368 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE_6610_XL 0x0145
19369 +#define PCI_DEVICE_ID_NVIDIA_QUADRO_FX_540 0x014E
19370 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE_6200 0x014F
19371 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE2_GTS 0x0150
19372 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE2_GTS2 0x0151
19373 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE2_ULTRA 0x0152
19374 +#define PCI_DEVICE_ID_NVIDIA_QUADRO2_PRO 0x0153
19375 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE_6200_TURBOCACHE 0x0161
19376 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE_GO_6200 0x0164
19377 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE_GO_6250 0x0166
19378 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE_GO_6200_1 0x0167
19379 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE_GO_6250_1 0x0168
19380 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_MX_460 0x0170
19381 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_MX_440 0x0171
19382 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_MX_420 0x0172
19383 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_MX_440_SE 0x0173
19384 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_440_GO 0x0174
19385 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_420_GO 0x0175
19386 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_420_GO_M32 0x0176
19387 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_460_GO 0x0177
19388 +#define PCI_DEVICE_ID_NVIDIA_QUADRO4_500XGL 0x0178
19389 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_440_GO_M64 0x0179
19390 +#define PCI_DEVICE_ID_NVIDIA_QUADRO4_200 0x017A
19391 +#define PCI_DEVICE_ID_NVIDIA_QUADRO4_550XGL 0x017B
19392 +#define PCI_DEVICE_ID_NVIDIA_QUADRO4_500_GOGL 0x017C
19393 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_410_GO_M16 0x017D
19394 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_MX_440_8X 0x0181
19395 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_MX_440SE_8X 0x0182
19396 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_MX_420_8X 0x0183
19397 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_448_GO 0x0186
19398 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_488_GO 0x0187
19399 +#define PCI_DEVICE_ID_NVIDIA_QUADRO4_580_XGL 0x0188
19400 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_MX_MAC 0x0189
19401 +#define PCI_DEVICE_ID_NVIDIA_QUADRO4_280_NVS 0x018A
19402 +#define PCI_DEVICE_ID_NVIDIA_QUADRO4_380_XGL 0x018B
19403 +#define PCI_DEVICE_ID_NVIDIA_IGEFORCE2 0x01a0
19404 +#define PCI_DEVICE_ID_NVIDIA_NFORCE 0x01a4
19405 +#define PCI_DEVICE_ID_NVIDIA_MCP1_AUDIO 0x01b1
19406 +#define PCI_DEVICE_ID_NVIDIA_NFORCE_SMBUS 0x01b4
19407 +#define PCI_DEVICE_ID_NVIDIA_NFORCE_IDE 0x01bc
19408 +#define PCI_DEVICE_ID_NVIDIA_NVENET_1 0x01c3
19409 +#define PCI_DEVICE_ID_NVIDIA_NFORCE2 0x01e0
19410 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE3 0x0200
19411 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE3_1 0x0201
19412 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE3_2 0x0202
19413 +#define PCI_DEVICE_ID_NVIDIA_QUADRO_DDC 0x0203
19414 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE_6800B 0x0211
19415 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE_6800B_LE 0x0212
19416 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE_6800B_GT 0x0215
19417 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4600 0x0250
19418 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4400 0x0251
19419 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4200 0x0253
19420 +#define PCI_DEVICE_ID_NVIDIA_QUADRO4_900XGL 0x0258
19421 +#define PCI_DEVICE_ID_NVIDIA_QUADRO4_750XGL 0x0259
19422 +#define PCI_DEVICE_ID_NVIDIA_QUADRO4_700XGL 0x025B
19423 +#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_IDE 0x0265
19424 +#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA 0x0266
19425 +#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA2 0x0267
19426 +#define PCI_DEVICE_ID_NVIDIA_NVENET_12 0x0268
19427 +#define PCI_DEVICE_ID_NVIDIA_NVENET_13 0x0269
19428 +#define PCI_DEVICE_ID_NVIDIA_MCP51_AUDIO 0x026B
19429 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4800 0x0280
19430 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4800_8X 0x0281
19431 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4800SE 0x0282
19432 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_4200_GO 0x0286
19433 +#define PCI_DEVICE_ID_NVIDIA_QUADRO4_980_XGL 0x0288
19434 +#define PCI_DEVICE_ID_NVIDIA_QUADRO4_780_XGL 0x0289
19435 +#define PCI_DEVICE_ID_NVIDIA_QUADRO4_700_GOGL 0x028C
19436 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_5800_ULTRA 0x0301
19437 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_5800 0x0302
19438 +#define PCI_DEVICE_ID_NVIDIA_QUADRO_FX_2000 0x0308
19439 +#define PCI_DEVICE_ID_NVIDIA_QUADRO_FX_1000 0x0309
19440 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_5600_ULTRA 0x0311
19441 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_5600 0x0312
19442 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_5600SE 0x0314
19443 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_GO5600 0x031A
19444 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_GO5650 0x031B
19445 +#define PCI_DEVICE_ID_NVIDIA_QUADRO_FX_GO700 0x031C
19446 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_5200 0x0320
19447 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_5200_ULTRA 0x0321
19448 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_5200_1 0x0322
19449 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_5200SE 0x0323
19450 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_GO5200 0x0324
19451 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_GO5250 0x0325
19452 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_5500 0x0326
19453 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_5100 0x0327
19454 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_GO5250_32 0x0328
19455 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_GO_5200 0x0329
19456 +#define PCI_DEVICE_ID_NVIDIA_QUADRO_NVS_280_PCI 0x032A
19457 +#define PCI_DEVICE_ID_NVIDIA_QUADRO_FX_500 0x032B
19458 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_GO5300 0x032C
19459 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_GO5100 0x032D
19460 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_5900_ULTRA 0x0330
19461 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_5900 0x0331
19462 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_5900XT 0x0332
19463 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_5950_ULTRA 0x0333
19464 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_5900ZT 0x0334
19465 +#define PCI_DEVICE_ID_NVIDIA_QUADRO_FX_3000 0x0338
19466 +#define PCI_DEVICE_ID_NVIDIA_QUADRO_FX_700 0x033F
19467 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_5700_ULTRA 0x0341
19468 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_5700 0x0342
19469 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_5700LE 0x0343
19470 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_5700VE 0x0344
19471 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_GO5700_1 0x0347
19472 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_GO5700_2 0x0348
19473 +#define PCI_DEVICE_ID_NVIDIA_QUADRO_FX_GO1000 0x034C
19474 +#define PCI_DEVICE_ID_NVIDIA_QUADRO_FX_1100 0x034E
19476 +#define PCI_VENDOR_ID_IMS 0x10e0
19477 +#define PCI_DEVICE_ID_IMS_8849 0x8849
19478 +#define PCI_DEVICE_ID_IMS_TT128 0x9128
19479 +#define PCI_DEVICE_ID_IMS_TT3D 0x9135
19481 +#define PCI_VENDOR_ID_TEKRAM2 0x10e1
19482 +#define PCI_DEVICE_ID_TEKRAM2_690c 0x690c
19484 +#define PCI_VENDOR_ID_TUNDRA 0x10e3
19485 +#define PCI_DEVICE_ID_TUNDRA_CA91C042 0x0000
19487 +#define PCI_VENDOR_ID_AMCC 0x10e8
19488 +#define PCI_DEVICE_ID_AMCC_MYRINET 0x8043
19489 +#define PCI_DEVICE_ID_AMCC_PARASTATION 0x8062
19490 +#define PCI_DEVICE_ID_AMCC_S5933 0x807d
19491 +#define PCI_DEVICE_ID_AMCC_S5933_HEPC3 0x809c
19493 +#define PCI_VENDOR_ID_INTERG 0x10ea
19494 +#define PCI_DEVICE_ID_INTERG_1680 0x1680
19495 +#define PCI_DEVICE_ID_INTERG_1682 0x1682
19496 +#define PCI_DEVICE_ID_INTERG_2000 0x2000
19497 +#define PCI_DEVICE_ID_INTERG_2010 0x2010
19498 +#define PCI_DEVICE_ID_INTERG_5000 0x5000
19499 +#define PCI_DEVICE_ID_INTERG_5050 0x5050
19501 +#define PCI_VENDOR_ID_REALTEK 0x10ec
19502 +#define PCI_DEVICE_ID_REALTEK_8029 0x8029
19503 +#define PCI_DEVICE_ID_REALTEK_8129 0x8129
19504 +#define PCI_DEVICE_ID_REALTEK_8139 0x8139
19505 +#define PCI_DEVICE_ID_REALTEK_8169 0x8169
19507 +#define PCI_VENDOR_ID_XILINX 0x10ee
19508 +#define PCI_DEVICE_ID_TURBOPAM 0x4020
19510 +#define PCI_VENDOR_ID_TRUEVISION 0x10fa
19511 +#define PCI_DEVICE_ID_TRUEVISION_T1000 0x000c
19513 +#define PCI_VENDOR_ID_INIT 0x1101
19514 +#define PCI_DEVICE_ID_INIT_320P 0x9100
19515 +#define PCI_DEVICE_ID_INIT_360P 0x9500
19517 +#define PCI_VENDOR_ID_CREATIVE 0x1102 // duplicate: ECTIVA
19518 +#define PCI_DEVICE_ID_CREATIVE_EMU10K1 0x0002
19520 +#define PCI_VENDOR_ID_ECTIVA 0x1102 // duplicate: CREATIVE
19521 +#define PCI_DEVICE_ID_ECTIVA_EV1938 0x8938
19523 +#define PCI_VENDOR_ID_TTI 0x1103
19524 +#define PCI_DEVICE_ID_TTI_HPT343 0x0003
19525 +#define PCI_DEVICE_ID_TTI_HPT366 0x0004
19526 +#define PCI_DEVICE_ID_TTI_HPT372 0x0005
19527 +#define PCI_DEVICE_ID_TTI_HPT302 0x0006
19528 +#define PCI_DEVICE_ID_TTI_HPT371 0x0007
19529 +#define PCI_DEVICE_ID_TTI_HPT374 0x0008
19530 +#define PCI_DEVICE_ID_TTI_HPT372N 0x0009 // apparently a 372N variant?
19532 +#define PCI_VENDOR_ID_VIA 0x1106
19533 +#define PCI_DEVICE_ID_VIA_8763_0 0x0198
19534 +#define PCI_DEVICE_ID_VIA_8380_0 0x0204
19535 +#define PCI_DEVICE_ID_VIA_3238_0 0x0238
19536 +#define PCI_DEVICE_ID_VIA_PT880 0x0258
19537 +#define PCI_DEVICE_ID_VIA_PX8X0_0 0x0259
19538 +#define PCI_DEVICE_ID_VIA_3269_0 0x0269
19539 +#define PCI_DEVICE_ID_VIA_K8T800PRO_0 0x0282
19540 +#define PCI_DEVICE_ID_VIA_8363_0 0x0305
19541 +#define PCI_DEVICE_ID_VIA_8371_0 0x0391
19542 +#define PCI_DEVICE_ID_VIA_8501_0 0x0501
19543 +#define PCI_DEVICE_ID_VIA_82C505 0x0505
19544 +#define PCI_DEVICE_ID_VIA_82C561 0x0561
19545 +#define PCI_DEVICE_ID_VIA_82C586_1 0x0571
19546 +#define PCI_DEVICE_ID_VIA_82C576 0x0576
19547 +#define PCI_DEVICE_ID_VIA_82C585 0x0585
19548 +#define PCI_DEVICE_ID_VIA_82C586_0 0x0586
19549 +#define PCI_DEVICE_ID_VIA_82C595 0x0595
19550 +#define PCI_DEVICE_ID_VIA_82C596 0x0596
19551 +#define PCI_DEVICE_ID_VIA_82C597_0 0x0597
19552 +#define PCI_DEVICE_ID_VIA_82C598_0 0x0598
19553 +#define PCI_DEVICE_ID_VIA_8601_0 0x0601
19554 +#define PCI_DEVICE_ID_VIA_8605_0 0x0605
19555 +#define PCI_DEVICE_ID_VIA_82C680 0x0680
19556 +#define PCI_DEVICE_ID_VIA_82C686 0x0686
19557 +#define PCI_DEVICE_ID_VIA_82C691_0 0x0691
19558 +#define PCI_DEVICE_ID_VIA_82C693 0x0693
19559 +#define PCI_DEVICE_ID_VIA_82C693_1 0x0698
19560 +#define PCI_DEVICE_ID_VIA_82C926 0x0926
19561 +#define PCI_DEVICE_ID_VIA_82C576_1 0x1571
19562 +#define PCI_DEVICE_ID_VIA_82C595_97 0x1595
19563 +#define PCI_DEVICE_ID_VIA_82C586_2 0x3038
19564 +#define PCI_DEVICE_ID_VIA_82C586_3 0x3040
19565 +#define PCI_DEVICE_ID_VIA_6305 0x3044
19566 +#define PCI_DEVICE_ID_VIA_82C596_3 0x3050
19567 +#define PCI_DEVICE_ID_VIA_82C596B_3 0x3051
19568 +#define PCI_DEVICE_ID_VIA_82C686_4 0x3057
19569 +#define PCI_DEVICE_ID_VIA_82C686_5 0x3058
19570 +#define PCI_DEVICE_ID_VIA_8233_5 0x3059
19571 +#define PCI_DEVICE_ID_VIA_8233_7 0x3065
19572 +#define PCI_DEVICE_ID_VIA_82C686_6 0x3068
19573 +#define PCI_DEVICE_ID_VIA_8233_0 0x3074
19574 +#define PCI_DEVICE_ID_VIA_8633_0 0x3091
19575 +#define PCI_DEVICE_ID_VIA_8367_0 0x3099
19576 +#define PCI_DEVICE_ID_VIA_8653_0 0x3101
19577 +#define PCI_DEVICE_ID_VIA_8622 0x3102
19578 +#define PCI_DEVICE_ID_VIA_8233C_0 0x3109
19579 +#define PCI_DEVICE_ID_VIA_8361 0x3112
19580 +#define PCI_DEVICE_ID_VIA_XM266 0x3116
19581 +#define PCI_DEVICE_ID_VIA_612X 0x3119
19582 +#define PCI_DEVICE_ID_VIA_862X_0 0x3123
19583 +#define PCI_DEVICE_ID_VIA_8753_0 0x3128
19584 +#define PCI_DEVICE_ID_VIA_8233A 0x3147
19585 +#define PCI_DEVICE_ID_VIA_8703_51_0 0x3148
19586 +#define PCI_DEVICE_ID_VIA_8237_SATA 0x3149
19587 +#define PCI_DEVICE_ID_VIA_XN266 0x3156
19588 +#define PCI_DEVICE_ID_VIA_8754C_0 0x3168
19589 +#define PCI_DEVICE_ID_VIA_8235 0x3177
19590 +#define PCI_DEVICE_ID_VIA_P4N333 0x3178
19591 +#define PCI_DEVICE_ID_VIA_8385_0 0x3188
19592 +#define PCI_DEVICE_ID_VIA_8377_0 0x3189
19593 +#define PCI_DEVICE_ID_VIA_8378_0 0x3205
19594 +#define PCI_DEVICE_ID_VIA_8783_0 0x3208
19595 +#define PCI_DEVICE_ID_VIA_P4M400 0x3209
19596 +#define PCI_DEVICE_ID_VIA_8237 0x3227
19597 +#define PCI_DEVICE_ID_VIA_3296_0 0x0296
19598 +#define PCI_DEVICE_ID_VIA_86C100A 0x6100
19599 +#define PCI_DEVICE_ID_VIA_8231 0x8231
19600 +#define PCI_DEVICE_ID_VIA_8231_4 0x8235
19601 +#define PCI_DEVICE_ID_VIA_8365_1 0x8305
19602 +#define PCI_DEVICE_ID_VIA_8371_1 0x8391
19603 +#define PCI_DEVICE_ID_VIA_8501_1 0x8501
19604 +#define PCI_DEVICE_ID_VIA_82C597_1 0x8597
19605 +#define PCI_DEVICE_ID_VIA_82C598_1 0x8598
19606 +#define PCI_DEVICE_ID_VIA_8601_1 0x8601
19607 +#define PCI_DEVICE_ID_VIA_8505_1 0x8605
19608 +#define PCI_DEVICE_ID_VIA_8633_1 0xB091
19609 +#define PCI_DEVICE_ID_VIA_8367_1 0xB099
19610 +#define PCI_DEVICE_ID_VIA_P4X266_1 0xB101
19611 +#define PCI_DEVICE_ID_VIA_8615_1 0xB103
19612 +#define PCI_DEVICE_ID_VIA_8361_1 0xB112
19613 +#define PCI_DEVICE_ID_VIA_8235_1 0xB168
19614 +#define PCI_DEVICE_ID_VIA_838X_1 0xB188
19615 +#define PCI_DEVICE_ID_VIA_83_87XX_1 0xB198
19617 +#define PCI_VENDOR_ID_SIEMENS 0x110A
19618 +#define PCI_DEVICE_ID_SIEMENS_DSCC4 0x2102
19620 +#define PCI_VENDOR_ID_SMC2 0x1113
19621 +#define PCI_DEVICE_ID_SMC2_1211TX 0x1211
19623 +#define PCI_VENDOR_ID_VORTEX 0x1119
19624 +#define PCI_DEVICE_ID_VORTEX_GDT60x0 0x0000
19625 +#define PCI_DEVICE_ID_VORTEX_GDT6000B 0x0001
19626 +#define PCI_DEVICE_ID_VORTEX_GDT6x10 0x0002
19627 +#define PCI_DEVICE_ID_VORTEX_GDT6x20 0x0003
19628 +#define PCI_DEVICE_ID_VORTEX_GDT6530 0x0004
19629 +#define PCI_DEVICE_ID_VORTEX_GDT6550 0x0005
19630 +#define PCI_DEVICE_ID_VORTEX_GDT6x17 0x0006
19631 +#define PCI_DEVICE_ID_VORTEX_GDT6x27 0x0007
19632 +#define PCI_DEVICE_ID_VORTEX_GDT6537 0x0008
19633 +#define PCI_DEVICE_ID_VORTEX_GDT6557 0x0009
19634 +#define PCI_DEVICE_ID_VORTEX_GDT6x15 0x000a
19635 +#define PCI_DEVICE_ID_VORTEX_GDT6x25 0x000b
19636 +#define PCI_DEVICE_ID_VORTEX_GDT6535 0x000c
19637 +#define PCI_DEVICE_ID_VORTEX_GDT6555 0x000d
19638 +#define PCI_DEVICE_ID_VORTEX_GDT6x17RP 0x0100
19639 +#define PCI_DEVICE_ID_VORTEX_GDT6x27RP 0x0101
19640 +#define PCI_DEVICE_ID_VORTEX_GDT6537RP 0x0102
19641 +#define PCI_DEVICE_ID_VORTEX_GDT6557RP 0x0103
19642 +#define PCI_DEVICE_ID_VORTEX_GDT6x11RP 0x0104
19643 +#define PCI_DEVICE_ID_VORTEX_GDT6x21RP 0x0105
19644 +#define PCI_DEVICE_ID_VORTEX_GDT6x17RP1 0x0110
19645 +#define PCI_DEVICE_ID_VORTEX_GDT6x27RP1 0x0111
19646 +#define PCI_DEVICE_ID_VORTEX_GDT6537RP1 0x0112
19647 +#define PCI_DEVICE_ID_VORTEX_GDT6557RP1 0x0113
19648 +#define PCI_DEVICE_ID_VORTEX_GDT6x11RP1 0x0114
19649 +#define PCI_DEVICE_ID_VORTEX_GDT6x21RP1 0x0115
19650 +#define PCI_DEVICE_ID_VORTEX_GDT6x17RP2 0x0120
19651 +#define PCI_DEVICE_ID_VORTEX_GDT6x27RP2 0x0121
19652 +#define PCI_DEVICE_ID_VORTEX_GDT6537RP2 0x0122
19653 +#define PCI_DEVICE_ID_VORTEX_GDT6557RP2 0x0123
19654 +#define PCI_DEVICE_ID_VORTEX_GDT6x11RP2 0x0124
19655 +#define PCI_DEVICE_ID_VORTEX_GDT6x21RP2 0x0125
19657 +#define PCI_VENDOR_ID_EF 0x111a
19658 +#define PCI_DEVICE_ID_EF_ATM_FPGA 0x0000
19659 +#define PCI_DEVICE_ID_EF_ATM_ASIC 0x0002
19660 +#define PCI_VENDOR_ID_EF_ATM_LANAI2 0x0003
19661 +#define PCI_VENDOR_ID_EF_ATM_LANAIHB 0x0005
19663 +#define PCI_VENDOR_ID_IDT 0x111d
19664 +#define PCI_DEVICE_ID_IDT_IDT77201 0x0001
19666 +#define PCI_VENDOR_ID_FORE 0x1127
19667 +#define PCI_DEVICE_ID_FORE_PCA200PC 0x0210
19668 +#define PCI_DEVICE_ID_FORE_PCA200E 0x0300
19670 +#define PCI_VENDOR_ID_IMAGINGTECH 0x112f
19671 +#define PCI_DEVICE_ID_IMAGINGTECH_ICPCI 0x0000
19673 +#define PCI_VENDOR_ID_PHILIPS 0x1131
19674 +#define PCI_DEVICE_ID_PHILIPS_SAA7145 0x7145
19675 +#define PCI_DEVICE_ID_PHILIPS_SAA7146 0x7146
19676 +#define PCI_DEVICE_ID_PHILIPS_SAA9730 0x9730
19678 +#define PCI_VENDOR_ID_EICON 0x1133
19679 +#define PCI_DEVICE_ID_EICON_DIVA20PRO 0xe001
19680 +#define PCI_DEVICE_ID_EICON_DIVA20 0xe002
19681 +#define PCI_DEVICE_ID_EICON_DIVA20PRO_U 0xe003
19682 +#define PCI_DEVICE_ID_EICON_DIVA20_U 0xe004
19683 +#define PCI_DEVICE_ID_EICON_DIVA201 0xe005
19684 +#define PCI_DEVICE_ID_EICON_DIVA202 0xe00b
19685 +#define PCI_DEVICE_ID_EICON_MAESTRA 0xe010
19686 +#define PCI_DEVICE_ID_EICON_MAESTRAQ 0xe012
19687 +#define PCI_DEVICE_ID_EICON_MAESTRAQ_U 0xe013
19688 +#define PCI_DEVICE_ID_EICON_MAESTRAP 0xe014
19690 +#define PCI_VENDOR_ID_ZIATECH 0x1138
19691 +#define PCI_DEVICE_ID_ZIATECH_5550_HC 0x5550
19693 +#define PCI_VENDOR_ID_CYCLONE 0x113c
19694 +#define PCI_DEVICE_ID_CYCLONE_SDK 0x0001
19696 +#define PCI_VENDOR_ID_ALLIANCE 0x1142
19697 +#define PCI_DEVICE_ID_ALLIANCE_PROMOTIO 0x3210
19698 +#define PCI_DEVICE_ID_ALLIANCE_PROVIDEO 0x6422
19699 +#define PCI_DEVICE_ID_ALLIANCE_AT24 0x6424
19700 +#define PCI_DEVICE_ID_ALLIANCE_AT3D 0x643d
19702 +#define PCI_VENDOR_ID_SYSKONNECT 0x1148
19703 +#define PCI_DEVICE_ID_SYSKONNECT_FP 0x4000
19704 +#define PCI_DEVICE_ID_SYSKONNECT_TR 0x4200
19705 +#define PCI_DEVICE_ID_SYSKONNECT_GE 0x4300
19706 +#define PCI_DEVICE_ID_SYSKONNECT_YU 0x4320
19707 +#define PCI_DEVICE_ID_SYSKONNECT_9DXX 0x4400
19708 +#define PCI_DEVICE_ID_SYSKONNECT_9MXX 0x4500
19710 +#define PCI_VENDOR_ID_VMIC 0x114a
19711 +#define PCI_DEVICE_ID_VMIC_VME 0x7587
19713 +#define PCI_VENDOR_ID_DIGI 0x114f
19714 +#define PCI_DEVICE_ID_DIGI_EPC 0x0002
19715 +#define PCI_DEVICE_ID_DIGI_RIGHTSWITCH 0x0003
19716 +#define PCI_DEVICE_ID_DIGI_XEM 0x0004
19717 +#define PCI_DEVICE_ID_DIGI_XR 0x0005
19718 +#define PCI_DEVICE_ID_DIGI_CX 0x0006
19719 +#define PCI_DEVICE_ID_DIGI_XRJ 0x0009
19720 +#define PCI_DEVICE_ID_DIGI_EPCJ 0x000a
19721 +#define PCI_DEVICE_ID_DIGI_XR_920 0x0027
19722 +#define PCI_DEVICE_ID_DIGI_DF_M_IOM2_E 0x0070
19723 +#define PCI_DEVICE_ID_DIGI_DF_M_E 0x0071
19724 +#define PCI_DEVICE_ID_DIGI_DF_M_IOM2_A 0x0072
19725 +#define PCI_DEVICE_ID_DIGI_DF_M_A 0x0073
19726 +#define PCI_DEVICE_ID_NEO_2DB9 0x00C8
19727 +#define PCI_DEVICE_ID_NEO_2DB9PRI 0x00C9
19728 +#define PCI_DEVICE_ID_NEO_2RJ45 0x00CA
19729 +#define PCI_DEVICE_ID_NEO_2RJ45PRI 0x00CB
19731 +#define PCI_VENDOR_ID_MUTECH 0x1159
19732 +#define PCI_DEVICE_ID_MUTECH_MV1000 0x0001
19734 +#define PCI_VENDOR_ID_XIRCOM 0x115d
19735 +#define PCI_DEVICE_ID_XIRCOM_X3201_ETH 0x0003
19736 +#define PCI_DEVICE_ID_XIRCOM_RBM56G 0x0101
19737 +#define PCI_DEVICE_ID_XIRCOM_X3201_MDM 0x0103
19739 +#define PCI_VENDOR_ID_RENDITION 0x1163
19740 +#define PCI_DEVICE_ID_RENDITION_VERITE 0x0001
19741 +#define PCI_DEVICE_ID_RENDITION_VERITE2100 0x2000
19743 +#define PCI_VENDOR_ID_SERVERWORKS 0x1166
19744 +#define PCI_DEVICE_ID_SERVERWORKS_HE 0x0008
19745 +#define PCI_DEVICE_ID_SERVERWORKS_LE 0x0009
19746 +#define PCI_DEVICE_ID_SERVERWORKS_CIOB30 0x0010
19747 +#define PCI_DEVICE_ID_SERVERWORKS_CMIC_HE 0x0011
19748 +#define PCI_DEVICE_ID_SERVERWORKS_GCNB_LE 0x0017
19749 +#define PCI_DEVICE_ID_SERVERWORKS_OSB4 0x0200
19750 +#define PCI_DEVICE_ID_SERVERWORKS_CSB5 0x0201
19751 +#define PCI_DEVICE_ID_SERVERWORKS_CSB6 0x0203
19752 +#define PCI_DEVICE_ID_SERVERWORKS_OSB4IDE 0x0211
19753 +#define PCI_DEVICE_ID_SERVERWORKS_CSB5IDE 0x0212
19754 +#define PCI_DEVICE_ID_SERVERWORKS_CSB6IDE 0x0213
19755 +#define PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2 0x0217
19756 +#define PCI_DEVICE_ID_SERVERWORKS_OSB4USB 0x0220
19757 +#define PCI_DEVICE_ID_SERVERWORKS_CSB5USB PCI_DEVICE_ID_SERVERWORKS_OSB4USB
19758 +#define PCI_DEVICE_ID_SERVERWORKS_CSB6USB 0x0221
19759 +#define PCI_DEVICE_ID_SERVERWORKS_GCLE 0x0225
19760 +#define PCI_DEVICE_ID_SERVERWORKS_GCLE2 0x0227
19761 +#define PCI_DEVICE_ID_SERVERWORKS_CSB5ISA 0x0230
19763 +#define PCI_VENDOR_ID_SBE 0x1176
19764 +#define PCI_DEVICE_ID_SBE_WANXL100 0x0301
19765 +#define PCI_DEVICE_ID_SBE_WANXL200 0x0302
19766 +#define PCI_DEVICE_ID_SBE_WANXL400 0x0104
19768 +#define PCI_VENDOR_ID_TOSHIBA 0x1179
19769 +#define PCI_DEVICE_ID_TOSHIBA_PICCOLO 0x0102
19770 +#define PCI_DEVICE_ID_TOSHIBA_PICCOLO_1 0x0103
19771 +#define PCI_DEVICE_ID_TOSHIBA_PICCOLO_2 0x0105
19772 +#define PCI_DEVICE_ID_TOSHIBA_601 0x0601
19773 +#define PCI_DEVICE_ID_TOSHIBA_TOPIC95 0x060a
19774 +#define PCI_DEVICE_ID_TOSHIBA_TOPIC95_A 0x0603
19775 +#define PCI_DEVICE_ID_TOSHIBA_TOPIC95_B 0x060a
19776 +#define PCI_DEVICE_ID_TOSHIBA_TOPIC97 0x060f
19777 +#define PCI_DEVICE_ID_TOSHIBA_TOPIC100 0x0617
19779 +#define PCI_VENDOR_ID_TOSHIBA_2 0x102f
19780 +#define PCI_DEVICE_ID_TOSHIBA_TX3927 0x000a
19781 +#define PCI_DEVICE_ID_TOSHIBA_TC35815CF 0x0030
19782 +#define PCI_DEVICE_ID_TOSHIBA_TX4927 0x0180
19783 +#define PCI_DEVICE_ID_TOSHIBA_TC86C001_MISC 0x0108
19785 +#define PCI_VENDOR_ID_RICOH 0x1180
19786 +#define PCI_DEVICE_ID_RICOH_RL5C465 0x0465
19787 +#define PCI_DEVICE_ID_RICOH_RL5C466 0x0466
19788 +#define PCI_DEVICE_ID_RICOH_RL5C475 0x0475
19789 +#define PCI_DEVICE_ID_RICOH_RL5C476 0x0476
19790 +#define PCI_DEVICE_ID_RICOH_RL5C478 0x0478
19792 +#define PCI_VENDOR_ID_DLINK 0x1186
19793 +#define PCI_DEVICE_ID_DLINK_DGE510T 0x4c00
19795 +#define PCI_VENDOR_ID_ARTOP 0x1191
19796 +#define PCI_DEVICE_ID_ARTOP_ATP8400 0x0004
19797 +#define PCI_DEVICE_ID_ARTOP_ATP850UF 0x0005
19798 +#define PCI_DEVICE_ID_ARTOP_ATP860 0x0006
19799 +#define PCI_DEVICE_ID_ARTOP_ATP860R 0x0007
19800 +#define PCI_DEVICE_ID_ARTOP_ATP865 0x0008
19801 +#define PCI_DEVICE_ID_ARTOP_ATP865R 0x0009
19802 +#define PCI_DEVICE_ID_ARTOP_AEC7610 0x8002
19803 +#define PCI_DEVICE_ID_ARTOP_AEC7612UW 0x8010
19804 +#define PCI_DEVICE_ID_ARTOP_AEC7612U 0x8020
19805 +#define PCI_DEVICE_ID_ARTOP_AEC7612S 0x8030
19806 +#define PCI_DEVICE_ID_ARTOP_AEC7612D 0x8040
19807 +#define PCI_DEVICE_ID_ARTOP_AEC7612SUW 0x8050
19808 +#define PCI_DEVICE_ID_ARTOP_8060 0x8060
19809 +#define PCI_DEVICE_ID_ARTOP_AEC67160 0x8080
19810 +#define PCI_DEVICE_ID_ARTOP_AEC67160_2 0x8081
19811 +#define PCI_DEVICE_ID_ARTOP_AEC67162 0x808a
19813 +#define PCI_VENDOR_ID_ZEITNET 0x1193
19814 +#define PCI_DEVICE_ID_ZEITNET_1221 0x0001
19815 +#define PCI_DEVICE_ID_ZEITNET_1225 0x0002
19817 +#define PCI_VENDOR_ID_OMEGA 0x119b
19818 +#define PCI_DEVICE_ID_OMEGA_82C092G 0x1221
19820 +#define PCI_VENDOR_ID_FUJITSU_ME 0x119e
19821 +#define PCI_DEVICE_ID_FUJITSU_FS155 0x0001
19822 +#define PCI_DEVICE_ID_FUJITSU_FS50 0x0003
19824 +#define PCI_SUBVENDOR_ID_KEYSPAN 0x11a9
19825 +#define PCI_SUBDEVICE_ID_KEYSPAN_SX2 0x5334
19827 +#define PCI_VENDOR_ID_MARVELL 0x11ab
19828 +#define PCI_DEVICE_ID_MARVELL_GT64011 0x4146
19829 +#define PCI_DEVICE_ID_MARVELL_GT64111 0x4146
19830 +#define PCI_DEVICE_ID_MARVELL_GT64260 0x6430
19831 +#define PCI_DEVICE_ID_MARVELL_MV64360 0x6460
19832 +#define PCI_DEVICE_ID_MARVELL_MV64460 0x6480
19833 +#define PCI_DEVICE_ID_MARVELL_GT96100 0x9652
19834 +#define PCI_DEVICE_ID_MARVELL_GT96100A 0x9653
19836 +#define PCI_VENDOR_ID_LITEON 0x11ad
19837 +#define PCI_DEVICE_ID_LITEON_LNE100TX 0x0002
19839 +#define PCI_VENDOR_ID_V3 0x11b0
19840 +#define PCI_DEVICE_ID_V3_V960 0x0001
19841 +#define PCI_DEVICE_ID_V3_V350 0x0001
19842 +#define PCI_DEVICE_ID_V3_V961 0x0002
19843 +#define PCI_DEVICE_ID_V3_V351 0x0002
19845 +#define PCI_VENDOR_ID_NP 0x11bc
19846 +#define PCI_DEVICE_ID_NP_PCI_FDDI 0x0001
19848 +#define PCI_VENDOR_ID_ATT 0x11c1
19849 +#define PCI_DEVICE_ID_ATT_L56XMF 0x0440
19850 +#define PCI_DEVICE_ID_ATT_VENUS_MODEM 0x480
19852 +#define PCI_VENDOR_ID_NEC2 0x11c3 /* NEC (2nd) */
19854 +#define PCI_VENDOR_ID_SPECIALIX 0x11cb
19855 +#define PCI_DEVICE_ID_SPECIALIX_IO8 0x2000
19856 +#define PCI_DEVICE_ID_SPECIALIX_XIO 0x4000
19857 +#define PCI_DEVICE_ID_SPECIALIX_RIO 0x8000
19858 +#define PCI_SUBDEVICE_ID_SPECIALIX_SPEED4 0xa004
19860 +#define PCI_VENDOR_ID_AURAVISION 0x11d1
19861 +#define PCI_DEVICE_ID_AURAVISION_VXP524 0x01f7
19863 +#define PCI_VENDOR_ID_ANALOG_DEVICES 0x11d4
19864 +#define PCI_DEVICE_ID_AD1889JS 0x1889
19866 +#define PCI_VENDOR_ID_IKON 0x11d5
19867 +#define PCI_DEVICE_ID_IKON_10115 0x0115
19868 +#define PCI_DEVICE_ID_IKON_10117 0x0117
19870 +#define PCI_VENDOR_ID_SEGA 0x11db
19871 +#define PCI_DEVICE_ID_SEGA_BBA 0x1234
19873 +#define PCI_VENDOR_ID_ZORAN 0x11de
19874 +#define PCI_DEVICE_ID_ZORAN_36057 0x6057
19875 +#define PCI_DEVICE_ID_ZORAN_36120 0x6120
19877 +#define PCI_VENDOR_ID_KINETIC 0x11f4
19878 +#define PCI_DEVICE_ID_KINETIC_2915 0x2915
19880 +#define PCI_VENDOR_ID_COMPEX 0x11f6
19881 +#define PCI_DEVICE_ID_COMPEX_ENET100VG4 0x0112
19882 +#define PCI_DEVICE_ID_COMPEX_RL2000 0x1401
19884 +#define PCI_VENDOR_ID_RP 0x11fe
19885 +#define PCI_DEVICE_ID_RP32INTF 0x0001
19886 +#define PCI_DEVICE_ID_RP8INTF 0x0002
19887 +#define PCI_DEVICE_ID_RP16INTF 0x0003
19888 +#define PCI_DEVICE_ID_RP4QUAD 0x0004
19889 +#define PCI_DEVICE_ID_RP8OCTA 0x0005
19890 +#define PCI_DEVICE_ID_RP8J 0x0006
19891 +#define PCI_DEVICE_ID_RP4J 0x0007
19892 +#define PCI_DEVICE_ID_RP8SNI 0x0008
19893 +#define PCI_DEVICE_ID_RP16SNI 0x0009
19894 +#define PCI_DEVICE_ID_RPP4 0x000A
19895 +#define PCI_DEVICE_ID_RPP8 0x000B
19896 +#define PCI_DEVICE_ID_RP8M 0x000C
19897 +#define PCI_DEVICE_ID_RP4M 0x000D
19898 +#define PCI_DEVICE_ID_RP2_232 0x000E
19899 +#define PCI_DEVICE_ID_RP2_422 0x000F
19900 +#define PCI_DEVICE_ID_URP32INTF 0x0801
19901 +#define PCI_DEVICE_ID_URP8INTF 0x0802
19902 +#define PCI_DEVICE_ID_URP16INTF 0x0803
19903 +#define PCI_DEVICE_ID_URP8OCTA 0x0805
19904 +#define PCI_DEVICE_ID_UPCI_RM3_8PORT 0x080C
19905 +#define PCI_DEVICE_ID_UPCI_RM3_4PORT 0x080D
19906 +#define PCI_DEVICE_ID_CRP16INTF 0x0903
19908 +#define PCI_VENDOR_ID_CYCLADES 0x120e
19909 +#define PCI_DEVICE_ID_CYCLOM_Y_Lo 0x0100
19910 +#define PCI_DEVICE_ID_CYCLOM_Y_Hi 0x0101
19911 +#define PCI_DEVICE_ID_CYCLOM_4Y_Lo 0x0102
19912 +#define PCI_DEVICE_ID_CYCLOM_4Y_Hi 0x0103
19913 +#define PCI_DEVICE_ID_CYCLOM_8Y_Lo 0x0104
19914 +#define PCI_DEVICE_ID_CYCLOM_8Y_Hi 0x0105
19915 +#define PCI_DEVICE_ID_CYCLOM_Z_Lo 0x0200
19916 +#define PCI_DEVICE_ID_CYCLOM_Z_Hi 0x0201
19917 +#define PCI_DEVICE_ID_PC300_RX_2 0x0300
19918 +#define PCI_DEVICE_ID_PC300_RX_1 0x0301
19919 +#define PCI_DEVICE_ID_PC300_TE_2 0x0310
19920 +#define PCI_DEVICE_ID_PC300_TE_1 0x0311
19921 +#define PCI_DEVICE_ID_PC300_TE_M_2 0x0320
19922 +#define PCI_DEVICE_ID_PC300_TE_M_1 0x0321
19924 +/* Allied Telesyn */
19925 +#define PCI_VENDOR_ID_AT 0x1259
19926 +#define PCI_SUBDEVICE_ID_AT_2701FX 0x2703
19928 +#define PCI_VENDOR_ID_ESSENTIAL 0x120f
19929 +#define PCI_DEVICE_ID_ESSENTIAL_ROADRUNNER 0x0001
19931 +#define PCI_VENDOR_ID_O2 0x1217
19932 +#define PCI_DEVICE_ID_O2_6729 0x6729
19933 +#define PCI_DEVICE_ID_O2_6730 0x673a
19934 +#define PCI_DEVICE_ID_O2_6832 0x6832
19935 +#define PCI_DEVICE_ID_O2_6836 0x6836
19937 +#define PCI_VENDOR_ID_3DFX 0x121a
19938 +#define PCI_DEVICE_ID_3DFX_VOODOO 0x0001
19939 +#define PCI_DEVICE_ID_3DFX_VOODOO2 0x0002
19940 +#define PCI_DEVICE_ID_3DFX_BANSHEE 0x0003
19941 +#define PCI_DEVICE_ID_3DFX_VOODOO3 0x0005
19942 +#define PCI_DEVICE_ID_3DFX_VOODOO5 0x0009
19944 +#define PCI_VENDOR_ID_SIGMADES 0x1236
19945 +#define PCI_DEVICE_ID_SIGMADES_6425 0x6401
19947 +#define PCI_VENDOR_ID_CCUBE 0x123f
19949 +#define PCI_VENDOR_ID_AVM 0x1244
19950 +#define PCI_DEVICE_ID_AVM_B1 0x0700
19951 +#define PCI_DEVICE_ID_AVM_C4 0x0800
19952 +#define PCI_DEVICE_ID_AVM_A1 0x0a00
19953 +#define PCI_DEVICE_ID_AVM_A1_V2 0x0e00
19954 +#define PCI_DEVICE_ID_AVM_C2 0x1100
19955 +#define PCI_DEVICE_ID_AVM_T1 0x1200
19957 +#define PCI_VENDOR_ID_DIPIX 0x1246
19959 +#define PCI_VENDOR_ID_STALLION 0x124d
19960 +#define PCI_DEVICE_ID_STALLION_ECHPCI832 0x0000
19961 +#define PCI_DEVICE_ID_STALLION_ECHPCI864 0x0002
19962 +#define PCI_DEVICE_ID_STALLION_EIOPCI 0x0003
19964 +#define PCI_VENDOR_ID_OPTIBASE 0x1255
19965 +#define PCI_DEVICE_ID_OPTIBASE_FORGE 0x1110
19966 +#define PCI_DEVICE_ID_OPTIBASE_FUSION 0x1210
19967 +#define PCI_DEVICE_ID_OPTIBASE_VPLEX 0x2110
19968 +#define PCI_DEVICE_ID_OPTIBASE_VPLEXCC 0x2120
19969 +#define PCI_DEVICE_ID_OPTIBASE_VQUEST 0x2130
19971 +/* Allied Telesyn */
19972 +#define PCI_VENDOR_ID_AT 0x1259
19973 +#define PCI_SUBDEVICE_ID_AT_2700FX 0x2701
19974 +#define PCI_SUBDEVICE_ID_AT_2701FX 0x2703
19976 +#define PCI_VENDOR_ID_ESS 0x125d
19977 +#define PCI_DEVICE_ID_ESS_ESS1968 0x1968
19978 +#define PCI_DEVICE_ID_ESS_AUDIOPCI 0x1969
19979 +#define PCI_DEVICE_ID_ESS_ESS1978 0x1978
19981 +#define PCI_VENDOR_ID_SATSAGEM 0x1267
19982 +#define PCI_DEVICE_ID_SATSAGEM_NICCY 0x1016
19983 +#define PCI_DEVICE_ID_SATSAGEM_PCR2101 0x5352
19984 +#define PCI_DEVICE_ID_SATSAGEM_TELSATTURBO 0x5a4b
19986 +#define PCI_VENDOR_ID_HUGHES 0x1273
19987 +#define PCI_DEVICE_ID_HUGHES_DIRECPC 0x0002
19989 +#define PCI_VENDOR_ID_ENSONIQ 0x1274
19990 +#define PCI_DEVICE_ID_ENSONIQ_CT5880 0x5880
19991 +#define PCI_DEVICE_ID_ENSONIQ_ES1370 0x5000
19992 +#define PCI_DEVICE_ID_ENSONIQ_ES1371 0x1371
19994 +#define PCI_VENDOR_ID_TRANSMETA 0x1279
19995 +#define PCI_DEVICE_ID_EFFICEON 0x0060
19997 +#define PCI_VENDOR_ID_ROCKWELL 0x127A
19999 +#define PCI_VENDOR_ID_ITE 0x1283
20000 +#define PCI_DEVICE_ID_ITE_IT8172G 0x8172
20001 +#define PCI_DEVICE_ID_ITE_IT8172G_AUDIO 0x0801
20002 +#define PCI_DEVICE_ID_ITE_8872 0x8872
20003 +#define PCI_DEVICE_ID_ITE_IT8330G_0 0xe886
20005 +/* formerly Platform Tech */
20006 +#define PCI_VENDOR_ID_ESS_OLD 0x1285
20007 +#define PCI_DEVICE_ID_ESS_ESS0100 0x0100
20009 +#define PCI_VENDOR_ID_ALTEON 0x12ae
20010 +#define PCI_DEVICE_ID_ALTEON_ACENIC 0x0001
20012 +#define PCI_VENDOR_ID_USR 0x12B9
20014 +#define PCI_SUBVENDOR_ID_CONNECT_TECH 0x12c4
20015 +#define PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_232 0x0001
20016 +#define PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_232 0x0002
20017 +#define PCI_SUBDEVICE_ID_CONNECT_TECH_BH2_232 0x0003
20018 +#define PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_485 0x0004
20019 +#define PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_485_4_4 0x0005
20020 +#define PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_485 0x0006
20021 +#define PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_485_2_2 0x0007
20022 +#define PCI_SUBDEVICE_ID_CONNECT_TECH_BH2_485 0x0008
20023 +#define PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_485_2_6 0x0009
20024 +#define PCI_SUBDEVICE_ID_CONNECT_TECH_BH081101V1 0x000A
20025 +#define PCI_SUBDEVICE_ID_CONNECT_TECH_BH041101V1 0x000B
20027 +#define PCI_VENDOR_ID_PICTUREL 0x12c5
20028 +#define PCI_DEVICE_ID_PICTUREL_PCIVST 0x0081
20030 +#define PCI_VENDOR_ID_NVIDIA_SGS 0x12d2
20031 +#define PCI_DEVICE_ID_NVIDIA_SGS_RIVA128 0x0018
20033 +#define PCI_SUBVENDOR_ID_CHASE_PCIFAST 0x12E0
20034 +#define PCI_SUBDEVICE_ID_CHASE_PCIFAST4 0x0031
20035 +#define PCI_SUBDEVICE_ID_CHASE_PCIFAST8 0x0021
20036 +#define PCI_SUBDEVICE_ID_CHASE_PCIFAST16 0x0011
20037 +#define PCI_SUBDEVICE_ID_CHASE_PCIFAST16FMC 0x0041
20038 +#define PCI_SUBVENDOR_ID_CHASE_PCIRAS 0x124D
20039 +#define PCI_SUBDEVICE_ID_CHASE_PCIRAS4 0xF001
20040 +#define PCI_SUBDEVICE_ID_CHASE_PCIRAS8 0xF010
20042 +#define PCI_VENDOR_ID_AUREAL 0x12eb
20043 +#define PCI_DEVICE_ID_AUREAL_VORTEX_1 0x0001
20044 +#define PCI_DEVICE_ID_AUREAL_VORTEX_2 0x0002
20045 +#define PCI_DEVICE_ID_AUREAL_ADVANTAGE 0x0003
20047 +#define PCI_VENDOR_ID_ELECTRONICDESIGNGMBH 0x12f8
20048 +#define PCI_DEVICE_ID_LML_33R10 0x8a02
20050 +#define PCI_VENDOR_ID_CBOARDS 0x1307
20051 +#define PCI_DEVICE_ID_CBOARDS_DAS1602_16 0x0001
20053 +#define PCI_VENDOR_ID_SIIG 0x131f
20054 +#define PCI_DEVICE_ID_SIIG_1S_10x_550 0x1000
20055 +#define PCI_DEVICE_ID_SIIG_1S_10x_650 0x1001
20056 +#define PCI_DEVICE_ID_SIIG_1S_10x_850 0x1002
20057 +#define PCI_DEVICE_ID_SIIG_1S1P_10x_550 0x1010
20058 +#define PCI_DEVICE_ID_SIIG_1S1P_10x_650 0x1011
20059 +#define PCI_DEVICE_ID_SIIG_1S1P_10x_850 0x1012
20060 +#define PCI_DEVICE_ID_SIIG_1P_10x 0x1020
20061 +#define PCI_DEVICE_ID_SIIG_2P_10x 0x1021
20062 +#define PCI_DEVICE_ID_SIIG_2S_10x_550 0x1030
20063 +#define PCI_DEVICE_ID_SIIG_2S_10x_650 0x1031
20064 +#define PCI_DEVICE_ID_SIIG_2S_10x_850 0x1032
20065 +#define PCI_DEVICE_ID_SIIG_2S1P_10x_550 0x1034
20066 +#define PCI_DEVICE_ID_SIIG_2S1P_10x_650 0x1035
20067 +#define PCI_DEVICE_ID_SIIG_2S1P_10x_850 0x1036
20068 +#define PCI_DEVICE_ID_SIIG_4S_10x_550 0x1050
20069 +#define PCI_DEVICE_ID_SIIG_4S_10x_650 0x1051
20070 +#define PCI_DEVICE_ID_SIIG_4S_10x_850 0x1052
20071 +#define PCI_DEVICE_ID_SIIG_1S_20x_550 0x2000
20072 +#define PCI_DEVICE_ID_SIIG_1S_20x_650 0x2001
20073 +#define PCI_DEVICE_ID_SIIG_1S_20x_850 0x2002
20074 +#define PCI_DEVICE_ID_SIIG_1P_20x 0x2020
20075 +#define PCI_DEVICE_ID_SIIG_2P_20x 0x2021
20076 +#define PCI_DEVICE_ID_SIIG_2S_20x_550 0x2030
20077 +#define PCI_DEVICE_ID_SIIG_2S_20x_650 0x2031
20078 +#define PCI_DEVICE_ID_SIIG_2S_20x_850 0x2032
20079 +#define PCI_DEVICE_ID_SIIG_2P1S_20x_550 0x2040
20080 +#define PCI_DEVICE_ID_SIIG_2P1S_20x_650 0x2041
20081 +#define PCI_DEVICE_ID_SIIG_2P1S_20x_850 0x2042
20082 +#define PCI_DEVICE_ID_SIIG_1S1P_20x_550 0x2010
20083 +#define PCI_DEVICE_ID_SIIG_1S1P_20x_650 0x2011
20084 +#define PCI_DEVICE_ID_SIIG_1S1P_20x_850 0x2012
20085 +#define PCI_DEVICE_ID_SIIG_4S_20x_550 0x2050
20086 +#define PCI_DEVICE_ID_SIIG_4S_20x_650 0x2051
20087 +#define PCI_DEVICE_ID_SIIG_4S_20x_850 0x2052
20088 +#define PCI_DEVICE_ID_SIIG_2S1P_20x_550 0x2060
20089 +#define PCI_DEVICE_ID_SIIG_2S1P_20x_650 0x2061
20090 +#define PCI_DEVICE_ID_SIIG_2S1P_20x_850 0x2062
20092 +#define PCI_VENDOR_ID_RADISYS 0x1331
20093 +#define PCI_DEVICE_ID_RADISYS_ENP2611 0x0030
20095 +#define PCI_VENDOR_ID_DOMEX 0x134a
20096 +#define PCI_DEVICE_ID_DOMEX_DMX3191D 0x0001
20098 +#define PCI_VENDOR_ID_QUATECH 0x135C
20099 +#define PCI_DEVICE_ID_QUATECH_QSC100 0x0010
20100 +#define PCI_DEVICE_ID_QUATECH_DSC100 0x0020
20101 +#define PCI_DEVICE_ID_QUATECH_DSC200 0x0030
20102 +#define PCI_DEVICE_ID_QUATECH_QSC200 0x0040
20103 +#define PCI_DEVICE_ID_QUATECH_ESC100D 0x0050
20104 +#define PCI_DEVICE_ID_QUATECH_ESC100M 0x0060
20106 +#define PCI_VENDOR_ID_SEALEVEL 0x135e
20107 +#define PCI_DEVICE_ID_SEALEVEL_U530 0x7101
20108 +#define PCI_DEVICE_ID_SEALEVEL_UCOMM2 0x7201
20109 +#define PCI_DEVICE_ID_SEALEVEL_UCOMM422 0x7402
20110 +#define PCI_DEVICE_ID_SEALEVEL_UCOMM232 0x7202
20111 +#define PCI_DEVICE_ID_SEALEVEL_COMM4 0x7401
20112 +#define PCI_DEVICE_ID_SEALEVEL_COMM8 0x7801
20113 +#define PCI_DEVICE_ID_SEALEVEL_UCOMM8 0x7804
20115 +#define PCI_VENDOR_ID_HYPERCOPE 0x1365
20116 +#define PCI_DEVICE_ID_HYPERCOPE_PLX 0x9050
20117 +#define PCI_SUBDEVICE_ID_HYPERCOPE_OLD_ERGO 0x0104
20118 +#define PCI_SUBDEVICE_ID_HYPERCOPE_ERGO 0x0106
20119 +#define PCI_SUBDEVICE_ID_HYPERCOPE_METRO 0x0107
20120 +#define PCI_SUBDEVICE_ID_HYPERCOPE_CHAMP2 0x0108
20121 +#define PCI_SUBDEVICE_ID_HYPERCOPE_PLEXUS 0x0109
20123 +#define PCI_VENDOR_ID_KAWASAKI 0x136b
20124 +#define PCI_DEVICE_ID_MCHIP_KL5A72002 0xff01
20126 +#define PCI_VENDOR_ID_CNET 0x1371
20127 +#define PCI_DEVICE_ID_CNET_GIGACARD 0x434e
20129 +#define PCI_VENDOR_ID_LMC 0x1376
20130 +#define PCI_DEVICE_ID_LMC_HSSI 0x0003
20131 +#define PCI_DEVICE_ID_LMC_DS3 0x0004
20132 +#define PCI_DEVICE_ID_LMC_SSI 0x0005
20133 +#define PCI_DEVICE_ID_LMC_T1 0x0006
20135 +#define PCI_VENDOR_ID_NETGEAR 0x1385
20136 +#define PCI_DEVICE_ID_NETGEAR_GA620 0x620a
20137 +#define PCI_DEVICE_ID_NETGEAR_GA622 0x622a
20139 +#define PCI_VENDOR_ID_APPLICOM 0x1389
20140 +#define PCI_DEVICE_ID_APPLICOM_PCIGENERIC 0x0001
20141 +#define PCI_DEVICE_ID_APPLICOM_PCI2000IBS_CAN 0x0002
20142 +#define PCI_DEVICE_ID_APPLICOM_PCI2000PFB 0x0003
20144 +#define PCI_VENDOR_ID_MOXA 0x1393
20145 +#define PCI_DEVICE_ID_MOXA_RC7000 0x0001
20146 +#define PCI_DEVICE_ID_MOXA_CP102 0x1020
20147 +#define PCI_DEVICE_ID_MOXA_CP102UL 0x1021
20148 +#define PCI_DEVICE_ID_MOXA_CP102U 0x1022
20149 +#define PCI_DEVICE_ID_MOXA_C104 0x1040
20150 +#define PCI_DEVICE_ID_MOXA_CP104U 0x1041
20151 +#define PCI_DEVICE_ID_MOXA_CP104JU 0x1042
20152 +#define PCI_DEVICE_ID_MOXA_CT114 0x1140
20153 +#define PCI_DEVICE_ID_MOXA_CP114 0x1141
20154 +#define PCI_DEVICE_ID_MOXA_CP118U 0x1180
20155 +#define PCI_DEVICE_ID_MOXA_CP132 0x1320
20156 +#define PCI_DEVICE_ID_MOXA_CP132U 0x1321
20157 +#define PCI_DEVICE_ID_MOXA_CP134U 0x1340
20158 +#define PCI_DEVICE_ID_MOXA_C168 0x1680
20159 +#define PCI_DEVICE_ID_MOXA_CP168U 0x1681
20160 +#define PCI_DEVICE_ID_MOXA_CP204J 0x2040
20161 +#define PCI_DEVICE_ID_MOXA_C218 0x2180
20162 +#define PCI_DEVICE_ID_MOXA_C320 0x3200
20164 +#define PCI_VENDOR_ID_CCD 0x1397
20165 +#define PCI_DEVICE_ID_CCD_2BD0 0x2bd0
20166 +#define PCI_DEVICE_ID_CCD_B000 0xb000
20167 +#define PCI_DEVICE_ID_CCD_B006 0xb006
20168 +#define PCI_DEVICE_ID_CCD_B007 0xb007
20169 +#define PCI_DEVICE_ID_CCD_B008 0xb008
20170 +#define PCI_DEVICE_ID_CCD_B009 0xb009
20171 +#define PCI_DEVICE_ID_CCD_B00A 0xb00a
20172 +#define PCI_DEVICE_ID_CCD_B00B 0xb00b
20173 +#define PCI_DEVICE_ID_CCD_B00C 0xb00c
20174 +#define PCI_DEVICE_ID_CCD_B100 0xb100
20176 +#define PCI_VENDOR_ID_EXAR 0x13a8
20177 +#define PCI_DEVICE_ID_EXAR_XR17C152 0x0152
20178 +#define PCI_DEVICE_ID_EXAR_XR17C154 0x0154
20179 +#define PCI_DEVICE_ID_EXAR_XR17C158 0x0158
20181 +#define PCI_VENDOR_ID_MICROGATE 0x13c0
20182 +#define PCI_DEVICE_ID_MICROGATE_USC 0x0010
20183 +#define PCI_DEVICE_ID_MICROGATE_SCC 0x0020
20184 +#define PCI_DEVICE_ID_MICROGATE_SCA 0x0030
20185 +#define PCI_DEVICE_ID_MICROGATE_USC2 0x0210
20187 +#define PCI_VENDOR_ID_3WARE 0x13C1
20188 +#define PCI_DEVICE_ID_3WARE_1000 0x1000
20189 +#define PCI_DEVICE_ID_3WARE_7000 0x1001
20190 +#define PCI_DEVICE_ID_3WARE_9000 0x1002
20192 +#define PCI_VENDOR_ID_IOMEGA 0x13ca
20193 +#define PCI_DEVICE_ID_IOMEGA_BUZ 0x4231
20195 +#define PCI_VENDOR_ID_ABOCOM 0x13D1
20196 +#define PCI_DEVICE_ID_ABOCOM_2BD1 0x2BD1
20198 +#define PCI_VENDOR_ID_CMEDIA 0x13f6
20199 +#define PCI_DEVICE_ID_CMEDIA_CM8338A 0x0100
20200 +#define PCI_DEVICE_ID_CMEDIA_CM8338B 0x0101
20201 +#define PCI_DEVICE_ID_CMEDIA_CM8738 0x0111
20202 +#define PCI_DEVICE_ID_CMEDIA_CM8738B 0x0112
20204 +#define PCI_VENDOR_ID_LAVA 0x1407
20205 +#define PCI_DEVICE_ID_LAVA_DSERIAL 0x0100 /* 2x 16550 */
20206 +#define PCI_DEVICE_ID_LAVA_QUATRO_A 0x0101 /* 2x 16550, half of 4 port */
20207 +#define PCI_DEVICE_ID_LAVA_QUATRO_B 0x0102 /* 2x 16550, half of 4 port */
20208 +#define PCI_DEVICE_ID_LAVA_OCTO_A 0x0180 /* 4x 16550A, half of 8 port */
20209 +#define PCI_DEVICE_ID_LAVA_OCTO_B 0x0181 /* 4x 16550A, half of 8 port */
20210 +#define PCI_DEVICE_ID_LAVA_PORT_PLUS 0x0200 /* 2x 16650 */
20211 +#define PCI_DEVICE_ID_LAVA_QUAD_A 0x0201 /* 2x 16650, half of 4 port */
20212 +#define PCI_DEVICE_ID_LAVA_QUAD_B 0x0202 /* 2x 16650, half of 4 port */
20213 +#define PCI_DEVICE_ID_LAVA_SSERIAL 0x0500 /* 1x 16550 */
20214 +#define PCI_DEVICE_ID_LAVA_PORT_650 0x0600 /* 1x 16650 */
20215 +#define PCI_DEVICE_ID_LAVA_PARALLEL 0x8000
20216 +#define PCI_DEVICE_ID_LAVA_DUAL_PAR_A 0x8002 /* The Lava Dual Parallel is */
20217 +#define PCI_DEVICE_ID_LAVA_DUAL_PAR_B 0x8003 /* two PCI devices on a card */
20218 +#define PCI_DEVICE_ID_LAVA_BOCA_IOPPAR 0x8800
20220 +#define PCI_VENDOR_ID_TIMEDIA 0x1409
20221 +#define PCI_DEVICE_ID_TIMEDIA_1889 0x7168
20223 +#define PCI_VENDOR_ID_OXSEMI 0x1415
20224 +#define PCI_DEVICE_ID_OXSEMI_12PCI840 0x8403
20225 +#define PCI_DEVICE_ID_OXSEMI_16PCI954 0x9501
20226 +#define PCI_DEVICE_ID_OXSEMI_16PCI95N 0x9511
20227 +#define PCI_DEVICE_ID_OXSEMI_16PCI954PP 0x9513
20228 +#define PCI_DEVICE_ID_OXSEMI_16PCI952 0x9521
20230 +#define PCI_VENDOR_ID_SAMSUNG 0x144d
20232 +#define PCI_VENDOR_ID_AIRONET 0x14b9
20233 +#define PCI_DEVICE_ID_AIRONET_4800_1 0x0001
20234 +#define PCI_DEVICE_ID_AIRONET_4800 0x4500 // values switched? see
20235 +#define PCI_DEVICE_ID_AIRONET_4500 0x4800 // drivers/net/aironet4500_card.c
20237 +#define PCI_VENDOR_ID_TITAN 0x14D2
20238 +#define PCI_DEVICE_ID_TITAN_010L 0x8001
20239 +#define PCI_DEVICE_ID_TITAN_100L 0x8010
20240 +#define PCI_DEVICE_ID_TITAN_110L 0x8011
20241 +#define PCI_DEVICE_ID_TITAN_200L 0x8020
20242 +#define PCI_DEVICE_ID_TITAN_210L 0x8021
20243 +#define PCI_DEVICE_ID_TITAN_400L 0x8040
20244 +#define PCI_DEVICE_ID_TITAN_800L 0x8080
20245 +#define PCI_DEVICE_ID_TITAN_100 0xA001
20246 +#define PCI_DEVICE_ID_TITAN_200 0xA005
20247 +#define PCI_DEVICE_ID_TITAN_400 0xA003
20248 +#define PCI_DEVICE_ID_TITAN_800B 0xA004
20250 +#define PCI_VENDOR_ID_PANACOM 0x14d4
20251 +#define PCI_DEVICE_ID_PANACOM_QUADMODEM 0x0400
20252 +#define PCI_DEVICE_ID_PANACOM_DUALMODEM 0x0402
20254 +#define PCI_VENDOR_ID_SIPACKETS 0x14d9
20255 +#define PCI_DEVICE_ID_SP_HT 0x0010
20257 +#define PCI_VENDOR_ID_AFAVLAB 0x14db
20258 +#define PCI_DEVICE_ID_AFAVLAB_P028 0x2180
20259 +#define PCI_DEVICE_ID_AFAVLAB_P030 0x2182
20261 +#define PCI_VENDOR_ID_BROADCOM 0x14e4
20262 +#define PCI_DEVICE_ID_TIGON3_5752 0x1600
20263 +#define PCI_DEVICE_ID_TIGON3_5752M 0x1601
20264 +#define PCI_DEVICE_ID_TIGON3_5700 0x1644
20265 +#define PCI_DEVICE_ID_TIGON3_5701 0x1645
20266 +#define PCI_DEVICE_ID_TIGON3_5702 0x1646
20267 +#define PCI_DEVICE_ID_TIGON3_5703 0x1647
20268 +#define PCI_DEVICE_ID_TIGON3_5704 0x1648
20269 +#define PCI_DEVICE_ID_TIGON3_5704S_2 0x1649
20270 +#define PCI_DEVICE_ID_NX2_5706 0x164a
20271 +#define PCI_DEVICE_ID_TIGON3_5702FE 0x164d
20272 +#define PCI_DEVICE_ID_TIGON3_5705 0x1653
20273 +#define PCI_DEVICE_ID_TIGON3_5705_2 0x1654
20274 +#define PCI_DEVICE_ID_TIGON3_5720 0x1658
20275 +#define PCI_DEVICE_ID_TIGON3_5721 0x1659
20276 +#define PCI_DEVICE_ID_TIGON3_5705M 0x165d
20277 +#define PCI_DEVICE_ID_TIGON3_5705M_2 0x165e
20278 +#define PCI_DEVICE_ID_TIGON3_5705F 0x166e
20279 +#define PCI_DEVICE_ID_TIGON3_5750 0x1676
20280 +#define PCI_DEVICE_ID_TIGON3_5751 0x1677
20281 +#define PCI_DEVICE_ID_TIGON3_5750M 0x167c
20282 +#define PCI_DEVICE_ID_TIGON3_5751M 0x167d
20283 +#define PCI_DEVICE_ID_TIGON3_5751F 0x167e
20284 +#define PCI_DEVICE_ID_TIGON3_5782 0x1696
20285 +#define PCI_DEVICE_ID_TIGON3_5788 0x169c
20286 +#define PCI_DEVICE_ID_TIGON3_5789 0x169d
20287 +#define PCI_DEVICE_ID_TIGON3_5702X 0x16a6
20288 +#define PCI_DEVICE_ID_TIGON3_5703X 0x16a7
20289 +#define PCI_DEVICE_ID_TIGON3_5704S 0x16a8
20290 +#define PCI_DEVICE_ID_NX2_5706S 0x16aa
20291 +#define PCI_DEVICE_ID_TIGON3_5702A3 0x16c6
20292 +#define PCI_DEVICE_ID_TIGON3_5703A3 0x16c7
20293 +#define PCI_DEVICE_ID_TIGON3_5781 0x16dd
20294 +#define PCI_DEVICE_ID_TIGON3_5753 0x16f7
20295 +#define PCI_DEVICE_ID_TIGON3_5753M 0x16fd
20296 +#define PCI_DEVICE_ID_TIGON3_5753F 0x16fe
20297 +#define PCI_DEVICE_ID_TIGON3_5901 0x170d
20298 +#define PCI_DEVICE_ID_BCM4401B1 0x170c
20299 +#define PCI_DEVICE_ID_TIGON3_5901_2 0x170e
20300 +#define PCI_DEVICE_ID_BCM4401 0x4401
20301 +#define PCI_DEVICE_ID_BCM4401B0 0x4402
20303 +#define PCI_VENDOR_ID_TOPIC 0x151f
20304 +#define PCI_DEVICE_ID_TOPIC_TP560 0x0000
20306 +#define PCI_VENDOR_ID_ENE 0x1524
20307 +#define PCI_DEVICE_ID_ENE_1211 0x1211
20308 +#define PCI_DEVICE_ID_ENE_1225 0x1225
20309 +#define PCI_DEVICE_ID_ENE_1410 0x1410
20310 +#define PCI_DEVICE_ID_ENE_1420 0x1420
20312 +#define PCI_VENDOR_ID_SYBA 0x1592
20313 +#define PCI_DEVICE_ID_SYBA_2P_EPP 0x0782
20314 +#define PCI_DEVICE_ID_SYBA_1P_ECP 0x0783
20316 +#define PCI_VENDOR_ID_MORETON 0x15aa
20317 +#define PCI_DEVICE_ID_RASTEL_2PORT 0x2000
20319 +#define PCI_VENDOR_ID_ZOLTRIX 0x15b0
20320 +#define PCI_DEVICE_ID_ZOLTRIX_2BD0 0x2bd0
20322 +#define PCI_VENDOR_ID_MELLANOX 0x15b3
20323 +#define PCI_DEVICE_ID_MELLANOX_TAVOR 0x5a44
20324 +#define PCI_DEVICE_ID_MELLANOX_ARBEL_COMPAT 0x6278
20325 +#define PCI_DEVICE_ID_MELLANOX_ARBEL 0x6282
20326 +#define PCI_DEVICE_ID_MELLANOX_SINAI_OLD 0x5e8c
20327 +#define PCI_DEVICE_ID_MELLANOX_SINAI 0x6274
20329 +#define PCI_VENDOR_ID_PDC 0x15e9
20330 +#define PCI_DEVICE_ID_PDC_1841 0x1841
20332 +#define PCI_VENDOR_ID_MACROLINK 0x15ed
20333 +#define PCI_DEVICE_ID_MACROLINK_MCCS8 0x1000
20334 +#define PCI_DEVICE_ID_MACROLINK_MCCS 0x1001
20335 +#define PCI_DEVICE_ID_MACROLINK_MCCS8H 0x1002
20336 +#define PCI_DEVICE_ID_MACROLINK_MCCSH 0x1003
20337 +#define PCI_DEVICE_ID_MACROLINK_MCCR8 0x2000
20338 +#define PCI_DEVICE_ID_MACROLINK_MCCR 0x2001
20340 +#define PCI_VENDOR_ID_FARSITE 0x1619
20341 +#define PCI_DEVICE_ID_FARSITE_T2P 0x0400
20342 +#define PCI_DEVICE_ID_FARSITE_T4P 0x0440
20343 +#define PCI_DEVICE_ID_FARSITE_T1U 0x0610
20344 +#define PCI_DEVICE_ID_FARSITE_T2U 0x0620
20345 +#define PCI_DEVICE_ID_FARSITE_T4U 0x0640
20346 +#define PCI_DEVICE_ID_FARSITE_TE1 0x1610
20347 +#define PCI_DEVICE_ID_FARSITE_TE1C 0x1612
20349 +#define PCI_VENDOR_ID_SIBYTE 0x166d
20350 +#define PCI_DEVICE_ID_BCM1250_HT 0x0002
20352 +#define PCI_VENDOR_ID_LINKSYS 0x1737
20353 +#define PCI_DEVICE_ID_LINKSYS_EG1032 0x1032
20354 +#define PCI_DEVICE_ID_LINKSYS_EG1064 0x1064
20356 +#define PCI_VENDOR_ID_ALTIMA 0x173b
20357 +#define PCI_DEVICE_ID_ALTIMA_AC1000 0x03e8
20358 +#define PCI_DEVICE_ID_ALTIMA_AC1001 0x03e9
20359 +#define PCI_DEVICE_ID_ALTIMA_AC9100 0x03ea
20360 +#define PCI_DEVICE_ID_ALTIMA_AC1003 0x03eb
20362 +#define PCI_VENDOR_ID_S2IO 0x17d5
20363 +#define PCI_DEVICE_ID_S2IO_WIN 0x5731
20364 +#define PCI_DEVICE_ID_S2IO_UNI 0x5831
20365 +#define PCI_DEVICE_ID_HERC_WIN 0x5732
20366 +#define PCI_DEVICE_ID_HERC_UNI 0x5832
20368 +#define PCI_VENDOR_ID_INFINICON 0x1820
20370 +#define PCI_VENDOR_ID_TOPSPIN 0x1867
20372 +#define PCI_VENDOR_ID_TDI 0x192E
20373 +#define PCI_DEVICE_ID_TDI_EHCI 0x0101
20375 +#define PCI_VENDOR_ID_SYMPHONY 0x1c1c
20376 +#define PCI_DEVICE_ID_SYMPHONY_101 0x0001
20378 +#define PCI_VENDOR_ID_TEKRAM 0x1de1
20379 +#define PCI_DEVICE_ID_TEKRAM_DC290 0xdc29
20381 +#define PCI_VENDOR_ID_HINT 0x3388
20382 +#define PCI_DEVICE_ID_HINT_VXPROII_IDE 0x8013
20384 +#define PCI_VENDOR_ID_3DLABS 0x3d3d
20385 +#define PCI_DEVICE_ID_3DLABS_300SX 0x0001
20386 +#define PCI_DEVICE_ID_3DLABS_500TX 0x0002
20387 +#define PCI_DEVICE_ID_3DLABS_DELTA 0x0003
20388 +#define PCI_DEVICE_ID_3DLABS_PERMEDIA 0x0004
20389 +#define PCI_DEVICE_ID_3DLABS_MX 0x0006
20390 +#define PCI_DEVICE_ID_3DLABS_PERMEDIA2 0x0007
20391 +#define PCI_DEVICE_ID_3DLABS_GAMMA 0x0008
20392 +#define PCI_DEVICE_ID_3DLABS_PERMEDIA2V 0x0009
20394 +#define PCI_VENDOR_ID_AVANCE 0x4005
20395 +#define PCI_DEVICE_ID_AVANCE_ALG2064 0x2064
20396 +#define PCI_DEVICE_ID_AVANCE_2302 0x2302
20398 +#define PCI_VENDOR_ID_AKS 0x416c
20399 +#define PCI_DEVICE_ID_AKS_ALADDINCARD 0x0100
20400 +#define PCI_DEVICE_ID_AKS_CPC 0x0200
20402 +#define PCI_VENDOR_ID_REDCREEK 0x4916
20403 +#define PCI_DEVICE_ID_RC45 0x1960
20405 +#define PCI_VENDOR_ID_NETVIN 0x4a14
20406 +#define PCI_DEVICE_ID_NETVIN_NV5000SC 0x5000
20408 +#define PCI_VENDOR_ID_S3 0x5333
20409 +#define PCI_DEVICE_ID_S3_PLATO_PXS 0x0551
20410 +#define PCI_DEVICE_ID_S3_ViRGE 0x5631
20411 +#define PCI_DEVICE_ID_S3_TRIO 0x8811
20412 +#define PCI_DEVICE_ID_S3_AURORA64VP 0x8812
20413 +#define PCI_DEVICE_ID_S3_TRIO64UVP 0x8814
20414 +#define PCI_DEVICE_ID_S3_ViRGE_VX 0x883d
20415 +#define PCI_DEVICE_ID_S3_868 0x8880
20416 +#define PCI_DEVICE_ID_S3_928 0x88b0
20417 +#define PCI_DEVICE_ID_S3_864_1 0x88c0
20418 +#define PCI_DEVICE_ID_S3_864_2 0x88c1
20419 +#define PCI_DEVICE_ID_S3_964_1 0x88d0
20420 +#define PCI_DEVICE_ID_S3_964_2 0x88d1
20421 +#define PCI_DEVICE_ID_S3_968 0x88f0
20422 +#define PCI_DEVICE_ID_S3_TRIO64V2 0x8901
20423 +#define PCI_DEVICE_ID_S3_PLATO_PXG 0x8902
20424 +#define PCI_DEVICE_ID_S3_ViRGE_DXGX 0x8a01
20425 +#define PCI_DEVICE_ID_S3_ViRGE_GX2 0x8a10
20426 +#define PCI_DEVICE_ID_S3_SAVAGE4 0x8a25
20427 +#define PCI_DEVICE_ID_S3_ViRGE_MX 0x8c01
20428 +#define PCI_DEVICE_ID_S3_ViRGE_MXP 0x8c02
20429 +#define PCI_DEVICE_ID_S3_ViRGE_MXPMV 0x8c03
20430 +#define PCI_DEVICE_ID_S3_PROSAVAGE8 0x8d04
20431 +#define PCI_DEVICE_ID_S3_SONICVIBES 0xca00
20433 +#define PCI_VENDOR_ID_DUNORD 0x5544
20434 +#define PCI_DEVICE_ID_DUNORD_I3000 0x0001
20436 +#define PCI_VENDOR_ID_DCI 0x6666
20437 +#define PCI_DEVICE_ID_DCI_PCCOM4 0x0001
20438 +#define PCI_DEVICE_ID_DCI_PCCOM8 0x0002
20440 +#define PCI_VENDOR_ID_DUNORD 0x5544
20441 +#define PCI_DEVICE_ID_DUNORD_I3000 0x0001
20443 +#define PCI_VENDOR_ID_GENROCO 0x5555
20444 +#define PCI_DEVICE_ID_GENROCO_HFP832 0x0003
20446 +#define PCI_VENDOR_ID_INTEL 0x8086
20447 +#define PCI_DEVICE_ID_INTEL_EESSC 0x0008
20448 +#define PCI_DEVICE_ID_INTEL_21145 0x0039
20449 +#define PCI_DEVICE_ID_INTEL_82375 0x0482
20450 +#define PCI_DEVICE_ID_INTEL_82424 0x0483
20451 +#define PCI_DEVICE_ID_INTEL_82378 0x0484
20452 +#define PCI_DEVICE_ID_INTEL_82430 0x0486
20453 +#define PCI_DEVICE_ID_INTEL_82434 0x04a3
20454 +#define PCI_DEVICE_ID_INTEL_I960 0x0960
20455 +#define PCI_DEVICE_ID_INTEL_I960RM 0x0962
20456 +#define PCI_DEVICE_ID_INTEL_82562ET 0x1031
20457 +#define PCI_DEVICE_ID_INTEL_82801CAM 0x1038
20458 +#define PCI_DEVICE_ID_INTEL_82815_MC 0x1130
20459 +#define PCI_DEVICE_ID_INTEL_82815_AB 0x1131
20460 +#define PCI_DEVICE_ID_INTEL_82815_CGC 0x1132
20461 +#define PCI_DEVICE_ID_INTEL_82559ER 0x1209
20462 +#define PCI_DEVICE_ID_INTEL_82092AA_0 0x1221
20463 +#define PCI_DEVICE_ID_INTEL_82092AA_1 0x1222
20464 +#define PCI_DEVICE_ID_INTEL_7116 0x1223
20465 +#define PCI_DEVICE_ID_INTEL_7505_0 0x2550
20466 +#define PCI_DEVICE_ID_INTEL_7505_1 0x2552
20467 +#define PCI_DEVICE_ID_INTEL_7205_0 0x255d
20468 +#define PCI_DEVICE_ID_INTEL_82596 0x1226
20469 +#define PCI_DEVICE_ID_INTEL_82865 0x1227
20470 +#define PCI_DEVICE_ID_INTEL_82557 0x1229
20471 +#define PCI_DEVICE_ID_INTEL_82437 0x122d
20472 +#define PCI_DEVICE_ID_INTEL_82371FB_0 0x122e
20473 +#define PCI_DEVICE_ID_INTEL_82371FB_1 0x1230
20474 +#define PCI_DEVICE_ID_INTEL_82371MX 0x1234
20475 +#define PCI_DEVICE_ID_INTEL_82437MX 0x1235
20476 +#define PCI_DEVICE_ID_INTEL_82441 0x1237
20477 +#define PCI_DEVICE_ID_INTEL_82380FB 0x124b
20478 +#define PCI_DEVICE_ID_INTEL_82439 0x1250
20479 +#define PCI_DEVICE_ID_INTEL_80960_RP 0x1960
20480 +#define PCI_DEVICE_ID_INTEL_82840_HB 0x1a21
20481 +#define PCI_DEVICE_ID_INTEL_82845_HB 0x1a30
20482 +#define PCI_DEVICE_ID_INTEL_82801AA_0 0x2410
20483 +#define PCI_DEVICE_ID_INTEL_82801AA_1 0x2411
20484 +#define PCI_DEVICE_ID_INTEL_82801AA_2 0x2412
20485 +#define PCI_DEVICE_ID_INTEL_82801AA_3 0x2413
20486 +#define PCI_DEVICE_ID_INTEL_82801AA_5 0x2415
20487 +#define PCI_DEVICE_ID_INTEL_82801AA_6 0x2416
20488 +#define PCI_DEVICE_ID_INTEL_82801AA_8 0x2418
20489 +#define PCI_DEVICE_ID_INTEL_82801AB_0 0x2420
20490 +#define PCI_DEVICE_ID_INTEL_82801AB_1 0x2421
20491 +#define PCI_DEVICE_ID_INTEL_82801AB_2 0x2422
20492 +#define PCI_DEVICE_ID_INTEL_82801AB_3 0x2423
20493 +#define PCI_DEVICE_ID_INTEL_82801AB_5 0x2425
20494 +#define PCI_DEVICE_ID_INTEL_82801AB_6 0x2426
20495 +#define PCI_DEVICE_ID_INTEL_82801AB_8 0x2428
20496 +#define PCI_DEVICE_ID_INTEL_82801BA_0 0x2440
20497 +#define PCI_DEVICE_ID_INTEL_82801BA_1 0x2442
20498 +#define PCI_DEVICE_ID_INTEL_82801BA_2 0x2443
20499 +#define PCI_DEVICE_ID_INTEL_82801BA_3 0x2444
20500 +#define PCI_DEVICE_ID_INTEL_82801BA_4 0x2445
20501 +#define PCI_DEVICE_ID_INTEL_82801BA_5 0x2446
20502 +#define PCI_DEVICE_ID_INTEL_82801BA_6 0x2448
20503 +#define PCI_DEVICE_ID_INTEL_82801BA_7 0x2449
20504 +#define PCI_DEVICE_ID_INTEL_82801BA_8 0x244a
20505 +#define PCI_DEVICE_ID_INTEL_82801BA_9 0x244b
20506 +#define PCI_DEVICE_ID_INTEL_82801BA_10 0x244c
20507 +#define PCI_DEVICE_ID_INTEL_82801BA_11 0x244e
20508 +#define PCI_DEVICE_ID_INTEL_82801E_0 0x2450
20509 +#define PCI_DEVICE_ID_INTEL_82801E_2 0x2452
20510 +#define PCI_DEVICE_ID_INTEL_82801E_3 0x2453
20511 +#define PCI_DEVICE_ID_INTEL_82801E_9 0x2459
20512 +#define PCI_DEVICE_ID_INTEL_82801E_11 0x245b
20513 +#define PCI_DEVICE_ID_INTEL_82801E_13 0x245d
20514 +#define PCI_DEVICE_ID_INTEL_82801E_14 0x245e
20515 +#define PCI_DEVICE_ID_INTEL_82801CA_0 0x2480
20516 +#define PCI_DEVICE_ID_INTEL_82801CA_2 0x2482
20517 +#define PCI_DEVICE_ID_INTEL_82801CA_3 0x2483
20518 +#define PCI_DEVICE_ID_INTEL_82801CA_4 0x2484
20519 +#define PCI_DEVICE_ID_INTEL_82801CA_5 0x2485
20520 +#define PCI_DEVICE_ID_INTEL_82801CA_6 0x2486
20521 +#define PCI_DEVICE_ID_INTEL_82801CA_7 0x2487
20522 +#define PCI_DEVICE_ID_INTEL_82801CA_10 0x248a
20523 +#define PCI_DEVICE_ID_INTEL_82801CA_11 0x248b
20524 +#define PCI_DEVICE_ID_INTEL_82801CA_12 0x248c
20525 +#define PCI_DEVICE_ID_INTEL_82801DB_0 0x24c0
20526 +#define PCI_DEVICE_ID_INTEL_82801DB_1 0x24c1
20527 +#define PCI_DEVICE_ID_INTEL_82801DB_2 0x24c2
20528 +#define PCI_DEVICE_ID_INTEL_82801DB_3 0x24c3
20529 +#define PCI_DEVICE_ID_INTEL_82801DB_4 0x24c4
20530 +#define PCI_DEVICE_ID_INTEL_82801DB_5 0x24c5
20531 +#define PCI_DEVICE_ID_INTEL_82801DB_6 0x24c6
20532 +#define PCI_DEVICE_ID_INTEL_82801DB_7 0x24c7
20533 +#define PCI_DEVICE_ID_INTEL_82801DB_9 0x24c9
20534 +#define PCI_DEVICE_ID_INTEL_82801DB_10 0x24ca
20535 +#define PCI_DEVICE_ID_INTEL_82801DB_11 0x24cb
20536 +#define PCI_DEVICE_ID_INTEL_82801DB_12 0x24cc
20537 +#define PCI_DEVICE_ID_INTEL_82801DB_13 0x24cd
20538 +#define PCI_DEVICE_ID_INTEL_82801EB_0 0x24d0
20539 +#define PCI_DEVICE_ID_INTEL_82801EB_1 0x24d1
20540 +#define PCI_DEVICE_ID_INTEL_82801EB_2 0x24d2
20541 +#define PCI_DEVICE_ID_INTEL_82801EB_3 0x24d3
20542 +#define PCI_DEVICE_ID_INTEL_82801EB_4 0x24d4
20543 +#define PCI_DEVICE_ID_INTEL_82801EB_5 0x24d5
20544 +#define PCI_DEVICE_ID_INTEL_82801EB_6 0x24d6
20545 +#define PCI_DEVICE_ID_INTEL_82801EB_7 0x24d7
20546 +#define PCI_DEVICE_ID_INTEL_82801EB_11 0x24db
20547 +#define PCI_DEVICE_ID_INTEL_82801EB_13 0x24dd
20548 +#define PCI_DEVICE_ID_INTEL_ESB_1 0x25a1
20549 +#define PCI_DEVICE_ID_INTEL_ESB_2 0x25a2
20550 +#define PCI_DEVICE_ID_INTEL_ESB_3 0x25a3
20551 +#define PCI_DEVICE_ID_INTEL_ESB_31 0x25b0
20552 +#define PCI_DEVICE_ID_INTEL_ESB_4 0x25a4
20553 +#define PCI_DEVICE_ID_INTEL_ESB_5 0x25a6
20554 +#define PCI_DEVICE_ID_INTEL_ESB_6 0x25a7
20555 +#define PCI_DEVICE_ID_INTEL_ESB_7 0x25a9
20556 +#define PCI_DEVICE_ID_INTEL_ESB_8 0x25aa
20557 +#define PCI_DEVICE_ID_INTEL_ESB_9 0x25ab
20558 +#define PCI_DEVICE_ID_INTEL_ESB_11 0x25ac
20559 +#define PCI_DEVICE_ID_INTEL_ESB_12 0x25ad
20560 +#define PCI_DEVICE_ID_INTEL_ESB_13 0x25ae
20561 +#define PCI_DEVICE_ID_INTEL_82820_HB 0x2500
20562 +#define PCI_DEVICE_ID_INTEL_82820_UP_HB 0x2501
20563 +#define PCI_DEVICE_ID_INTEL_82850_HB 0x2530
20564 +#define PCI_DEVICE_ID_INTEL_82860_HB 0x2531
20565 +#define PCI_DEVICE_ID_INTEL_82845G_HB 0x2560
20566 +#define PCI_DEVICE_ID_INTEL_82845G_IG 0x2562
20567 +#define PCI_DEVICE_ID_INTEL_82865_HB 0x2570
20568 +#define PCI_DEVICE_ID_INTEL_82865_IG 0x2572
20569 +#define PCI_DEVICE_ID_INTEL_82875_HB 0x2578
20570 +#define PCI_DEVICE_ID_INTEL_82875_IG 0x257b
20571 +#define PCI_DEVICE_ID_INTEL_82915G_HB 0x2580
20572 +#define PCI_DEVICE_ID_INTEL_82915G_IG 0x2582
20573 +#define PCI_DEVICE_ID_INTEL_82915GM_HB 0x2590
20574 +#define PCI_DEVICE_ID_INTEL_82915GM_IG 0x2592
20575 +#define PCI_DEVICE_ID_INTEL_82945G_HB 0x2770
20576 +#define PCI_DEVICE_ID_INTEL_82945G_IG 0x2772
20577 +#define PCI_DEVICE_ID_INTEL_ICH6_0 0x2640
20578 +#define PCI_DEVICE_ID_INTEL_ICH6_1 0x2641
20579 +#define PCI_DEVICE_ID_INTEL_ICH6_2 0x2642
20580 +#define PCI_DEVICE_ID_INTEL_ICH6_3 0x2651
20581 +#define PCI_DEVICE_ID_INTEL_ICH6_4 0x2652
20582 +#define PCI_DEVICE_ID_INTEL_ICH6_5 0x2653
20583 +#define PCI_DEVICE_ID_INTEL_ICH6_6 0x2658
20584 +#define PCI_DEVICE_ID_INTEL_ICH6_7 0x2659
20585 +#define PCI_DEVICE_ID_INTEL_ICH6_8 0x265a
20586 +#define PCI_DEVICE_ID_INTEL_ICH6_9 0x265b
20587 +#define PCI_DEVICE_ID_INTEL_ICH6_10 0x265c
20588 +#define PCI_DEVICE_ID_INTEL_ICH6_11 0x2660
20589 +#define PCI_DEVICE_ID_INTEL_ICH6_12 0x2662
20590 +#define PCI_DEVICE_ID_INTEL_ICH6_13 0x2664
20591 +#define PCI_DEVICE_ID_INTEL_ICH6_14 0x2666
20592 +#define PCI_DEVICE_ID_INTEL_ICH6_15 0x2668
20593 +#define PCI_DEVICE_ID_INTEL_ICH6_16 0x266a
20594 +#define PCI_DEVICE_ID_INTEL_ICH6_17 0x266d
20595 +#define PCI_DEVICE_ID_INTEL_ICH6_18 0x266e
20596 +#define PCI_DEVICE_ID_INTEL_ICH6_19 0x266f
20597 +#define PCI_DEVICE_ID_INTEL_ESB2_0 0x2670
20598 +#define PCI_DEVICE_ID_INTEL_ESB2_1 0x2680
20599 +#define PCI_DEVICE_ID_INTEL_ESB2_2 0x2681
20600 +#define PCI_DEVICE_ID_INTEL_ESB2_3 0x2682
20601 +#define PCI_DEVICE_ID_INTEL_ESB2_4 0x2683
20602 +#define PCI_DEVICE_ID_INTEL_ESB2_5 0x2688
20603 +#define PCI_DEVICE_ID_INTEL_ESB2_6 0x2689
20604 +#define PCI_DEVICE_ID_INTEL_ESB2_7 0x268a
20605 +#define PCI_DEVICE_ID_INTEL_ESB2_8 0x268b
20606 +#define PCI_DEVICE_ID_INTEL_ESB2_9 0x268c
20607 +#define PCI_DEVICE_ID_INTEL_ESB2_10 0x2690
20608 +#define PCI_DEVICE_ID_INTEL_ESB2_11 0x2692
20609 +#define PCI_DEVICE_ID_INTEL_ESB2_12 0x2694
20610 +#define PCI_DEVICE_ID_INTEL_ESB2_13 0x2696
20611 +#define PCI_DEVICE_ID_INTEL_ESB2_14 0x2698
20612 +#define PCI_DEVICE_ID_INTEL_ESB2_15 0x2699
20613 +#define PCI_DEVICE_ID_INTEL_ESB2_16 0x269a
20614 +#define PCI_DEVICE_ID_INTEL_ESB2_17 0x269b
20615 +#define PCI_DEVICE_ID_INTEL_ESB2_18 0x269e
20616 +#define PCI_DEVICE_ID_INTEL_ICH7_0 0x27b8
20617 +#define PCI_DEVICE_ID_INTEL_ICH7_1 0x27b9
20618 +#define PCI_DEVICE_ID_INTEL_ICH7_2 0x27c0
20619 +#define PCI_DEVICE_ID_INTEL_ICH7_3 0x27c1
20620 +#define PCI_DEVICE_ID_INTEL_ICH7_30 0x27b0
20621 +#define PCI_DEVICE_ID_INTEL_ICH7_31 0x27bd
20622 +#define PCI_DEVICE_ID_INTEL_ICH7_5 0x27c4
20623 +#define PCI_DEVICE_ID_INTEL_ICH7_6 0x27c5
20624 +#define PCI_DEVICE_ID_INTEL_ICH7_7 0x27c8
20625 +#define PCI_DEVICE_ID_INTEL_ICH7_8 0x27c9
20626 +#define PCI_DEVICE_ID_INTEL_ICH7_9 0x27ca
20627 +#define PCI_DEVICE_ID_INTEL_ICH7_10 0x27cb
20628 +#define PCI_DEVICE_ID_INTEL_ICH7_11 0x27cc
20629 +#define PCI_DEVICE_ID_INTEL_ICH7_12 0x27d0
20630 +#define PCI_DEVICE_ID_INTEL_ICH7_13 0x27d2
20631 +#define PCI_DEVICE_ID_INTEL_ICH7_14 0x27d4
20632 +#define PCI_DEVICE_ID_INTEL_ICH7_15 0x27d6
20633 +#define PCI_DEVICE_ID_INTEL_ICH7_16 0x27d8
20634 +#define PCI_DEVICE_ID_INTEL_ICH7_17 0x27da
20635 +#define PCI_DEVICE_ID_INTEL_ICH7_18 0x27dc
20636 +#define PCI_DEVICE_ID_INTEL_ICH7_19 0x27dd
20637 +#define PCI_DEVICE_ID_INTEL_ICH7_20 0x27de
20638 +#define PCI_DEVICE_ID_INTEL_ICH7_21 0x27df
20639 +#define PCI_DEVICE_ID_INTEL_ICH7_22 0x27e0
20640 +#define PCI_DEVICE_ID_INTEL_ICH7_23 0x27e2
20641 +#define PCI_DEVICE_ID_INTEL_82855PM_HB 0x3340
20642 +#define PCI_DEVICE_ID_INTEL_ESB2_19 0x3500
20643 +#define PCI_DEVICE_ID_INTEL_ESB2_20 0x3501
20644 +#define PCI_DEVICE_ID_INTEL_ESB2_21 0x3504
20645 +#define PCI_DEVICE_ID_INTEL_ESB2_22 0x3505
20646 +#define PCI_DEVICE_ID_INTEL_ESB2_23 0x350c
20647 +#define PCI_DEVICE_ID_INTEL_ESB2_24 0x350d
20648 +#define PCI_DEVICE_ID_INTEL_ESB2_25 0x3510
20649 +#define PCI_DEVICE_ID_INTEL_ESB2_26 0x3511
20650 +#define PCI_DEVICE_ID_INTEL_ESB2_27 0x3514
20651 +#define PCI_DEVICE_ID_INTEL_ESB2_28 0x3515
20652 +#define PCI_DEVICE_ID_INTEL_ESB2_29 0x3518
20653 +#define PCI_DEVICE_ID_INTEL_ESB2_30 0x3519
20654 +#define PCI_DEVICE_ID_INTEL_82830_HB 0x3575
20655 +#define PCI_DEVICE_ID_INTEL_82830_CGC 0x3577
20656 +#define PCI_DEVICE_ID_INTEL_82855GM_HB 0x3580
20657 +#define PCI_DEVICE_ID_INTEL_82855GM_IG 0x3582
20658 +#define PCI_DEVICE_ID_INTEL_E7520_MCH 0x3590
20659 +#define PCI_DEVICE_ID_INTEL_E7320_MCH 0x3592
20660 +#define PCI_DEVICE_ID_INTEL_MCH_PA 0x3595
20661 +#define PCI_DEVICE_ID_INTEL_MCH_PA1 0x3596
20662 +#define PCI_DEVICE_ID_INTEL_MCH_PB 0x3597
20663 +#define PCI_DEVICE_ID_INTEL_MCH_PB1 0x3598
20664 +#define PCI_DEVICE_ID_INTEL_MCH_PC 0x3599
20665 +#define PCI_DEVICE_ID_INTEL_MCH_PC1 0x359a
20666 +#define PCI_DEVICE_ID_INTEL_E7525_MCH 0x359e
20667 +#define PCI_DEVICE_ID_INTEL_80310 0x530d
20668 +#define PCI_DEVICE_ID_INTEL_82371SB_0 0x7000
20669 +#define PCI_DEVICE_ID_INTEL_82371SB_1 0x7010
20670 +#define PCI_DEVICE_ID_INTEL_82371SB_2 0x7020
20671 +#define PCI_DEVICE_ID_INTEL_82437VX 0x7030
20672 +#define PCI_DEVICE_ID_INTEL_82439TX 0x7100
20673 +#define PCI_DEVICE_ID_INTEL_82371AB_0 0x7110
20674 +#define PCI_DEVICE_ID_INTEL_82371AB 0x7111
20675 +#define PCI_DEVICE_ID_INTEL_82371AB_2 0x7112
20676 +#define PCI_DEVICE_ID_INTEL_82371AB_3 0x7113
20677 +#define PCI_DEVICE_ID_INTEL_82810_MC1 0x7120
20678 +#define PCI_DEVICE_ID_INTEL_82810_IG1 0x7121
20679 +#define PCI_DEVICE_ID_INTEL_82810_MC3 0x7122
20680 +#define PCI_DEVICE_ID_INTEL_82810_IG3 0x7123
20681 +#define PCI_DEVICE_ID_INTEL_82810E_MC 0x7124
20682 +#define PCI_DEVICE_ID_INTEL_82810E_IG 0x7125
20683 +#define PCI_DEVICE_ID_INTEL_82443LX_0 0x7180
20684 +#define PCI_DEVICE_ID_INTEL_82443LX_1 0x7181
20685 +#define PCI_DEVICE_ID_INTEL_82443BX_0 0x7190
20686 +#define PCI_DEVICE_ID_INTEL_82443BX_1 0x7191
20687 +#define PCI_DEVICE_ID_INTEL_82443BX_2 0x7192
20688 +#define PCI_DEVICE_ID_INTEL_440MX 0x7195
20689 +#define PCI_DEVICE_ID_INTEL_82443MX_0 0x7198
20690 +#define PCI_DEVICE_ID_INTEL_82443MX_1 0x7199
20691 +#define PCI_DEVICE_ID_INTEL_82443MX_2 0x719a
20692 +#define PCI_DEVICE_ID_INTEL_82443MX_3 0x719b
20693 +#define PCI_DEVICE_ID_INTEL_82443GX_0 0x71a0
20694 +#define PCI_DEVICE_ID_INTEL_82443GX_1 0x71a1
20695 +#define PCI_DEVICE_ID_INTEL_82443GX_2 0x71a2
20696 +#define PCI_DEVICE_ID_INTEL_82372FB_0 0x7600
20697 +#define PCI_DEVICE_ID_INTEL_82372FB_1 0x7601
20698 +#define PCI_DEVICE_ID_INTEL_82372FB_2 0x7602
20699 +#define PCI_DEVICE_ID_INTEL_82372FB_3 0x7603
20700 +#define PCI_DEVICE_ID_INTEL_82454GX 0x84c4
20701 +#define PCI_DEVICE_ID_INTEL_82450GX 0x84c5
20702 +#define PCI_DEVICE_ID_INTEL_82451NX 0x84ca
20703 +#define PCI_DEVICE_ID_INTEL_82454NX 0x84cb
20704 +#define PCI_DEVICE_ID_INTEL_84460GX 0x84ea
20705 +#define PCI_DEVICE_ID_INTEL_IXP4XX 0x8500
20706 +#define PCI_DEVICE_ID_INTEL_IXP2400 0x9001
20707 +#define PCI_DEVICE_ID_INTEL_IXP2800 0x9004
20708 +#define PCI_DEVICE_ID_INTEL_S21152BB 0xb152
20710 +#define PCI_VENDOR_ID_COMPUTONE 0x8e0e
20711 +#define PCI_DEVICE_ID_COMPUTONE_IP2EX 0x0291
20712 +#define PCI_DEVICE_ID_COMPUTONE_PG 0x0302
20713 +#define PCI_SUBVENDOR_ID_COMPUTONE 0x8e0e
20714 +#define PCI_SUBDEVICE_ID_COMPUTONE_PG4 0x0001
20715 +#define PCI_SUBDEVICE_ID_COMPUTONE_PG8 0x0002
20716 +#define PCI_SUBDEVICE_ID_COMPUTONE_PG6 0x0003
20718 +#define PCI_VENDOR_ID_KTI 0x8e2e
20719 +#define PCI_DEVICE_ID_KTI_ET32P2 0x3000
20721 +#define PCI_VENDOR_ID_ADAPTEC 0x9004
20722 +#define PCI_DEVICE_ID_ADAPTEC_7810 0x1078
20723 +#define PCI_DEVICE_ID_ADAPTEC_7821 0x2178
20724 +#define PCI_DEVICE_ID_ADAPTEC_38602 0x3860
20725 +#define PCI_DEVICE_ID_ADAPTEC_7850 0x5078
20726 +#define PCI_DEVICE_ID_ADAPTEC_7855 0x5578
20727 +#define PCI_DEVICE_ID_ADAPTEC_5800 0x5800
20728 +#define PCI_DEVICE_ID_ADAPTEC_3860 0x6038
20729 +#define PCI_DEVICE_ID_ADAPTEC_1480A 0x6075
20730 +#define PCI_DEVICE_ID_ADAPTEC_7860 0x6078
20731 +#define PCI_DEVICE_ID_ADAPTEC_7861 0x6178
20732 +#define PCI_DEVICE_ID_ADAPTEC_7870 0x7078
20733 +#define PCI_DEVICE_ID_ADAPTEC_7871 0x7178
20734 +#define PCI_DEVICE_ID_ADAPTEC_7872 0x7278
20735 +#define PCI_DEVICE_ID_ADAPTEC_7873 0x7378
20736 +#define PCI_DEVICE_ID_ADAPTEC_7874 0x7478
20737 +#define PCI_DEVICE_ID_ADAPTEC_7895 0x7895
20738 +#define PCI_DEVICE_ID_ADAPTEC_7880 0x8078
20739 +#define PCI_DEVICE_ID_ADAPTEC_7881 0x8178
20740 +#define PCI_DEVICE_ID_ADAPTEC_7882 0x8278
20741 +#define PCI_DEVICE_ID_ADAPTEC_7883 0x8378
20742 +#define PCI_DEVICE_ID_ADAPTEC_7884 0x8478
20743 +#define PCI_DEVICE_ID_ADAPTEC_7885 0x8578
20744 +#define PCI_DEVICE_ID_ADAPTEC_7886 0x8678
20745 +#define PCI_DEVICE_ID_ADAPTEC_7887 0x8778
20746 +#define PCI_DEVICE_ID_ADAPTEC_7888 0x8878
20747 +#define PCI_DEVICE_ID_ADAPTEC_1030 0x8b78
20749 +#define PCI_VENDOR_ID_ADAPTEC2 0x9005
20750 +#define PCI_DEVICE_ID_ADAPTEC2_2940U2 0x0010
20751 +#define PCI_DEVICE_ID_ADAPTEC2_2930U2 0x0011
20752 +#define PCI_DEVICE_ID_ADAPTEC2_7890B 0x0013
20753 +#define PCI_DEVICE_ID_ADAPTEC2_7890 0x001f
20754 +#define PCI_DEVICE_ID_ADAPTEC2_3940U2 0x0050
20755 +#define PCI_DEVICE_ID_ADAPTEC2_3950U2D 0x0051
20756 +#define PCI_DEVICE_ID_ADAPTEC2_7896 0x005f
20757 +#define PCI_DEVICE_ID_ADAPTEC2_7892A 0x0080
20758 +#define PCI_DEVICE_ID_ADAPTEC2_7892B 0x0081
20759 +#define PCI_DEVICE_ID_ADAPTEC2_7892D 0x0083
20760 +#define PCI_DEVICE_ID_ADAPTEC2_7892P 0x008f
20761 +#define PCI_DEVICE_ID_ADAPTEC2_7899A 0x00c0
20762 +#define PCI_DEVICE_ID_ADAPTEC2_7899B 0x00c1
20763 +#define PCI_DEVICE_ID_ADAPTEC2_7899D 0x00c3
20764 +#define PCI_DEVICE_ID_ADAPTEC2_7899P 0x00cf
20765 +#define PCI_DEVICE_ID_ADAPTEC2_SCAMP 0x0503
20767 +#define PCI_VENDOR_ID_ATRONICS 0x907f
20768 +#define PCI_DEVICE_ID_ATRONICS_2015 0x2015
20770 +#define PCI_VENDOR_ID_HOLTEK 0x9412
20771 +#define PCI_DEVICE_ID_HOLTEK_6565 0x6565
20773 +#define PCI_VENDOR_ID_NETMOS 0x9710
20774 +#define PCI_DEVICE_ID_NETMOS_9705 0x9705
20775 +#define PCI_DEVICE_ID_NETMOS_9715 0x9715
20776 +#define PCI_DEVICE_ID_NETMOS_9735 0x9735
20777 +#define PCI_DEVICE_ID_NETMOS_9745 0x9745
20778 +#define PCI_DEVICE_ID_NETMOS_9755 0x9755
20779 +#define PCI_DEVICE_ID_NETMOS_9805 0x9805
20780 +#define PCI_DEVICE_ID_NETMOS_9815 0x9815
20781 +#define PCI_DEVICE_ID_NETMOS_9835 0x9835
20782 +#define PCI_DEVICE_ID_NETMOS_9845 0x9845
20783 +#define PCI_DEVICE_ID_NETMOS_9855 0x9855
20785 +#define PCI_SUBVENDOR_ID_EXSYS 0xd84d
20786 +#define PCI_SUBDEVICE_ID_EXSYS_4014 0x4014
20788 +#define PCI_VENDOR_ID_TIGERJET 0xe159
20789 +#define PCI_DEVICE_ID_TIGERJET_300 0x0001
20790 +#define PCI_DEVICE_ID_TIGERJET_100 0x0002
20792 +#define PCI_VENDOR_ID_TTTECH 0x0357
20793 +#define PCI_DEVICE_ID_TTTECH_MC322 0x000A
20795 +#define PCI_VENDOR_ID_ARK 0xedd8
20796 +#define PCI_DEVICE_ID_ARK_STING 0xa091
20797 +#define PCI_DEVICE_ID_ARK_STINGARK 0xa099
20798 +#define PCI_DEVICE_ID_ARK_2000MT 0xa0a1